Index: applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java
===================================================================
--- applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(revision 36175)
+++ applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(revision 36176)
@@ -20,9 +20,9 @@
 
 import org.geotools.coverage.grid.GridCoverage2D;
-import org.geotools.geometry.Envelope2D;
+import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.geotools.image.ImageWorker;
 import org.geotools.referencing.CRS;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
 import org.openstreetmap.josm.actions.RenameLayerAction;
 import org.openstreetmap.josm.data.Bounds;
@@ -57,5 +57,5 @@
 
     // current bbox
-    private Envelope2D bbox;
+    private ReferencedEnvelope bbox;
 
     // Layer icon
@@ -144,6 +144,6 @@
         Logging.debug("ImportImagePlugin ImageLayer: Coverage created: {0}", coverage);
 
-        upperLeft = new EastNorth(coverage.getEnvelope2D().x,
-                coverage.getEnvelope2D().y + coverage.getEnvelope2D().height);
+        upperLeft = new EastNorth(coverage.getEnvelope2D().getMinX(),
+                coverage.getEnvelope2D().getMaxY());
         angle = 0;
         bbox = coverage.getEnvelope2D();
@@ -230,5 +230,5 @@
     }
 
-    public Envelope2D getBbox() {
+    public ReferencedEnvelope getBbox() {
         return bbox;
     }
@@ -301,7 +301,5 @@
         this.image = ((PlanarImage) coverage.getRenderedImage()).getAsBufferedImage();
 
-        upperLeft = new EastNorth(coverage.getEnvelope2D().x, coverage
-                .getEnvelope2D().y
-                + coverage.getEnvelope2D().height);
+        upperLeft = new EastNorth(coverage.getEnvelope2D().getMinX(), coverage.getEnvelope2D().getMaxY());
         angle = 0;
 
Index: applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java
===================================================================
--- applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java	(revision 36175)
+++ applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java	(revision 36176)
@@ -31,6 +31,6 @@
 
 import org.geotools.referencing.CRS;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
 import org.openstreetmap.josm.tools.Logging;
 
Index: applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java
===================================================================
--- applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 36175)
+++ applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 36176)
@@ -2,5 +2,4 @@
 package org.openstreetmap.josm.plugins.ImportImagePlugin;
 
-import java.awt.geom.Rectangle2D;
 import java.awt.image.BufferedImage;
 import java.io.BufferedReader;
@@ -17,18 +16,18 @@
 import javax.imageio.ImageIO;
 
+import org.geotools.api.data.DataSourceException;
+import org.geotools.api.parameter.ParameterValueGroup;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CRSAuthorityFactory;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.util.InternationalString;
 import org.geotools.coverage.grid.GridCoverage2D;
 import org.geotools.coverage.grid.GridCoverageFactory;
 import org.geotools.coverage.processing.CoverageProcessor;
-import org.geotools.data.DataSourceException;
 import org.geotools.data.WorldFileReader;
 import org.geotools.gce.geotiff.GeoTiffReader;
-import org.geotools.geometry.Envelope2D;
+import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.geotools.referencing.CRS;
 import org.geotools.util.factory.Hints;
-import org.opengis.parameter.ParameterValueGroup;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CRSAuthorityFactory;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.util.InternationalString;
 import org.openstreetmap.josm.tools.Logging;
 
@@ -153,5 +152,5 @@
             double lowerLeft_x = tfwReader.getXULC();
             double lowerLeft_y = tfwReader.getYULC() - height;
-            Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
+            ReferencedEnvelope bbox = ReferencedEnvelope.rect(lowerLeft_x, lowerLeft_y, width, height, null);
             coverage = createGridCoverage(img, bbox, refSys);
 
@@ -185,5 +184,5 @@
             double lowerLeft_x = tfwReader.getXULC();
             double lowerLeft_y = tfwReader.getYULC() - height;
-            Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
+            ReferencedEnvelope bbox = ReferencedEnvelope.rect(lowerLeft_x, lowerLeft_y, width, height, null);
             coverage = createGridCoverage(img, bbox, refSys);
 
@@ -216,5 +215,5 @@
             double lowerLeft_x = tfwReader.getXULC();
             double lowerLeft_y = tfwReader.getYULC() - height;
-            Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
+            ReferencedEnvelope bbox = ReferencedEnvelope.rect(lowerLeft_x, lowerLeft_y, width, height, null);
             coverage = createGridCoverage(img, bbox, refSys);
 
@@ -248,5 +247,5 @@
             double lowerLeft_x = tfwReader.getXULC();
             double lowerLeft_y = tfwReader.getYULC() - height;
-            Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
+            ReferencedEnvelope bbox = ReferencedEnvelope.rect(lowerLeft_x, lowerLeft_y, width, height, null);
             coverage = createGridCoverage(img, bbox, refSys);
 
@@ -293,5 +292,5 @@
      * Method for external use.
      */
-    public static GridCoverage2D createGridCoverage(BufferedImage img, Envelope2D bbox, CoordinateReferenceSystem crs) {
+    public static GridCoverage2D createGridCoverage(BufferedImage img, ReferencedEnvelope bbox, CoordinateReferenceSystem crs) {
         bbox.setCoordinateReferenceSystem(crs);
         return new GridCoverageFactory().create("", img, bbox);
Index: applications/editors/josm/plugins/MicrosoftStreetside/ivy.xml
===================================================================
--- applications/editors/josm/plugins/MicrosoftStreetside/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/MicrosoftStreetside/ivy.xml	(revision 36176)
@@ -2,12 +2,12 @@
 <ivy-module xmlns:m="http://ant.apache.org/ivy/maven" version="2.0">
   <info organisation="org.openstreetmap.josm.plugins" module="MicrosoftStreetside" revision="0.0.1"/>
-  <configurations defaultconf="default" defaultconfmapping="default-&gt;default">
+  <configurations defaultconf="default" defaultconfmapping="default->default">
     <conf name="default"/>
     <conf name="provided" description="Needed for compile, but will be present at runtime"/>
   </configurations>
   <dependencies>
-    <dependency org="com.fasterxml.jackson.core" name="jackson-annotations" rev="2.12.4" conf="default-&gt;default"/>
-    <dependency org="com.fasterxml.jackson.core" name="jackson-databind" rev="2.12.4" conf="default-&gt;default"/>
-    <dependency org="us.monoid.web" name="resty" rev="0.3.2" conf="default-&gt;default"/>
+    <dependency org="com.fasterxml.jackson.core" name="jackson-annotations" rev="2.15.3" conf="default->default"/>
+    <dependency org="com.fasterxml.jackson.core" name="jackson-databind" rev="2.15.3" conf="default->default"/>
+    <dependency org="us.monoid.web" name="resty" rev="0.3.2" conf="default->default"/>
     <dependency org="org.openjfx" name="javafx-swing" rev="19" conf="provided">
       <artifact name="javafx-swing" type="jar" m:classifier="linux"/>
Index: applications/editors/josm/plugins/MicrosoftStreetside/ivy_settings.xml
===================================================================
--- applications/editors/josm/plugins/MicrosoftStreetside/ivy_settings.xml	(revision 36175)
+++ 	(revision )
@@ -1,13 +1,0 @@
-<ivysettings>
-    <!--<version-matchers usedefaults="true">
-        <maven-tsnap-vm/>
-    </version-matchers>-->
-    <settings defaultResolver="josm-nexus"/>
-    <resolvers>
-        <ibiblio name="josm-nexus" root="https://josm.openstreetmap.de/nexus/content/repositories/public/" m2compatible="true" />
-    </resolvers>
-    <modules>
-        <module organisation="org.openstreetmap.jmapviewer" resolver="josm-nexus"/>
-        <module organisation="org.openstreetmap.josm" resolver="josm-nexus"/>
-    </modules>
-</ivysettings>
Index: applications/editors/josm/plugins/OsmInspectorPlugin/build.xml
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/build.xml	(revision 36175)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/build.xml	(revision 36176)
@@ -13,9 +13,14 @@
     <!--<property name="plugin.link" value=""/>-->
     <property name="plugin.requires" value="jts;geotools"/>
+    <property name="plugin.minimum.java.version" value="11"/>
 
     <!-- ** include targets that all plugins have in common ** -->
     <import file="../build-common.xml"/>
 
-	<fileset id="plugin.requires.jars" dir="${plugin.dist.dir}">
+    <target name="pre-compile" depends="fetch_dependencies">
+        <!-- include fetch_dependencies task -->
+    </target>
+
+    <fileset id="plugin.requires.jars" dir="${plugin.dist.dir}">
         <include name="jts.jar"/>
         <include name="geotools.jar"/>
Index: applications/editors/josm/plugins/OsmInspectorPlugin/ivy.xml
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/ivy.xml	(revision 36176)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/ivy.xml	(revision 36176)
@@ -0,0 +1,60 @@
+<ivy-module version="2.0">
+    <info organisation="org.openstreetmap.josm.plugins" module="OsmInspector"/>
+    <dependencies>
+        <dependency org="org.geotools" name="gt-app-schema-resolver" rev="${gt.version}" conf="default->default"/>
+        <dependency org="org.geotools" name="gt-cql" rev="${gt.version}" conf="default->default"/>
+        <dependency org="org.geotools" name="gt-render" rev="${gt.version}" conf="default->default"/>
+        <dependency org="org.geotools" name="gt-wfs-ng" rev="${gt.version}" conf="default->default"/>
+        <dependency org="org.geotools" name="gt-xml" rev="${gt.version}" conf="default->default"/>
+        <!--
+        <dependency org="org.geotools" name="gt-xsd-core" rev="${gt.version}" conf="default->default"/>
+        <dependency org="org.geotools" name="gt-xsd-wfs" rev="${gt.version}" conf="default->default"/>
+        -->
+
+        <!-- from geotools plugin (effectively copied from geotools ivy.xml, just excluding all geotools dependencies) -->
+        <exclude org="org.geotools" module="gt-coverage" />
+        <exclude org="org.geotools" module="gt-coverage-api" />
+        <exclude org="org.geotools" module="gt-epsg-extension" />
+        <exclude org="org.geotools" module="gt-epsg-hsql" />
+        <exclude org="org.geotools" module="gt-geotiff" />
+        <exclude org="org.geotools" module="gt-main" />
+        <exclude org="org.geotools" module="gt-metadata" />
+        <exclude org="org.geotools" module="gt-api" />
+        <exclude org="org.geotools" module="gt-referencing" />
+        <exclude org="org.geotools" module="gt-shapefile" />
+        <exclude org="org.geotools" module="gt-geopkg" />
+        <!-- Dependencies that were not needed in 22.0 (according to lib in svn) -->
+        <exclude org="org.geotools" module="gt-imagemosaic"/>
+        <exclude org="net.sourceforge.hatbox" module="hatbox"/>
+        <exclude org="com.google.guava" module="guava"/>
+        <!-- unnecessary dependencies -->
+        <exclude org="com.github.spotbugs"/>
+        <exclude org="org.geotools.demo"/>
+        <!-- ecore is rather large (1.3M) -->
+        <exclude org="org.eclipse.emf"/>
+        <!-- from jaxb plugin (Eclipse JAXB 2.3.2, at time of writing) JAXB 3.0 uses jakarta.xml.bind/com.sun.xml.bind -->
+        <exclude org="javax.xml.bind" module="jaxb-api" />
+        <exclude org="org.glassfish.jaxb" module="jaxb-runtime" />
+        <!-- from ejml plugin -->
+        <exclude org="org.ejml"/>
+        <!-- from jts plugin -->
+        <exclude org="org.locationtech.jts" module="jts-core"/>
+        <exclude org="org.locationtech.jts.io" module="jts-io-common"/>
+        <!-- from apache-commons plugin -->
+        <exclude org="com.github.luben" module="zstd-jni"/>
+        <exclude org="org.apache.commons" module="commons-collections4"/>
+        <exclude org="org.apache.commons" module="commons-compress"/>
+        <exclude org="org.apache.commons" module="commons-imaging"/>
+        <exclude org="commons-io" module="commons-io"/>
+        <exclude org="commons-logging" module="commons-logging"/>
+        <exclude org="org.apache.commons" module="commons-lang3"/>
+        <exclude org="org.apache.commons" module="commons-math3"/>
+        <exclude org="org.apache.commons" module="commons-text"/>
+        <exclude org="org.brotli" module="dec"/>
+        <exclude org="org.tukaani" module="xz"/>
+        <!-- from jaxb plugin -->
+        <exclude org="javax.activation" module="javax.activation-api"/>
+        <!-- from jackson plugin -->
+        <exclude org="com.fasterxml.jackson.core" module="jackson-core"/>
+    </dependencies>
+</ivy-module>
Index: applications/editors/josm/plugins/OsmInspectorPlugin/ivy_settings.xml
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/ivy_settings.xml	(revision 36176)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/ivy_settings.xml	(revision 36176)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ivysettings>
+  <include file="../geotools/ivy_settings.xml" />
+</ivysettings>
+
Index: applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/GeoFabrikWFSClient.java
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/GeoFabrikWFSClient.java	(revision 36175)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/GeoFabrikWFSClient.java	(revision 36176)
@@ -8,19 +8,19 @@
 import javax.swing.ProgressMonitor;
 
-import org.geotools.data.DataStore;
-import org.geotools.data.DataStoreFinder;
-import org.geotools.data.FeatureSource;
+import org.geotools.api.data.DataStore;
+import org.geotools.api.data.DataStoreFinder;
+import org.geotools.api.data.FeatureSource;
 import org.geotools.factory.CommonFactoryFinder;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.geotools.referencing.CRS;
-import org.opengis.feature.simple.SimpleFeature;
-import org.opengis.feature.simple.SimpleFeatureType;
-import org.opengis.feature.type.AttributeDescriptor;
-import org.opengis.filter.Filter;
-import org.opengis.filter.FilterFactory2;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.NoSuchAuthorityCodeException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.feature.simple.SimpleFeature;
+import org.geotools.api.feature.simple.SimpleFeatureType;
+import org.geotools.api.feature.type.AttributeDescriptor;
+import org.geotools.api.filter.Filter;
+import org.geotools.api.filter.FilterFactory;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.NoSuchAuthorityCodeException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -30,92 +30,92 @@
 public class GeoFabrikWFSClient {
 
-	//private Bounds bbox;
-	private DataStore data;
-	private boolean bInitialized = false;
+    //private Bounds bbox;
+    private DataStore data;
+    private boolean bInitialized;
 
-	public GeoFabrikWFSClient(Bounds bounds) {
-		//bbox = bounds;
-	}
+    public GeoFabrikWFSClient(Bounds bounds) {
+        //bbox = bounds;
+    }
 
-	public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatures(
-			String typeName, ProgressMonitor progressMonitor)
-			throws IOException, NoSuchAuthorityCodeException, FactoryException {
+    public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatures(
+            String typeName, ProgressMonitor progressMonitor)
+            throws IOException, NoSuchAuthorityCodeException, FactoryException {
 
-		initializeDataStore();
+        initializeDataStore();
 
-		// Step 3 - discovery; enhance to iterate over all types with bounds
-		SimpleFeatureType schema = data.getSchema(typeName);
-		progressMonitor.setProgress(30);
-		
-		// Step 4 - target
-		FeatureSource<SimpleFeatureType, SimpleFeature> source = data
-				.getFeatureSource(typeName);
-		Logging.info("Source Metadata Bounds:" + source.getBounds());
-		Logging.info("Source schema: " + source.getSchema());
+        // Step 3 - discovery; enhance to iterate over all types with bounds
+        SimpleFeatureType schema = data.getSchema(typeName);
+        progressMonitor.setProgress(30);
 
-		progressMonitor.setProgress(40);
-		
-		// Step 5 - query
-		List<AttributeDescriptor> listAttrs = schema.getAttributeDescriptors();
-		String geomName = listAttrs.get(0).getLocalName();
-		CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4236");
+        // Step 4 - target
+        FeatureSource<SimpleFeatureType, SimpleFeature> source = data
+                .getFeatureSource(typeName);
+        Logging.info("Source Metadata Bounds:" + source.getBounds());
+        Logging.info("Source schema: " + source.getSchema());
 
-		Bounds bounds = MainApplication.getMap().mapView.getLatLonBounds(
-		        MainApplication.getMap().mapView.getBounds());
+        progressMonitor.setProgress(40);
 
-		LatLon minLL = bounds.getMin();
-		LatLon maxLL = bounds.getMax();
-		double minLat = Math.min(minLL.getY(), maxLL.getY());
-		double maxLat = Math.max(minLL.getY(), maxLL.getY());
-		double minLon = Math.min(minLL.getX(), maxLL.getX());
-		double maxLon = Math.max(minLL.getX(), maxLL.getX());
+        // Step 5 - query
+        List<AttributeDescriptor> listAttrs = schema.getAttributeDescriptors();
+        String geomName = listAttrs.get(0).getLocalName();
+        CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:4236");
 
-		ReferencedEnvelope bboxRef = new ReferencedEnvelope(minLon, maxLon,
-				minLat, maxLat, targetCRS);
-		Logging.info("Reference Bounds:" + bboxRef);
+        Bounds bounds = MainApplication.getMap().mapView.getLatLonBounds(
+                MainApplication.getMap().mapView.getBounds());
 
-		progressMonitor.setProgress(50);
-		//
-		// Ask WFS service for typeName data constrained by bboxRef
-		//
-		FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
-		Filter filterBB = ff.bbox(ff.property(geomName), bboxRef);
-		FeatureCollection<SimpleFeatureType, SimpleFeature> features = source
-				.getFeatures(filterBB);
+        LatLon minLL = bounds.getMin();
+        LatLon maxLL = bounds.getMax();
+        double minLat = Math.min(minLL.getY(), maxLL.getY());
+        double maxLat = Math.max(minLL.getY(), maxLL.getY());
+        double minLon = Math.min(minLL.getX(), maxLL.getX());
+        double maxLon = Math.max(minLL.getX(), maxLL.getX());
 
-		progressMonitor.setProgress(80);
-		return features;
-	}
+        ReferencedEnvelope bboxRef = new ReferencedEnvelope(minLon, maxLon,
+                minLat, maxLat, targetCRS);
+        Logging.info("Reference Bounds:" + bboxRef);
 
-	public void initializeDataStore() throws IOException {
-		if (bInitialized == true)
-			return;
+        progressMonitor.setProgress(50);
+        //
+        // Ask WFS service for typeName data constrained by bboxRef
+        //
+        FilterFactory ff = CommonFactoryFinder.getFilterFactory();
+        Filter filterBB = ff.bbox(ff.property(geomName), bboxRef);
+        FeatureCollection<SimpleFeatureType, SimpleFeature> features = source
+                .getFeatures(filterBB);
 
-		String getCapabilities = "http://tools.geofabrik.de/osmi/view/routing_non_eu/wxs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities";
-		@SuppressWarnings("rawtypes")
-		Map<String, Comparable> connectionParameters = new HashMap<>();
-		connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL",
-				getCapabilities);
-		connectionParameters.put("WFSDataStoreFactory:WFS_STRATEGY",
-				"mapserver");
-		connectionParameters.put("WFSDataStoreFactory:LENIENT", true);
-		connectionParameters.put("WFSDataStoreFactory:TIMEOUT", 20000);
-		connectionParameters.put("WFSDataStoreFactory:BUFFER_SIZE", 10000);
-		// Step 2 - connection
-		data = DataStoreFinder.getDataStore(connectionParameters);
+        progressMonitor.setProgress(80);
+        return features;
+    }
 
-		bInitialized = true;
-	}
+    public void initializeDataStore() throws IOException {
+        if (bInitialized)
+            return;
 
-	public String[] getTypeNames() throws IOException {
-		return data.getTypeNames();
-	}
+        String getCapabilities = "http://tools.geofabrik.de/osmi/view/routing_non_eu/wxs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities";
+        @SuppressWarnings("rawtypes")
+        Map<String, Comparable> connectionParameters = new HashMap<>();
+        connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL",
+                getCapabilities);
+        connectionParameters.put("WFSDataStoreFactory:WFS_STRATEGY",
+                "mapserver");
+        connectionParameters.put("WFSDataStoreFactory:LENIENT", true);
+        connectionParameters.put("WFSDataStoreFactory:TIMEOUT", 20000);
+        connectionParameters.put("WFSDataStoreFactory:BUFFER_SIZE", 10000);
+        // Step 2 - connection
+        data = DataStoreFinder.getDataStore(connectionParameters);
 
-	public DataStore getData() {
-		return data;
-	}
+        bInitialized = true;
+    }
 
-	public void setData(DataStore data) {
-		this.data = data;
-	}
+    public String[] getTypeNames() throws IOException {
+        return data.getTypeNames();
+    }
+
+    public DataStore getData() {
+        return data;
+    }
+
+    public void setData(DataStore data) {
+        this.data = data;
+    }
 }
Index: applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/ImportOsmInspectorBugsAction.java
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/ImportOsmInspectorBugsAction.java	(revision 36175)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/ImportOsmInspectorBugsAction.java	(revision 36176)
@@ -11,5 +11,5 @@
 import javax.swing.ProgressMonitor;
 
-import org.opengis.referencing.FactoryException;
+import org.geotools.api.referencing.FactoryException;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.Bounds;
@@ -22,58 +22,56 @@
 
 public class ImportOsmInspectorBugsAction extends JosmAction {
-	OsmInspectorPlugin plugin;
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -6484182416189079287L;
+    OsmInspectorPlugin plugin;
+    /**
+     *
+     */
+    private static final long serialVersionUID = -6484182416189079287L;
 
-	public ImportOsmInspectorBugsAction(OsmInspectorPlugin thePlugin) {
-		super(tr("Import Osm Inspector Bugs..."), "importosmibugs",
-				tr("Import Osm Inspector Bugs..."), Shortcut.registerShortcut("importosmibugs",
-						tr("Edit: {0}", tr("Import Osm Inspector Bugs...")),
-						KeyEvent.VK_O, Shortcut.ALT_CTRL), true);
-		putValue("help", ht("/Action/ImportOsmInspectorBugs"));
-		plugin = thePlugin;
-	}
+    public ImportOsmInspectorBugsAction(OsmInspectorPlugin thePlugin) {
+        super(tr("Import Osm Inspector Bugs..."), "importosmibugs",
+                tr("Import Osm Inspector Bugs..."), Shortcut.registerShortcut("importosmibugs",
+                        tr("Edit: {0}", tr("Import Osm Inspector Bugs...")),
+                        KeyEvent.VK_O, Shortcut.ALT_CTRL), true);
+        putValue("help", ht("/Action/ImportOsmInspectorBugs"));
+        plugin = thePlugin;
+    }
 
-	@Override
-	public void actionPerformed(ActionEvent event) {
-		if (isEnabled()) {
-		    MapView mapView = MainApplication.getMap().mapView;
-			ProgressMonitor monitor = new ProgressMonitor(mapView,
-					"Querying WFS Geofabrik", "Dowloading features", 0, 100);
+    @Override
+    public void actionPerformed(ActionEvent event) {
+        if (isEnabled()) {
+            MapView mapView = MainApplication.getMap().mapView;
+            ProgressMonitor monitor = new ProgressMonitor(mapView,
+                    "Querying WFS Geofabrik", "Dowloading features", 0, 100);
 
-			try {
-				Bounds bounds = mapView.getLatLonBounds(mapView.getBounds());
+            try {
+                Bounds bounds = mapView.getLatLonBounds(mapView.getBounds());
 
-				Logging.info("OSMI View bounds" + bounds);
+                Logging.info("OSMI View bounds" + bounds);
 
-				monitor.setProgress(10);
+                monitor.setProgress(10);
 
-				OsmInspectorLayer inspector = plugin.getLayer();
-				if (inspector == null) {
-					GeoFabrikWFSClient wfs = new GeoFabrikWFSClient(bounds);
-					wfs.initializeDataStore();
-					inspector = new OsmInspectorLayer(wfs, monitor);
-					MainApplication.getLayerManager().addLayer(inspector);
-					plugin.setLayer(inspector);
-				} else {
-					GeoFabrikWFSClient wfs = new GeoFabrikWFSClient(bounds);
-					wfs.initializeDataStore();
-					inspector.loadFeatures(wfs);
+                OsmInspectorLayer inspector = plugin.getLayer();
+                GeoFabrikWFSClient wfs = new GeoFabrikWFSClient(bounds);
+                wfs.initializeDataStore();
+                if (inspector == null) {
+                    inspector = new OsmInspectorLayer(wfs, monitor);
+                    MainApplication.getLayerManager().addLayer(inspector);
+                    plugin.setLayer(inspector);
+                } else {
+                    inspector.loadFeatures(wfs);
 
-				}
-			} catch (IOException | IndexOutOfBoundsException | NoSuchElementException | FactoryException | ParseException e) {
-				Logging.error(e);
-			} finally {
-				monitor.close();
-				if (plugin.getLayer() != null) {
-					plugin.getLayer().updateView();
-				}
-			}
-		} else {
-		    Logging.warn("Osm Inspector Action not enabled");
-		}
-	}
+                }
+            } catch (IOException | IndexOutOfBoundsException | NoSuchElementException | FactoryException | ParseException e) {
+                Logging.error(e);
+            } finally {
+                monitor.close();
+                if (plugin.getLayer() != null) {
+                    plugin.getLayer().updateView();
+                }
+            }
+        } else {
+            Logging.warn("Osm Inspector Action not enabled");
+        }
+    }
 
 }
Index: applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OSMIFeatureTracker.java
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OSMIFeatureTracker.java	(revision 36175)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OSMIFeatureTracker.java	(revision 36176)
@@ -2,72 +2,72 @@
 
 import java.util.HashMap;
-import java.util.Iterator;
+import java.util.Map;
 
+import org.geotools.api.feature.simple.SimpleFeature;
+import org.geotools.api.feature.simple.SimpleFeatureType;
 import org.geotools.data.memory.MemoryFeatureCollection;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.feature.FeatureIterator;
-import org.opengis.feature.simple.SimpleFeature;
-import org.opengis.feature.simple.SimpleFeatureType;
+import org.openstreetmap.josm.tools.Logging;
 
 public class OSMIFeatureTracker {
 
-	private HashMap<Long, SimpleFeature> hashFeatures;
-	private MemoryFeatureCollection features;
+    private final Map<Long, SimpleFeature> hashFeatures;
+    private final MemoryFeatureCollection features;
 
-	public OSMIFeatureTracker(
-			FeatureCollection<SimpleFeatureType, SimpleFeature> featuresIn) {
-		hashFeatures = new HashMap<>();
-		features = new MemoryFeatureCollection(featuresIn.getSchema());
+    public OSMIFeatureTracker(
+            FeatureCollection<SimpleFeatureType, SimpleFeature> featuresIn) {
+        hashFeatures = new HashMap<>();
+        features = new MemoryFeatureCollection(featuresIn.getSchema());
 
-		for (Iterator<?> it = features.iterator(); it.hasNext();) {
-			SimpleFeature element = (SimpleFeature) it.next();
-			try {
-				Long ID = (Long.parseLong((String) element
-						.getAttribute("problem_id")));
+        for (SimpleFeature element : features) {
+            try {
+                Long id = (Long.parseLong((String) element
+                        .getAttribute("problem_id")));
 
-				if (!hashFeatures.containsKey(ID)) {
-					hashFeatures.put(ID, element);
-					features.add(element);
-				}
-			} catch (NumberFormatException e) {
-				continue;
-			}
-		}
+                if (!hashFeatures.containsKey(id)) {
+                    hashFeatures.put(id, element);
+                    features.add(element);
+                }
+            } catch (NumberFormatException e) {
+                Logging.trace(e);
+            }
+        }
 
-		try (FeatureIterator<SimpleFeature> it = featuresIn.features()) {
-		    while (it.hasNext()) {
-		        features.add(it.next());
-		    }
-		}
-	}
+        try (FeatureIterator<SimpleFeature> it = featuresIn.features()) {
+            while (it.hasNext()) {
+                features.add(it.next());
+            }
+        }
+    }
 
-	public boolean mergeFeatures(
-			FeatureCollection<SimpleFeatureType, SimpleFeature> newFeatures) {
-	    try (FeatureIterator<SimpleFeature> it = newFeatures.features()) {
-	        while (it.hasNext()) {
-    			SimpleFeature element = (SimpleFeature) it.next();
-    			try {
-    				Long ID = (Long.parseLong((String) element
-    						.getAttribute("problem_id")));
+    public boolean mergeFeatures(
+            FeatureCollection<SimpleFeatureType, SimpleFeature> newFeatures) {
+        try (FeatureIterator<SimpleFeature> it = newFeatures.features()) {
+            while (it.hasNext()) {
+                SimpleFeature element = it.next();
+                try {
+                    Long id = (Long.parseLong((String) element
+                            .getAttribute("problem_id")));
     
-    				if (!hashFeatures.containsKey(ID)) {
-    					hashFeatures.put(ID, element);
-    					features.add(element);
-    				}
-    			} catch (NumberFormatException e) {
-    				continue;
-    			}
-    		}
-	    }
+                    if (!hashFeatures.containsKey(id)) {
+                        hashFeatures.put(id, element);
+                        features.add(element);
+                    }
+                } catch (NumberFormatException e) {
+                    Logging.trace(e);
+                }
+            }
+        }
 
-		return true;
-	}
+        return true;
+    }
 
-	public HashMap<Long, SimpleFeature> getFeatureHash() {
-		return hashFeatures;
-	}
+    public Map<Long, SimpleFeature> getFeatureHash() {
+        return hashFeatures;
+    }
 
-	public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatures() {
-		return features;
-	}
+    public FeatureCollection<SimpleFeatureType, SimpleFeature> getFeatures() {
+        return features;
+    }
 }
Index: applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OsmInspectorLayer.java
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OsmInspectorLayer.java	(revision 36175)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OsmInspectorLayer.java	(revision 36176)
@@ -9,6 +9,6 @@
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -20,6 +20,25 @@
 import javax.swing.ProgressMonitor;
 
+import org.geotools.api.data.SimpleFeatureSource;
+import org.geotools.api.feature.Property;
+import org.geotools.api.feature.simple.SimpleFeature;
+import org.geotools.api.feature.simple.SimpleFeatureType;
+import org.geotools.api.feature.type.Name;
+import org.geotools.api.filter.FilterFactory;
+import org.geotools.api.filter.identity.FeatureId;
+import org.geotools.api.filter.spatial.Intersects;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.NoSuchAuthorityCodeException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.style.FeatureTypeStyle;
+import org.geotools.api.style.Fill;
+import org.geotools.api.style.Graphic;
+import org.geotools.api.style.Mark;
+import org.geotools.api.style.Rule;
+import org.geotools.api.style.Stroke;
+import org.geotools.api.style.Style;
+import org.geotools.api.style.StyleFactory;
+import org.geotools.api.style.Symbolizer;
 import org.geotools.data.DataUtilities;
-import org.geotools.data.simple.SimpleFeatureSource;
 import org.geotools.factory.CommonFactoryFinder;
 import org.geotools.feature.FeatureCollection;
@@ -30,23 +49,7 @@
 import org.geotools.referencing.CRS;
 import org.geotools.renderer.lite.StreamingRenderer;
-import org.geotools.styling.FeatureTypeStyle;
-import org.geotools.styling.Fill;
-import org.geotools.styling.Graphic;
-import org.geotools.styling.Mark;
-import org.geotools.styling.Rule;
-import org.geotools.styling.Stroke;
-import org.geotools.styling.Style;
-import org.geotools.styling.StyleFactory;
-import org.geotools.styling.Symbolizer;
-import org.opengis.feature.Property;
-import org.opengis.feature.simple.SimpleFeature;
-import org.opengis.feature.simple.SimpleFeatureType;
-import org.opengis.feature.type.Name;
-import org.opengis.filter.FilterFactory2;
-import org.opengis.filter.identity.FeatureId;
-import org.opengis.filter.spatial.Intersects;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.NoSuchAuthorityCodeException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.locationtech.jts.geom.Envelope;
+import org.locationtech.jts.geom.Geometry;
+import org.locationtech.jts.io.ParseException;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -60,573 +63,559 @@
 import org.openstreetmap.josm.tools.Logging;
 
-import org.locationtech.jts.geom.Envelope;
-import org.locationtech.jts.geom.Geometry;
-import org.locationtech.jts.io.ParseException;
-
 public class OsmInspectorLayer extends Layer {
 
-	private StyleFactory sf = CommonFactoryFinder.getStyleFactory(null);
-	private FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
-	private StreamingRenderer renderer;
-	private CoordinateReferenceSystem crsOSMI;
-	private GeomType geometryType;
-	private String geometryAttributeName;
-
-	private SimpleFeatureSource featureSource;
-	private MapContent content;
-	private boolean bIsChanged;
-
-	private int layerOffset = 1;
-
-	private ArrayList<GeomType> selectGeomType;
-	private Color[] featureFills = { new Color(255, 0, 0),
-			new Color(0, 0, 255), // duplicate ways
-			new Color(204, 204, 0), // minor 5
-			new Color(255, 230, 128), // minor 2
-			new Color(255, 204, 0), // minor 1
-			new Color(255, 102, 102), // major 5
-			new Color(255, 148, 77), // major 2
-			new Color(255, 0, 0), // major 1
-			new Color(255, 255, 64), // selected
-			new Color(255, 0, 0), new Color(255, 0, 0) };
-
-	/**
-	 * dialog showing the bug info
-	 */
-	private OsmInspectorDialog dialog;
-
-	/**
-	 * supported actions
-	 */
-
-	// Container for bugs from Osmi
-	private ArrayList<OSMIFeatureTracker> arrFeatures;
-	private LinkedHashMap<BugInfo, Long> osmiBugInfo;
-
-	public Geometry getOsmBugGeometry(int index) {
-		BugInfo[] array = new BugInfo[osmiBugInfo.keySet().size()];
-		array = osmiBugInfo.keySet().toArray(array);
-		return array[index].getGeom();
-	}
-
-	public Map<BugInfo, Long> getOsmiBugInfo() {
-		return osmiBugInfo;
-	}
-
-	public SimpleFeatureSource getFeatureSource() {
-		return featureSource;
-	}
-
-	public void setFeatureSource(SimpleFeatureSource featureSource) {
-		this.featureSource = featureSource;
-	}
-
-	public boolean isbIsChanged() {
-		return bIsChanged;
-	}
-
-	public void setbIsChanged(boolean bIsChanged) {
-		this.bIsChanged = bIsChanged;
-	}
-
-	public ArrayList<OSMIFeatureTracker> getArrFeatures() {
-		return arrFeatures;
-	}
-
-	public void setArrFeatures(ArrayList<OSMIFeatureTracker> arrFeatures) {
-		this.arrFeatures = arrFeatures;
-	}
-
-	public BugIndex getOsmiIndex() {
-		return osmiIndex;
-	}
-
-	// Pointer to prev and next osmi bugs
-	private BugIndex osmiIndex;
-
-	/**
-	 * 
-	 * The Bug attribute class: hold geom, id and description for that bug
-	 * 
-	 * @author snikhil
-	 * 
-	 */
-	public static class BugInfo implements Comparable<BugInfo>{
-
-		public Geometry getGeom() {
-			return geom;
-		}
-
-		public String getDesc() {
-			return desc;
-		}
-
-		public String getId() {
-			return id;
-		}
-
-		@Override
-		public int hashCode() {
-			String fid = attributes.get("FID");
-			String hash =  (fid == null || fid.isEmpty()) ? attributes.get("problem_id") : fid;
-			return hash.hashCode();
-		}
-
-		@Override
-		public boolean equals(Object obj) {
-			String fid = attributes.get("FID");
-			String hash =  (fid == null || fid.isEmpty()) ? attributes.get("problem_id") : fid;
-			
-			
-			if (obj instanceof BugInfo) {
-				BugInfo b = (BugInfo) obj;
-				
-				String bfid = b.attributes.get("FID");
-				String bhash =  (bfid == null || bfid.isEmpty()) ? b.attributes.get("problem_id") : bfid;
-				return hash.equals(bhash);
-			}
-			return false;
-		}
-
-		// private final long bugId; //incremental bugId
-		private final long bugId;
-		private final Geometry geom;
-		private final String desc;
-		private final String id;
-		private final Name name;
-		private final Map<String, String> attributes;
-
-		public BugInfo(SimpleFeature next, long idx)
-				throws IndexOutOfBoundsException, ParseException {
-
-			bugId = idx;
-			attributes = new HashMap<>();
-			Collection<Property> properties = next.getProperties();
-			Iterator<Property> it = properties.iterator();
-			while (it.hasNext()) {
-				Property p = it.next();
-				attributes.put(p.getName().toString(), p.getValue().toString());
-			}
-			this.geom = (Geometry) next.getAttribute(0);
-			this.desc = (String) next.getAttribute("error_desc");
-			this.id = next.getID();
-			name = next.getName();
-		}
-
-		@Override
-		public String toString() {
-			StringBuilder sb = new StringBuilder();
-			sb.append("BugId_").append(String.valueOf(bugId)).append("\n");
-			return sb.toString();
-		}
-
-		public String getContentString() {
-			StringBuilder sb = new StringBuilder();
-			sb.append("Layer:").append(name.getLocalPart()).append("\n");
-			Iterator<Entry<String, String>> it = attributes.entrySet()
-					.iterator();
-			while (it.hasNext()) {
-				Entry<String, String> next = it.next();
-				sb.append(next.getKey()).append(":").append(next.getValue())
-						.append("\n");
-			}
-			return sb.toString();
-		}
-
-		public long getBugId() {
-			return bugId;
-		}
-
-		@Override
-		public int compareTo(BugInfo o) {
-			String fid = attributes.get("FID");
-			String hash =  (fid == null || fid.isEmpty()) ? attributes.get("problem_id") : fid;
-			
-			String ofid = o.attributes.get("FID");
-			String ohash =  (ofid == null || ofid.isEmpty()) ? o.attributes.get("problem_id") : ofid;
-			return hash.compareTo(ohash);
-		}
-	}
-
-	/**
-	 * Helper class that stores the bug next and prev pointers and can navigate
-	 * the entire bug list
-	 * 
-	 * @author snikhil
-	 * 
-	 */
-	public static class BugIndex {
-		private int nextIndex;
-		private int previousIndex;
-		private ArrayList<BugInfo> osmBugs;
-
-		public BugIndex(Map<BugInfo, Long> bugs) {
-			osmBugs = new ArrayList<>(bugs.keySet());
-			nextIndex = 0;
-			previousIndex = -1;
-		}
-
-		public BugIndex(Map<BugInfo, Long> bugs, int n, int p) {
-			osmBugs = new ArrayList<>(bugs.keySet());
-			nextIndex = n;
-			previousIndex = p;
-		}
-
-		public void next() {
-			previousIndex = nextIndex;
-			nextIndex = ++nextIndex % osmBugs.size();
-		}
-
-		public void prev() {
-			nextIndex = previousIndex;
-			previousIndex = previousIndex - 1 < 0 ? osmBugs.size() - 1
-					: --previousIndex;
-		}
-
-		public BugInfo getItemPointedByNext() {
-			return osmBugs.get(nextIndex);
-		}
-
-		public BugInfo getItemPointedByPrev() {
-			return osmBugs.get(nextIndex);
-		}
-
-		public int indexOf(BugInfo b) {
-			return osmBugs.indexOf(b);
-		}
-
-		public BugInfo getNext() {
-			next();
-			return osmBugs.get(nextIndex);
-		}
-
-		public BugInfo getPrev() {
-			prev();
-			return osmBugs.get(nextIndex);
-		}
-
-		public ArrayList<BugInfo> getBugs() {
-			return osmBugs;
-		}
-
-		public void append(LinkedHashMap<BugInfo, Long> osmiBugInfo) {
-			Iterator<BugInfo> it = osmiBugInfo.keySet().iterator();
-			while(it.hasNext()){
-				BugInfo next = it.next();
-				if(!osmBugs.contains(next)){
-					this.osmBugs.add(next);
-				}
-			}
-		}
-	}
-
-	private enum GeomType {
-		POINT, LINE, POLYGON
-	}
-
-	private static final Color SELECTED_COLOUR = Color.ORANGE;
-	private static final float SELECTED_POINT_SIZE = 15.0f;
-	private static final float OPACITY = 1.0f;
-	private static final float LINE_WIDTH = 1.0f;
-	private static final float POINT_SIZE = 10.0f;
-
-	public OsmInspectorLayer(GeoFabrikWFSClient wfsClient,
-			ProgressMonitor monitor) throws NoSuchAuthorityCodeException,
-			FactoryException, IOException, IndexOutOfBoundsException,
-			ParseException {
-		super("OsmInspector");
-
-		arrFeatures = new ArrayList<>();
-		osmiBugInfo = new LinkedHashMap<>();
-		selectGeomType = new ArrayList<>();
-
-		// Step 3 - discovery; enhance to iterate over all types with bounds
-
-		String typeNames[] = wfsClient.getTypeNames();
-		renderer = new StreamingRenderer();
-		CRS.decode(ProjectionRegistry.getProjection().toCode());
-		crsOSMI = CRS.decode("EPSG:4326");
-		content = new MapContent();
-		content.getViewport().setCoordinateReferenceSystem(crsOSMI);
-
-		selectGeomType.add(GeomType.POINT);
-		for (int idx = 1; idx < typeNames.length; ++idx) {
-			String typeName = typeNames[idx];
-			Set<FeatureId> selectedFeatures = new HashSet<>();
-
-			FeatureCollection<SimpleFeatureType, SimpleFeature> features = wfsClient
-					.getFeatures(typeName, monitor);
-			setGeometry(selectGeomType, typeName);
-
-			Logging.info("Osm Inspector Features size: " + features.size());
-			Style style = createDefaultStyle(idx, selectedFeatures);
-
-			OSMIFeatureTracker tracker = new OSMIFeatureTracker(features);
-			arrFeatures.add(tracker);
-			FeatureIterator<SimpleFeature> it = tracker.getFeatures().features();
-
-			while (it.hasNext()) {
-				BugInfo theInfo = new BugInfo(it.next(), osmiBugInfo.size());
-				osmiBugInfo.put(theInfo, theInfo.bugId);
-			}
-
-			content.addLayer(new FeatureLayer(tracker.getFeatures(), style));
-		}
-
-		osmiIndex = new BugIndex(osmiBugInfo);
-		content.setTitle("Osm Inspector Errors");
-		renderer.setMapContent(content);
-		bIsChanged = true;
-
-		// finally initialize the dialog
-		dialog = new OsmInspectorDialog(this);
-		this.updateView();
-	}
-
-	public void loadFeatures(GeoFabrikWFSClient wfsClient)
-			throws NoSuchAuthorityCodeException, FactoryException, IOException,
-			IndexOutOfBoundsException, NoSuchElementException, ParseException {
-		String typeNames[] = wfsClient.getTypeNames();
-
-		content.layers().clear();
-		selectGeomType.clear();
-		selectGeomType.add(GeomType.POINT);
-
-		ProgressMonitor monitor = new ProgressMonitor(MainApplication.getMap().mapView,
-				"Loading features", "", 0, 100);
-
-		for (int idx = 1; idx < typeNames.length; ++idx) {
-			String typeName = typeNames[idx];
-			Set<FeatureId> selectedFeatures = new HashSet<>();
-
-			monitor.setProgress(100 / typeNames.length * idx);
-			FeatureCollection<SimpleFeatureType, SimpleFeature> features = wfsClient
-					.getFeatures(typeName, monitor);
-			setGeometry(selectGeomType, typeName);
-
-			Logging.info("Osm Inspector Features size: " + features.size());
-
-			OSMIFeatureTracker tracker = arrFeatures.get(idx - layerOffset);
-			tracker.mergeFeatures(features);
-
-			FeatureIterator<SimpleFeature> it = tracker.getFeatures().features();
-
-			while (it.hasNext()) {
-				BugInfo theInfo = new BugInfo(it.next(), osmiBugInfo.size());
-				if (!osmiBugInfo.keySet().contains(theInfo)) {
-					osmiBugInfo.put(theInfo, theInfo.bugId);
-				}
-			}
-
-			Style style = createDefaultStyle(idx, selectedFeatures);
-			content.addLayer(new FeatureLayer(tracker.getFeatures(), style));
-		}
-
-		osmiIndex.append(osmiBugInfo);
-		
-		
-		monitor.setProgress(100);
-		monitor.close();
-		bIsChanged = true;
-		//dialog.updateDialog(this);
-		dialog.refreshModel();
-		//dialog.updateNextPrevAction(this);
-		
-		this.updateView();
-	}
-
-	private Style createDefaultStyle(int idx, Set<FeatureId> IDs) {
-		Color fillColor = featureFills[idx];
-
-		Rule selectedRule = createRule(SELECTED_COLOUR, SELECTED_COLOUR, true);
-		selectedRule.setFilter(ff.id(IDs));
-
-		Rule rule = createRule(fillColor, fillColor, false);
-		rule.setElseFilter(true);
-
-		FeatureTypeStyle fts = sf.createFeatureTypeStyle();
-		fts.rules().add(selectedRule);
-		fts.rules().add(rule);
-
-		Style style = sf.createStyle();
-		style.featureTypeStyles().add(fts);
-		return style;
-	}
-
-	private Rule createRule(Color outlineColor, Color fillColor,
-			boolean bSelected) {
-		Symbolizer symbolizer = null;
-		Fill fill = null;
-		Stroke stroke = sf.createStroke(ff.literal(outlineColor),
-				ff.literal(LINE_WIDTH));
-
-		switch (geometryType) {
-		case POLYGON:
-			fill = sf.createFill(ff.literal(fillColor), ff.literal(OPACITY));
-			symbolizer = sf.createPolygonSymbolizer(stroke, fill,
-					geometryAttributeName);
-			break;
-
-		case LINE:
-			symbolizer = sf.createLineSymbolizer(stroke, geometryAttributeName);
-			break;
-
-		case POINT:
-			fill = sf.createFill(ff.literal(fillColor), ff.literal(OPACITY));
-
-			Mark mark = sf.getTriangleMark();
-			mark.setFill(fill);
-			mark.setStroke(stroke);
-
-			Graphic graphic = sf.createDefaultGraphic();
-			graphic.graphicalSymbols().clear();
-			graphic.graphicalSymbols().add(mark);
-			graphic.setSize(ff.literal(bSelected ? SELECTED_POINT_SIZE
-					: POINT_SIZE));
-
-			symbolizer = sf.createPointSymbolizer(graphic,
-					geometryAttributeName);
-		}
-
-		Rule rule = sf.createRule();
-		rule.symbolizers().add(symbolizer);
-		return rule;
-	}
-
-	private void setGeometry(ArrayList<GeomType> selectedTypes, String typename) {
-	    Logging.info("Passed type is" + typename);
-		if (typename.compareTo("duplicate_ways") == 0) {
-			geometryType = GeomType.LINE;
-		} else
-			geometryType = GeomType.POINT;
-
-		selectedTypes.add(geometryType);
-	}
-
-	@Override
-	public Icon getIcon() {
-		return ImageProvider.get("layer/osmdata_small");
-	}
-
-	@Override
-	public Object getInfoComponent() {
-		return getToolTipText();
-	}
-
-	@Override
-	public Action[] getMenuEntries() {
-		return new Action[] {};
-	}
-
-	@Override
-	public String getToolTipText() {
-		return org.openstreetmap.josm.tools.I18n.tr("OsmInspector");
-	}
-
-	@Override
-	public boolean isMergable(Layer other) {
-		return false;
-	}
-
-	@Override
-	public void mergeFrom(Layer from) {
-		return;
-	}
-
-	@Override
-	public void paint(Graphics2D g, MapView mv, Bounds box) {
-		LatLon min = box.getMin();
-		LatLon max = box.getMax();
-
-		Envelope envelope2 = new Envelope(Math.min(min.lat(), max.lat()),
-				Math.max(min.lat(), max.lat()), Math.min(min.lon(), max.lon()),
-				Math.max(min.lon(), max.lon()));
-
-		ReferencedEnvelope mapArea = new ReferencedEnvelope(envelope2, crsOSMI);
-
-		renderer.setInteractive(false);
-		renderer.paint(g, mv.getBounds(), mapArea);
-		bIsChanged = false;
-	}
-
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor v) {
-	}
-
-	public boolean isChanged() {
-		return bIsChanged;
-	}
-
-	public void updateView() {
-		this.dialog.revalidate();
-		invalidate();
-	}
-
-	public void selectFeatures(int x, int y) {
-		int pixelDelta = 2;
-		LatLon clickUL = MainApplication.getMap().mapView.getLatLon(x - pixelDelta, y
-				- pixelDelta);
-		LatLon clickLR = MainApplication.getMap().mapView.getLatLon(x + pixelDelta, y
-				+ pixelDelta);
-
-		Envelope envelope = new Envelope(
-				Math.min(clickUL.lon(), clickLR.lon()), Math.max(clickUL.lon(),
-						clickLR.lon()), Math.min(clickUL.lat(), clickLR.lat()),
-				Math.max(clickUL.lat(), clickLR.lat()));
-
-		ReferencedEnvelope mapArea = new ReferencedEnvelope(envelope, crsOSMI);
-
-		Intersects filter = ff.intersects(ff.property("msGeometry"),
-				ff.literal(mapArea));
-		//
-		// Select features in all layers
-		//
-		content.layers().clear();
-
-		// Iterate through features and build a list that intersects the above
-		// envelope
-		for (int idx = 0; idx < arrFeatures.size(); ++idx) {
-			OSMIFeatureTracker tracker = arrFeatures.get(idx);
-			FeatureCollection<SimpleFeatureType, SimpleFeature> features = tracker
-					.getFeatures();
-
-			SimpleFeatureSource tempfs = DataUtilities.source(features);
-			FeatureCollection<SimpleFeatureType, SimpleFeature> selectedFeatures;
-
-			try {
-				selectedFeatures = tempfs.getFeatures(filter);
+    private final StyleFactory sf = CommonFactoryFinder.getStyleFactory(null);
+    private final FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
+    private final StreamingRenderer renderer;
+    private final CoordinateReferenceSystem crsOSMI;
+    private GeomType geometryType;
+    private String geometryAttributeName;
+
+    private SimpleFeatureSource featureSource;
+    private final MapContent content;
+    private boolean bIsChanged;
+
+    private final int layerOffset = 1;
+
+    private final ArrayList<GeomType> selectGeomType;
+    private final Color[] featureFills = { new Color(255, 0, 0),
+            new Color(0, 0, 255), // duplicate ways
+            new Color(204, 204, 0), // minor 5
+            new Color(255, 230, 128), // minor 2
+            new Color(255, 204, 0), // minor 1
+            new Color(255, 102, 102), // major 5
+            new Color(255, 148, 77), // major 2
+            new Color(255, 0, 0), // major 1
+            new Color(255, 255, 64), // selected
+            new Color(255, 0, 0), new Color(255, 0, 0) };
+
+    /**
+     * dialog showing the bug info
+     */
+    private final OsmInspectorDialog dialog;
+
+    /**
+     * supported actions
+     */
+
+    // Container for bugs from Osmi
+    private List<OSMIFeatureTracker> arrFeatures;
+    private final LinkedHashMap<BugInfo, Long> osmiBugInfo;
+
+    public Geometry getOsmBugGeometry(int index) {
+        BugInfo[] array = new BugInfo[osmiBugInfo.keySet().size()];
+        array = osmiBugInfo.keySet().toArray(array);
+        return array[index].getGeom();
+    }
+
+    public Map<BugInfo, Long> getOsmiBugInfo() {
+        return osmiBugInfo;
+    }
+
+    public SimpleFeatureSource getFeatureSource() {
+        return featureSource;
+    }
+
+    public void setFeatureSource(SimpleFeatureSource featureSource) {
+        this.featureSource = featureSource;
+    }
+
+    public boolean isbIsChanged() {
+        return bIsChanged;
+    }
+
+    public void setbIsChanged(boolean bIsChanged) {
+        this.bIsChanged = bIsChanged;
+    }
+
+    public List<OSMIFeatureTracker> getArrFeatures() {
+        return arrFeatures;
+    }
+
+    public void setArrFeatures(List<OSMIFeatureTracker> arrFeatures) {
+        this.arrFeatures = arrFeatures;
+    }
+
+    public BugIndex getOsmiIndex() {
+        return osmiIndex;
+    }
+
+    // Pointer to prev and next osmi bugs
+    private final BugIndex osmiIndex;
+
+    /**
+     *
+     * The Bug attribute class: hold geom, id and description for that bug
+     *
+     * @author snikhil
+     *
+     */
+    public static class BugInfo implements Comparable<BugInfo>{
+
+        public Geometry getGeom() {
+            return geom;
+        }
+
+        public String getDesc() {
+            return desc;
+        }
+
+        public String getId() {
+            return id;
+        }
+
+        @Override
+        public int hashCode() {
+            String fid = attributes.get("FID");
+            String hash =  (fid == null || fid.isEmpty()) ? attributes.get("problem_id") : fid;
+            return hash.hashCode();
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            String fid = attributes.get("FID");
+            String hash =  (fid == null || fid.isEmpty()) ? attributes.get("problem_id") : fid;
+
+
+            if (obj instanceof BugInfo) {
+                BugInfo b = (BugInfo) obj;
+
+                String bfid = b.attributes.get("FID");
+                String bhash =  (bfid == null || bfid.isEmpty()) ? b.attributes.get("problem_id") : bfid;
+                return hash.equals(bhash);
+            }
+            return false;
+        }
+
+        // private final long bugId; //incremental bugId
+        private final long bugId;
+        private final Geometry geom;
+        private final String desc;
+        private final String id;
+        private final Name name;
+        private final Map<String, String> attributes;
+
+        public BugInfo(SimpleFeature next, long idx)
+                throws IndexOutOfBoundsException, ParseException {
+
+            bugId = idx;
+            attributes = new HashMap<>();
+            Collection<Property> properties = next.getProperties();
+            for (Property p : properties) {
+                attributes.put(p.getName().toString(), p.getValue().toString());
+            }
+            this.geom = (Geometry) next.getAttribute(0);
+            this.desc = (String) next.getAttribute("error_desc");
+            this.id = next.getID();
+            name = next.getName();
+        }
+
+        @Override
+        public String toString() {
+            return "BugId_" + bugId + "\n";
+        }
+
+        public String getContentString() {
+            StringBuilder sb = new StringBuilder();
+            sb.append("Layer:").append(name.getLocalPart()).append("\n");
+            for (Entry<String, String> next : attributes.entrySet()) {
+                sb.append(next.getKey()).append(":").append(next.getValue())
+                        .append("\n");
+            }
+            return sb.toString();
+        }
+
+        public long getBugId() {
+            return bugId;
+        }
+
+        @Override
+        public int compareTo(BugInfo o) {
+            String fid = attributes.get("FID");
+            String hash =  (fid == null || fid.isEmpty()) ? attributes.get("problem_id") : fid;
+
+            String ofid = o.attributes.get("FID");
+            String ohash =  (ofid == null || ofid.isEmpty()) ? o.attributes.get("problem_id") : ofid;
+            return hash.compareTo(ohash);
+        }
+    }
+
+    /**
+     * Helper class that stores the bug next and prev pointers and can navigate
+     * the entire bug list
+     *
+     * @author snikhil
+     *
+     */
+    public static class BugIndex {
+        private int nextIndex;
+        private int previousIndex;
+        private final ArrayList<BugInfo> osmBugs;
+
+        public BugIndex(Map<BugInfo, Long> bugs) {
+            osmBugs = new ArrayList<>(bugs.keySet());
+            nextIndex = 0;
+            previousIndex = -1;
+        }
+
+        public BugIndex(Map<BugInfo, Long> bugs, int n, int p) {
+            osmBugs = new ArrayList<>(bugs.keySet());
+            nextIndex = n;
+            previousIndex = p;
+        }
+
+        public void next() {
+            previousIndex = nextIndex;
+            nextIndex = ++nextIndex % osmBugs.size();
+        }
+
+        public void prev() {
+            nextIndex = previousIndex;
+            previousIndex = previousIndex - 1 < 0 ? osmBugs.size() - 1
+                    : --previousIndex;
+        }
+
+        public BugInfo getItemPointedByNext() {
+            return osmBugs.get(nextIndex);
+        }
+
+        public BugInfo getItemPointedByPrev() {
+            return osmBugs.get(nextIndex);
+        }
+
+        public int indexOf(BugInfo b) {
+            return osmBugs.indexOf(b);
+        }
+
+        public BugInfo getNext() {
+            next();
+            return osmBugs.get(nextIndex);
+        }
+
+        public BugInfo getPrev() {
+            prev();
+            return osmBugs.get(nextIndex);
+        }
+
+        public List<BugInfo> getBugs() {
+            return osmBugs;
+        }
+
+        public void append(Map<BugInfo, Long> osmiBugInfo) {
+            for (BugInfo next : osmiBugInfo.keySet()) {
+                if (!osmBugs.contains(next)) {
+                    this.osmBugs.add(next);
+                }
+            }
+        }
+    }
+
+    private enum GeomType {
+        POINT, LINE, POLYGON
+    }
+
+    private static final Color SELECTED_COLOUR = Color.ORANGE;
+    private static final float SELECTED_POINT_SIZE = 15.0f;
+    private static final float OPACITY = 1.0f;
+    private static final float LINE_WIDTH = 1.0f;
+    private static final float POINT_SIZE = 10.0f;
+
+    public OsmInspectorLayer(GeoFabrikWFSClient wfsClient,
+            ProgressMonitor monitor) throws NoSuchAuthorityCodeException,
+            FactoryException, IOException, IndexOutOfBoundsException,
+            ParseException {
+        super("OsmInspector");
+
+        arrFeatures = new ArrayList<>();
+        osmiBugInfo = new LinkedHashMap<>();
+        selectGeomType = new ArrayList<>();
+
+        // Step 3 - discovery; enhance to iterate over all types with bounds
+
+        String[] typeNames = wfsClient.getTypeNames();
+        renderer = new StreamingRenderer();
+        CRS.decode(ProjectionRegistry.getProjection().toCode());
+        crsOSMI = CRS.decode("EPSG:4326");
+        content = new MapContent();
+        content.getViewport().setCoordinateReferenceSystem(crsOSMI);
+
+        selectGeomType.add(GeomType.POINT);
+        for (int idx = 1; idx < typeNames.length; ++idx) {
+            String typeName = typeNames[idx];
+            Set<FeatureId> selectedFeatures = new HashSet<>();
+
+            FeatureCollection<SimpleFeatureType, SimpleFeature> features = wfsClient
+                    .getFeatures(typeName, monitor);
+            setGeometry(selectGeomType, typeName);
+
+            Logging.info("Osm Inspector Features size: " + features.size());
+            Style style = createDefaultStyle(idx, selectedFeatures);
+
+            OSMIFeatureTracker tracker = new OSMIFeatureTracker(features);
+            arrFeatures.add(tracker);
+            FeatureIterator<SimpleFeature> it = tracker.getFeatures().features();
+
+            while (it.hasNext()) {
+                BugInfo theInfo = new BugInfo(it.next(), osmiBugInfo.size());
+                osmiBugInfo.put(theInfo, theInfo.bugId);
+            }
+
+            content.addLayer(new FeatureLayer(tracker.getFeatures(), style));
+        }
+
+        osmiIndex = new BugIndex(osmiBugInfo);
+        content.setTitle("Osm Inspector Errors");
+        renderer.setMapContent(content);
+        bIsChanged = true;
+
+        // finally initialize the dialog
+        dialog = new OsmInspectorDialog(this);
+        this.updateView();
+    }
+
+    public void loadFeatures(GeoFabrikWFSClient wfsClient)
+            throws NoSuchAuthorityCodeException, FactoryException, IOException,
+            IndexOutOfBoundsException, NoSuchElementException, ParseException {
+        String[] typeNames = wfsClient.getTypeNames();
+
+        content.layers().clear();
+        selectGeomType.clear();
+        selectGeomType.add(GeomType.POINT);
+
+        ProgressMonitor monitor = new ProgressMonitor(MainApplication.getMap().mapView,
+                "Loading features", "", 0, 100);
+
+        for (int idx = 1; idx < typeNames.length; ++idx) {
+            String typeName = typeNames[idx];
+            Set<FeatureId> selectedFeatures = new HashSet<>();
+
+            monitor.setProgress(100 / typeNames.length * idx);
+            FeatureCollection<SimpleFeatureType, SimpleFeature> features = wfsClient
+                    .getFeatures(typeName, monitor);
+            setGeometry(selectGeomType, typeName);
+
+            Logging.info("Osm Inspector Features size: " + features.size());
+
+            OSMIFeatureTracker tracker = arrFeatures.get(idx - layerOffset);
+            tracker.mergeFeatures(features);
+
+            FeatureIterator<SimpleFeature> it = tracker.getFeatures().features();
+
+            while (it.hasNext()) {
+                BugInfo theInfo = new BugInfo(it.next(), osmiBugInfo.size());
+                if (!osmiBugInfo.containsKey(theInfo)) {
+                    osmiBugInfo.put(theInfo, theInfo.bugId);
+                }
+            }
+
+            Style style = createDefaultStyle(idx, selectedFeatures);
+            content.addLayer(new FeatureLayer(tracker.getFeatures(), style));
+        }
+
+        osmiIndex.append(osmiBugInfo);
+
+
+        monitor.setProgress(100);
+        monitor.close();
+        bIsChanged = true;
+        //dialog.updateDialog(this);
+        dialog.refreshModel();
+        //dialog.updateNextPrevAction(this);
+
+        this.updateView();
+    }
+
+    private Style createDefaultStyle(int idx, Set<FeatureId> IDs) {
+        Color fillColor = featureFills[idx];
+
+        Rule selectedRule = createRule(SELECTED_COLOUR, SELECTED_COLOUR, true);
+        selectedRule.setFilter(ff.id(IDs));
+
+        Rule rule = createRule(fillColor, fillColor, false);
+        rule.setElseFilter(true);
+
+        FeatureTypeStyle fts = sf.createFeatureTypeStyle();
+        fts.rules().add(selectedRule);
+        fts.rules().add(rule);
+
+        Style style = sf.createStyle();
+        style.featureTypeStyles().add(fts);
+        return style;
+    }
+
+    private Rule createRule(Color outlineColor, Color fillColor,
+            boolean bSelected) {
+        Symbolizer symbolizer = null;
+        Fill fill = null;
+        Stroke stroke = sf.createStroke(ff.literal(outlineColor),
+                ff.literal(LINE_WIDTH));
+
+        switch (geometryType) {
+        case POLYGON:
+            fill = sf.createFill(ff.literal(fillColor), ff.literal(OPACITY));
+            symbolizer = sf.createPolygonSymbolizer(stroke, fill,
+                    geometryAttributeName);
+            break;
+
+        case LINE:
+            symbolizer = sf.createLineSymbolizer(stroke, geometryAttributeName);
+            break;
+
+        case POINT:
+            fill = sf.createFill(ff.literal(fillColor), ff.literal(OPACITY));
+
+            Mark mark = sf.getTriangleMark();
+            mark.setFill(fill);
+            mark.setStroke(stroke);
+
+            Graphic graphic = sf.createDefaultGraphic();
+            graphic.graphicalSymbols().clear();
+            graphic.graphicalSymbols().add(mark);
+            graphic.setSize(ff.literal(bSelected ? SELECTED_POINT_SIZE
+                    : POINT_SIZE));
+
+            symbolizer = sf.createPointSymbolizer(graphic,
+                    geometryAttributeName);
+        }
+
+        Rule rule = sf.createRule();
+        rule.symbolizers().add(symbolizer);
+        return rule;
+    }
+
+    private void setGeometry(ArrayList<GeomType> selectedTypes, String typename) {
+        Logging.info("Passed type is" + typename);
+        if (typename.compareTo("duplicate_ways") == 0) {
+            geometryType = GeomType.LINE;
+        } else
+            geometryType = GeomType.POINT;
+
+        selectedTypes.add(geometryType);
+    }
+
+    @Override
+    public Icon getIcon() {
+        return ImageProvider.get("layer/osmdata_small");
+    }
+
+    @Override
+    public Object getInfoComponent() {
+        return getToolTipText();
+    }
+
+    @Override
+    public Action[] getMenuEntries() {
+        return new Action[] {};
+    }
+
+    @Override
+    public String getToolTipText() {
+        return org.openstreetmap.josm.tools.I18n.tr("OsmInspector");
+    }
+
+    @Override
+    public boolean isMergable(Layer other) {
+        return false;
+    }
+
+    @Override
+    public void mergeFrom(Layer from) {
+        return;
+    }
+
+    @Override
+    public void paint(Graphics2D g, MapView mv, Bounds box) {
+        LatLon min = box.getMin();
+        LatLon max = box.getMax();
+
+        Envelope envelope2 = new Envelope(Math.min(min.lat(), max.lat()),
+                Math.max(min.lat(), max.lat()), Math.min(min.lon(), max.lon()),
+                Math.max(min.lon(), max.lon()));
+
+        ReferencedEnvelope mapArea = new ReferencedEnvelope(envelope2, crsOSMI);
+
+        renderer.setInteractive(false);
+        renderer.paint(g, mv.getBounds(), mapArea);
+        bIsChanged = false;
+    }
+
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor v) {
+    }
+
+    public boolean isChanged() {
+        return bIsChanged;
+    }
+
+    public void updateView() {
+        this.dialog.revalidate();
+        invalidate();
+    }
+
+    public void selectFeatures(int x, int y) {
+        int pixelDelta = 2;
+        LatLon clickUL = MainApplication.getMap().mapView.getLatLon(x - pixelDelta, y
+                - pixelDelta);
+        LatLon clickLR = MainApplication.getMap().mapView.getLatLon(x + pixelDelta, y
+                + pixelDelta);
+
+        Envelope envelope = new Envelope(
+                Math.min(clickUL.lon(), clickLR.lon()), Math.max(clickUL.lon(),
+                        clickLR.lon()), Math.min(clickUL.lat(), clickLR.lat()),
+                Math.max(clickUL.lat(), clickLR.lat()));
+
+        ReferencedEnvelope mapArea = new ReferencedEnvelope(envelope, crsOSMI);
+
+        Intersects filter = ff.intersects(ff.property("msGeometry"),
+                ff.literal(mapArea));
+        //
+        // Select features in all layers
+        //
+        content.layers().clear();
+
+        // Iterate through features and build a list that intersects the above
+        // envelope
+        for (int idx = 0; idx < arrFeatures.size(); ++idx) {
+            OSMIFeatureTracker tracker = arrFeatures.get(idx);
+            FeatureCollection<SimpleFeatureType, SimpleFeature> features = tracker
+                    .getFeatures();
+
+            SimpleFeatureSource tempfs = DataUtilities.source(features);
+            FeatureCollection<SimpleFeatureType, SimpleFeature> selectedFeatures;
+
+            try {
+                selectedFeatures = tempfs.getFeatures(filter);
                 Set<FeatureId> IDs = new HashSet<>();
 
-				try (FeatureIterator<SimpleFeature> iter = selectedFeatures.features()) {
+                try (FeatureIterator<SimpleFeature> iter = selectedFeatures.features()) {
     
-    				Logging.info("Selected features " + selectedFeatures.size());
+                    Logging.info("Selected features " + selectedFeatures.size());
     
-    				while (iter.hasNext()) {
-    					SimpleFeature feature = iter.next();
-    					IDs.add(feature.getIdentifier());
-    				}
-				}
-
-				geometryType = selectGeomType.get(idx + layerOffset);
-				Style style = createDefaultStyle(idx + layerOffset, IDs);
-				content.addLayer(new FeatureLayer(features, style));
-			} catch (IOException e) {
-				Logging.error(e);
-			}
-		}
-
-		bIsChanged = true;
-	}
-
-	public void selectFeatures(LatLon center) {
-		Point point = MainApplication.getMap().mapView.getPoint(center);
-		selectFeatures(point.x, point.y);
-	}
-
-	public void setOsmiIndex(int firstIndex) {
-		osmiIndex.nextIndex = firstIndex;
-		osmiIndex.previousIndex = firstIndex - 1 >= 0 ? firstIndex - 1
-				: osmiBugInfo.size() - 1;
-	}
-
+                    while (iter.hasNext()) {
+                        SimpleFeature feature = iter.next();
+                        IDs.add(feature.getIdentifier());
+                    }
+                }
+
+                geometryType = selectGeomType.get(idx + layerOffset);
+                Style style = createDefaultStyle(idx + layerOffset, IDs);
+                content.addLayer(new FeatureLayer(features, style));
+            } catch (IOException e) {
+                Logging.error(e);
+            }
+        }
+
+        bIsChanged = true;
+    }
+
+    public void selectFeatures(LatLon center) {
+        Point point = MainApplication.getMap().mapView.getPoint(center);
+        selectFeatures(point.x, point.y);
+    }
+
+    public void setOsmiIndex(int firstIndex) {
+        osmiIndex.nextIndex = firstIndex;
+        osmiIndex.previousIndex = firstIndex - 1 >= 0 ? firstIndex - 1
+                : osmiBugInfo.size() - 1;
+    }
 }
Index: applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OsmInspectorPlugin.java
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OsmInspectorPlugin.java	(revision 36175)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/OsmInspectorPlugin.java	(revision 36176)
@@ -26,5 +26,5 @@
 MouseListener, PreferenceChangedListener, DownloadSelection{
 
-	/** The JOSM user identity manager, it is used for obtaining the user name */
+    /** The JOSM user identity manager, it is used for obtaining the user name */
     private final UserIdentityManager userIdentityManager;
    
@@ -35,11 +35,11 @@
     private OsmInspectorLayer inspectorLayer;
     
-	public OsmInspectorPlugin(PluginInformation info) {
-		super(info);
-		userIdentityManager = UserIdentityManager.getInstance();
-		initializePlugin();
-	}
-	
-	/**
+    public OsmInspectorPlugin(PluginInformation info) {
+        super(info);
+        userIdentityManager = UserIdentityManager.getInstance();
+        initializePlugin();
+    }
+
+    /**
      * Initialize the <code>OsmInspectorPlugin</code> object. Creates the
      * <code>OsmInspectorGUI</code> and initializes the following variables with
@@ -59,8 +59,8 @@
         inspectorLayer = null;
     }
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		MainApplication.getToolbar().register( new ImportOsmInspectorBugsAction( this ) );
-		if (newFrame == null) {
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        MainApplication.getToolbar().register( new ImportOsmInspectorBugsAction( this ) );
+        if (newFrame == null) {
             /* if new MapFrame is null, remove listener */
             NavigatableComponent.removeZoomChangeListener(this);
@@ -81,64 +81,64 @@
             }
         }
-	}
+    }
 
-	@Override
-	public void zoomChanged() {
-		
-	}
+    @Override
+    public void zoomChanged() {
 
-	@Override
-	//
-	//  Delegate feature selection to layer
-	//
-	public void mouseClicked(MouseEvent e) {
-	    if (inspectorLayer != null) {
-	        inspectorLayer.selectFeatures(e.getX(), e.getY());
-	    }
-	}
+    }
 
-	@Override
-	public void mouseEntered(MouseEvent e) {
-		
-	}
+    @Override
+    //
+    //  Delegate feature selection to layer
+    //
+    public void mouseClicked(MouseEvent e) {
+        if (inspectorLayer != null) {
+            inspectorLayer.selectFeatures(e.getX(), e.getY());
+        }
+    }
 
-	@Override
-	public void mouseExited(MouseEvent e) {
-		
-	}
+    @Override
+    public void mouseEntered(MouseEvent e) {
 
-	@Override
-	public void mousePressed(MouseEvent e) {
-		
-	}
+    }
 
-	@Override
-	public void mouseReleased(MouseEvent e) {
-		
-	}
+    @Override
+    public void mouseExited(MouseEvent e) {
 
-	@Override
-	public void preferenceChanged(PreferenceChangeEvent e) {
-		
-	}
+    }
 
-	public OsmInspectorLayer getLayer()
-	{
-		return inspectorLayer;
-	}
+    @Override
+    public void mousePressed(MouseEvent e) {
 
-	public void setLayer( OsmInspectorLayer theLayer )
-	{
-		inspectorLayer = theLayer;
-	}
+    }
 
-	@Override
-	public void addGui(DownloadDialog gui) {
-		// TODO Auto-generated method stub
-	}
+    @Override
+    public void mouseReleased(MouseEvent e) {
 
-	@Override
-	public void setDownloadArea(Bounds bounds) {
-		// TODO Auto-generated method stub
-	}
+    }
+
+    @Override
+    public void preferenceChanged(PreferenceChangeEvent e) {
+
+    }
+
+    public OsmInspectorLayer getLayer()
+    {
+        return inspectorLayer;
+    }
+
+    public void setLayer( OsmInspectorLayer theLayer )
+    {
+        inspectorLayer = theLayer;
+    }
+
+    @Override
+    public void addGui(DownloadDialog gui) {
+        // TODO Auto-generated method stub
+    }
+
+    @Override
+    public void setDownloadArea(Bounds bounds) {
+        // TODO Auto-generated method stub
+    }
 }
Index: applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorBugInfoDialog.java
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorBugInfoDialog.java	(revision 36175)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorBugInfoDialog.java	(revision 36176)
@@ -4,10 +4,9 @@
 
 import java.awt.event.KeyEvent;
-import java.util.Arrays;
+import java.util.Collections;
 
 import javax.swing.JTextPane;
 
 import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
 import org.openstreetmap.josm.plugins.osminspector.OsmInspectorLayer;
@@ -17,42 +16,42 @@
 public class OsmInspectorBugInfoDialog extends ToggleDialog {
 
-	private JTextPane bugTextArea;
+    private JTextPane bugTextArea;
 
-	/**
-	 * Builds the content panel for this dialog
-	 */
-	protected void buildContentPanel() {
-		MainApplication.getMap().addToggleDialog(this, true);
-		
-		bugTextArea = new JTextPane();
-		createLayout(bugTextArea, true, Arrays.asList(new SideButton[] {}));
-		bugTextArea.setText("This is a demo");
-		this.add(bugTextArea);
-	}
+    /**
+     * Builds the content panel for this dialog
+     */
+    protected void buildContentPanel() {
+        MainApplication.getMap().addToggleDialog(this, true);
 
-	public OsmInspectorBugInfoDialog(OsmInspectorLayer layer) {
+        bugTextArea = new JTextPane();
+        createLayout(bugTextArea, true, Collections.emptyList());
+        bugTextArea.setText("This is a demo");
+        this.add(bugTextArea);
+    }
 
-		super(tr("OsmBugInfo"), "select",
-				tr("Open a OSM Inspector selection list window."), Shortcut.registerShortcut("subwindow:select",
-								tr("Toggle: {0}", tr("Current Selected Bug Info")),
-								KeyEvent.VK_D, Shortcut.ALT_SHIFT), 150, // default
-																			// height
-				true // default is "show dialog"
-		);
-		buildContentPanel();
-	}
+    public OsmInspectorBugInfoDialog(OsmInspectorLayer layer) {
 
-	public void updateDialog(OsmInspectorLayer l) {
-	}
-	
-	public void setBugDescription(BugInfo i){
-	    bugTextArea.setText(i.getContentString());
-	}
-	
-	@Override
-	public void hideNotify() {
-		if (dialogsPanel != null) {
-			super.hideNotify();
-		}
-	}
+        super(tr("OsmBugInfo"), "select",
+                tr("Open a OSM Inspector selection list window."), Shortcut.registerShortcut("subwindow:select",
+                                tr("Toggle: {0}", tr("Current Selected Bug Info")),
+                                KeyEvent.VK_D, Shortcut.ALT_SHIFT), 150, // default
+                                                                            // height
+                true // default is "show dialog"
+        );
+        buildContentPanel();
+    }
+
+    public void updateDialog(OsmInspectorLayer l) {
+    }
+
+    public void setBugDescription(BugInfo i){
+        bugTextArea.setText(i.getContentString());
+    }
+
+    @Override
+    public void hideNotify() {
+        if (dialogsPanel != null) {
+            super.hideNotify();
+        }
+    }
 }
Index: applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorDialog.java
===================================================================
--- applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorDialog.java	(revision 36175)
+++ applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorDialog.java	(revision 36176)
@@ -4,5 +4,4 @@
 
 import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
 import java.util.Arrays;
@@ -14,7 +13,7 @@
 import javax.swing.ListSelectionModel;
 import javax.swing.ScrollPaneConstants;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
+
+import org.locationtech.jts.geom.Geometry;
+import org.locationtech.jts.geom.Point;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -32,218 +31,204 @@
 import org.openstreetmap.josm.tools.Shortcut;
 
-import org.locationtech.jts.geom.Geometry;
-import org.locationtech.jts.geom.Point;
-
 public class OsmInspectorDialog extends ToggleDialog implements LayerChangeListener, ActiveLayerChangeListener {
 
-	private OsmInspectorLayer layer;
-	private JList<String> bugsList;
-	private OsmInspectorNextAction actNext;
-	private OsmInspectorPrevAction actPrev;
-	private DefaultListModel<String> model;
-
-	private OsmInspectorBugInfoDialog bugInfoDialog;
-	
-	public void updateNextPrevAction(OsmInspectorLayer l) {
-		this.actNext.inspectlayer = l;
-		this.actPrev.inspectlayer = l;
-	}
-	
-	/**
-	 * Builds the content panel for this dialog
-	 */
-	protected void buildContentPanel() {
-		MainApplication.getMap().addToggleDialog(this, true);
-
-		model = new DefaultListModel<>();
-		refreshModel();
-		bugsList = new JList<>(model);
-		bugsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-		bugsList.setLayoutOrientation(JList.VERTICAL_WRAP);
-		
-		bugsList.setVisibleRowCount(-1);
-		JScrollPane scroll = new JScrollPane(bugsList,
-				ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
-				ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-		
-		bugsList.addListSelectionListener(new ListSelectionListener() {
-			
-			@Override
-			public void valueChanged(ListSelectionEvent e) {
-				layer.setOsmiIndex(e.getFirstIndex());
-				BugInfo next = layer.getOsmiIndex().getItemPointedByNext();
-				layer.setOsmiIndex((e.getFirstIndex() + 1) % layer.getOsmiBugInfo().size());
-				Geometry geom = next.getGeom();
-				Point centroid = geom.getCentroid();
-				LatLon center = new LatLon(centroid.getY(), centroid.getX());
-				MainApplication.getMap().mapView.zoomTo(center);
-				layer.selectFeatures(center);
-				bugInfoDialog.setBugDescription(next);
-			}
-		});
-		
-		// refreshBugList();
-		// the next action
-		final SideButton nextButton = new SideButton(
-				actNext = new OsmInspectorNextAction(layer));
-		nextButton.createArrow(new ActionListener() {
-		    @Override
-			public void actionPerformed(ActionEvent e) {
-				int index = bugsList.getSelectedIndex();
-				Geometry geom = layer.getOsmBugGeometry(index);
-				Point centroid = geom.getCentroid();
-				LatLon center = new LatLon(centroid.getY(), centroid.getX());
-				MainApplication.getMap().mapView.zoomTo(center);
-				layer.selectFeatures(center);
-			}
-		});
-
-		// the previous button
-		final SideButton prevButton = new SideButton(
-				actPrev = new OsmInspectorPrevAction(layer));
-		prevButton.createArrow(new ActionListener() {
-            @Override
-			public void actionPerformed(ActionEvent e) {
-			}
-		});
-
-		createLayout(scroll, true,
-				Arrays.asList(new SideButton[] { nextButton, prevButton }));
-		this.add(scroll);
-
-		Shortcut sprev = Shortcut.registerShortcut("osmi:prev", tr("Prev OSMI bug"),
-				KeyEvent.VK_J, Shortcut.CTRL_SHIFT);
-		MainApplication.registerActionShortcut(actPrev, sprev);
-
-		Shortcut snext = Shortcut.registerShortcut("osmi:next", tr("Next OSMI bug"),
-				KeyEvent.VK_K, Shortcut.CTRL_SHIFT);
-		MainApplication.registerActionShortcut(actNext, snext);
-	}
-
-	public void refreshModel() {
-		model.clear();
-		for (Object b : layer.getOsmiBugInfo().keySet()) {
-			if (b instanceof BugInfo) {
-				model.addElement(b.toString());
-			}
-		}
-	}
-
-	public OsmInspectorDialog(OsmInspectorLayer layer) {
-
-		super(tr("OSM Inspector Bugs"), "selectionlist",
-				tr("Open a OSM Inspector selection list window."), Shortcut.registerShortcut("subwindow:osminspector",
-								tr("Toggle: {0}", tr("OSM Inspector Bugs")),
-								KeyEvent.VK_W, Shortcut.ALT_SHIFT), 150, // default height
-				true // default is "show dialog"
-		);
-		this.layer = layer;
-		buildContentPanel();
-		bugInfoDialog = new OsmInspectorBugInfoDialog(layer);
-		bugInfoDialog.setTitle(tr("Selected Bug Info"));
-	}
-
-	public void updateDialog(OsmInspectorLayer l) {
-		this.layer = l;
-		bugInfoDialog.updateDialog(l);
-		refreshModel();
-		refreshBugList();
-	}
-	
-	@Override
-	public void showNotify() {
-		super.showNotify();
-	}
-
-	@Override
-	public void hideNotify() {
-		if (dialogsPanel != null) {
-			super.hideNotify();
-		}
-	}
-
-	public class OsmInspectorNextAction extends AbstractAction {
-
-		private OsmInspectorLayer inspectlayer;
-
-		public OsmInspectorNextAction(Layer inspector) {
-			super("next");
-			inspectlayer = (OsmInspectorLayer) inspector;
-		}
-
-		@Override
-		public void actionPerformed(ActionEvent e) {
-			inspectlayer.getOsmiIndex().next();
-			BugInfo next = inspectlayer.getOsmiIndex().getItemPointedByNext();
-			Geometry geom = next.getGeom();
-			Point centroid = geom.getCentroid();
-			LatLon center = new LatLon(centroid.getY(), centroid.getX());
-			MainApplication.getMap().mapView.zoomTo(center);
-			inspectlayer.selectFeatures(center);
-			bugInfoDialog.setBugDescription(next);
-			updateSelection(next);
-		}
-	}
-
-	private void updateSelection(BugInfo prev) {
-		int idx = layer.getOsmiIndex().indexOf(prev);
-		if (idx >= 0) {
-			bugsList.setSelectedIndex(idx);
-		}
-	}
-
-	private class OsmInspectorPrevAction extends AbstractAction {
-
-		private OsmInspectorLayer inspectlayer;
-
-		public OsmInspectorPrevAction(Layer inspector) {
-			super("prev");
-			inspectlayer = (OsmInspectorLayer) inspector;
-		}
-
-		@Override
-		public void actionPerformed(ActionEvent e) {
-			inspectlayer.getOsmiIndex().prev();
-			BugInfo prev = inspectlayer.getOsmiIndex().getItemPointedByPrev();
-			Geometry geom = prev.getGeom();
-			Point centroid = geom.getCentroid();
-			LatLon center = new LatLon(centroid.getY(), centroid.getX());
-			MainApplication.getMap().mapView.zoomTo(center);
-			inspectlayer.selectFeatures(center);
-			bugInfoDialog.setBugDescription(prev);
-			updateSelection(prev);
-		}
-	}
-
-	@Override
-	public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
-	    Layer newLayer = MainApplication.getLayerManager().getActiveLayer();
-		if (newLayer instanceof OsmInspectorLayer) {
-			this.layer = (OsmInspectorLayer) newLayer;
-			refreshModel();
-			refreshBugList();
-		}
-	}
-
-	private void refreshBugList() {
-		bugsList.clearSelection();
-		bugsList = new JList<>(model);
-	}
-
-	@Override
-	public void layerAdded(LayerAddEvent e) {
-		if (layer != null) {
-			refreshModel();
-			refreshBugList();
-		}
-	}
-
-	@Override
-	public void layerRemoving(LayerRemoveEvent e) {
-		if (layer != null) {
-			bugsList.clearSelection();
-			model.clear();
-		}
-	}
+    private OsmInspectorLayer layer;
+    private JList<String> bugsList;
+    private OsmInspectorNextAction actNext;
+    private OsmInspectorPrevAction actPrev;
+    private DefaultListModel<String> model;
+
+    private final OsmInspectorBugInfoDialog bugInfoDialog;
+
+    public void updateNextPrevAction(OsmInspectorLayer l) {
+        this.actNext.inspectlayer = l;
+        this.actPrev.inspectlayer = l;
+    }
+
+    /**
+     * Builds the content panel for this dialog
+     */
+    protected void buildContentPanel() {
+        MainApplication.getMap().addToggleDialog(this, true);
+
+        model = new DefaultListModel<>();
+        refreshModel();
+        bugsList = new JList<>(model);
+        bugsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        bugsList.setLayoutOrientation(JList.VERTICAL_WRAP);
+
+        bugsList.setVisibleRowCount(-1);
+        JScrollPane scroll = new JScrollPane(bugsList,
+                ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
+                ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+
+        bugsList.addListSelectionListener(e -> {
+            layer.setOsmiIndex(e.getFirstIndex());
+            BugInfo next = layer.getOsmiIndex().getItemPointedByNext();
+            layer.setOsmiIndex((e.getFirstIndex() + 1) % layer.getOsmiBugInfo().size());
+            Geometry geom = next.getGeom();
+            Point centroid = geom.getCentroid();
+            LatLon center = new LatLon(centroid.getY(), centroid.getX());
+            MainApplication.getMap().mapView.zoomTo(center);
+            layer.selectFeatures(center);
+            bugInfoDialog.setBugDescription(next);
+        });
+
+        // refreshBugList();
+        // the next action
+        final SideButton nextButton = new SideButton(
+                actNext = new OsmInspectorNextAction(layer));
+        nextButton.createArrow(e -> {
+            int index = bugsList.getSelectedIndex();
+            Geometry geom = layer.getOsmBugGeometry(index);
+            Point centroid = geom.getCentroid();
+            LatLon center = new LatLon(centroid.getY(), centroid.getX());
+            MainApplication.getMap().mapView.zoomTo(center);
+            layer.selectFeatures(center);
+        });
+
+        // the previous button
+		actPrev = new OsmInspectorPrevAction(layer);
+        final SideButton prevButton = new SideButton(actPrev);
+        prevButton.createArrow(e -> { });
+
+        createLayout(scroll, true,
+                Arrays.asList(nextButton, prevButton));
+        this.add(scroll);
+
+        Shortcut sprev = Shortcut.registerShortcut("osmi:prev", tr("Prev OSMI bug"),
+                KeyEvent.VK_J, Shortcut.CTRL_SHIFT);
+        MainApplication.registerActionShortcut(actPrev, sprev);
+
+        Shortcut snext = Shortcut.registerShortcut("osmi:next", tr("Next OSMI bug"),
+                KeyEvent.VK_K, Shortcut.CTRL_SHIFT);
+        MainApplication.registerActionShortcut(actNext, snext);
+    }
+
+    public void refreshModel() {
+        model.clear();
+        for (Object b : layer.getOsmiBugInfo().keySet()) {
+            if (b instanceof BugInfo) {
+                model.addElement(b.toString());
+            }
+        }
+    }
+
+    public OsmInspectorDialog(OsmInspectorLayer layer) {
+
+        super(tr("OSM Inspector Bugs"), "selectionlist",
+                tr("Open a OSM Inspector selection list window."), Shortcut.registerShortcut("subwindow:osminspector",
+                                tr("Toggle: {0}", tr("OSM Inspector Bugs")),
+                                KeyEvent.VK_W, Shortcut.ALT_SHIFT), 150, // default height
+                true // default is "show dialog"
+        );
+        this.layer = layer;
+        buildContentPanel();
+        bugInfoDialog = new OsmInspectorBugInfoDialog(layer);
+        bugInfoDialog.setTitle(tr("Selected Bug Info"));
+    }
+
+    public void updateDialog(OsmInspectorLayer l) {
+        this.layer = l;
+        bugInfoDialog.updateDialog(l);
+        refreshModel();
+        refreshBugList();
+    }
+
+    @Override
+    public void showNotify() {
+        super.showNotify();
+    }
+
+    @Override
+    public void hideNotify() {
+        if (dialogsPanel != null) {
+            super.hideNotify();
+        }
+    }
+
+    public class OsmInspectorNextAction extends AbstractAction {
+
+        private OsmInspectorLayer inspectlayer;
+
+        public OsmInspectorNextAction(Layer inspector) {
+            super("next");
+            inspectlayer = (OsmInspectorLayer) inspector;
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            inspectlayer.getOsmiIndex().next();
+            BugInfo next = inspectlayer.getOsmiIndex().getItemPointedByNext();
+            Geometry geom = next.getGeom();
+            Point centroid = geom.getCentroid();
+            LatLon center = new LatLon(centroid.getY(), centroid.getX());
+            MainApplication.getMap().mapView.zoomTo(center);
+            inspectlayer.selectFeatures(center);
+            bugInfoDialog.setBugDescription(next);
+            updateSelection(next);
+        }
+    }
+
+    private void updateSelection(BugInfo prev) {
+        int idx = layer.getOsmiIndex().indexOf(prev);
+        if (idx >= 0) {
+            bugsList.setSelectedIndex(idx);
+        }
+    }
+
+    private class OsmInspectorPrevAction extends AbstractAction {
+
+        private OsmInspectorLayer inspectlayer;
+
+        public OsmInspectorPrevAction(Layer inspector) {
+            super("prev");
+            inspectlayer = (OsmInspectorLayer) inspector;
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            inspectlayer.getOsmiIndex().prev();
+            BugInfo prev = inspectlayer.getOsmiIndex().getItemPointedByPrev();
+            Geometry geom = prev.getGeom();
+            Point centroid = geom.getCentroid();
+            LatLon center = new LatLon(centroid.getY(), centroid.getX());
+            MainApplication.getMap().mapView.zoomTo(center);
+            inspectlayer.selectFeatures(center);
+            bugInfoDialog.setBugDescription(prev);
+            updateSelection(prev);
+        }
+    }
+
+    @Override
+    public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
+        Layer newLayer = MainApplication.getLayerManager().getActiveLayer();
+        if (newLayer instanceof OsmInspectorLayer) {
+            this.layer = (OsmInspectorLayer) newLayer;
+            refreshModel();
+            refreshBugList();
+        }
+    }
+
+    private void refreshBugList() {
+        bugsList.clearSelection();
+        bugsList = new JList<>(model);
+    }
+
+    @Override
+    public void layerAdded(LayerAddEvent e) {
+        if (layer != null) {
+            refreshModel();
+            refreshBugList();
+        }
+    }
+
+    @Override
+    public void layerRemoving(LayerRemoveEvent e) {
+        if (layer != null) {
+            bugsList.clearSelection();
+            model.clear();
+        }
+    }
 
     @Override
Index: applications/editors/josm/plugins/apache-commons/ivy.xml
===================================================================
--- applications/editors/josm/plugins/apache-commons/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/apache-commons/ivy.xml	(revision 36176)
@@ -4,13 +4,13 @@
     <info organisation="org.openstreetmap.josm.plugins" module="apache-commons"/>
     <dependencies>
-        <dependency org="com.github.luben" name="zstd-jni" rev="1.5.2-5" conf="default->default"/>
+        <dependency org="com.github.luben" name="zstd-jni" rev="1.5.5-6" conf="default->default"/>
         <dependency org="org.apache.commons" name="commons-collections4" rev="4.4" conf="default->default"/>
-        <dependency org="org.apache.commons" name="commons-compress" rev="1.22" conf="default->default"/>
+        <dependency org="org.apache.commons" name="commons-compress" rev="1.24.0" conf="default->default"/>
         <dependency org="org.apache.commons" name="commons-imaging" rev="1.0-alpha3" conf="default->default"/>
         <!-- Apache Commons IO does not use the standard org name -->
-        <dependency org="commons-io" name="commons-io" rev="2.11.0" conf="default->default"/>
+        <dependency org="commons-io" name="commons-io" rev="2.14.0" conf="default->default"/>
         <!-- Apache Commons Logging also does not use the standard org name -->
         <dependency org="commons-logging" name="commons-logging" rev="1.2" conf="default->default"/>
-        <dependency org="org.apache.commons" name="commons-lang3" rev="3.12.0" conf="default->default"/>
+        <dependency org="org.apache.commons" name="commons-lang3" rev="3.13.0" conf="default->default"/>
         <dependency org="org.apache.commons" name="commons-math3" rev="3.6.1" conf="default->default"/>
         <dependency org="org.apache.commons" name="commons-text" rev="1.10.0" conf="default->default"/>
Index: applications/editors/josm/plugins/apache-http/build.xml
===================================================================
--- applications/editors/josm/plugins/apache-http/build.xml	(revision 36175)
+++ applications/editors/josm/plugins/apache-http/build.xml	(revision 36176)
@@ -18,9 +18,6 @@
     <import file="../build-common.xml"/>
 
-    <target name="resolve" description="--> retrieve dependencies with Ivy">
-        <ivy:retrieve/>
+    <target name="pre-compile" depends="fetch_dependencies">
+        <!-- include fetch_dependencies task -->
     </target>
-
-    <target name="dist" depends="resolve,plugin_common.dist"/>
-
 </project>
Index: applications/editors/josm/plugins/apache-http/ivy.xml
===================================================================
--- applications/editors/josm/plugins/apache-http/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/apache-http/ivy.xml	(revision 36176)
@@ -4,10 +4,5 @@
     <info organisation="org.openstreetmap.josm.plugins" module="apache-http"/>
     <dependencies>
-        <!-- Leave these in until at least 2021-03-01 so plugins can migrate -->
-        <dependency org="org.apache.httpcomponents" name="httpcore" rev="4.4.15" conf="default->default"/>
-        <dependency org="org.apache.httpcomponents" name="httpclient" rev="4.5.13" conf="default->default"/>
-        <dependency org="org.apache.httpcomponents" name="httpmime" rev="4.5.13" conf="default->default"/>
-        <!-- These are in a different namespace, so conflicts shouldn't occur. -->
-        <dependency org="org.apache.httpcomponents.client5" name="httpclient5" rev="5.1.2" conf="default->default"/>
+        <dependency org="org.apache.httpcomponents.client5" name="httpclient5" rev="5.2.1" conf="default->default"/>
         <!-- We may want to add fluent, cache, and windows extensions in the future -->
     </dependencies>
Index: applications/editors/josm/plugins/build-common.xml
===================================================================
--- applications/editors/josm/plugins/build-common.xml	(revision 36175)
+++ applications/editors/josm/plugins/build-common.xml	(revision 36176)
@@ -32,5 +32,4 @@
     <property name="java.lang.version"      value="8" />
     <property name="javadoc.executable"     value="javadoc" />
-    <property name="javadoc.link"           value="https://docs.oracle.com/javase/8/docs/api" />
     <property name="manifest"               value="MANIFEST"/>
     <property name="manifest.unixoid"       value="MANIFEST-unixoid"/>
@@ -62,4 +61,11 @@
     <condition property="isJava17"><matches string="${ant.java.version}" pattern="1[7-9]|[2-9][0-9]" /></condition>
     <condition property="isJava21"><matches string="${ant.java.version}" pattern="2[1-9]|[3-9][0-9]" /></condition>
+
+    <!-- set the javadoc location -->
+    <property name="javadoc.link"           value="https://docs.oracle.com/javase/8/docs/api" unless:set="isJava11"/>
+    <property name="javadoc.link"           value="https://docs.oracle.com/en/java/javase/11/docs/api/" if:set="isJava11" unless:set="isJava17"/>
+    <property name="javadoc.link"           value="https://docs.oracle.com/en/java/javase/17/docs/api/" if:set="isJava17" unless:set="isJava21"/>
+    <property name="javadoc.link"           value="https://docs.oracle.com/en/java/javase/21/docs/api/" if:set="isJava21"/>
+
     <!-- Disable jacoco on Java 21+ (Jacoco does not yet support Java 21+) -->
     <condition property="coverageByDefault">
Index: applications/editors/josm/plugins/cadastre-fr/build.xml
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 36175)
+++ applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 36176)
@@ -16,4 +16,5 @@
     <property name="plugin.stage" value="60"/>
     <property name="plugin.requires" value="apache-commons;ejml;jts;geotools"/>
+    <property name="plugin.minimum.java.version" value="11"/>
 
     <!-- ** include targets that all plugins have in common ** -->
Index: applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/actions/MenuActionSaveRasterAs.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/actions/MenuActionSaveRasterAs.java	(revision 36175)
+++ applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/actions/MenuActionSaveRasterAs.java	(revision 36176)
@@ -21,8 +21,8 @@
 import org.geotools.gce.geotiff.GeoTiffWriteParams;
 import org.geotools.gce.geotiff.GeoTiffWriter;
-import org.geotools.geometry.Envelope2D;
+import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.geotools.referencing.CRS;
-import org.opengis.parameter.GeneralParameterValue;
-import org.opengis.parameter.ParameterValueGroup;
+import org.geotools.api.parameter.GeneralParameterValue;
+import org.geotools.api.parameter.ParameterValueGroup;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -37,5 +37,5 @@
     private static final String NAME = marktr("Save image as...");
 
-    private WMSLayer wmsLayer;
+    private final WMSLayer wmsLayer;
 
     static class FiltrePng extends FileFilter {
@@ -106,7 +106,7 @@
                     double x = wmsLayer.getImage(0).min.east();
                     double y = wmsLayer.getImage(0).min.north();
-                    Envelope2D bbox = new Envelope2D(CRS.decode("EPSG:27561"),
-                            x, y,
-                            wmsLayer.getImage(0).max.east()-x, wmsLayer.getImage(0).max.north()-y);
+                    ReferencedEnvelope bbox = ReferencedEnvelope.rect(x, y,
+                            wmsLayer.getImage(0).max.east() - x, wmsLayer.getImage(0).max.north() - y,
+                            CRS.decode("EPSG:27561"));
                     GridCoverageFactory factory = new GridCoverageFactory();
                     GridCoverage2D coverage = factory.create("tiff", bi, bbox);
Index: applications/editors/josm/plugins/comfort0/build.xml
===================================================================
--- applications/editors/josm/plugins/comfort0/build.xml	(revision 36175)
+++ applications/editors/josm/plugins/comfort0/build.xml	(revision 36176)
@@ -18,4 +18,5 @@
     <target name="pre-compile" depends="javacc"/>
     <target name="javacc" depends="init,init-ivy" unless="javacc.notRequired">
+        <ivy:settings file="${josm.ivysettings}" />
         <ivy:cachepath file="${core.tools.ivy}" pathid="javacc.classpath" conf="javacc"/>
         <mkdir dir="${parser.dir}/parsergen"/>
Index: applications/editors/josm/plugins/ejml/build.xml
===================================================================
--- applications/editors/josm/plugins/ejml/build.xml	(revision 36175)
+++ applications/editors/josm/plugins/ejml/build.xml	(revision 36176)
@@ -12,4 +12,5 @@
     <property name="plugin.canloadatruntime" value="true"/>
     <property name="plugin.stage" value="15"/>
+    <property name="plugin.minimum.java.version" value="11"/>
 
     <!-- ** include targets that all plugins have in common ** -->
Index: applications/editors/josm/plugins/ejml/ivy.xml
===================================================================
--- applications/editors/josm/plugins/ejml/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/ejml/ivy.xml	(revision 36176)
@@ -5,6 +5,6 @@
     <dependencies>
         <!-- We included everything in 0.34, including experimental -->
-        <dependency org="org.ejml" name="ejml-all" rev="0.41"/>
-        <dependency org="org.ejml" name="ejml-experimental" rev="0.41"/>
+        <dependency org="org.ejml" name="ejml-all" rev="0.43.1"/>
+        <dependency org="org.ejml" name="ejml-experimental" rev="0.43.1"/>
     </dependencies>
 </ivy-module>
Index: applications/editors/josm/plugins/flatlaf/ivy.xml
===================================================================
--- applications/editors/josm/plugins/flatlaf/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/flatlaf/ivy.xml	(revision 36176)
@@ -2,5 +2,5 @@
   <info organisation="org.openstreetmap.josm.plugins" module="flatlaf"/>
   <dependencies>
-    <dependency conf="default->default" org="com.formdev" name="flatlaf" rev="3.2"/>
+    <dependency conf="default->default" org="com.formdev" name="flatlaf" rev="3.2.2"/>
   </dependencies>
 </ivy-module>
Index: applications/editors/josm/plugins/geotools/build.xml
===================================================================
--- applications/editors/josm/plugins/geotools/build.xml	(revision 36175)
+++ applications/editors/josm/plugins/geotools/build.xml	(revision 36176)
@@ -13,4 +13,5 @@
     <property name="plugin.requires" value="apache-commons;ejml;jackson;jaxb;jts"/>
     <property name="plugin.stage" value="20"/>
+    <property name="plugin.minimum.java.version" value="11"/>
 
     <!-- ** include targets that all plugins have in common ** -->
Index: applications/editors/josm/plugins/geotools/ivy.xml
===================================================================
--- applications/editors/josm/plugins/geotools/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/geotools/ivy.xml	(revision 36176)
@@ -11,5 +11,5 @@
         <dependency org="org.geotools" name="gt-main" rev="${gt.version}" conf="default->default"/>
         <dependency org="org.geotools" name="gt-metadata" rev="${gt.version}" conf="default->default"/>
-        <dependency org="org.geotools" name="gt-opengis" rev="${gt.version}" conf="default->default"/>
+        <dependency org="org.geotools" name="gt-api" rev="${gt.version}" conf="default->default"/>
         <dependency org="org.geotools" name="gt-referencing" rev="${gt.version}" conf="default->default"/>
         <dependency org="org.geotools" name="gt-shapefile" rev="${gt.version}" conf="default->default"/>
Index: applications/editors/josm/plugins/geotools/ivy_settings.xml
===================================================================
--- applications/editors/josm/plugins/geotools/ivy_settings.xml	(revision 36175)
+++ applications/editors/josm/plugins/geotools/ivy_settings.xml	(revision 36176)
@@ -2,5 +2,6 @@
 <ivysettings>
   <!-- When geotools is updated, run `ant merge-geotools-services` -->
-  <property name="gt.version" value="28.2"/>
+  <property name="gt.version" value="30.0"/>
+  <include file="${josm.ivysettings}" optional="true" /> <!-- optional for IDEs -->
   <settings defaultResolver="ordered-resolvers"/>
   <resolvers>
Index: applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java
===================================================================
--- applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java	(revision 36175)
+++ applications/editors/josm/plugins/geotools/src/org/openstreetmap/josm/plugins/geotools/GeoToolsPlugin.java	(revision 36176)
@@ -4,4 +4,5 @@
 import java.io.IOException;
 import java.io.InputStream;
+import java.util.Collection;
 import java.util.Iterator;
 import java.util.ServiceLoader;
@@ -15,6 +16,6 @@
 import org.geotools.image.ImageWorker;
 import org.geotools.referencing.CRS;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.NoSuchAuthorityCodeException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.NoSuchAuthorityCodeException;
 import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.plugins.PluginInformation;
@@ -102,10 +103,13 @@
 
     private static void checkEPSG() {
+        final Collection<String> codes = CRS.getSupportedCodes("EPSG");
+        if (codes.isEmpty() || !(codes.contains("4326") || codes.contains("EPSG:4326"))) {
         try {
-            CRS.decode("EPSG:4326");
-        } catch (NoSuchAuthorityCodeException e) {
-            Logging.error("geotools: error in EPSG database initialization. NoSuchAuthorityCodeException: "+e.getMessage());
-        } catch (FactoryException e) {
-            Logging.error("geotools: error in EPSG database initialization. FactoryException: "+e.getMessage());
+                CRS.decode("EPSG:4326");
+            } catch (NoSuchAuthorityCodeException e) {
+                Logging.error("geotools: error in EPSG database initialization. NoSuchAuthorityCodeException: " + e.getMessage());
+            } catch (FactoryException e) {
+                Logging.error("geotools: error in EPSG database initialization. FactoryException: " + e.getMessage());
+            }
         }
     }
Index: applications/editors/josm/plugins/jackson/ivy.xml
===================================================================
--- applications/editors/josm/plugins/jackson/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/jackson/ivy.xml	(revision 36176)
@@ -2,7 +2,7 @@
 <!-- License: GPL. For details, see LICENSE file. -->
 <ivy-module version="2.0">
-    <info organisation="org.openstreetmap.josm.plugins" module="geotools"/>
+    <info organisation="org.openstreetmap.josm.plugins" module="jackson"/>
     <dependencies>
-        <dependency org="com.fasterxml.jackson.core" name="jackson-core" rev="2.14.0" conf="default->default"/>
+        <dependency org="com.fasterxml.jackson.core" name="jackson-core" rev="2.15.3" conf="default->default"/>
     </dependencies>
 </ivy-module>
Index: applications/editors/josm/plugins/javafx/ivy_settings.xml
===================================================================
--- applications/editors/josm/plugins/javafx/ivy_settings.xml	(revision 36175)
+++ 	(revision )
@@ -1,14 +1,0 @@
-<ivysettings>
-    <version-matchers usedefaults="true">
-        <maven-tsnap-vm/>
-    </version-matchers>
-    <settings defaultResolver="josm-nexus"/>
-    <resolvers>
-        <ibiblio name="josm-nexus" root="https://josm.openstreetmap.de/nexus/content/repositories/public/" m2compatible="true" />
-        <ibiblio name="central" m2compatible="true"/>
-    </resolvers>
-    <modules>
-        <module organisation="org.openstreetmap.jmapviewer" resolver="josm-nexus"/>
-        <module organisation="org.openstreetmap.josm" resolver="josm-nexus"/>
-    </modules>
-</ivysettings>
Index: applications/editors/josm/plugins/jna/ivy.xml
===================================================================
--- applications/editors/josm/plugins/jna/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/jna/ivy.xml	(revision 36176)
@@ -5,6 +5,6 @@
 	</configurations>
 	<dependencies>
-        <dependency org="net.java.dev.jna" name="jna" rev="5.12.1"/>
-        <dependency org="net.java.dev.jna" name="jna-platform" rev="5.12.1"/>
+        <dependency org="net.java.dev.jna" name="jna" rev="5.13.0"/>
+        <dependency org="net.java.dev.jna" name="jna-platform" rev="5.13.0"/>
 	</dependencies>
 </ivy-module>
Index: applications/editors/josm/plugins/jna/ivy_settings.xml
===================================================================
--- applications/editors/josm/plugins/jna/ivy_settings.xml	(revision 36175)
+++ 	(revision )
@@ -1,14 +1,0 @@
-<ivysettings>
-    <version-matchers usedefaults="true">
-        <maven-tsnap-vm/>
-    </version-matchers>
-    <settings defaultResolver="josm-nexus"/>
-    <resolvers>
-        <ibiblio name="josm-nexus" root="https://josm.openstreetmap.de/nexus/content/repositories/public/" m2compatible="true" />
-        <ibiblio name="central" m2compatible="true"/>
-    </resolvers>
-    <modules>
-        <module organisation="org.openstreetmap.jmapviewer" resolver="josm-nexus"/>
-        <module organisation="org.openstreetmap.josm" resolver="josm-nexus"/>
-    </modules>
-</ivysettings>
Index: applications/editors/josm/plugins/log4j/ivy.xml
===================================================================
--- applications/editors/josm/plugins/log4j/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/log4j/ivy.xml	(revision 36176)
@@ -4,7 +4,7 @@
     <info organisation="org.openstreetmap.josm.plugins" module="log4j"/>
     <dependencies>
-      <dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.19.0" conf="default->default"/>
-      <dependency org="org.apache.logging.log4j" name="log4j-1.2-api" rev="2.19.0" conf="default->default"/>
-      <dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.19.0" conf="default->default"/>
+      <dependency org="org.apache.logging.log4j" name="log4j-api" rev="2.21.0" conf="default->default"/>
+      <dependency org="org.apache.logging.log4j" name="log4j-1.2-api" rev="2.21.0" conf="default->default"/>
+      <dependency org="org.apache.logging.log4j" name="log4j-core" rev="2.21.0" conf="default->default"/>
     </dependencies>
 </ivy-module>
Index: applications/editors/josm/plugins/lwjgl/ivy_settings.xml
===================================================================
--- applications/editors/josm/plugins/lwjgl/ivy_settings.xml	(revision 36175)
+++ applications/editors/josm/plugins/lwjgl/ivy_settings.xml	(revision 36176)
@@ -2,6 +2,7 @@
 <ivysettings>
   <property name="joml.version" value="1.10.5"/>
-  <property name="lwjgl.version" value="3.3.1"/>
+  <property name="lwjgl.version" value="3.3.3"/>
   <property name="lwjgl3-awt.version" value="0.1.8"/>
+  <include file="${josm.ivysettings}" optional="true"/> <!-- optional for IDEs -->
   <settings defaultResolver="chained-resolver"/>
   <resolvers>
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/at/AustrianGmlHandler.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/at/AustrianGmlHandler.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/at/AustrianGmlHandler.java	(revision 36176)
@@ -3,7 +3,7 @@
 
 import org.geotools.referencing.CRS;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.NoSuchAuthorityCodeException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.NoSuchAuthorityCodeException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
 import org.openstreetmap.josm.plugins.opendata.core.io.geographic.DefaultGmlHandler;
 
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/fr/FrenchShpHandler.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/fr/FrenchShpHandler.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/fr/FrenchShpHandler.java	(revision 36176)
@@ -5,9 +5,9 @@
 import org.geotools.referencing.operation.projection.LambertConformal2SP;
 import org.geotools.referencing.operation.projection.MapProjection.AbstractProvider;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.crs.ProjectedCRS;
-import org.opengis.referencing.datum.GeodeticDatum;
-import org.opengis.referencing.operation.MathTransform;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.crs.ProjectedCRS;
+import org.geotools.api.referencing.datum.GeodeticDatum;
+import org.geotools.api.referencing.operation.MathTransform;
 import org.openstreetmap.josm.plugins.opendata.core.io.geographic.DefaultShpHandler;
 import org.openstreetmap.josm.plugins.opendata.core.io.geographic.GeotoolsHandler;
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultGeographicHandler.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultGeographicHandler.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultGeographicHandler.java	(revision 36176)
@@ -3,7 +3,7 @@
 
 import org.geotools.referencing.CRS;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.NoSuchAuthorityCodeException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.NoSuchAuthorityCodeException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
 
 public abstract class DefaultGeographicHandler implements GeographicHandler {
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultGmlHandler.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultGmlHandler.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultGmlHandler.java	(revision 36176)
@@ -3,7 +3,7 @@
 
 import org.geotools.referencing.CRS;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.MathTransform;
 
 public class DefaultGmlHandler extends DefaultGeographicHandler implements GmlHandler {
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultMifHandler.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultMifHandler.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultMifHandler.java	(revision 36176)
@@ -2,7 +2,7 @@
 package org.openstreetmap.josm.plugins.opendata.core.io.geographic;
 
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.MathTransform;
 import org.openstreetmap.josm.data.projection.Projection;
 
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicHandler.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicHandler.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicHandler.java	(revision 36176)
@@ -2,8 +2,8 @@
 package org.openstreetmap.josm.plugins.opendata.core.io.geographic;
 
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.NoSuchAuthorityCodeException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.NoSuchAuthorityCodeException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.MathTransform;
 
 public interface GeographicHandler {
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicReader.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicReader.java	(revision 36176)
@@ -31,14 +31,14 @@
 import org.locationtech.jts.geom.LineString;
 import org.locationtech.jts.geom.Point;
-import org.opengis.geometry.MismatchedDimensionException;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.IdentifiedObject;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.crs.ProjectedCRS;
-import org.opengis.referencing.cs.CoordinateSystem;
-import org.opengis.referencing.datum.Datum;
-import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.OperationNotFoundException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.geometry.MismatchedDimensionException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.IdentifiedObject;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.crs.ProjectedCRS;
+import org.geotools.api.referencing.cs.CoordinateSystem;
+import org.geotools.api.referencing.datum.Datum;
+import org.geotools.api.referencing.operation.MathTransform;
+import org.geotools.api.referencing.operation.OperationNotFoundException;
+import org.geotools.api.referencing.operation.TransformException;
 import org.openstreetmap.josm.data.coor.ILatLon;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -348,5 +348,5 @@
      * @param parent The parent component, used for showing dialogs
      * @param findSimiliarCrs {@code true} if we don't need to find the exact CRS
-     * @throws FactoryException See {@link CRS#findMathTransform}, {@link org.opengis.referencing.AuthorityFactory#getAuthorityCodes}
+     * @throws FactoryException See {@link CRS#findMathTransform}, {@link org.geotools.api.referencing.AuthorityFactory#getAuthorityCodes}
      * @throws UserCancelException If the user cancelled in one of the message dialogs
      * @throws GeoMathTransformException If no transform could be found
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeotoolsConverter.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeotoolsConverter.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeotoolsConverter.java	(revision 36176)
@@ -18,6 +18,6 @@
 import javax.swing.JOptionPane;
 
-import org.geotools.data.DataStore;
-import org.geotools.data.FeatureSource;
+import org.geotools.api.data.DataStore;
+import org.geotools.api.data.FeatureSource;
 import org.geotools.feature.FeatureCollection;
 import org.geotools.feature.FeatureIterator;
@@ -28,12 +28,12 @@
 import org.locationtech.jts.geom.Polygon;
 import org.locationtech.jts.io.ParseException;
-import org.opengis.feature.Feature;
-import org.opengis.feature.GeometryAttribute;
-import org.opengis.feature.Property;
-import org.opengis.feature.type.GeometryDescriptor;
-import org.opengis.feature.type.Name;
-import org.opengis.geometry.MismatchedDimensionException;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.feature.Feature;
+import org.geotools.api.feature.GeometryAttribute;
+import org.geotools.api.feature.Property;
+import org.geotools.api.feature.type.GeometryDescriptor;
+import org.geotools.api.feature.type.Name;
+import org.geotools.api.geometry.MismatchedDimensionException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeotoolsHandler.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeotoolsHandler.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeotoolsHandler.java	(revision 36176)
@@ -14,10 +14,10 @@
 import org.geotools.referencing.operation.projection.LambertConformal2SP;
 import org.geotools.referencing.operation.projection.MapProjection.AbstractProvider;
-import org.opengis.parameter.ParameterDescriptor;
-import org.opengis.parameter.ParameterValueGroup;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.datum.GeodeticDatum;
-import org.opengis.referencing.operation.MathTransform;
+import org.geotools.api.parameter.ParameterDescriptor;
+import org.geotools.api.parameter.ParameterValueGroup;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.datum.GeodeticDatum;
+import org.geotools.api.referencing.operation.MathTransform;
 import org.openstreetmap.josm.data.projection.AbstractProjection;
 import org.openstreetmap.josm.data.projection.Ellipsoid;
@@ -40,5 +40,5 @@
      * A mapping of GeoTools ellipsoid to JOSM ellipsoids. Don't use outside the {@link GeotoolsHandler} class.
      */
-    List<Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>>
+    List<Pair<org.geotools.api.referencing.datum.Ellipsoid, Ellipsoid>>
             ellipsoids = Collections.unmodifiableList(Arrays.asList(
             new Pair<>(DefaultEllipsoid.GRS80, Ellipsoid.GRS80),
@@ -63,5 +63,5 @@
                         AbstractProjection ap = (AbstractProjection) p;
                         if (ap.getProj() instanceof LambertConformalConic) {
-                            for (Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid> pair : ellipsoids) {
+                            for (Pair<org.geotools.api.referencing.datum.Ellipsoid, Ellipsoid> pair : ellipsoids) {
                                 if (pair.a.equals(geo.getEllipsoid()) && pair.b.equals(ap.getEllipsoid())) {
                                     boolean ok = true;
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GmlReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GmlReader.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GmlReader.java	(revision 36176)
@@ -16,9 +16,9 @@
 import org.locationtech.jts.geom.GeometryFactory;
 import org.locationtech.jts.geom.Point;
-import org.opengis.geometry.MismatchedDimensionException;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.MathTransform;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.geometry.MismatchedDimensionException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.crs.CoordinateReferenceSystem;
+import org.geotools.api.referencing.operation.MathTransform;
+import org.geotools.api.referencing.operation.TransformException;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java	(revision 36176)
@@ -21,10 +21,10 @@
 import java.util.Set;
 
-import org.geotools.data.DataStore;
+import org.geotools.api.data.DataStore;
 import org.geotools.data.shapefile.ShapefileDataStoreFactory;
 import org.locationtech.jts.geom.Point;
-import org.opengis.geometry.MismatchedDimensionException;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.geometry.MismatchedDimensionException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
Index: applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/geopackage/GeoPackageReader.java
===================================================================
--- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/geopackage/GeoPackageReader.java	(revision 36175)
+++ applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/geopackage/GeoPackageReader.java	(revision 36176)
@@ -10,9 +10,9 @@
 import java.util.Map;
 
-import org.geotools.data.DataStore;
-import org.geotools.data.DataStoreFinder;
+import org.geotools.api.data.DataStore;
+import org.geotools.api.data.DataStoreFinder;
 import org.geotools.geopkg.GeoPkgDataStoreFactory;
-import org.opengis.referencing.FactoryException;
-import org.opengis.referencing.operation.TransformException;
+import org.geotools.api.referencing.FactoryException;
+import org.geotools.api.referencing.operation.TransformException;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
Index: applications/editors/josm/plugins/pbf/ivy.xml
===================================================================
--- applications/editors/josm/plugins/pbf/ivy.xml	(revision 36175)
+++ applications/editors/josm/plugins/pbf/ivy.xml	(revision 36176)
@@ -2,5 +2,5 @@
   <info organisation="org.openstreetmap.josm.plugins" module="pbf"/>
   <dependencies>
-    <dependency conf="default->default" org="com.google.protobuf" name="protobuf-java" rev="3.20.3"/>
+    <dependency conf="default->default" org="com.google.protobuf" name="protobuf-java" rev="3.24.4"/>
     <dependency conf="default->default" org="org.openstreetmap.pbf" name="osmpbf" rev="1.5.0"/>
   </dependencies>
Index: applications/editors/josm/plugins/pbf/ivy_settings.xml
===================================================================
--- applications/editors/josm/plugins/pbf/ivy_settings.xml	(revision 36175)
+++ 	(revision )
@@ -1,9 +1,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ivysettings>
-  <settings defaultResolver="josm-nexus"/>
-  <resolvers>
-    <ibiblio name="josm-nexus" m2compatible="true" root="https://josm.openstreetmap.de/nexus/content/repositories/public/" />
-  </resolvers>
-  <modules>
-  </modules>
-</ivysettings>
