Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See #23220: Use jakarta.annotation instead of javax.annotation #224

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ant-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"


6 changes: 2 additions & 4 deletions .github/workflows/ant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion .github/workflows/reports.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ permissions:

jobs:
call-workflow:
uses: JOSM/JOSMPluginAction/.github/workflows/reports.yaml@v1
uses: JOSM/JOSMPluginAction/.github/workflows/reports.yaml@v2
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 <T> The component that the date picker returns for the UI
* @author Taylor Smock
*/
public interface IDatePicker<T extends JComponent> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -34,6 +33,7 @@ public class DatePickerJDatePicker implements IDatePicker<JDatePickerImpl> {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,6 +24,7 @@ public class DatePickerSwing implements IDatePicker<JosmTextField> {
private Instant date;
private final JosmTextField component = new DisableShortcutsOnFocusGainedTextField("", 12);

/** Create a new {@link DatePickerSwing} component */
public DatePickerSwing() {
super();
component.setToolTipText("YYYY-MM-DD");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<OrganizationRecordListener> LISTENERS = ListenerList.create();
private final String description;
private final long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
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;
import javax.swing.SwingUtilities;
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<MVTTile.TileListener> tileListeners = ListenerList.create();
Expand Down Expand Up @@ -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)) {
Expand Down
Loading