﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
16850	[PATCH] Make overriding `DownloadOsmTask.AbstractInternalTask.createNewLayer()` methods easier	floscher	Don-vip	"== The issue ==
At [https://github.com/JOSM/geojson/pull/24#discussion_r225891791 JOSM/geojson issue #24 (comment)] the method [https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java?rev=14247#L253 DownloadOsmTask.AbstractInternalTask.createNewLayer(String)] is overridden and returns a subclass of `OsmDataLayer`. To do this, the whole logic had to be duplicated from the ""super"" method.

== What the patch changes ==

My patch creates a new method (`createNewLayer(DataSet, String)`), which only instantiates the `OsmDataLayer` object. This can be easily overridden by plugins to return instances of any subclass.

I also added `//TODO` comments to make `createNewLayer()` and `createNewLayer(String)` final (currently these are overridden by plugins `cadastre-fr`, `geojson`, `opendata`). Since these are only convenience methods that eventually call `createNewLayer(DataSet, String)`, they should not be overridable. When plugins no longer override the methods, they should be made final to enforce this.

The new method `getNonBlankLayerName(String)` is created so subclasses can change how the layer name is determined. It takes a nullable string and returns a non-blank (not null, length >= 1 and at least one non-whitespace char) layer name."	enhancement	closed	normal	18.10	Core	latest	fixed		
