Changeset 10634 in josm for trunk/src


Ignore:
Timestamp:
2016-07-25T09:15:56+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - pmd:UselessQualifiedThis - Useless qualified this usage in the same class

Location:
trunk/src/org/openstreetmap/josm
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r10601 r10634  
    5858            new ImageProvider(icon).setOptional(true).getInBackground((ImageResource result) -> {
    5959                if (result != null) {
    60                     GuiHelper.runInEDT(() -> result.attachImageIcon(AddImageryLayerAction.this));
     60                    GuiHelper.runInEDT(() -> result.attachImageIcon(this));
    6161                }
    6262            });
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java

    r10608 r10634  
    362362     */
    363363    public Iterable<Collection<WayPoint>> getLinesIterable(final boolean[] trackVisibility) {
    364         return () -> new LinesIterator(GpxData.this, trackVisibility);
     364        return () -> new LinesIterator(this, trackVisibility);
    365365    }
    366366
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r10611 r10634  
    632632    public String formatAsHtmlUnorderedList(Collection<? extends OsmPrimitive> primitives, int maxElements) {
    633633        final Collection<String> displayNames = Utils.transform(primitives,
    634                 (Function<OsmPrimitive, String>) x -> x.getDisplayName(DefaultNameFormatter.this));
     634                (Function<OsmPrimitive, String>) x -> x.getDisplayName(this));
    635635        return Utils.joinAsHtmlUnorderedList(Utils.limit(displayNames, maxElements, "..."));
    636636    }
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r10627 r10634  
    143143                    content = new MotdContent().updateIfRequiredString();
    144144                    contentInitialized = true;
    145                     ProxyPreference.removeProxyPreferenceListener(GettingStarted.this);
     145                    ProxyPreference.removeProxyPreferenceListener(this);
    146146                } catch (IOException ex) {
    147147                    Main.warn(ex, tr("Failed to read MOTD. Exception was: {0}", ex.toString()));
     
    149149                            + "</h1>\n<h2 align=\"center\">(" + tr("Message of the day not available") + ")</h2></html>";
    150150                    // In case of MOTD not loaded because of proxy error, listen to preference changes to retry after update
    151                     ProxyPreference.addProxyPreferenceListener(GettingStarted.this);
     151                    ProxyPreference.addProxyPreferenceListener(this);
    152152                }
    153153            }
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r10627 r10634  
    572572        }
    573573
    574         for (JComponent c : getMapNavigationComponents(MapView.this)) {
     574        for (JComponent c : getMapNavigationComponents(this)) {
    575575            add(c);
    576576        }
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r10611 r10634  
    8888        MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().lock();
    8989        try {
    90             return !MapPaintStyles.getStyles().get(prim, getDist100Pixel(), NavigatableComponent.this).isEmpty();
     90            return !MapPaintStyles.getStyles().get(prim, getDist100Pixel(), this).isEmpty();
    9191        } finally {
    9292            MapCSSStyleSource.STYLE_SOURCE_LOCK.readLock().unlock();
  • trunk/src/org/openstreetmap/josm/gui/ScrollViewport.java

    r10611 r10634  
    6868    private final List<JButton> buttons = new ArrayList<>();
    6969
    70     private final Timer timer = new Timer(100, evt -> ScrollViewport.this.scroll());
     70    private final Timer timer = new Timer(100, evt -> scroll());
    7171
    7272    private int scrollDirection = NO_SCROLL;
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java

    r10611 r10634  
    113113            Bookmark b = bookmarks.getSelectedValue();
    114114            if (b != null && gui != null) {
    115                 gui.boundingBoxChanged(b.getArea(), BookmarkSelection.this);
     115                gui.boundingBoxChanged(b.getArea(), this);
    116116            }
    117117        });
  • trunk/src/org/openstreetmap/josm/gui/history/VersionTable.java

    r10611 r10634  
    9292        });
    9393        getModel().addTableModelListener(e -> {
    94             adjustColumnWidth(VersionTable.this, 0, 0);
    95             adjustColumnWidth(VersionTable.this, 1, -8);
    96             adjustColumnWidth(VersionTable.this, 2, -8);
    97             adjustColumnWidth(VersionTable.this, 3, 0);
    98             adjustColumnWidth(VersionTable.this, 4, 0);
     94            adjustColumnWidth(this, 0, 0);
     95            adjustColumnWidth(this, 1, -8);
     96            adjustColumnWidth(this, 2, -8);
     97            adjustColumnWidth(this, 3, 0);
     98            adjustColumnWidth(this, 4, 0);
    9999        });
    100100    }
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r10626 r10634  
    675675
    676676        event.getMapView().addMouseListener(adapter);
    677         MapView.addZoomChangeListener(AbstractTileSourceLayer.this);
     677        MapView.addZoomChangeListener(this);
    678678
    679679        if (this instanceof NativeScaleLayer) {
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r10611 r10634  
    7575        return getTileSourceStatic(info, () -> {
    7676            Main.debug("Attribution loaded, running loadAllErrorTiles");
    77             TMSLayer.this.loadAllErrorTiles(false);
     77            this.loadAllErrorTiles(false);
    7878        });
    7979    }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

    r10627 r10634  
    434434                    if (selected.equals(data.get(i))) {
    435435                        currentPhoto = i;
    436                         ImageViewerDialog.showImage(GeoImageLayer.this, data.get(i));
     436                        ImageViewerDialog.showImage(this, data.get(i));
    437437                        break;
    438438                    }
     
    889889
    890890        Main.getLayerManager().addActiveLayerChangeListener(e -> {
    891             if (Main.getLayerManager().getActiveLayer() == GeoImageLayer.this) {
     891            if (Main.getLayerManager().getActiveLayer() == this) {
    892892                // only in select mode it is possible to click the images
    893893                Main.map.selectSelectTool(false);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java

    r10611 r10634  
    100100                .setOptional(true)
    101101                .getInBackground((ImageCallback) result -> {
    102                     synchronized (MapImage.this) {
     102                    synchronized (this) {
    103103                        if (result == null) {
    104104                            source.logWarning(tr("Failed to locate image ''{0}''", name));
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r10626 r10634  
    17201720        tab.getTabPane().addChangeListener(e -> {
    17211721            if (tab.getTabPane().getSelectedComponent() == component) {
    1722                 SourceEditor.this.initiallyLoadAvailableSources();
     1722                initiallyLoadAvailableSources();
    17231723            }
    17241724        });
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java

    r10611 r10634  
    9090                if ((incomingData.startsWith("<html>") || incomingData.startsWith("<HTML>"))
    9191                  && (incomingData.endsWith("</html>") || incomingData.endsWith("</HTML>"))) {
    92                     GuiHelper.notifyUserHtmlError(AddWMSLayerPanel.this, title, message, incomingData);
     92                    GuiHelper.notifyUserHtmlError(this, title, message, incomingData);
    9393                } else {
    9494                    if (ex3.getMessage() != null) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CommonSettingsPanel.java

    r10611 r10634  
    5757            JColorChooser chooser = new JColorChooser(btnFadeColor.getBackground());
    5858            int answer = JOptionPane.showConfirmDialog(
    59                     CommonSettingsPanel.this, chooser,
     59                    this, chooser,
    6060                    tr("Choose a color for {0}", tr("imagery fade")),
    6161                    JOptionPane.OK_CANCEL_OPTION,
  • trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java

    r10611 r10634  
    166166    public void doBeginTask() {
    167167        doInEDT(() -> {
    168             Main.currentProgressMonitor = PleaseWaitProgressMonitor.this;
     168            Main.currentProgressMonitor = this;
    169169            if (GraphicsEnvironment.isHeadless()) {
    170170                return;
     
    296296        doInEDT(() -> {
    297297            if (dialog != null) {
    298                 dialog.setInBackgroundPossible(PleaseWaitProgressMonitor.this.taskId != null && Main.isDisplayingMapView());
     298                dialog.setInBackgroundPossible(taskId != null && Main.isDisplayingMapView());
    299299                reset();
    300300                getDialog();
     
    308308        doInEDT(() -> {
    309309            if (dialog != null) {
    310                 dialog.setInBackgroundPossible(PleaseWaitProgressMonitor.this.taskId != null && Main.isDisplayingMapView());
     310                dialog.setInBackgroundPossible(taskId != null && Main.isDisplayingMapView());
    311311            }
    312312        });
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r10611 r10634  
    206206        imgProv.getInBackground((ImageResourceCallback) result -> {
    207207            if (result != null) {
    208                 GuiHelper.runInEDT(() -> result.attachImageIcon(TaggingPreset.this));
     208                GuiHelper.runInEDT(() -> result.attachImageIcon(this));
    209209            } else {
    210                 Main.warn(TaggingPreset.this + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName);
     210                Main.warn(toString() + ": " + PRESET_ICON_ERROR_MSG_PREFIX + iconName);
    211211            }
    212212        });
Note: See TracChangeset for help on using the changeset viewer.