Changeset 6990 in josm
- Timestamp:
- 2014-04-19T00:36:43+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r6979 r6990 1056 1056 } else if (os.toLowerCase().startsWith("windows")) { 1057 1057 platform = new PlatformHookWindows(); 1058 } else if ( os.equals("Linux") || os.equals("Solaris") ||1059 os.equals("SunOS") || os.equals("AIX") ||1060 os.equals("FreeBSD") || os.equals("NetBSD") || os.equals("OpenBSD")) {1058 } else if ("Linux".equals(os) || "Solaris".equals(os) || 1059 "SunOS".equals(os) || "AIX".equals(os) || 1060 "FreeBSD".equals(os) || "NetBSD".equals(os) || "OpenBSD".equals(os)) { 1061 1061 platform = new PlatformHookUnixoid(); 1062 1062 } else if (os.toLowerCase().startsWith("mac os x")) { -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r6920 r6990 81 81 String[] table = url.split("\\?|=|&"); 82 82 for (int i = 0; i<table.length; i++) { 83 if ( table[i].equals("bbox") && i<table.length-1 )83 if ("bbox".equals(table[i]) && i<table.length-1 ) 84 84 return download(newLayer, new Bounds(table[i+1], ",", ParseMethod.LEFT_BOTTOM_RIGHT_TOP), progressMonitor); 85 85 } -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r6883 r6990 502 502 String mv = null; 503 503 504 if ( key.equals("timestamp")) {504 if ("timestamp".equals(key)) { 505 505 mv = DateUtils.fromDate(osm.getTimestamp()); 506 506 } else { … … 603 603 } 604 604 605 if (regexp && key.length() > 0 && ! key.equals("*")) {605 if (regexp && key.length() > 0 && !"*".equals(key)) { 606 606 try { 607 607 keyPattern = Pattern.compile(key, regexFlags(false)); … … 614 614 keyPattern = null; 615 615 } 616 if (regexp && this.value.length() > 0 && ! this.value.equals("*")) {616 if (regexp && this.value.length() > 0 && !"*".equals(this.value)) { 617 617 try { 618 618 valuePattern = Pattern.compile(this.value, regexFlags(false)); … … 769 769 private String user; 770 770 public UserMatch(String user) { 771 if ( user.equals("anonymous")) {771 if ("anonymous".equals(user)) { 772 772 this.user = null; 773 773 } else { … … 1314 1314 value = ""; 1315 1315 } 1316 if ( key.equals("type"))1316 if ("type".equals(key)) 1317 1317 return new ExactType(value); 1318 else if ( key.equals("user"))1318 else if ("user".equals(key)) 1319 1319 return new UserMatch(value); 1320 else if ( key.equals("role"))1320 else if ("role".equals(key)) 1321 1321 return new RoleMatch(value); 1322 1322 else -
trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java
r6987 r6990 191 191 String sign = matcher.group(1); 192 192 String rest = matcher.group(2); 193 sign = sign.equals("-") ? "" : "-";193 sign = "-".equals(sign) ? "" : "-"; 194 194 return sign + rest; 195 195 } -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r6986 r6990 1365 1365 int event = parser.next(); 1366 1366 if (event == XMLStreamConstants.START_ELEMENT) { 1367 if (parser.getLocalName().equals("tag")) { 1367 String localName = parser.getLocalName(); 1368 if ("tag".equals(localName)) { 1368 1369 settingsMap.put(parser.getAttributeValue(null, "key"), new StringSetting(parser.getAttributeValue(null, "value"))); 1369 1370 jumpToEnd(); 1370 } else if ( parser.getLocalName().equals("list") ||1371 parser.getLocalName().equals("collection") ||1372 parser.getLocalName().equals("lists") ||1373 parser.getLocalName().equals("maps")1371 } else if ("list".equals(localName) || 1372 "collection".equals(localName) || 1373 "lists".equals(localName) || 1374 "maps".equals(localName) 1374 1375 ) { 1375 1376 parseToplevelList(); 1376 1377 } else { 1377 throwException("Unexpected element: "+ parser.getLocalName());1378 throwException("Unexpected element: "+localName); 1378 1379 } 1379 1380 } else if (event == XMLStreamConstants.END_ELEMENT) { … … 1404 1405 int event = parser.next(); 1405 1406 if (event == XMLStreamConstants.START_ELEMENT) { 1406 if (parser.getLocalName().equals("entry")) { 1407 String localName = parser.getLocalName(); 1408 if ("entry".equals(localName)) { 1407 1409 if (entries == null) { 1408 1410 entries = new ArrayList<String>(); … … 1410 1412 entries.add(parser.getAttributeValue(null, "value")); 1411 1413 jumpToEnd(); 1412 } else if ( parser.getLocalName().equals("list")) {1414 } else if ("list".equals(localName)) { 1413 1415 if (lists == null) { 1414 1416 lists = new ArrayList<List<String>>(); 1415 1417 } 1416 1418 lists.add(parseInnerList()); 1417 } else if ( parser.getLocalName().equals("map")) {1419 } else if ("map".equals(localName)) { 1418 1420 if (maps == null) { 1419 1421 maps = new ArrayList<Map<String, String>>(); … … 1421 1423 maps.add(parseMap()); 1422 1424 } else { 1423 throwException("Unexpected element: "+ parser.getLocalName());1425 throwException("Unexpected element: "+localName); 1424 1426 } 1425 1427 } else if (event == XMLStreamConstants.END_ELEMENT) { … … 1434 1436 settingsMap.put(key, new MapListSetting(Collections.unmodifiableList(maps))); 1435 1437 } else { 1436 if ( name.equals("lists")) {1438 if ("lists".equals(name)) { 1437 1439 settingsMap.put(key, new ListListSetting(Collections.<List<String>>emptyList())); 1438 } else if ( name.equals("maps")) {1440 } else if ("maps".equals(name)) { 1439 1441 settingsMap.put(key, new MapListSetting(Collections.<Map<String, String>>emptyList())); 1440 1442 } else { … … 1449 1451 int event = parser.next(); 1450 1452 if (event == XMLStreamConstants.START_ELEMENT) { 1451 if ( parser.getLocalName().equals("entry")) {1453 if ("entry".equals(parser.getLocalName())) { 1452 1454 entries.add(parser.getAttributeValue(null, "value")); 1453 1455 jumpToEnd(); … … 1467 1469 int event = parser.next(); 1468 1470 if (event == XMLStreamConstants.START_ELEMENT) { 1469 if ( parser.getLocalName().equals("tag")) {1471 if ("tag".equals(parser.getLocalName())) { 1470 1472 map.put(parser.getAttributeValue(null, "key"), parser.getAttributeValue(null, "value")); 1471 1473 jumpToEnd(); … … 1500 1502 @Override 1501 1503 public void visit(StringSetting setting) { 1502 if (noPassword && key.equals("osm-server.password"))1504 if (noPassword && "osm-server.password".equals(key)) 1503 1505 return; // do not store plain password. 1504 1506 /* don't save default values */ -
trunk/src/org/openstreetmap/josm/data/Version.java
r6889 r6990 131 131 isLocalBuild = false; 132 132 value = properties.get("Is-Local-Build"); 133 if (value != null && value.trim().equalsIgnoreCase("true")) {133 if (value != null && "true".equalsIgnoreCase(value.trim())) { 134 134 isLocalBuild = true; 135 135 } -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r6920 r6990 136 136 String sSeconds = cDmsSecondFormatter.format(tSeconds); 137 137 138 if ( sSeconds.equals(cDms60)) {138 if (cDms60.equals(sSeconds)) { 139 139 sSeconds = cDms00; 140 140 sMinutes = cDmsMinuteFormatter.format(tMinutes+1); 141 141 } 142 if ( sMinutes.equals("60")) {142 if ("60".equals(sMinutes)) { 143 143 sMinutes = "00"; 144 144 sDegrees = Integer.toString(tDegree+1); -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r6968 r6990 765 765 public void setAttribution(AbstractTileSource s) { 766 766 if (attributionText != null) { 767 if ( attributionText.equals("osm")) {767 if ("osm".equals(attributionText)) { 768 768 s.setAttributionText(new Mapnik().getAttributionText(0, null, null)); 769 769 } else { … … 772 772 } 773 773 if (attributionLinkURL != null) { 774 if ( attributionLinkURL.equals("osm")) {774 if ("osm".equals(attributionLinkURL)) { 775 775 s.setAttributionLinkURL(new Mapnik().getAttributionLinkURL()); 776 776 } else { … … 791 791 } 792 792 if (termsOfUseURL != null) { 793 if ( termsOfUseURL.equals("osm")) {793 if ("osm".equals(termsOfUseURL)) { 794 794 s.setTermsOfUseURL(new Mapnik().getTermsOfUseURL()); 795 795 } else { -
trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java
r6889 r6990 175 175 } 176 176 177 /** 178 * Replies the list of open changesets. 179 * @return The list of open changesets 180 */ 177 181 public List<Changeset> getOpenChangesets() { 178 182 List<Changeset> ret = new ArrayList<Changeset>(); … … 190 194 @Override 191 195 public void preferenceChanged(PreferenceChangeEvent e) { 192 if (e.getKey() == null || ! e.getKey().equals("osm-server.url"))196 if (e.getKey() == null || !"osm-server.url".equals(e.getKey())) 193 197 return; 194 198 -
trunk/src/org/openstreetmap/josm/data/osm/TigerUtils.java
r6380 r6990 28 28 } 29 29 30 /** 31 * Determines if the given key denotes an integer value. 32 * @param name The key to determine 33 * @return {@code true} if the given key denotes an integer value 34 */ 30 35 public static boolean tagIsInt(String name) { 31 if ( name.equals("tiger:tlid"))36 if ("tiger:tlid".equals(name)) 32 37 return true; 33 38 return false; -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r6890 r6990 173 173 String key = m.group(1); 174 174 // alias 175 if ( key.equals("k")) {175 if ("k".equals(key)) { 176 176 key = Param.k_0.key; 177 177 } … … 181 181 // some aliases 182 182 if (key.equals(Param.proj.key)) { 183 if ( value.equals("longlat") || value.equals("latlon") || value.equals("latlong")) {183 if ("longlat".equals(value) || "latlon".equals(value) || "latlong".equals(value)) { 184 184 value = "lonlat"; 185 185 } … … 264 264 nadgridsId = nadgridsId.substring(1); 265 265 } 266 if ( nadgridsId.equals("null"))266 if ("null".equals(nadgridsId)) 267 267 return new NullDatum(null, ellps); 268 268 NTV2GridShiftFileWrapper nadgrids = Projections.getNTV2Grid(nadgridsId); -
trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java
r6830 r6990 169 169 HashMap<String, List<NTV2SubGrid>> subGridMap = new HashMap<String, List<NTV2SubGrid>>(); 170 170 for (int i = 0; i < subGrid.length; i++) { 171 if ( subGrid[i].getParentSubGridName().equalsIgnoreCase("NONE")) {171 if ("NONE".equalsIgnoreCase(subGrid[i].getParentSubGridName())) { 172 172 topLevelCount++; 173 173 } … … 177 177 topLevelCount = 0; 178 178 for (int i = 0; i < subGrid.length; i++) { 179 if ( subGrid[i].getParentSubGridName().equalsIgnoreCase("NONE")) {179 if ("NONE".equalsIgnoreCase(subGrid[i].getParentSubGridName())) { 180 180 topLevelSubGrid[topLevelCount++] = subGrid[i]; 181 181 } else { -
trunk/src/org/openstreetmap/josm/data/validation/Test.java
r6623 r6990 327 327 protected static final boolean isBuilding(OsmPrimitive p) { 328 328 String v = p.get("building"); 329 return v != null && ! v.equals("no") && !v.equals("entrance");329 return v != null && !"no".equals(v) && !"entrance".equals(v); 330 330 } 331 331 } -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r6986 r6990 445 445 446 446 private String getNameTagValue(IRelation relation, String nameTag) { 447 if ( nameTag.equals("name")) {447 if ("name".equals(nameTag)) { 448 448 if (Main.pref.getBoolean("osm-primitives.localize-name", true)) 449 449 return relation.getLocalName(); 450 450 else 451 451 return relation.getName(); 452 } else if ( nameTag.equals(":LocationCode")) {452 } else if (":LocationCode".equals(nameTag)) { 453 453 for (String m : relation.keySet()) { 454 454 if (m.endsWith(nameTag)) -
trunk/src/org/openstreetmap/josm/gui/IconToggleButton.java
r6380 r6990 62 62 @Override 63 63 public void propertyChange(PropertyChangeEvent evt) { 64 if ( evt.getPropertyName().equals("active")) {64 if ("active".equals(evt.getPropertyName())) { 65 65 setSelected((Boolean)evt.getNewValue()); 66 66 requestFocusInWindow(); 67 } else if ( evt.getPropertyName().equals("selected")) {67 } else if ("selected".equals(evt.getPropertyName())) { 68 68 setSelected((Boolean)evt.getNewValue()); 69 69 } -
trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
r6889 r6990 21 21 22 22 /** 23 * JosmUser StateManager is a global object which keeps track of what JOSM knows about23 * JosmUserIdentityManager is a global object which keeps track of what JOSM knows about 24 24 * the identity of the current user. 25 25 * … … 37 37 * of the current user. 38 38 * 39 * The global JosmUser StateManager listens to {@link PreferenceChangeEvent}s and keeps track39 * The global JosmUserIdentityManager listens to {@link PreferenceChangeEvent}s and keeps track 40 40 * of what the current JOSM instance knows about the current user. Other subsystems can 41 * let the global JosmUser StateManager know in case they fully identify the current user, see41 * let the global JosmUserIdentityManager know in case they fully identify the current user, see 42 42 * {@link #setFullyIdentified}. 43 43 * 44 * The information kept by the JosmUser StateManager can be used to44 * The information kept by the JosmUserIdentityManager can be used to 45 45 * <ul> 46 46 * <li>safely query changesets owned by the current user based on its user id, not on its user name</li> … … 242 242 @Override 243 243 public void preferenceChanged(PreferenceChangeEvent evt) { 244 if ( evt.getKey().equals("osm-server.username")) {244 if ("osm-server.username".equals(evt.getKey())) { 245 245 if (!(evt.getNewValue() instanceof StringSetting)) return; 246 246 String newValue = ((StringSetting) evt.getNewValue()).getValue(); … … 254 254 return; 255 255 256 } else if ( evt.getKey().equals("osm-server.url")) {256 } else if ("osm-server.url".equals(evt.getKey())) { 257 257 if (!(evt.getNewValue() instanceof StringSetting)) return; 258 258 String newValue = ((StringSetting) evt.getNewValue()).getValue(); … … 263 263 } 264 264 265 } else if ( evt.getKey().equals("oauth.access-token.key")) {265 } else if ("oauth.access-token.key".equals(evt.getKey())) { 266 266 accessTokenKeyChanged = true; 267 267 268 } else if ( evt.getKey().equals("oauth.access-token.secret")) {268 } else if ("oauth.access-token.secret".equals(evt.getKey())) { 269 269 accessTokenSecretChanged = true; 270 270 } -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r6889 r6990 753 753 @Override 754 754 public void preferenceChanged(PreferenceChangeEvent e) { 755 if ( e.getKey().equals("audio.menuinvisible")) {755 if ("audio.menuinvisible".equals(e.getKey())) { 756 756 showAudioMenu(!Boolean.parseBoolean(e.getNewValue().toString())); 757 757 } -
trunk/src/org/openstreetmap/josm/gui/MapMover.java
r6989 r6990 41 41 @Override 42 42 public void actionPerformed(ActionEvent e) { 43 if ( action.equals(".") || action.equals(",")) {43 if (".".equals(action) || ",".equals(action)) { 44 44 Point mouse = nc.getMousePosition(); 45 45 if (mouse == null) 46 46 mouse = new Point((int)nc.getBounds().getCenterX(), (int)nc.getBounds().getCenterY()); 47 MouseWheelEvent we = new MouseWheelEvent(nc, e.getID(), e.getWhen(), e.getModifiers(), mouse.x, mouse.y, 0, false, MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, action.equals(",") ? -1 : 1); 47 MouseWheelEvent we = new MouseWheelEvent(nc, e.getID(), e.getWhen(), e.getModifiers(), mouse.x, mouse.y, 0, false, 48 MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, ",".equals(action) ? -1 : 1); 48 49 mouseWheelMoved(we); 49 50 } else { 50 51 EastNorth center = nc.getCenter(); 51 52 EastNorth newcenter = nc.getEastNorth(nc.getWidth()/2+nc.getWidth()/5, nc.getHeight()/2+nc.getHeight()/5); 52 if ( action.equals("left"))53 if ("left".equals(action)) 53 54 nc.zoomTo(new EastNorth(2*center.east()-newcenter.east(), center.north())); 54 else if ( action.equals("right"))55 else if ("right".equals(action)) 55 56 nc.zoomTo(new EastNorth(newcenter.east(), center.north())); 56 else if ( action.equals("up"))57 else if ("up".equals(action)) 57 58 nc.zoomTo(new EastNorth(center.east(), 2*center.north()-newcenter.north())); 58 else if ( action.equals("down"))59 else if ("down".equals(action)) 59 60 nc.zoomTo(new EastNorth(center.east(), newcenter.north())); 60 61 } -
trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
r6380 r6990 279 279 @Override 280 280 public void propertyChange(PropertyChangeEvent evt) { 281 if ( evt.getPropertyName().equals("active") && !(Boolean)evt.getNewValue() && mousePosStart != null) {281 if ("active".equals(evt.getPropertyName()) && !(Boolean)evt.getNewValue() && mousePosStart != null) { 282 282 paintRect(); 283 283 mousePosStart = null; -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r6753 r6990 363 363 sb.append("x"); // cardinal direction 364 364 String c = m.group(7).toUpperCase(); 365 if ( c.equals("N") || c.equals("S") || c.equals("E") || c.equals("W")) {365 if ("N".equals(c) || "S".equals(c) || "E".equals(c) || "W".equals(c)) { 366 366 list.add(c); 367 367 } else { … … 461 461 462 462 double coord = (coordDeg < 0 ? -1 : 1) * (Math.abs(coordDeg) + coordMin / 60 + coordSec / 3600); 463 coord = card.equals("N") || card.equals("E") ? coord : -coord;464 if ( card.equals("N") || card.equals("S")) {463 coord = "N".equals(card) || "E".equals(card) ? coord : -coord; 464 if ("N".equals(card) || "S".equals(card)) { 465 465 latLon.lat = coord; 466 466 } else { -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
r6890 r6990 362 362 String prefRoot = "changeset-query.advanced.open-restrictions"; 363 363 String v = Main.pref.get(prefRoot + ".query-type", "open"); 364 rbBoth.setSelected( v.equals("both"));365 rbOpenOnly.setSelected( v.equals("open"));366 rbClosedOnly.setSelected( v.equals("closed"));364 rbBoth.setSelected("both".equals(v)); 365 rbOpenOnly.setSelected("open".equals(v)); 366 rbClosedOnly.setSelected("closed".equals(v)); 367 367 } 368 368 } … … 599 599 String prefRoot = "changeset-query.advanced.user-restrictions"; 600 600 String v = Main.pref.get(prefRoot + ".query-type", "mine"); 601 if ( v.equals("mine")) {601 if ("mine".equals(v)) { 602 602 JosmUserIdentityManager im = JosmUserIdentityManager.getInstance(); 603 603 if (im.isAnonymous()) { … … 606 606 rbRestrictToMyself.setSelected(true); 607 607 } 608 } else if ( v.equals("uid")) {608 } else if ("uid".equals(v)) { 609 609 rbRestrictToUid.setSelected(true); 610 } else if ( v.equals("username")) {610 } else if ("username".equals(v)) { 611 611 rbRestrictToUserName.setSelected(true); 612 612 } … … 896 896 String prefRoot = "changeset-query.advanced.open-restrictions"; 897 897 String v = Main.pref.get(prefRoot + ".query-type", "closed-after"); 898 rbClosedAfter.setSelected( v.equals("closed-after"));899 rbClosedAfterAndCreatedBefore.setSelected( v.equals("closed-after-created-before"));898 rbClosedAfter.setSelected("closed-after".equals(v)); 899 rbClosedAfterAndCreatedBefore.setSelected("closed-after-created-before".equals(v)); 900 900 if (!rbClosedAfter.isSelected() && !rbClosedAfterAndCreatedBefore.isSelected()) { 901 901 rbClosedAfter.setSelected(true); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
r6920 r6990 169 169 } 170 170 protected void feedbackValid() { 171 if ( getCurrentFeedback().equals("valid")) return;171 if ("valid".equals(getCurrentFeedback())) return; 172 172 lblValid.setIcon(ImageProvider.get("dialogs", "valid")); 173 173 lblValid.setToolTipText(""); … … 176 176 177 177 protected void feedbackInvalid() { 178 if ( getCurrentFeedback().equals("invalid")) return;178 if ("invalid".equals(getCurrentFeedback())) return; 179 179 lblValid.setIcon(ImageProvider.get("warning-small")); 180 180 lblValid.setToolTipText(tr("This changeset query URL is invalid")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationNodeMap.java
r6830 r6990 63 63 public static Node firstOnewayNode(RelationMember m){ 64 64 if(!m.isWay()) return null; 65 if(m.getRole().equals("backward")) return m.getWay().lastNode(); 65 if("backward".equals(m.getRole())) { 66 return m.getWay().lastNode(); 67 } 66 68 return m.getWay().firstNode(); 67 69 } … … 69 71 public static Node lastOnewayNode(RelationMember m){ 70 72 if(!m.isWay()) return null; 71 if(m.getRole().equals("backward")) return m.getWay().firstNode(); 73 if("backward".equals(m.getRole())) { 74 return m.getWay().firstNode(); 75 } 72 76 return m.getWay().lastNode(); 73 77 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java
r6362 r6990 50 50 51 51 static boolean isBackward(final RelationMember member){ 52 return member.getRole().equals("backward");52 return "backward".equals(member.getRole()); 53 53 } 54 54 55 55 static boolean isForward(final RelationMember member){ 56 return member.getRole().equals("forward");56 return "forward".equals(member.getRole()); 57 57 } 58 58 … … 60 60 return isForward(member) || isBackward(member); 61 61 } 62 63 62 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
r6890 r6990 78 78 for (KeyListener keyListener : getKeyListeners()) { 79 79 // Fix #3596 - Remove default keyListener to avoid conflicts with JOSM commands 80 if ( keyListener.getClass().getName().equals("javax.swing.plaf.basic.BasicTreeUI$Handler")) {80 if ("javax.swing.plaf.basic.BasicTreeUI$Handler".equals(keyListener.getClass().getName())) { 81 81 removeKeyListener(keyListener); 82 82 } -
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r6920 r6990 206 206 depth++; 207 207 try { 208 if ( qName.equals("searchresults")) {208 if ("searchresults".equals(qName)) { 209 209 // do nothing 210 } else if ( qName.equals("named") && (depth == 2)) {210 } else if ("named".equals(qName) && (depth == 2)) { 211 211 currentResult = new PlaceSelection.SearchResult(); 212 212 currentResult.name = atts.getValue("name"); … … 219 219 currentResult.zoom = Integer.parseInt(atts.getValue("zoom")); 220 220 data.add(currentResult); 221 } else if ( qName.equals("description") && (depth == 3)) {221 } else if ("description".equals(qName) && (depth == 3)) { 222 222 description = new StringBuffer(); 223 } else if ( qName.equals("named") && (depth == 4)) {223 } else if ("named".equals(qName) && (depth == 4)) { 224 224 // this is a "named" place in the nearest places list. 225 225 String info = atts.getValue("info"); … … 227 227 currentResult.nearestPlace = atts.getValue("name"); 228 228 } 229 } else if ( qName.equals("place") && atts.getValue("lat") != null) {229 } else if ("place".equals(qName) && atts.getValue("lat") != null) { 230 230 currentResult = new PlaceSelection.SearchResult(); 231 231 currentResult.name = atts.getValue("display_name"); … … 258 258 @Override 259 259 public void endElement(String namespaceURI, String localName, String qName) throws SAXException { 260 if ( qName.equals("description") && description != null) {260 if ("description".equals(qName) && description != null) { 261 261 currentResult.description = description.toString(); 262 262 description = null; -
trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
r6897 r6990 16 16 import org.openstreetmap.josm.tools.LanguageInfo.LocaleType; 17 17 18 /** 19 * Provides utility methods for help system. 20 * @since 2252 21 */ 18 22 public final class HelpUtil { 19 23 … … 140 144 public static String buildAbsoluteHelpTopic(String topic, LocaleType type) { 141 145 String prefix = getHelpTopicPrefix(type); 142 if (prefix == null || topic == null || topic.trim().length() == 0 || topic.trim().equals("/"))146 if (prefix == null || topic == null || topic.trim().length() == 0 || "/".equals(topic.trim())) 143 147 return prefix; 144 148 prefix += "/" + topic; … … 220 224 * </pre> 221 225 * 222 * 223 * @ param helpTopic226 * @param helpTopic Help topic to mark 227 * @return {@code helpTopic} 224 228 */ 225 229 public static String ht(String helpTopic) { -
trunk/src/org/openstreetmap/josm/gui/io/UploadDialog.java
r6889 r6990 578 578 @Override 579 579 public void preferenceChanged(PreferenceChangeEvent e) { 580 if (e.getKey() == null || ! e.getKey().equals("osm-server.url"))580 if (e.getKey() == null || !"osm-server.url".equals(e.getKey())) 581 581 return; 582 582 final Setting<?> newValue = e.getNewValue(); -
trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java
r6901 r6990 156 156 public void hyperlinkUpdate(HyperlinkEvent e) { 157 157 if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) { 158 if (e.getDescription() == null || configHandler == null) 158 String desc = e.getDescription(); 159 if (desc == null || configHandler == null) 159 160 return; 160 if ( e.getDescription().equals("urn:changeset-configuration")) {161 if ("urn:changeset-configuration".equals(desc)) { 161 162 configHandler.handleChangesetConfigurationRequest(); 162 } else if ( e.getDescription().equals("urn:advanced-configuration")) {163 } else if ("urn:advanced-configuration".equals(desc)) { 163 164 configHandler.handleUploadStrategyConfigurationRequest(); 164 165 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java
r6889 r6990 77 77 } 78 78 v = v.trim().toLowerCase(); 79 if ( v.equals("true"))79 if ("true".equals(v)) 80 80 return SINGLE_REQUEST_STRATEGY; 81 else if ( v.equals("false"))81 else if ("false".equals(v)) 82 82 return INDIVIDUAL_OBJECTS_STRATEGY; 83 83 else -
trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java
r6901 r6990 406 406 } 407 407 408 protected void vali ateChunkSize() {408 protected void validateChunkSize() { 409 409 try { 410 410 int chunkSize = Integer.parseInt(tfChunkSize.getText().trim()); … … 430 430 @Override 431 431 public void changedUpdate(DocumentEvent arg0) { 432 vali ateChunkSize();432 validateChunkSize(); 433 433 } 434 434 435 435 @Override 436 436 public void insertUpdate(DocumentEvent arg0) { 437 vali ateChunkSize();437 validateChunkSize(); 438 438 } 439 439 440 440 @Override 441 441 public void removeUpdate(DocumentEvent arg0) { 442 vali ateChunkSize();442 validateChunkSize(); 443 443 } 444 444 … … 446 446 public void propertyChange(PropertyChangeEvent evt) { 447 447 if (evt.getSource() == tfChunkSize 448 && evt.getPropertyName().equals("enabled")448 && "enabled".equals(evt.getPropertyName()) 449 449 && (Boolean)evt.getNewValue() 450 450 ) { 451 vali ateChunkSize();451 validateChunkSize(); 452 452 } 453 453 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r6883 r6990 147 147 MapImage mapImage = ((NodeElemStyle) style).mapImage; 148 148 if (mapImage != null) { 149 if (includeDeprecatedIcon || mapImage.name == null || ! mapImage.name.equals("misc/deprecated.png")) {149 if (includeDeprecatedIcon || mapImage.name == null || !"misc/deprecated.png".equals(mapImage.name)) { 150 150 return new ImageIcon(mapImage.getDisplayedNodeIcon(false)); 151 151 } else { -
trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java
r6561 r6990 19 19 public Range range; 20 20 21 /** 22 * Constructs a new {@code MultiCascade}. 23 */ 21 24 public MultiCascade() { 22 25 layers = new HashMap<String, Cascade>(); … … 39 42 // Everything that is not on the default layer is assumed to 40 43 // be a modifier. Can be overridden in style definition. 41 if (! layer.equals("default") && !layer.equals("*")) {44 if (!"default".equals(layer) && !"*".equals(layer)) { 42 45 c.put(MODIFIER, true); 43 46 } … … 60 63 if (c == null) { 61 64 c = new Cascade(); 62 if (! layer.equals("default") && !layer.equals("*")) {65 if (!"default".equals(layer) && !"*".equals(layer)) { 63 66 c.put(MODIFIER, true); 64 67 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r6977 r6990 429 429 430 430 public boolean matchesBase(OsmPrimitiveType type) { 431 if ( base.equals("*")) {431 if ("*".equals(base)) { 432 432 return true; 433 433 } else if (OsmPrimitiveType.NODE.equals(type)) { 434 return base.equals("node");434 return "node".equals(base); 435 435 } else if (OsmPrimitiveType.WAY.equals(type)) { 436 return base.equals("way") || base.equals("area");436 return "way".equals(base) || "area".equals(base); 437 437 } else if (OsmPrimitiveType.RELATION.equals(type)) { 438 return base.equals("area") || base.equals("relation") || base.equals("canvas");438 return "area".equals(base) || "relation".equals(base) || "canvas".equals(base); 439 439 } 440 440 return false; … … 446 446 } else { 447 447 if (p instanceof Relation) { 448 if ( base.equals("area")) {448 if ("area".equals(base)) { 449 449 return ((Relation) p).isMultipolygon(); 450 } else if ( base.equals("canvas")) {450 } else if ("canvas".equals(base)) { 451 451 return p.get("#canvas") != null; 452 452 } -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r6987 r6990 249 249 continue; 250 250 } 251 if ( kv[0].equals("_osm_session")) {251 if ("_osm_session".equals(kv[0])) { 252 252 // osm session cookie found 253 253 String token = extractToken(connection); -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r6844 r6990 487 487 @Override 488 488 public void actionPerformed(ActionEvent e) { 489 if ( e.getActionCommand().equals("<") && actionsTree.getSelectionCount() > 0) {489 if ("<".equals(e.getActionCommand()) && actionsTree.getSelectionCount() > 0) { 490 490 491 491 int leadItem = selected.getSize(); … … 500 500 } else if (node.getUserObject() instanceof Action) { 501 501 selected.add(leadItem++, new ActionDefinition((Action)node.getUserObject())); 502 503 502 } 504 503 } 505 } else if ( e.getActionCommand().equals(">") && selectedList.getSelectedIndex() != -1) {504 } else if (">".equals(e.getActionCommand()) && selectedList.getSelectedIndex() != -1) { 506 505 while (selectedList.getSelectedIndex() != -1) { 507 506 selected.remove(selectedList.getSelectedIndex()); 508 507 } 509 } else if ( e.getActionCommand().equals("up")) {508 } else if ("up".equals(e.getActionCommand())) { 510 509 int i = selectedList.getSelectedIndex(); 511 510 Object o = selected.get(i); … … 515 514 selectedList.setSelectedIndex(i-1); 516 515 } 517 } else if ( e.getActionCommand().equals("down")) {516 } else if ("down".equals(e.getActionCommand())) { 518 517 int i = selectedList.getSelectedIndex(); 519 518 Object o = selected.get(i); … … 580 579 private JButton createButton(String name) { 581 580 JButton b = new JButton(); 582 if ( name.equals("up")) {581 if ("up".equals(name)) { 583 582 b.setIcon(ImageProvider.get("dialogs", "up")); 584 } else if ( name.equals("down")) {583 } else if ("down".equals(name)) { 585 584 b.setIcon(ImageProvider.get("dialogs", "down")); 586 585 } else { … … 739 738 @Override 740 739 protected void exportDone(JComponent source, Transferable data, int action) { 741 if ( movingComponent.equals("list")) {740 if ("list".equals(movingComponent)) { 742 741 try { 743 742 List<?> draggedData = (List<?>) data.getTransferData(ACTION_FLAVOR); … … 981 980 982 981 for (String s : getToolString()) { 983 if ( s.equals("|")) {982 if ("|".equals(s)) { 984 983 result.add(ActionDefinition.getSeparator()); 985 984 } else { -
trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
r6890 r6990 115 115 public final void initFromPreferences() { 116 116 String authMethod = Main.pref.get("osm-server.auth-method", "basic"); 117 if ( authMethod.equals("basic")) {117 if ("basic".equals(authMethod)) { 118 118 rbBasicAuthentication.setSelected(true); 119 } else if ( authMethod.equals("oauth")) {119 } else if ("oauth".equals(authMethod)) { 120 120 rbOAuth.setSelected(true); 121 121 } else { … … 140 140 } 141 141 Main.pref.put("osm-server.auth-method", authMethod); 142 if ( authMethod.equals("basic")) {142 if ("basic".equals(authMethod)) { 143 143 // save username and password and clear the OAuth token 144 144 pnlBasicAuthPreferences.saveToPreferences(); 145 145 OAuthAccessTokenHolder.getInstance().clear(); 146 146 OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManager.getInstance()); 147 } else if ( authMethod.equals("oauth")) {147 } else if ("oauth".equals(authMethod)) { 148 148 // clear the password in the preferences 149 149 pnlBasicAuthPreferences.clearPassword(); -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r6798 r6990 322 322 if (panel.cbDisable.isSelected()) { 323 323 sc.setAssignedModifier(-1); 324 } else if (panel.tfKey.getSelectedItem() == null || panel.tfKey.getSelectedItem().equals("")) {324 } else if (panel.tfKey.getSelectedItem() == null || "".equals(panel.tfKey.getSelectedItem())) { 325 325 sc.setAssignedModifier(KeyEvent.VK_CANCEL); 326 326 } else { -
trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java
r6883 r6990 173 173 @Override 174 174 public void propertyChange(PropertyChangeEvent evt) { 175 if ( evt.getPropertyName().equals("enabled")) {175 if ("enabled".equals(evt.getPropertyName())) { 176 176 boolean enabled = (Boolean)evt.getNewValue(); 177 177 if (enabled) { -
trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java
r6890 r6990 187 187 188 188 @Override public void propertyChange(PropertyChangeEvent evt) { 189 if ( evt.getPropertyName().equals("editable")) {189 if ("editable".equals(evt.getPropertyName())) { 190 190 if (evt.getNewValue().equals(true)) { 191 191 enableMenu(); … … 193 193 disableMenu(); 194 194 } 195 } else if ( evt.getPropertyName().equals("editor")) {195 } else if ("editor".equals(evt.getPropertyName())) { 196 196 disableMenu(); 197 197 if (isEditable()) { -
trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
r6792 r6990 42 42 protected final PropertyChangeListener propertyChangeListener = new PropertyChangeListener() { 43 43 @Override public void propertyChange(PropertyChangeEvent evt) { 44 if ( evt.getPropertyName().equals("editable")) {44 if ("editable".equals(evt.getPropertyName())) { 45 45 removeAll(); 46 46 addMenuEntries(); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
r6907 r6990 165 165 String url = st.nextToken(); 166 166 167 if (! method.equals("GET")) {167 if (!"GET".equals(method)) { 168 168 sendNotImplemented(out); 169 169 return; -
trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java
r6450 r6990 37 37 if (imgNode.getNodeType() == Node.ELEMENT_NODE) { 38 38 Element imgElem = (Element) imgNode; 39 if ( imgElem.getTagName().equals("geoimage")) {39 if ("geoimage".equals(imgElem.getTagName())) { 40 40 ImageEntry entry = new ImageEntry(); 41 41 NodeList attrNodes = imgElem.getChildNodes(); … … 45 45 Element attrElem = (Element) attrNode; 46 46 try { 47 if (attrElem.getTagName().equals("file")) { 47 String attrElemName = attrElem.getTagName(); 48 if ("file".equals(attrElemName)) { 48 49 entry.setFile(new File(attrElem.getTextContent())); 49 } else if ( attrElem.getTagName().equals("position")) {50 } else if ("position".equals(attrElemName)) { 50 51 double lat = Double.parseDouble(attrElem.getAttribute("lat")); 51 52 double lon = Double.parseDouble(attrElem.getAttribute("lon")); 52 53 entry.setPos(new LatLon(lat, lon)); 53 } else if ( attrElem.getTagName().equals("speed")) {54 } else if ("speed".equals(attrElemName)) { 54 55 entry.setSpeed(Double.parseDouble(attrElem.getTextContent())); 55 } else if ( attrElem.getTagName().equals("elevation")) {56 } else if ("elevation".equals(attrElemName)) { 56 57 entry.setElevation(Double.parseDouble(attrElem.getTextContent())); 57 } else if ( attrElem.getTagName().equals("gps-time")) {58 } else if ("gps-time".equals(attrElemName)) { 58 59 entry.setGpsTime(new Date(Long.parseLong(attrElem.getTextContent()))); 59 } else if ( attrElem.getTagName().equals("exif-orientation")) {60 } else if ("exif-orientation".equals(attrElemName)) { 60 61 entry.setExifOrientation(Integer.parseInt(attrElem.getTextContent())); 61 } else if ( attrElem.getTagName().equals("exif-time")) {62 } else if ("exif-time".equals(attrElemName)) { 62 63 entry.setExifTime(new Date(Long.parseLong(attrElem.getTextContent()))); 63 } else if ( attrElem.getTagName().equals("exif-gps-time")) {64 } else if ("exif-gps-time".equals(attrElemName)) { 64 65 entry.setExifGpsTime(new Date(Long.parseLong(attrElem.getTextContent()))); 65 } else if ( attrElem.getTagName().equals("exif-coordinates")) {66 } else if ("exif-coordinates".equals(attrElemName)) { 66 67 double lat = Double.parseDouble(attrElem.getAttribute("lat")); 67 68 double lon = Double.parseDouble(attrElem.getAttribute("lon")); 68 69 entry.setExifCoor(new LatLon(lat, lon)); 69 } else if ( attrElem.getTagName().equals("exif-image-direction")) {70 } else if ("exif-image-direction".equals(attrElemName)) { 70 71 entry.setExifImgDir(Double.parseDouble(attrElem.getTextContent())); 71 } else if ( attrElem.getTagName().equals("is-new-gps-data") && Boolean.parseBoolean(attrElem.getTextContent())) {72 } else if ("is-new-gps-data".equals(attrElemName) && Boolean.parseBoolean(attrElem.getTextContent())) { 72 73 entry.flagNewGpsData(); 73 74 } … … 79 80 } 80 81 entries.add(entry); 81 } else if ( imgElem.getTagName().equals("show-thumbnails")) {82 } else if ("show-thumbnails".equals(imgElem.getTagName())) { 82 83 useThumbs = Boolean.parseBoolean(imgElem.getTextContent()); 83 84 } -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r6890 r6990 353 353 String policy = Main.pref.get(togglePreferenceKey, "ask"); 354 354 policy = policy.trim().toLowerCase(); 355 if ( policy.equals("never")) {355 if ("never".equals(policy)) { 356 356 if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) { 357 357 Main.info(tr("Skipping plugin update after JOSM upgrade. Automatic update at startup is disabled.")); … … 362 362 } 363 363 364 if ( policy.equals("always")) {364 if ("always".equals(policy)) { 365 365 if ("pluginmanager.version-based-update.policy".equals(togglePreferenceKey)) { 366 366 Main.info(tr("Running plugin update after JOSM upgrade. Automatic update at startup is enabled.")); … … 371 371 } 372 372 373 if (! policy.equals("ask")) {373 if (!"ask".equals(policy)) { 374 374 Main.warn(tr("Unexpected value ''{0}'' for preference ''{1}''. Assuming value ''ask''.", policy, togglePreferenceKey)); 375 375 } … … 1355 1355 String policy = Main.pref.get(preferencesKey, "ask"); 1356 1356 policy = policy.trim().toLowerCase(); 1357 cbDontShowAgain.setSelected(! policy.equals("ask"));1357 cbDontShowAgain.setSelected(!"ask".equals(policy)); 1358 1358 } 1359 1359
Note:
See TracChangeset
for help on using the changeset viewer.