Index: trunk/build.xml
===================================================================
--- trunk/build.xml (revision 10658)
+++ trunk/build.xml (revision 10659)
@@ -265,4 +265,5 @@
+
@@ -286,4 +287,5 @@
+
Index: trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java (revision 10659)
@@ -13,4 +13,5 @@
import java.util.LinkedList;
import java.util.List;
+import java.util.Objects;
import java.util.Set;
@@ -313,9 +314,9 @@
Node lastNode = null;
Way lastWay = null;
- while (firstNode != lastNode) {
+ while (!Objects.equals(firstNode, lastNode)) {
if (lastNode == null) lastNode = firstNode;
for (Way way: ways) {
- if (way == lastWay) continue;
- if (way.firstNode() == lastNode) {
+ if (Objects.equals(way, lastWay)) continue;
+ if (Objects.equals(way.firstNode(), lastNode)) {
List wayNodes = way.getNodes();
for (int i = 0; i < wayNodes.size() - 1; i++) {
@@ -326,5 +327,5 @@
break;
}
- if (way.lastNode() == lastNode) {
+ if (Objects.equals(way.lastNode(), lastNode)) {
List wayNodes = way.getNodes();
for (int i = wayNodes.size() - 1; i > 0; i--) {
@@ -394,5 +395,5 @@
if (way.isFirstLastNode(node)) continue;
for (Way wayOther: ways) {
- if (way == wayOther) continue;
+ if (Objects.equals(way, wayOther)) continue;
if (node.getReferrers().contains(wayOther)) return false;
}
@@ -407,5 +408,5 @@
for (Way w: ways) {
if (w.isClosed()) return ways.size() == 1;
- if (w == currentWay) continue;
+ if (Objects.equals(w, currentWay)) continue;
if (currentWay == null) {
nextWay = w;
@@ -414,10 +415,10 @@
break;
}
- if (w.firstNode() == endNode) {
+ if (Objects.equals(w.firstNode(), endNode)) {
nextWay = w;
endNode = w.lastNode();
break;
}
- if (w.lastNode() == endNode) {
+ if (Objects.equals(w.lastNode(), endNode)) {
nextWay = w;
endNode = w.firstNode();
@@ -428,5 +429,5 @@
used += 1;
currentWay = nextWay;
- if (endNode == startNode) return used == ways.size();
+ if (Objects.equals(endNode, startNode)) return used == ways.size();
}
}
Index: trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java (revision 10659)
@@ -295,9 +295,9 @@
public boolean isSuccessorOf(NodePair other) {
- return other.getB() == a;
+ return Objects.equals(other.getB(), a);
}
public boolean isPredecessorOf(NodePair other) {
- return b == other.getA();
+ return Objects.equals(b, other.getA());
}
@@ -323,5 +323,5 @@
*/
public boolean contains(Node n) {
- return a == n || b == n;
+ return Objects.equals(a, n) || Objects.equals(b, n);
}
@@ -337,5 +337,5 @@
NodePair nodePair = (NodePair) obj;
return Objects.equals(a, nodePair.a) &&
- Objects.equals(b, nodePair.b);
+ Objects.equals(b, nodePair.b);
}
}
Index: trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java (revision 10659)
@@ -14,4 +14,5 @@
import java.util.LinkedList;
import java.util.List;
+import java.util.Objects;
import java.util.Set;
@@ -243,8 +244,8 @@
} else {
// Simplify segment
- if (simplifiedNodes.isEmpty() || simplifiedNodes.get(simplifiedNodes.size()-1) != fromN) {
+ if (simplifiedNodes.isEmpty() || !Objects.equals(simplifiedNodes.get(simplifiedNodes.size()-1), fromN)) {
simplifiedNodes.add(fromN);
}
- if (fromN != toN) {
+ if (!Objects.equals(fromN, toN)) {
simplifiedNodes.add(toN);
}
Index: trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java (revision 10659)
@@ -18,4 +18,5 @@
import java.util.LinkedList;
import java.util.List;
+import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
@@ -444,5 +445,5 @@
if (wayChunks.size() < 2) {
- if (wayChunks.get(0).get(0) == wayChunks.get(0).get(wayChunks.get(0).size() - 1)) {
+ if (Objects.equals(wayChunks.get(0).get(0), wayChunks.get(0).get(wayChunks.get(0).size() - 1))) {
new Notification(
tr("You must select two or more nodes to split a circular way."))
@@ -569,5 +570,5 @@
List relationMembers = r.getMembers();
for (RelationMember rm: relationMembers) {
- if (rm.isWay() && rm.getMember() == way) {
+ if (rm.isWay() && Objects.equals(rm.getMember(), way)) {
boolean insert = true;
if ("restriction".equals(type) || "destination_sign".equals(type)) {
@@ -630,7 +631,7 @@
if ((ir - k >= 0) && relationMembers.get(ir - k).isWay()) {
Way w = relationMembers.get(ir - k).getWay();
- if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) {
+ if (Objects.equals(w.lastNode(), way.firstNode()) || Objects.equals(w.firstNode(), way.firstNode())) {
backwards = Boolean.FALSE;
- } else if ((w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) {
+ } else if (Objects.equals(w.firstNode(), way.lastNode()) || Objects.equals(w.lastNode(), way.lastNode())) {
backwards = Boolean.TRUE;
}
@@ -639,7 +640,7 @@
if ((ir + k < relationMembers.size()) && relationMembers.get(ir + k).isWay()) {
Way w = relationMembers.get(ir + k).getWay();
- if ((w.lastNode() == way.firstNode()) || w.firstNode() == way.firstNode()) {
+ if (Objects.equals(w.lastNode(), way.firstNode()) || Objects.equals(w.firstNode(), way.firstNode())) {
backwards = Boolean.TRUE;
- } else if ((w.firstNode() == way.lastNode()) || w.lastNode() == way.lastNode()) {
+ } else if (Objects.equals(w.firstNode(), way.lastNode()) || Objects.equals(w.lastNode(), way.lastNode())) {
backwards = Boolean.FALSE;
}
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java (revision 10659)
@@ -28,4 +28,5 @@
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
@@ -526,5 +527,5 @@
// User clicked last node again, finish way
- if (n0 == n) {
+ if (Objects.equals(n0, n)) {
finishDrawing();
return;
@@ -575,5 +576,5 @@
// Add new node to way
- if (way.getNode(way.getNodesCount() - 1) == n0) {
+ if (Objects.equals(way.getNode(way.getNodesCount() - 1), n0)) {
way.addNode(n);
} else {
@@ -817,7 +818,6 @@
}
- if (getCurrentBaseNode() == null || getCurrentBaseNode() == currentMouseNode)
+ if (getCurrentBaseNode() == null || getCurrentBaseNode().equals(currentMouseNode))
return; // Don't create zero length way segments.
-
double curHdg = Math.toDegrees(getCurrentBaseNode().getEastNorth()
@@ -904,8 +904,8 @@
private void continueWayFromNode(Way way, Node node) {
int n = way.getNodesCount();
- if (node == way.firstNode()) {
+ if (Objects.equals(node, way.firstNode())) {
currentBaseNode = node;
if (n > 1) previousNode = way.getNode(1);
- } else if (node == way.lastNode()) {
+ } else if (Objects.equals(node, way.lastNode())) {
currentBaseNode = node;
if (n > 1) previousNode = way.getNode(n-2);
@@ -944,5 +944,5 @@
Node firstNode = w.getNode(0);
Node lastNode = w.getNode(w.getNodesCount() - 1);
- if ((firstNode == n || lastNode == n) && (firstNode != lastNode)) {
+ if ((Objects.equals(firstNode, n) || Objects.equals(lastNode, n)) && !Objects.equals(firstNode, lastNode)) {
if (way != null)
return null;
Index: trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java (revision 10659)
@@ -48,9 +48,9 @@
public boolean isMatchingMy(OsmPrimitive my) {
- return this.my == my;
+ return Objects.equals(this.my, my);
}
public boolean isMatchingTheir(OsmPrimitive their) {
- return this.their == their;
+ return Objects.equals(this.their, their);
}
Index: trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java (revision 10659)
@@ -334,5 +334,5 @@
*/
public String getUniqueId(ImageryInfo info) {
- if (info.getId() != null && layerIds.get(info.getId()) == info) {
+ if (info.getId() != null && info.equals(layerIds.get(info.getId()))) {
return info.getId();
}
Index: trunk/src/org/openstreetmap/josm/gui/MapMover.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapMover.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/gui/MapMover.java (revision 10659)
@@ -194,5 +194,5 @@
@Override
public void mouseReleased(MouseEvent e) {
- if (e.getButton() == MouseEvent.BUTTON3 || Main.isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1) {
+ if (e.getButton() == MouseEvent.BUTTON3 || (Main.isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1)) {
endMovement();
}
Index: trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/SelectionManager.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/gui/SelectionManager.java (revision 10659)
@@ -92,5 +92,5 @@
@Override
public void paint(Graphics2D g, MapView mv, Bounds bbox) {
- if (mousePos == null || mousePosStart == null || mousePos == mousePosStart)
+ if (mousePos == null || mousePosStart == null || mousePos.equals(mousePosStart))
return;
Color color = Utils.complement(PaintColors.getBackgroundColor());
@@ -279,5 +279,5 @@
private boolean isNoSelection() {
- return mousePos == null || mousePosStart == null || mousePos == mousePosStart;
+ return mousePos == null || mousePosStart == null || mousePos.equals(mousePosStart);
}
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java (revision 10659)
@@ -692,5 +692,5 @@
int i = 1;
for (RelationMember m : r.getMembers()) {
- if (m.getMember() == primitive) {
+ if (primitive.equals(m.getMember())) {
mi.add(m, i);
}
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java (revision 10659)
@@ -678,5 +678,5 @@
for (int i = 0; i < tagData.getRowCount(); ++i) {
if (item.getValue().equals(tagData.getValueAt(i, 0) /* sic! do not use getDataKey*/)) {
- if (itemToSelect == item) {
+ if (item.equals(itemToSelect)) {
itemToSelect = null;
}
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java (revision 10659)
@@ -482,5 +482,5 @@
}
Color customColoringTransparent = hdopAlpha < 0 ? trkPnt.customColoring :
- new Color(trkPnt.customColoring.getRGB() & 0x00ffffff | hdopAlpha << 24, true);
+ new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (hdopAlpha << 24), true);
g.setColor(customColoringTransparent);
// hdop circles
@@ -494,5 +494,5 @@
if (trkPnt.customColoring != null) {
Color customColoringTransparent = largePointAlpha < 0 ? trkPnt.customColoring :
- new Color(trkPnt.customColoring.getRGB() & 0x00ffffff | largePointAlpha << 24, true);
+ new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (largePointAlpha << 24), true);
g.setColor(customColoringTransparent);
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java (revision 10659)
@@ -513,5 +513,5 @@
@Override
public boolean applies(Environment env) {
- return env != null && env.getCascade(env.layer) != null && not ^ env.getCascade(env.layer).containsKey(id);
+ return env != null && env.getCascade(env.layer) != null && (not ^ env.getCascade(env.layer).containsKey(id));
}
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java (revision 10659)
@@ -189,5 +189,5 @@
}
- private abstract class AbstractFinder extends AbstractVisitor {
+ private abstract static class AbstractFinder extends AbstractVisitor {
protected final Environment e;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java (revision 10659)
@@ -27,4 +27,5 @@
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
@@ -659,5 +660,5 @@
@Override
public boolean isDataFlavorSupported(DataFlavor flavor) {
- return flavors[0] == flavor;
+ return Objects.equals(flavors[0], flavor);
}
}
Index: trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java (revision 10659)
@@ -7,4 +7,5 @@
import java.io.IOException;
import java.net.URL;
+import java.util.Objects;
import javax.sound.sampled.AudioFormat;
@@ -297,5 +298,5 @@
double offset = command.offset();
speed = command.speed();
- if (playingUrl != command.url() ||
+ if (!Objects.equals(playingUrl, command.url()) ||
stateChange != State.PAUSED ||
offset != 0) {
Index: trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java (revision 10658)
+++ trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java (revision 10659)
@@ -147,5 +147,5 @@
}
for (OsmPrimitive o: rhs.getPrimitives(root)) {
- if (condition == null || condition.match(o) && !result.contains(o)) {
+ if (condition == null || (condition.match(o) && !result.contains(o))) {
result.add(o);
}