Subject: [PATCH] Typo/documentation fixes
---
Index: src/org/openstreetmap/josm/actions/upload/UploadHook.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/upload/UploadHook.java b/src/org/openstreetmap/josm/actions/upload/UploadHook.java
--- a/src/org/openstreetmap/josm/actions/upload/UploadHook.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/actions/upload/UploadHook.java	(date 1679257200926)
@@ -6,7 +6,7 @@
 import org.openstreetmap.josm.data.APIDataSet;
 
 /**
- * Change, or block, the upload.
+ * Change or block the upload.
  *
  * The UploadHook may modify the uploaded data silently, it may display a
  * warning message to the user or prevent the upload altogether.
@@ -16,7 +16,7 @@
 public interface UploadHook {
 
     /**
-     * Check, and/or change, the data to be uploaded.
+     * Check and/or change the data to be uploaded.
      * Default implementation is to approve the upload.
      * @param apiDataSet the data to upload, modify this to change the data.
      * @return {@code true} if upload is possible, {@code false} to block the upload.
Index: src/org/openstreetmap/josm/actions/UploadAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/UploadAction.java b/src/org/openstreetmap/josm/actions/UploadAction.java
--- a/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/actions/UploadAction.java	(date 1679257200942)
@@ -56,7 +56,7 @@
      * when the user wants to upload data. Plugins can insert their own hooks here
      * if they want to be able to veto an upload.
      *
-     * Be default, the standard upload dialog is the only element in the list.
+     * By default, the standard upload dialog is the only element in the list.
      * Plugins should normally insert their code before that, so that the upload
      * dialog is the last thing shown before upload really starts; on occasion
      * however, a plugin might also want to insert something after that.
@@ -214,9 +214,9 @@
                 return false;
             }
         }
+
         // Call all upload hooks in sequence.
         // FIXME: this should become an asynchronous task
-        //
         if (apiData != null) {
             return UPLOAD_HOOKS.stream().allMatch(hook -> hook.checkUpload(apiData));
         }
@@ -283,9 +283,7 @@
             Optional<AsynchronousUploadPrimitivesTask> asyncUploadTask = AsynchronousUploadPrimitivesTask.createAsynchronousUploadTask(
                     uploadStrategySpecification, layer, apiData, cs);
 
-            if (asyncUploadTask.isPresent()) {
-                MainApplication.worker.execute(asyncUploadTask.get());
-            }
+            asyncUploadTask.ifPresent(MainApplication.worker::execute);
         } else {
             MainApplication.worker.execute(new UploadPrimitivesTask(uploadStrategySpecification, layer, apiData, cs));
         }
Index: src/org/openstreetmap/josm/data/osm/IPrimitive.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/osm/IPrimitive.java b/src/org/openstreetmap/josm/data/osm/IPrimitive.java
--- a/src/org/openstreetmap/josm/data/osm/IPrimitive.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/data/osm/IPrimitive.java	(date 1679257200966)
@@ -287,7 +287,7 @@
      * used to check against edit conflicts.
      *
      * @return date of last modification
-     * @see #getInstant
+     * @see #setInstant
      */
     Instant getInstant();
 
Index: src/org/openstreetmap/josm/data/osm/OsmUtils.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/osm/OsmUtils.java b/src/org/openstreetmap/josm/data/osm/OsmUtils.java
--- a/src/org/openstreetmap/josm/data/osm/OsmUtils.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/data/osm/OsmUtils.java	(date 1679257200994)
@@ -118,7 +118,7 @@
     /**
      * Check if a tag value represents a boolean false value
      * @param value The value to check
-     * @return true if it is a true value.
+     * @return true if it is a false value.
      */
     public static boolean isFalse(String value) {
         if (value == null) {
@@ -137,7 +137,7 @@
 
     /**
      * Creates a new OSM primitive around (0,0) according to the given assertion. Originally written for unit tests,
-     * this can also be used in another places like validation of local MapCSS validator rules.
+     * this can also be used in other places like validation of local MapCSS validator rules.
      * Ways and relations created using this method are empty.
      * @param assertion The assertion describing OSM primitive (ex: "way name=Foo railway=rail")
      * @return a new OSM primitive according to the given assertion
@@ -150,7 +150,7 @@
 
     /**
      * Creates a new OSM primitive according to the given assertion. Originally written for unit tests,
-     * this can also be used in another places like validation of local MapCSS validator rules.
+     * this can also be used in other places like validation of local MapCSS validator rules.
      * @param assertion The assertion describing OSM primitive (ex: "way name=Foo railway=rail")
      * @param around the coordinate at which the primitive will be located
      * @param enforceLocation if {@code true}, ways and relations will not be empty to force a physical location
Index: src/org/openstreetmap/josm/data/osm/Storage.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/osm/Storage.java b/src/org/openstreetmap/josm/data/osm/Storage.java
--- a/src/org/openstreetmap/josm/data/osm/Storage.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/data/osm/Storage.java	(date 1679257201002)
@@ -14,7 +14,7 @@
 import org.openstreetmap.josm.tools.Utils;
 
 /**
- * A Set-like class that allows looking up equivalent preexising instance.
+ * A Set-like class that allows looking up equivalent preexisting instance.
  * It is useful wherever one would use self-mapping construct like
  * <code>Map&lt;T,T&gt;.put(t,t)</code>, that is, for caches, uniqueness filters or similar.
  *
Index: src/org/openstreetmap/josm/data/projection/Ellipsoid.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/projection/Ellipsoid.java b/src/org/openstreetmap/josm/data/projection/Ellipsoid.java
--- a/src/org/openstreetmap/josm/data/projection/Ellipsoid.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/data/projection/Ellipsoid.java	(date 1679257201010)
@@ -356,7 +356,7 @@
     public double latitude(double latIso, double e, double epsilon) {
         double lat0 = 2*Math.atan(Math.exp(latIso))-Math.PI/2;
         double lati = lat0;
-        double lati1 = 1.0; // random value to start the iterative processus
+        double lati1 = 1.0; // random value to start the iterative processes
         while (Math.abs(lati1-lati) >= epsilon) {
             lati = lati1;
             double v1 = 1+e*Math.sin(lati);
Index: src/org/openstreetmap/josm/data/validation/routines/EmailValidator.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/validation/routines/EmailValidator.java b/src/org/openstreetmap/josm/data/validation/routines/EmailValidator.java
--- a/src/org/openstreetmap/josm/data/validation/routines/EmailValidator.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/data/validation/routines/EmailValidator.java	(date 1679257131671)
@@ -29,7 +29,6 @@
  * </p>
  * <p>
  * This implementation is not guaranteed to catch all possible errors in an email address.
- * </p>.
  *
  * @version $Revision: 1741724 $
  * @since Validator 1.4
@@ -125,9 +124,9 @@
     }
 
     /**
-     * <p>Checks if a field has a valid e-mail address.</p>
+     * Checks if a field has a valid e-mail address.
      *
-     * @param email The value validation is being performed on.  A <code>null</code>
+     * @param email The value validation is being performed on. A <code>null</code>
      *              value is considered invalid.
      * @return true if the email address is valid.
      */
Index: src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMergeModel.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMergeModel.java b/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMergeModel.java
--- a/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMergeModel.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMergeModel.java	(date 1679257201050)
@@ -634,7 +634,7 @@
          * replies true if the {@link ListRole} of this {@link EntriesTableModel}
          * participates in the current {@link ComparePairType}
          *
-         * @return true, if the if the {@link ListRole} of this {@link EntriesTableModel}
+         * @return true, if the {@link ListRole} of this {@link EntriesTableModel}
          * participates in the current {@link ComparePairType}
          *
          * @see AbstractListMergeModel.ComparePairListModel#getSelectedComparePair()
Index: src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMerger.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMerger.java b/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMerger.java
--- a/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMerger.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/gui/conflict/pair/AbstractListMerger.java	(date 1679257201054)
@@ -774,7 +774,7 @@
         }
 
         /**
-         * Java 1.5 doesn't known Action.SELECT_KEY. Wires a toggle button to this action
+         * Java 1.5 doesn't know Action.SELECT_KEY. Wires a toggle button to this action
          * such that the action gets notified about item state changes and the button gets
          * notified about selection state changes of the action.
          *
Index: src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java b/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
--- a/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(date 1679257201074)
@@ -135,7 +135,7 @@
  *
  * If no object is selected, the dialog list is empty.
  * If only one is selected, all tags of this object are selected.
- * If more than one object are selected, the sum of all tags are displayed. If the
+ * If more than one object is selected, the sum of all tags is displayed. If the
  * different objects share the same tag, the shared value is displayed. If they have
  * different values, all of them are put in a combo box and the string "&lt;different&gt;"
  * is displayed in italic.
Index: src/org/openstreetmap/josm/gui/layer/MainLayerManager.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java b/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java
--- a/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/gui/layer/MainLayerManager.java	(date 1679257201134)
@@ -26,7 +26,7 @@
  * <p>
  * The active layer is the layer the user is currently working on.
  * <p>
- * The edit layer is an data layer that we currently work with.
+ * The edit layer is a data layer that we currently work with.
  * @author Michael Zangl
  * @since 10279
  */
@@ -210,7 +210,7 @@
     }
 
     /**
-     * Adds a active/edit layer change listener. Fire a fake active-layer-changed-event right after adding
+     * Adds an active/edit layer change listener. Fire a fake active-layer-changed-event right after adding
      * the listener. The previous layers will be null. The listener is notified in the current thread.
      * @param listener the listener.
      */
Index: src/org/openstreetmap/josm/gui/progress/swing/PleaseWaitProgressMonitor.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/progress/swing/PleaseWaitProgressMonitor.java b/src/org/openstreetmap/josm/gui/progress/swing/PleaseWaitProgressMonitor.java
--- a/src/org/openstreetmap/josm/gui/progress/swing/PleaseWaitProgressMonitor.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/gui/progress/swing/PleaseWaitProgressMonitor.java	(date 1679257201178)
@@ -106,7 +106,7 @@
     }
 
     private void doInEDT(Runnable runnable) {
-        // This must be invoke later even if current thread is EDT because inside there is dialog.setVisible
+        // This must be invoked later even if current thread is EDT because inside there is dialog.setVisible
         // which freeze current code flow until modal dialog is closed
         SwingUtilities.invokeLater(() -> {
             try {
Index: src/org/openstreetmap/josm/gui/progress/ProgressMonitor.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/progress/ProgressMonitor.java b/src/org/openstreetmap/josm/gui/progress/ProgressMonitor.java
--- a/src/org/openstreetmap/josm/gui/progress/ProgressMonitor.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/gui/progress/ProgressMonitor.java	(date 1679257201182)
@@ -75,10 +75,10 @@
     void finishTask();
 
     /**
-     * Can be used if method receive ProgressMonitor but it's not interested progress monitoring.
+     * Can be used if method receives ProgressMonitor, but it's not interested progress monitoring.
      * Basically replaces {@link #beginTask(String)} and {@link #finishTask()}
      *
-     * This method can be also used in finally section if method expects that some exception
+     * This method can be also used in finally section if method expects that some exceptions
      * might prevent it from passing progressMonitor away. If {@link #beginTask(String)} was
      * already called then this method does nothing.
      */
Index: src/org/openstreetmap/josm/gui/widgets/AbstractFileChooser.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/widgets/AbstractFileChooser.java b/src/org/openstreetmap/josm/gui/widgets/AbstractFileChooser.java
--- a/src/org/openstreetmap/josm/gui/widgets/AbstractFileChooser.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/gui/widgets/AbstractFileChooser.java	(date 1679257201202)
@@ -97,7 +97,7 @@
      * as an available choice in the choosable filter list.
      * If false, the <code>AcceptAll</code> file filter is removed from
      * the list of available file filters.
-     * If true, the <code>AcceptAll</code> file filter will become the
+     * If true, the <code>AcceptAll</code> file filter will become
      * the actively used file filter.
      * @param b whether the <code>AcceptAll FileFilter</code> is used
      * as an available choice in the choosable filter list
Index: src/org/openstreetmap/josm/gui/MainApplication.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/MainApplication.java b/src/org/openstreetmap/josm/gui/MainApplication.java
--- a/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/gui/MainApplication.java	(date 1679257201206)
@@ -683,6 +683,7 @@
                 "\t--version                                 "+tr("Displays the JOSM version and exits")+"\n\n"+
                 "\t--status-report                           "+ShowStatusReportAction.ACTION_DESCRIPTION+"\n\n"+
                 "\t--debug                                   "+tr("Print debugging messages to console")+"\n\n"+
+                "\t--trace                                   "+tr("Print detailed debugging messages to console")+"\n\n"+
                 "\t--skip-plugins                            "+tr("Skip loading plugins")+"\n\n"+
                 "\t--offline=" + Arrays.stream(OnlineResource.values()).map(OnlineResource::name).collect(
                         Collectors.joining("|", "<", ">")) + "\n" +
@@ -992,7 +993,7 @@
         ChangesetUpdater.start();
 
         if (Config.getPref().getBoolean("debug.edt-checker.enable", Version.getInstance().isLocalBuild())) {
-            // Repaint manager is registered so late for a reason - there is lots of violation during startup process
+            // Repaint manager is registered so late for a reason - there are lots of violations during startup process
             // but they don't seem to break anything and are difficult to fix
             Logging.info("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console");
             RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager());
@@ -1180,7 +1181,7 @@
         UIManager.put("OptionPane.yesIcon", UIManager.get("OptionPane.okIcon"));
         UIManager.put("OptionPane.cancelIcon", ImageProvider.getIfAvailable("cancel"));
         UIManager.put("OptionPane.noIcon", UIManager.get("OptionPane.cancelIcon"));
-        // Ensures caret color is the same than text foreground color, see #12257
+        // Ensures caret color is the same as text foreground color, see #12257
         // See https://docs.oracle.com/javase/8/docs/api/javax/swing/plaf/synth/doc-files/componentProperties.html
         for (String p : Arrays.asList(
                 "EditorPane", "FormattedTextField", "PasswordField", "TextArea", "TextField", "TextPane")) {
Index: src/org/openstreetmap/josm/tools/Geometry.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/tools/Geometry.java b/src/org/openstreetmap/josm/tools/Geometry.java
--- a/src/org/openstreetmap/josm/tools/Geometry.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/tools/Geometry.java	(date 1679257201242)
@@ -350,7 +350,7 @@
     }
 
     /**
-     * Get the segment segment intersection of two line segments
+     * Get the segment-segment intersection of two line segments
      * @param x1 The x coordinate of the first point (first segment)
      * @param y1 The y coordinate of the first point (first segment)
      * @param x2 The x coordinate of the second point (first segment)
@@ -921,7 +921,7 @@
     }
 
     /**
-     * Get angles in radians and return it's value in range [0, 180].
+     * Get angles in radians and return its value in range [0, 180].
      *
      * @param angle the angle in radians
      * @return normalized angle in degrees
@@ -992,7 +992,7 @@
     }
 
     /**
-     * Compute center of the circle closest to different nodes.
+     * Compute the center of the circle closest to different nodes.
      *
      * Ensure exact center computation in case nodes are already aligned in circle.
      * This is done by least square method.
Index: src/org/openstreetmap/josm/tools/GuiSizesHelper.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/tools/GuiSizesHelper.java b/src/org/openstreetmap/josm/tools/GuiSizesHelper.java
--- a/src/org/openstreetmap/josm/tools/GuiSizesHelper.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/tools/GuiSizesHelper.java	(date 1679263492857)
@@ -10,7 +10,7 @@
 /**
  * Support class to handle size information of Gui elements
  * This is needed, because display resolution may vary a lot and a common set
- * of sizes wont work for all users alike.
+ * of sizes won't work for all users alike.
  * @since 12682 (moved from {@code gui.util} package)
  * @since 10358
  */
Index: src/org/openstreetmap/josm/tools/HttpClient.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/tools/HttpClient.java b/src/org/openstreetmap/josm/tools/HttpClient.java
--- a/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 18694)
+++ b/src/org/openstreetmap/josm/tools/HttpClient.java	(date 1679257201382)
@@ -35,7 +35,7 @@
 import org.openstreetmap.josm.spi.preferences.Config;
 
 /**
- * Provides a uniform access for a HTTP/HTTPS server. This class should be used in favour of {@link HttpURLConnection}.
+ * Provides uniform access for a HTTP/HTTPS server. This class should be used in favour of {@link HttpURLConnection}.
  * @since 9168
  */
 public abstract class HttpClient {
Index: test/unit/org/openstreetmap/josm/data/validation/tests/DirectionNodesTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/DirectionNodesTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/DirectionNodesTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/tests/DirectionNodesTest.java	(revision 18694)
+++ b/test/unit/org/openstreetmap/josm/data/validation/tests/DirectionNodesTest.java	(date 1679257131687)
@@ -9,11 +9,10 @@
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
- * JUnit Test of Multipolygon validation test.
+ * JUnit Test of {@link DirectionNodes} validation test.
  */
 class DirectionNodesTest {
 
-
     /**
      * Setup test.
      */
@@ -26,7 +25,7 @@
      * @throws Exception in case of error
      */
     @Test
-    void testDirectionsNodesTestFile() throws Exception {
+    void testDirectionNodesTestFile() throws Exception {
         final DirectionNodes test = new DirectionNodes();
         ValidatorTestUtils.testSampleFile("nodist/data/direction-nodes.osm", DataSet::getNodes, null, test);
     }
Index: test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java b/test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java
--- a/test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java	(revision 18694)
+++ b/test/unit/org/openstreetmap/josm/data/validation/tests/SelfIntersectingWayTest.java	(date 1679257201410)
@@ -22,7 +22,7 @@
 import org.openstreetmap.josm.data.osm.Way;
 
 /**
- * JUnit Test of Multipolygon validation test.
+ * JUnit Test of SelfIntersectingWay validation test.
  */
 class SelfIntersectingWayTest {
 
