Index: /trunk/src/org/openstreetmap/josm/gui/io/importexport/GeoJSONImporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/io/importexport/GeoJSONImporter.java	(revision 18806)
+++ /trunk/src/org/openstreetmap/josm/gui/io/importexport/GeoJSONImporter.java	(revision 18807)
@@ -4,34 +4,24 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Arrays;
-import java.util.Locale;
 
-import javax.swing.JOptionPane;
-
-import jakarta.json.JsonException;
 import org.openstreetmap.josm.actions.ExtensionFileFilter;
 import org.openstreetmap.josm.data.osm.DataSet;
-import org.openstreetmap.josm.gui.MainApplication;
-import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
-import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.io.CachedFile;
 import org.openstreetmap.josm.io.Compression;
 import org.openstreetmap.josm.io.GeoJSONReader;
 import org.openstreetmap.josm.io.IllegalDataException;
-import org.openstreetmap.josm.tools.Logging;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
  * GeoJSON file importer.
  * @author Ian Dees &lt;ian.dees@gmail.com&gt;
- * @author matthieun &lt;https://github.com/matthieun&gt;
- * @since 15424
+ * @author <a href="https://github.com/matthieun">matthieun</a>
+ * @since 15424, extends {@link OsmImporter} since 18807
  */
-public class GeoJSONImporter extends FileImporter {
+public class GeoJSONImporter extends OsmImporter {
 
     private static final ExtensionFileFilter FILE_FILTER = ExtensionFileFilter.newFilterWithArchiveExtensions(
@@ -46,24 +36,4 @@
     }
 
-    @Override
-    public void importData(final File file, final ProgressMonitor progressMonitor) {
-        progressMonitor.beginTask(tr("Loading json file…"));
-        progressMonitor.setTicksCount(2);
-        Logging.info("Parsing GeoJSON: {0}", file.getAbsolutePath());
-        try (InputStream fileInputStream = Compression.getUncompressedFileInputStream(file)) {
-            DataSet data = GeoJSONReader.parseDataSet(fileInputStream, progressMonitor);
-            progressMonitor.worked(1);
-            MainApplication.getLayerManager().addLayer(new OsmDataLayer(data, file.getName(), file));
-        } catch (IOException | IllegalArgumentException | IllegalDataException | JsonException e) {
-            Logging.error("Error while reading json file!");
-            Logging.error(e);
-            String message = tr("Error loading geojson file {0}", file.getAbsolutePath())
-                    + tr(" ({0})", Utils.getSizeString(file.length(), Locale.getDefault()));
-            GuiHelper.runInEDT(() -> JOptionPane.showMessageDialog(null, message, tr("Error"), JOptionPane.WARNING_MESSAGE));
-        } finally {
-            progressMonitor.finishTask();
-        }
-    }
-
     /**
      * Parse GeoJSON dataset.
@@ -72,10 +42,17 @@
      * @throws IOException in case of I/O error
      * @throws IllegalDataException if an error was found while parsing the data from the source
+     * @deprecated since 18807, use {@link #parseDataSet(InputStream, ProgressMonitor)} instead
      */
+    @Deprecated
     public DataSet parseDataSet(final String source) throws IOException, IllegalDataException {
         try (CachedFile cf = new CachedFile(source)) {
             InputStream fileInputStream = Compression.getUncompressedFileInputStream(cf.getFile()); // NOPMD
-            return GeoJSONReader.parseDataSet(fileInputStream, NullProgressMonitor.INSTANCE);
+            return this.parseDataSet(fileInputStream, NullProgressMonitor.INSTANCE);
         }
     }
+
+    @Override
+    protected DataSet parseDataSet(InputStream in, ProgressMonitor progressMonitor) throws IllegalDataException {
+        return GeoJSONReader.parseDataSet(in, progressMonitor);
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionImporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionImporter.java	(revision 18806)
+++ /trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionImporter.java	(revision 18807)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -13,4 +14,6 @@
 import javax.xml.xpath.XPathFactory;
 
+import org.openstreetmap.josm.actions.ExtensionFileFilter;
+import org.openstreetmap.josm.gui.io.importexport.FileImporter;
 import org.openstreetmap.josm.gui.io.importexport.OsmImporter;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -31,5 +34,12 @@
     public Layer load(Element elem, ImportSupport support, ProgressMonitor progressMonitor) throws IOException, IllegalDataException {
         checkMetaVersion(elem);
-        String fileStr = extractFileName(elem, support);
+        final String fileStr = extractFileName(elem, support);
+        final File file = new File(fileStr);
+        for (FileImporter importer : ExtensionFileFilter.getImporters()) {
+            if (importer instanceof OsmImporter && importer.acceptFile(file)) {
+                return importData((OsmImporter) importer, support, fileStr, progressMonitor);
+            }
+        }
+        // Fall back to the default OsmImporter, just in case. It will probably fail.
         return importData(new OsmImporter(), support, fileStr, progressMonitor);
     }
Index: /trunk/test/data/sessions/data.geojson
===================================================================
--- /trunk/test/data/sessions/data.geojson	(revision 18807)
+++ /trunk/test/data/sessions/data.geojson	(revision 18807)
@@ -0,0 +1,10 @@
+{
+  "type": "Feature",
+  "geometry": {
+    "type": "Point",
+    "coordinates": [1, 2]
+  },
+  "properties": {
+    "name": "Test point"
+  }
+}
Index: /trunk/test/data/sessions/geojson.jos
===================================================================
--- /trunk/test/data/sessions/geojson.jos	(revision 18807)
+++ /trunk/test/data/sessions/geojson.jos	(revision 18807)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<josm-session version="0.1">
+    <viewport>
+        <center lat="0.0" lon="0.0"/>
+        <scale meter-per-pixel="10"/>
+    </viewport>
+    <layers>
+        <layer index="1" name="Geojson layer name" type="osm-data" version="0.1" visible="true">
+            <file>data.geojson</file>
+        </layer>
+    </layers>
+</josm-session>
Index: /trunk/test/unit/org/openstreetmap/josm/actions/SessionLoadActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/actions/SessionLoadActionTest.java	(revision 18806)
+++ /trunk/test/unit/org/openstreetmap/josm/actions/SessionLoadActionTest.java	(revision 18807)
@@ -4,25 +4,17 @@
 import static org.junit.jupiter.api.Assertions.assertFalse;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
 import org.openstreetmap.josm.gui.layer.TMSLayer;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Main;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for class {@link SessionLoadAction}.
  */
+@Main
+@Projection
 class SessionLoadActionTest {
-
-    /**
-     * Setup test.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().projection();
-
     /**
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17702">Bug #17702</a>.
Index: /trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 18806)
+++ /trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 18807)
@@ -15,8 +15,8 @@
 import java.util.List;
 
-import org.junit.jupiter.api.extension.RegisterExtension;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer;
@@ -28,20 +28,11 @@
 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
 import org.openstreetmap.josm.io.IllegalDataException;
-import org.openstreetmap.josm.testutils.JOSMTestRules;
-
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import org.openstreetmap.josm.testutils.annotations.Projection;
 
 /**
  * Unit tests for Session reading.
  */
+@Projection
 class SessionReaderTest {
-
-    /**
-     * Setup tests.
-     */
-    @RegisterExtension
-    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection();
-
     private static String getSessionDataDir() {
         return TestUtils.getTestDataRoot() + "/sessions";
@@ -161,4 +152,17 @@
     }
 
+    @Test
+    void testReadGeojson() throws IOException, IllegalDataException {
+        final List<Layer> layers = testRead("geojson.jos");
+        assertEquals(1, layers.size());
+        final OsmDataLayer osmDataLayer = assertInstanceOf(OsmDataLayer.class, layers.get(0));
+        assertEquals("Geojson layer name", osmDataLayer.getName());
+        assertEquals(1, osmDataLayer.getDataSet().allPrimitives().size());
+        final Node node = assertInstanceOf(Node.class, osmDataLayer.getDataSet().allPrimitives().iterator().next());
+        assertEquals(2d, node.lat(), 1e-9);
+        assertEquals(1d, node.lon(), 1e-9);
+        assertEquals("Test point", node.get("name"));
+    }
+
     /**
      * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17701">Bug #17701</a>.
