Changeset 36488 in osm


Ignore:
Timestamp:
2026-02-13T17:37:08+01:00 (6 days ago)
Author:
stoecker
Message:

fix #24638 - fix test build, add missing tr()'s, checkstyle fixes

Location:
applications/editors/josm/plugins
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/MicrosoftStreetside

    • Property svn:ignore
      •  

        old new  
        1212spotbugs-josm-MicrosoftStreetside.xml
        1313bintest
         14target
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideAbstractImage.java

    r36483 r36488  
    2727
    2828interface StreetsideAbstractImage extends ILatLon, IQuadBucketType, Comparable<StreetsideAbstractImage>, Serializable
    29 permits StreetsideImage
    30 {
     29permits StreetsideImage {
    3130
    3231    /**
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideImage.java

    r36483 r36488  
    1010 * A StreetsideImage object represents each of the images stored in Streetside.
    1111 *
     12 * @author nokutu
     13 * @author renerr18
    1214 * @param id The unique id for the cubemap
    1315 * @param lat The latitude of the image
     
    2527 * @param imageWidth The width for this image tiles
    2628 * @param imageUrlSubdomains The subdomains for this image
    27  *
    28  * @author nokutu
    29  * @author renerr18
    30  *
    3129 * @see StreetsideData
    3230 */
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsideLayer.java

    r36483 r36488  
    395395    @Override
    396396    public Action[] getMenuEntries() {
    397         return new Action[] { LayerListDialog.getInstance().createShowHideLayerAction(),
    398                 LayerListDialog.getInstance().createDeleteLayerAction(), new LayerListPopup.InfoAction(this) };
     397        return new Action[] {LayerListDialog.getInstance().createShowHideLayerAction(),
     398                LayerListDialog.getInstance().createDeleteLayerAction(), new LayerListPopup.InfoAction(this)};
    399399    }
    400400
     
    487487
    488488    private record NearestImgToTargetComparator(StreetsideAbstractImage target) implements Comparator<StreetsideAbstractImage> {
    489 
    490     @Override
    491     public int compare(StreetsideAbstractImage img1, StreetsideAbstractImage img2) {
    492         return (int) Math.signum(img1.greatCircleDistance(target) - img2.greatCircleDistance(target));
    493     }
    494 }}
     489        @Override
     490        public int compare(StreetsideAbstractImage img1, StreetsideAbstractImage img2) {
     491            return (int) Math.signum(img1.greatCircleDistance(target) - img2.greatCircleDistance(target));
     492        }
     493    }
     494}
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/StreetsidePlugin.java

    r36483 r36488  
    5252
    5353    static StreetsideDataListener[] getStreetsideDataListeners() {
    54         return new StreetsideDataListener[] { WALK_ACTION, ZOOM_ACTION, CubemapBuilder.getInstance() };
     54        return new StreetsideDataListener[] {WALK_ACTION, ZOOM_ACTION, CubemapBuilder.getInstance()};
    5555    }
    5656
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cache/CacheUtils.java

    r36483 r36488  
    136136    }
    137137
    138     private static class IgnoreDownload implements ICachedLoaderListener {
    139 
     138    private static final class IgnoreDownload implements ICachedLoaderListener {
    140139        @Override
    141140        public void loadingFinished(CacheEntry arg0, CacheEntryAttributes arg1, LoadResult arg2) {
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapBox.java

    r36483 r36488  
    2828    private final ImageView up = new ImageView();
    2929    private final ImageView down = new ImageView();
    30     private final ImageView[] views = new ImageView[] { front, right, back, left, up, down };
     30    private final ImageView[] views = new ImageView[] {front, right, back, left, up, down};
    3131    private final Image frontImg;
    3232    private final Image rightImg;
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/CubemapBuilder.java

    r36483 r36488  
    138138            if (Boolean.TRUE.equals(StreetsideProperties.DEBUGING_ENABLED.get())) {
    139139                LOGGER.log(Logging.LEVEL_DEBUG, "Completed downloading tiles for {0} in {1} seconds.",
    140                         new Object[] { newImage.id(), runTime });
     140                        new Object[] {newImage.id(), runTime});
    141141            }
    142142        }
     
    275275                LOGGER.log(Logging.LEVEL_DEBUG,
    276276                        "{0} tile images ready for building cumbemap faces for cubemap {1} in {2} seconds.",
    277                         new Object[] { currentTileCount.get(), CubemapBuilder.getInstance().getCubemap().id(),
    278                                 Long.toString(runTime) });
     277                        new Object[] {currentTileCount.get(), CubemapBuilder.getInstance().getCubemap().id(),
     278                                Long.toString(runTime)});
    279279            }
    280280
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/cubemap/TileDownloadingTask.java

    r36483 r36488  
    120120                long endTime = System.currentTimeMillis();
    121121                long runTime = (endTime - startTime) / 1000;
    122                 LOGGER.log(Logging.LEVEL_DEBUG, "Loaded image for {0} in {1} seconds.", new Object[] { url, runTime });
     122                LOGGER.log(Logging.LEVEL_DEBUG, "Loaded image for {0} in {1} seconds.", new Object[] {url, runTime});
    123123            }
    124124        } catch (IOException e) {
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/StreetsideImageDisplay.java

    r36483 r36488  
    217217    }
    218218
    219     private class ImgDisplayMouseListener implements MouseListener, MouseWheelListener, MouseMotionListener {
     219    private final class ImgDisplayMouseListener implements MouseListener, MouseWheelListener, MouseMotionListener {
    220220        private boolean mouseIsDragging;
    221221        private long lastTimeForMousePoint;
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/StreetsidePreferenceSetting.java

    r36483 r36488  
    4545
    4646    private final JComboBox<String> downloadModeComboBox = new JComboBox<>(
    47             new String[] { DOWNLOAD_MODE.VISIBLE_AREA.getLabel(), DOWNLOAD_MODE.OSM_AREA.getLabel(),
    48                     DOWNLOAD_MODE.MANUAL_ONLY.getLabel() });
     47            new String[] {DOWNLOAD_MODE.VISIBLE_AREA.getLabel(), DOWNLOAD_MODE.OSM_AREA.getLabel(),
     48                    DOWNLOAD_MODE.MANUAL_ONLY.getLabel()});
    4949
    5050    private final JCheckBox displayHour = new JCheckBox(I18n.tr("Display hour when the picture was taken"),
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/ImageInfoHelpPopup.java

    r36483 r36488  
    4747        mainText.setContentType("text/html");
    4848        mainText.setFont(SelectableLabel.DEFAULT_FONT);
    49         mainText.setText("<html><div style='width:250px'>"
    50                 + "Welcome to the Microsoft Streetside JOSM Plugin. To view the vector bubbles for the 360 degree imagery, select Imagery->Streetside from the JOSM menu."
     49        mainText.setText(I18n.tr("<html><div style='width:250px'>"
     50                + "Welcome to the Microsoft Streetside JOSM Plugin. To view the vector bubbles for the 360 degree imagery, "
     51                + "select Imagery->Streetside from the JOSM menu."
    5152                + "<br><br>"
    5253                + "Once the blue bubbles appear on the map, click on a vector bubble and undock/maximize the 360 viewer to view the imagery."
    53                 + "</div></html>");
     54                + "</div></html>"));
    5455        add(mainText, BorderLayout.CENTER);
    5556
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/gui/imageinfo/StreetsideViewerPanel.java

    r36483 r36488  
    8686        final var checkPanel = new JPanel();
    8787
    88         final var imgReloadAction = new ImageReloadAction("Reload");
     88        final var imgReloadAction = new ImageReloadAction(I18n.tr("Reload"));
    8989
    9090        final var imgReloadButton = new StreetsideButton(imgReloadAction);
    9191
    92         final var highResImageryCheck = new JCheckBox("High resolution");
     92        final var highResImageryCheck = new JCheckBox(I18n.tr("High resolution"));
    9393        highResImageryCheck.setSelected(StreetsideProperties.SHOW_HIGH_RES_STREETSIDE_IMAGERY.get());
    9494        highResImageryCheck.addActionListener(
     
    101101        final var privacyLink = new JPanel();
    102102
    103         imgLinkAction = new WebLinkAction("Report a privacy concern with this image", null);
     103        imgLinkAction = new WebLinkAction(I18n.tr("Report a privacy concern with this image"), null);
    104104        privacyLink.add(new StreetsideButton(imgLinkAction, true));
    105105        checkPanel.add(privacyLink, BorderLayout.PAGE_END);
     
    150150            if (Boolean.TRUE.equals(StreetsideProperties.DEBUGING_ENABLED.get())) {
    151151                LOGGER.log(Logging.LEVEL_DEBUG, "Privacy link set for Streetside image {0} quadKey {1}",
    152                         new Object[] { bubbleId, newImageId });
     152                        new Object[] {bubbleId, newImageId});
    153153            }
    154154
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/BoundsDownloadRunnable.java

    r36483 r36488  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.plugins.streetside.io.download;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
    35
    46import java.awt.GraphicsEnvironment;
     
    3941                if (Thread.interrupted()) {
    4042                    LOGGER.log(Logging.LEVEL_ERROR, "{0} for {1} interrupted!",
    41                             new Object[] { getClass().getSimpleName(), bounds });
     43                            new Object[] {getClass().getSimpleName(), bounds});
    4244                    return;
    4345                }
     
    4749            }
    4850        } catch (IOException e) {
    49             String message = "Could not read from URL " + nextURL + "!";
     51            String message = tr("Could not read from URL %s!", nextURL);
    5052            LOGGER.log(Logging.LEVEL_WARN, message, e);
    5153            if (!GraphicsEnvironment.isHeadless()) {
     
    5658    }
    5759
    58     public abstract void run(final URLConnection connection) throws IOException;
     60    public abstract void run(URLConnection connection) throws IOException;
    5961}
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/io/download/SequenceDownloadRunnable.java

    r36483 r36488  
    7474            final long endTime = System.currentTimeMillis();
    7575            LOG.log(Level.INFO, "Successfully loaded {0} Microsoft Streetside images in {1} seconds.",
    76                     new Object[] { this.images.size(), (endTime - startTime) / 1000 });
     76                    new Object[] {this.images.size(), (endTime - startTime) / 1000});
    7777        } catch (DateTimeParseException dateTimeParseException) {
    7878            // Added to debug #23658 -- a valid date string caused an exception
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/mode/AbstractMode.java

    r36483 r36488  
    6262    }
    6363
    64     private static class SemiautomaticThread extends Thread {
     64    private static final class SemiautomaticThread extends Thread {
    6565
    6666        /**
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/mode/SelectMode.java

    r36483 r36488  
    5151            if (closestTemp != null && !imageHighlighted) {
    5252                if (MainApplication.getMap().mapMode != null) {
    53                     MainApplication.getMap().mapMode.putValue("active", Boolean.FALSE);
     53                    MainApplication.getMap().mapMode.putValue("active", false);
    5454                }
    5555                imageHighlighted = true;
    5656            } else if (closestTemp == null && imageHighlighted && nothingHighlighted) {
    5757                if (MainApplication.getMap().mapMode != null) {
    58                     MainApplication.getMap().mapMode.putValue("active", Boolean.TRUE);
     58                    MainApplication.getMap().mapMode.putValue("active", true);
    5959                }
    6060                nothingHighlighted = false;
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/ImageUtil.java

    r36483 r36488  
    3030    public static ImageIcon scaleImageIcon(final ImageIcon icon, int size) {
    3131        if (Boolean.TRUE.equals(StreetsideProperties.DEBUGING_ENABLED.get())) {
    32             LOGGER.log(Logging.LEVEL_DEBUG, "Scale icon {0} → {1}", new Object[] { icon.getIconWidth(), size });
     32            LOGGER.log(Logging.LEVEL_DEBUG, "Scale icon {0} → {1}", new Object[] {icon.getIconWidth(), size});
    3333        }
    3434        return new ImageIcon(
  • applications/editors/josm/plugins/MicrosoftStreetside/test

    • Property svn:ignore
      •  

        old new  
        22report
        33*.exec
         4config
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/StreetsideLayerTest.java

    r36228 r36488  
    5050    }
    5151
    52     @DisabledIf(value = "java.awt.GraphicsEnvironment#isHeadless", disabledReason = "Listener for destruction is only registered in non-headless environments")
     52    @DisabledIf(value = "java.awt.GraphicsEnvironment#isHeadless",
     53        disabledReason = "Listener for destruction is only registered in non-headless environments")
    5354    @Test
    5455    void testClearInstance() {
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/utils/StreetsideURLTest.java

    r36228 r36488  
    6767        method.setAccessible(true);
    6868        // this simply invokes string2URL("malformed URL")
    69         Assertions.assertNull(method.invoke(null, (Object) new String[] { "malformed URL" }));
     69        Assertions.assertNull(method.invoke(null, (Object) new String[] {"malformed URL"}));
    7070        // invokes string2URL(null)
    7171        Assertions.assertNull(method.invoke(null, (Object) null));
  • applications/editors/josm/plugins/MicrosoftStreetside/test/unit/org/openstreetmap/josm/plugins/streetside/utils/TestUtil.java

    r36487 r36488  
    9595                lon, 268.811, 1.395, -4.875, Instant.ofEpochMilli(1614556800000L), Instant.ofEpochMilli(1614643199999L),
    9696                "https://dev.virtualearth.net/Branding/logo_powered_by.png",
    97                 "Copyright © 2024 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.",
     97                "Copyright © 2024 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the "
     98                + "content and any results may not be used, reproduced or transmitted in any manner without express "
     99                + "written permission from Microsoft Corporation.",
    98100                1, 3, 256, 256, Arrays.asList("t0", "t1", "t2", "t3"));
    99101    }
  • applications/editors/josm/plugins/build-common.xml

    r36486 r36488  
    601601        <delete dir="../00_core_test_config/unit-josm.home/cache" failonerror="false"/>
    602602    </target>
    603     <target name="test-compile" depends="test-init,dist" if="test.present" unless="skip-test">
     603    <target name="test-compile" depends="test-init,dist,plugin-classpath-actual" if="test.present" unless="skip-test">
    604604        <sequential>
    605605            <javac debug="on" includeantruntime="false" srcdir="${plugin.test.dir}/unit" destdir="${plugin.test.dir}/build/unit" encoding="UTF-8"
     
    608608                    <fileset refid="plugin.requires.jars"/>
    609609                    <path refid="test.classpath"/>
     610                    <path refid="plugin.classpath.actual"/>
    610611                </classpath>
    611612                <compilerarg value="-Xlint:all"/>
  • applications/editors/josm/plugins/javafx

    • Property svn:ignore
      •  

        old new  
        55lib
        66checkstyle-josm-javafx.xml
         7target
  • applications/editors/josm/plugins/terracer

    • Property svn:ignore
      •  

        old new  
        33findbugs-josm-terracer.xml
        44javadoc
         5target
Note: See TracChangeset for help on using the changeset viewer.