From 9d196a0d629ab19251fc660365d8346a06403ce7 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Wed, 25 Oct 2023 10:46:35 -0600 Subject: [PATCH] See #23220: Use jakarta.annotation instead of javax.annotation Signed-off-by: Taylor Smock --- .github/workflows/ant-release.yml | 4 ++-- .github/workflows/ant.yml | 6 ++--- .github/workflows/reports.yaml | 2 +- gradle.properties | 4 ++-- .../josm/plugins/datepicker/IDatePicker.java | 3 ++- .../impl/DatePickerJDatePicker.java | 4 ++-- .../datepicker/impl/DatePickerSwing.java | 6 ++--- .../mapillary/actions/SmartEditAddAction.java | 5 ++-- .../actions/SmartEditRemoveAction.java | 6 ++--- .../josm/plugins/mapillary/cache/Caches.java | 4 ++-- .../mapillary/cache/MapillaryCache.java | 5 ++-- .../command/AddMapillaryObjectCommand.java | 11 +++++++-- .../mapillary/AdditionalInstructions.java | 3 +-- .../mapillary/data/mapillary/ImageMode.java | 3 ++- .../data/mapillary/MapillaryDownloader.java | 5 ++-- .../data/mapillary/MapillaryFilterModel.java | 3 +-- .../data/mapillary/ObjectDetections.java | 4 ++-- .../data/mapillary/OrganizationRecord.java | 9 ++++--- .../mapillary/gui/DataMouseListener.java | 4 ++-- .../mapillary/gui/ImageCheckBoxButton.java | 4 ++-- .../gui/dialog/MapillaryFilterDialog.java | 2 +- .../gui/dialog/OldVersionDialog.java | 5 +++- .../gui/imageinfo/ImageInfoPanel.java | 2 +- .../mapillary/gui/layer/MapillaryLayer.java | 10 ++++---- .../layer/geoimage/MapillaryImageEntry.java | 9 +++---- .../export/MapillaryExportWriterThread.java | 4 ++-- .../mapillary/model/ImageDetection.java | 12 +++++++--- .../plugins/mapillary/oauth/OAuthUtils.java | 2 +- .../spi/preferences/IMapillaryUrls.java | 5 ++-- .../mapillary/utils/MapillaryImageUtils.java | 7 +++--- .../utils/MapillaryMapFeatureUtils.java | 5 ++-- .../utils/MapillarySequenceUtils.java | 10 ++++---- .../plugins/mapillary/utils/OffsetUtils.java | 4 ++-- .../mapillary/utils/ReflectionUtils.java | 15 ++++-------- .../mapillary/utils/api/JsonDecoder.java | 5 ++-- .../utils/api/JsonImageDetailsDecoder.java | 5 ++-- .../utils/api/JsonImageDetectionDecoder.java | 7 +++--- .../utils/api/JsonMapObjectDecoder.java | 5 ++-- .../actions/SmartEditAddActionTest.java | 24 +++++++++---------- .../mapillary/oauth/OAuthUtilsTest.java | 5 ++-- 40 files changed, 118 insertions(+), 120 deletions(-) diff --git a/.github/workflows/ant-release.yml b/.github/workflows/ant-release.yml index 55ee9ae48..d428b0e2d 100644 --- a/.github/workflows/ant-release.yml +++ b/.github/workflows/ant-release.yml @@ -6,8 +6,8 @@ on: jobs: call-workflow: - uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v1 + uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v2 with: - josm-revision: "r18723" + josm-revision: "r18877" diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml index 59a83c6a6..e46400f11 100644 --- a/.github/workflows/ant.yml +++ b/.github/workflows/ant.yml @@ -10,15 +10,13 @@ on: branches: - master - $default-branch - schedule: - - cron: "20 23 * * 3" workflow_dispatch: jobs: call-workflow: strategy: matrix: - josm-revision: ["", "r18723"] - uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v1 + josm-revision: ["", "r18877"] + uses: JOSM/JOSMPluginAction/.github/workflows/ant.yml@v2 with: josm-revision: ${{ matrix.josm-revision }} diff --git a/.github/workflows/reports.yaml b/.github/workflows/reports.yaml index e96588cfb..43794f4f3 100644 --- a/.github/workflows/reports.yaml +++ b/.github/workflows/reports.yaml @@ -10,4 +10,4 @@ permissions: jobs: call-workflow: - uses: JOSM/JOSMPluginAction/.github/workflows/reports.yaml@v1 + uses: JOSM/JOSMPluginAction/.github/workflows/reports.yaml@v2 diff --git a/gradle.properties b/gradle.properties index b81d24d1d..63b2b43e6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,11 +6,11 @@ plugin.icon=images/mapillary-logo.svg plugin.link=https://wiki.openstreetmap.org/wiki/JOSM/Plugins/Mapillary # Minimum required JOSM version to run this plugin, choose the lowest version possible that is compatible. # You can check if the plugin compiles against this version by executing `./gradlew compileJava_minJosm`. -plugin.main.version=18723 +plugin.main.version=18877 # Version of JOSM against which the plugin is compiled # Please check, if the specified version is available for download from https://josm.openstreetmap.de/download/ . # If not, choose the next higher number that is available, or the gradle build will break. -plugin.compile.version=18724 +plugin.compile.version=18877 # The datepicker plugin is currently in the source tree. TODO fix plugin.requires=apache-commons diff --git a/src/main/java/org/openstreetmap/josm/plugins/datepicker/IDatePicker.java b/src/main/java/org/openstreetmap/josm/plugins/datepicker/IDatePicker.java index 2c69b39a6..591e89dae 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/datepicker/IDatePicker.java +++ b/src/main/java/org/openstreetmap/josm/plugins/datepicker/IDatePicker.java @@ -4,9 +4,9 @@ import java.time.Instant; import java.util.function.Consumer; -import javax.annotation.Nonnull; import javax.swing.JComponent; +import jakarta.annotation.Nonnull; import org.openstreetmap.josm.plugins.datepicker.impl.DatePickerSwing; import org.openstreetmap.josm.spi.preferences.Config; import org.openstreetmap.josm.tools.Logging; @@ -16,6 +16,7 @@ * {@link IDatePicker#getNewDatePicker} to get a new date picker. It uses the * {@code "datepicker.classname"} setting to determine the appropriate class. * + * @param The component that the date picker returns for the UI * @author Taylor Smock */ public interface IDatePicker { diff --git a/src/main/java/org/openstreetmap/josm/plugins/datepicker/impl/DatePickerJDatePicker.java b/src/main/java/org/openstreetmap/josm/plugins/datepicker/impl/DatePickerJDatePicker.java index 6ca32402d..390a2dbfd 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/datepicker/impl/DatePickerJDatePicker.java +++ b/src/main/java/org/openstreetmap/josm/plugins/datepicker/impl/DatePickerJDatePicker.java @@ -8,8 +8,7 @@ import java.util.Properties; import java.util.function.Consumer; -import javax.annotation.Nonnull; - +import jakarta.annotation.Nonnull; import org.jdatepicker.impl.DateComponentFormatter; import org.jdatepicker.impl.JDatePanelImpl; import org.jdatepicker.impl.JDatePickerImpl; @@ -34,6 +33,7 @@ public class DatePickerJDatePicker implements IDatePicker { private final JDatePickerImpl datePicker; private final UtilCalendarModel model; + /** Create a new {@link DatePickerJDatePicker} component */ public DatePickerJDatePicker() { model = new UtilCalendarModel(); JDatePanelImpl datePanel = new JDatePanelImpl(model, PROPERTIES); diff --git a/src/main/java/org/openstreetmap/josm/plugins/datepicker/impl/DatePickerSwing.java b/src/main/java/org/openstreetmap/josm/plugins/datepicker/impl/DatePickerSwing.java index 376f6a9f4..f9bbfc560 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/datepicker/impl/DatePickerSwing.java +++ b/src/main/java/org/openstreetmap/josm/plugins/datepicker/impl/DatePickerSwing.java @@ -9,14 +9,13 @@ import java.time.format.DateTimeFormatter; import java.util.function.Consumer; -import javax.annotation.Nonnull; - +import jakarta.annotation.Nonnull; import org.openstreetmap.josm.gui.widgets.DisableShortcutsOnFocusGainedTextField; import org.openstreetmap.josm.gui.widgets.JosmTextField; import org.openstreetmap.josm.plugins.datepicker.IDatePicker; /** - * This is a fall back date picker. It is used when the set date picker fails to + * This is a fallback date picker. It is used when the set date picker fails to * load, for what ever reason. Do not directly use this implementation. * * @author Taylor Smock @@ -25,6 +24,7 @@ public class DatePickerSwing implements IDatePicker { private Instant date; private final JosmTextField component = new DisableShortcutsOnFocusGainedTextField("", 12); + /** Create a new {@link DatePickerSwing} component */ public DatePickerSwing() { super(); component.setToolTipText("YYYY-MM-DD"); diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditAddAction.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditAddAction.java index 1ec161930..31a2b7d78 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditAddAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditAddAction.java @@ -16,9 +16,8 @@ import java.util.stream.LongStream; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.actions.JosmAction; import org.openstreetmap.josm.command.AddPrimitivesCommand; import org.openstreetmap.josm.command.Command; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditRemoveAction.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditRemoveAction.java index e2f9da7d2..3b4a95b80 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditRemoveAction.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditRemoveAction.java @@ -7,11 +7,11 @@ import java.util.Locale; import java.util.Objects; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.swing.JOptionPane; import javax.swing.text.AbstractDocument; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.Json; import jakarta.json.JsonObjectBuilder; import org.openstreetmap.josm.actions.JosmAction; @@ -34,7 +34,7 @@ public class SmartEditRemoveAction extends JosmAction { private static final String TOOLTIP = tr( "This currently removes the detection from the current layer, but may report back to Mapillary in the future"); - private final VectorPrimitive mapillaryObject; + private final transient VectorPrimitive mapillaryObject; private final PointObjectLayer pointObjectLayer; /** diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java index d6f9aa576..042e06247 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/Caches.java @@ -21,10 +21,10 @@ import java.util.function.Supplier; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.swing.JOptionPane; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.Json; import jakarta.json.JsonReader; import jakarta.json.JsonValue; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java index 5f3d45734..c87682dc9 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/cache/MapillaryCache.java @@ -16,9 +16,8 @@ import java.util.regex.Matcher; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; import org.openstreetmap.josm.data.cache.HostLimitQueue; import org.openstreetmap.josm.data.cache.ICachedLoaderListener; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/command/AddMapillaryObjectCommand.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/command/AddMapillaryObjectCommand.java index c59979362..58430d751 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/command/AddMapillaryObjectCommand.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/command/AddMapillaryObjectCommand.java @@ -1,11 +1,12 @@ +// License: GPL. For details, see LICENSE file. package org.openstreetmap.josm.plugins.mapillary.command; import static org.openstreetmap.josm.tools.I18n.tr; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import java.util.Collection; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.command.Command; import org.openstreetmap.josm.data.osm.OsmPrimitive; import org.openstreetmap.josm.gui.MainApplication; @@ -22,6 +23,12 @@ public class AddMapillaryObjectCommand extends Command { @Nonnull private final GenericCommand deleteOriginal; + /** + * Create a new command for adding a mapillary object + * + * @param deleteOriginal The command to delete the original object from the Mapillary layer + * @param updateTagsCommand The command to use to update tags + */ public AddMapillaryObjectCommand(@Nonnull final GenericCommand deleteOriginal, @Nullable final Command updateTagsCommand) { super(updateTagsCommand != null ? updateTagsCommand.getAffectedDataSet() diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructions.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructions.java index 74b03ad83..74d14eadd 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructions.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/AdditionalInstructions.java @@ -10,8 +10,7 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.annotation.Nonnull; - +import jakarta.annotation.Nonnull; import org.openstreetmap.josm.command.ChangeNodesCommand; import org.openstreetmap.josm.command.ChangePropertyCommand; import org.openstreetmap.josm.command.Command; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ImageMode.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ImageMode.java index c395ec692..ab0b5d8f4 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ImageMode.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ImageMode.java @@ -1,6 +1,7 @@ +// License: GPL. For details, see LICENSE file. package org.openstreetmap.josm.plugins.mapillary.data.mapillary; -import javax.annotation.Nonnull; +import jakarta.annotation.Nonnull; /** * Possible image modes diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/MapillaryDownloader.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/MapillaryDownloader.java index 5ab0589c3..18ee43c93 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/MapillaryDownloader.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/MapillaryDownloader.java @@ -15,9 +15,8 @@ import java.util.stream.Collector; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.Json; import jakarta.json.JsonNumber; import jakarta.json.JsonObject; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/MapillaryFilterModel.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/MapillaryFilterModel.java index 993cbebdd..b5d46d1d4 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/MapillaryFilterModel.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/MapillaryFilterModel.java @@ -7,8 +7,7 @@ import java.util.concurrent.locks.Lock; import java.util.stream.Collectors; -import javax.annotation.Nullable; - +import jakarta.annotation.Nullable; import org.openstreetmap.josm.data.osm.DataSet; import org.openstreetmap.josm.data.osm.Filter; import org.openstreetmap.josm.data.osm.FilterMatcher; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ObjectDetections.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ObjectDetections.java index 63195c933..1fb4711eb 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ObjectDetections.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/ObjectDetections.java @@ -14,10 +14,10 @@ import java.util.function.Supplier; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.swing.ImageIcon; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.Json; import jakarta.json.JsonArray; import jakarta.json.JsonObject; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/OrganizationRecord.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/OrganizationRecord.java index 5f268c7ad..0953e5097 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/OrganizationRecord.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/data/mapillary/OrganizationRecord.java @@ -11,12 +11,11 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import javax.annotation.concurrent.Immutable; import javax.imageio.ImageIO; import javax.swing.ImageIcon; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.JsonObject; import org.openstreetmap.josm.data.imagery.vectortile.mapbox.MVTTile; import org.openstreetmap.josm.data.osm.INode; @@ -36,9 +35,9 @@ * * @author Taylor Smock */ -@Immutable +// @Immutable public final class OrganizationRecord implements Serializable { - private static final Pattern NUMBER_PATTERN = Pattern.compile("[0-9]+"); + private static final Pattern NUMBER_PATTERN = Pattern.compile("\\d+"); private static final ListenerList LISTENERS = ListenerList.create(); private final String description; private final long id; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/DataMouseListener.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/DataMouseListener.java index a44710e06..75200682d 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/DataMouseListener.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/DataMouseListener.java @@ -13,10 +13,10 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.swing.event.MouseInputAdapter; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.data.coor.LatLon; import org.openstreetmap.josm.data.osm.AbstractPrimitive; import org.openstreetmap.josm.data.osm.BBox; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/ImageCheckBoxButton.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/ImageCheckBoxButton.java index 20d52a1a9..ff58aa345 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/ImageCheckBoxButton.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/ImageCheckBoxButton.java @@ -9,8 +9,6 @@ import java.util.Collection; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JPanel; @@ -18,6 +16,8 @@ import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.data.osm.Filter; import org.openstreetmap.josm.gui.util.GuiHelper; import org.openstreetmap.josm.plugins.mapillary.data.mapillary.ObjectDetections; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/MapillaryFilterDialog.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/MapillaryFilterDialog.java index 9b7bbecde..1608c21ca 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/MapillaryFilterDialog.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/MapillaryFilterDialog.java @@ -27,7 +27,6 @@ import java.util.stream.LongStream; import java.util.stream.Stream; -import javax.annotation.Nonnull; import javax.swing.AbstractAction; import javax.swing.JCheckBox; import javax.swing.JComboBox; @@ -38,6 +37,7 @@ import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; +import jakarta.annotation.Nonnull; import org.openstreetmap.josm.data.Version; import org.openstreetmap.josm.data.imagery.vectortile.mapbox.MVTTile; import org.openstreetmap.josm.data.osm.INode; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/OldVersionDialog.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/OldVersionDialog.java index 8864a49e6..487e4b82f 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/OldVersionDialog.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/dialog/OldVersionDialog.java @@ -8,9 +8,9 @@ import java.util.Objects; import java.util.Optional; -import javax.annotation.Nullable; import javax.swing.JOptionPane; +import jakarta.annotation.Nullable; import jakarta.json.Json; import jakarta.json.JsonException; import jakarta.json.JsonObject; @@ -27,6 +27,9 @@ import org.openstreetmap.josm.spi.preferences.Config; import org.openstreetmap.josm.tools.Logging; +/** + * Check if Mapillary or JOSM are old versions + */ public final class OldVersionDialog { private static final IntegerProperty SHOWN_OLD = new IntegerProperty("mapillary.shown_old", 0); private static final StringProperty NEW_VERSION = new StringProperty("mapillary.new_version", null); diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java index da98436b8..6facb9edd 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/imageinfo/ImageInfoPanel.java @@ -18,13 +18,13 @@ import java.util.Optional; import java.util.function.Predicate; -import javax.annotation.Nullable; import javax.swing.ImageIcon; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SpinnerNumberModel; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.data.Version; import org.openstreetmap.josm.data.osm.DataSelectionListener; import org.openstreetmap.josm.data.osm.INode; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java index 92c0d5576..8714c44fe 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/MapillaryLayer.java @@ -34,13 +34,13 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.swing.Action; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.SwingUtilities; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.actions.UploadAction; import org.openstreetmap.josm.actions.upload.UploadHook; import org.openstreetmap.josm.data.Bounds; @@ -159,7 +159,7 @@ public final class MapillaryLayer extends MVTLayer implements ActiveLayerChangeL /** {@code true} if this layer is destroyed */ private boolean destroyed; - private static AlphaComposite fadeComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, + private AlphaComposite fadeComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, MapillaryProperties.UNSELECTED_OPACITY.get().floatValue()); private static Point2D standardImageCentroid; private final ListenerList tileListeners = ListenerList.create(); @@ -567,8 +567,8 @@ private void drawImageMarker(final AffineTransform originalTransform, final INod g.setTransform(originalTransform); } - private static void paintDirectionIndicator(Graphics2D g, Color directionC, INode img, - AffineTransform originalTransform, Point p, Image i) { + private void paintDirectionIndicator(Graphics2D g, Color directionC, INode img, AffineTransform originalTransform, + Point p, Image i) { // Paint direction indicator g.setColor(directionC); if (MapillaryImageUtils.IS_PANORAMIC.test(img)) { diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/geoimage/MapillaryImageEntry.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/geoimage/MapillaryImageEntry.java index e79cb11f4..5b7e0df6f 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/geoimage/MapillaryImageEntry.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/geoimage/MapillaryImageEntry.java @@ -33,8 +33,6 @@ import java.util.function.BiConsumer; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.swing.ImageIcon; import javax.swing.SwingUtilities; @@ -43,7 +41,10 @@ import com.drew.metadata.Directory; import com.drew.metadata.Metadata; import com.drew.metadata.MetadataException; +import com.drew.metadata.exif.ExifDirectoryBase; import com.drew.metadata.exif.ExifIFD0Directory; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.jcs3.access.CacheAccess; import org.openstreetmap.josm.actions.ExpertToggleAction; import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; @@ -629,8 +630,8 @@ private void updateExifInformation(byte[] imageBytes) { final Metadata metadata = JpegMetadataReader.readMetadata(new ByteArrayInputStream(imageBytes)); final Directory dirExif = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class); try { - if (dirExif != null && dirExif.containsTag(ExifIFD0Directory.TAG_ORIENTATION)) { - setExifOrientation(dirExif.getInt(ExifIFD0Directory.TAG_ORIENTATION)); + if (dirExif != null && dirExif.containsTag(ExifDirectoryBase.TAG_ORIENTATION)) { + setExifOrientation(dirExif.getInt(ExifDirectoryBase.TAG_ORIENTATION)); } } catch (MetadataException ex) { Logging.debug(ex); diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/io/export/MapillaryExportWriterThread.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/io/export/MapillaryExportWriterThread.java index e16a3cd6e..f2fb9fa10 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/io/export/MapillaryExportWriterThread.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/io/export/MapillaryExportWriterThread.java @@ -16,10 +16,10 @@ import java.time.format.DateTimeFormatter; import java.util.concurrent.ArrayBlockingQueue; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; import javax.imageio.ImageIO; +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.imaging.ImageReadException; import org.apache.commons.imaging.ImageWriteException; import org.apache.commons.imaging.common.RationalNumber; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/model/ImageDetection.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/model/ImageDetection.java index 8d16d952f..2237d36b7 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/model/ImageDetection.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/model/ImageDetection.java @@ -22,8 +22,7 @@ import java.util.function.BiConsumer; import java.util.function.Supplier; -import javax.annotation.Nullable; - +import jakarta.annotation.Nullable; import jakarta.json.Json; import jakarta.json.JsonObject; import jakarta.json.JsonReader; @@ -50,9 +49,14 @@ /** * A store for ImageDetection information + * + * @param The shape type */ public class ImageDetection extends SpecialImageArea { + /** + * Options for getting detections + */ public enum Options { /** Wait for the fetch to complete. Implies {@link #FETCH} */ WAIT, @@ -251,7 +255,7 @@ public Color getColor() { @Override public boolean equals(Object other) { - if (super.equals(other) && other instanceof ImageDetection) { + if (super.equals(other) && this.getClass().equals(other.getClass())) { ImageDetection o = (ImageDetection) other; return Objects.equals(this.approvalType, o.approvalType) && Objects.equals(this.originalValue, o.originalValue) && this.rejected == o.rejected @@ -288,7 +292,9 @@ public static class ImageDetectionForkJoinTask extends ForkJoinTask>>> listenerList = ListenerList .create(); + /** The image key for the detection we are getting */ public final long key; + /** The results from getting the detections for the image key */ private List> results; public ImageDetectionForkJoinTask(long key, BiConsumer>> listener) { diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtils.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtils.java index b158a266f..549ee6d57 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtils.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtils.java @@ -17,9 +17,9 @@ import java.time.temporal.ChronoUnit; import java.util.Collections; -import javax.annotation.Nullable; import javax.swing.JOptionPane; +import jakarta.annotation.Nullable; import jakarta.json.Json; import jakarta.json.JsonException; import jakarta.json.JsonObject; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/spi/preferences/IMapillaryUrls.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/spi/preferences/IMapillaryUrls.java index d21506f41..c0b37f06e 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/spi/preferences/IMapillaryUrls.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/spi/preferences/IMapillaryUrls.java @@ -18,9 +18,8 @@ import java.util.stream.LongStream; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryImageUtils; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryMapFeatureUtils; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryProperties; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryImageUtils.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryImageUtils.java index cd780ccd5..e9b81a824 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryImageUtils.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryImageUtils.java @@ -10,9 +10,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry; import org.openstreetmap.josm.data.cache.CacheEntry; import org.openstreetmap.josm.data.cache.ICachedLoaderListener; @@ -33,7 +32,7 @@ */ public final class MapillaryImageUtils { /** The base image url key pattern (v4 sizes are 256, 1024, 2048, and original) */ - public static final Pattern BASE_IMAGE_KEY = Pattern.compile("^thumb_([0-9]+|original)_url$"); + public static final Pattern BASE_IMAGE_KEY = Pattern.compile("^thumb_(\\d+|original)_url$"); // Image specific /** Check if the node is for a panoramic image */ public static final Predicate IS_PANORAMIC = node -> node != null diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryMapFeatureUtils.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryMapFeatureUtils.java index 133e8c7a9..c382d9610 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryMapFeatureUtils.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillaryMapFeatureUtils.java @@ -11,9 +11,8 @@ import java.util.regex.Pattern; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.Json; import jakarta.json.JsonReader; import org.openstreetmap.josm.data.osm.IPrimitive; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillarySequenceUtils.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillarySequenceUtils.java index aed5beaa8..32b1f3489 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillarySequenceUtils.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/MapillarySequenceUtils.java @@ -5,9 +5,8 @@ import java.util.List; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.apache.commons.jcs3.access.CacheAccess; import org.openstreetmap.josm.data.cache.JCSCacheManager; import org.openstreetmap.josm.data.osm.BBox; @@ -15,7 +14,10 @@ import org.openstreetmap.josm.data.osm.IPrimitive; import org.openstreetmap.josm.data.osm.IWay; -public class MapillarySequenceUtils { +/** + * Utils for Mapillary sequences + */ +public final class MapillarySequenceUtils { /** * An enum for next/previous, largely to help ensure that booleans aren't accidentally reversed */ diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/OffsetUtils.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/OffsetUtils.java index 25dd282cd..512318590 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/OffsetUtils.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/OffsetUtils.java @@ -1,3 +1,4 @@ +// License: GPL. For details, see LICENSE file. package org.openstreetmap.josm.plugins.mapillary.utils; import java.util.ArrayList; @@ -5,8 +6,7 @@ import java.util.Map; import java.util.WeakHashMap; -import javax.annotation.Nullable; - +import jakarta.annotation.Nullable; import org.openstreetmap.josm.data.coor.ILatLon; import org.openstreetmap.josm.data.osm.INode; import org.openstreetmap.josm.data.osm.IWay; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/ReflectionUtils.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/ReflectionUtils.java index 72d7d995e..fb36de94c 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/ReflectionUtils.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/ReflectionUtils.java @@ -2,14 +2,10 @@ package org.openstreetmap.josm.plugins.mapillary.utils; import java.lang.reflect.Field; -import java.security.AccessController; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; import java.util.Optional; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import org.openstreetmap.josm.tools.Logging; /** @@ -37,15 +33,12 @@ public static Optional getDeclaredField(@Nonnull Class @Nonnull String fieldInParentClass, @Nullable C objectWithField, @Nonnull Class returnClass) { try { Field tagMenuField = parentClass.getDeclaredField(fieldInParentClass); - AccessController.doPrivileged((PrivilegedExceptionAction) () -> { - tagMenuField.setAccessible(true); - return null; - }); + org.openstreetmap.josm.tools.ReflectionUtils.setObjectsAccessible(tagMenuField); final Object object = tagMenuField.get(objectWithField); if (returnClass.isInstance(object)) { return Optional.of(returnClass.cast(object)); } - } catch (PrivilegedActionException | ReflectiveOperationException e) { + } catch (ReflectiveOperationException e) { Logging.error(e); } return Optional.empty(); diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonDecoder.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonDecoder.java index 97b7123fb..ed135b3d0 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonDecoder.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonDecoder.java @@ -7,9 +7,8 @@ import java.util.Objects; import java.util.function.Function; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.JsonArray; import jakarta.json.JsonNumber; import jakarta.json.JsonObject; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonImageDetailsDecoder.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonImageDetailsDecoder.java index 34baabaaf..0529d0ef0 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonImageDetailsDecoder.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonImageDetailsDecoder.java @@ -9,9 +9,8 @@ import java.util.Optional; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.JsonArray; import jakarta.json.JsonObject; import jakarta.json.JsonString; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonImageDetectionDecoder.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonImageDetectionDecoder.java index 340991943..1ca92eba0 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonImageDetectionDecoder.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonImageDetectionDecoder.java @@ -13,9 +13,8 @@ import java.util.Objects; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.JsonObject; import jakarta.json.JsonString; import jakarta.json.JsonValue; @@ -81,7 +80,7 @@ public static Collection> decodeImageDetection(@Nullable final } /** - * Decode image ids (mostly so we can select the appropriate image) + * Decode image ids (so we can select the appropriate image) * * @param jsonValue The value to decode * @param defaultImageId The default image id. May be {@code null}. diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonMapObjectDecoder.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonMapObjectDecoder.java index 59ad3cd16..52b5a55d7 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonMapObjectDecoder.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/utils/api/JsonMapObjectDecoder.java @@ -10,9 +10,8 @@ import java.util.Objects; import java.util.stream.Collectors; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.JsonArray; import jakarta.json.JsonNumber; import jakarta.json.JsonObject; diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditAddActionTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditAddActionTest.java index 16bf12e58..e70cbccd9 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditAddActionTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/actions/SmartEditAddActionTest.java @@ -16,14 +16,12 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import mockit.Invocation; import mockit.Mock; import mockit.MockUp; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -48,8 +46,10 @@ import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryImageUtils; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryKeys; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryMapFeatureUtils; -import org.openstreetmap.josm.testutils.JOSMTestRules; import org.openstreetmap.josm.testutils.annotations.BasicPreferences; +import org.openstreetmap.josm.testutils.annotations.Main; +import org.openstreetmap.josm.testutils.annotations.Projection; +import org.openstreetmap.josm.testutils.annotations.TaggingPresets; /** * Test class for {@link SmartEditAddAction} @@ -59,11 +59,11 @@ @MapillaryLayerAnnotation @MapillaryURLWireMock @BasicPreferences +@Main @ObjectDetectionsAnnotation +@Projection +@TaggingPresets class SmartEditAddActionTest { - // Needed for layer cleanup and for UI mocks - @RegisterExtension - static JOSMTestRules josmTestRules = new JOSMTestRules().main().projection().presets(); private PointObjectLayer pointObjectLayer; private VectorNode node; @@ -91,7 +91,7 @@ void setUp() { @MapillaryURLWireMockErrors @ParameterizedTest @MethodSource("detectionsAreAdded") - void actionPerformedNoOsmLayer(ObjectDetections detection) { + void testActionPerformedNoOsmLayer(ObjectDetections detection) { node.put("value", detection.getKey()); final SmartEditAddAction smartEditAddAction = new SmartEditAddAction(pointObjectLayer, node); smartEditAddAction.actionPerformed(null); @@ -103,7 +103,7 @@ void actionPerformedNoOsmLayer(ObjectDetections detection) { @MapillaryURLWireMockErrors @ParameterizedTest @MethodSource("detectionsAreAdded") - void actionPerformedOsmLayerLocked(ObjectDetections detection) { + void testActionPerformedOsmLayerLocked(ObjectDetections detection) { node.put("value", detection.getKey()); final SmartEditAddAction smartEditAddAction = new SmartEditAddAction(pointObjectLayer, node); final OsmDataLayer osmDataLayer = new OsmDataLayer(new DataSet(), "SmartEditAddActionTest", null); @@ -117,7 +117,7 @@ void actionPerformedOsmLayerLocked(ObjectDetections detection) { @MapillaryURLWireMockErrors @ParameterizedTest @MethodSource("detectionsAreAdded") - void actionPerformedOsmLayerUnlockedNoApply(ObjectDetections detection) { + void testActionPerformedOsmLayerUnlockedNoApply(ObjectDetections detection) { node.put("value", detection.getKey()); final SmartEditAddAction smartEditAddAction = new SmartEditAddAction(pointObjectLayer, node); final OsmDataLayer osmDataLayer = new OsmDataLayer(new DataSet(), "SmartEditAddActionTest", null); @@ -136,7 +136,7 @@ void actionPerformedOsmLayerUnlockedNoApply(ObjectDetections detection) { @MapillaryURLWireMockErrors @ParameterizedTest @MethodSource("detectionsAreAdded") - void actionPerformedOsmLayerUnlockedApply(ObjectDetections detection, boolean added) { + void testActionPerformedOsmLayerUnlockedApply(ObjectDetections detection, boolean added) { final OsmDataLayer osmDataLayer = this.commonApply(detection); final SmartEditAddAction smartEditAddAction = new SmartEditAddAction(pointObjectLayer, node); diff --git a/test/unit/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtilsTest.java b/test/unit/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtilsTest.java index 419851158..40c839353 100644 --- a/test/unit/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtilsTest.java +++ b/test/unit/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthUtilsTest.java @@ -24,9 +24,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - +import jakarta.annotation.Nonnull; +import jakarta.annotation.Nullable; import jakarta.json.Json; import jakarta.json.JsonObject; import jakarta.json.JsonObjectBuilder;