Changeset 8365 in josm
- Timestamp:
- 2015-05-16T15:13:38+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r8338 r8365 245 245 if (type != 0) 246 246 return type; 247 return (Long.valueOf(o1.getUniqueId())).compareTo(o2.getUniqueId());247 return Long.compare(o1.getUniqueId(), o2.getUniqueId()); 248 248 } 249 249 }); -
trunk/src/org/openstreetmap/josm/data/APIDataSet.java
r8338 r8365 338 338 @Override 339 339 public int compare(Relation o1, Relation o2) { 340 return Integer. valueOf(uploadOrder.indexOf(o1)).compareTo(uploadOrder.indexOf(o2));340 return Integer.compare(uploadOrder.indexOf(o1), uploadOrder.indexOf(o2)); 341 341 } 342 342 } -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r8349 r8365 678 678 this.imageryType = type; 679 679 if (m.group(2) != null) { 680 defaultMaxZoom = Integer. valueOf(m.group(2));680 defaultMaxZoom = Integer.parseInt(m.group(2)); 681 681 } 682 682 if (m.group(1) != null) { 683 defaultMinZoom = Integer. valueOf(m.group(1));683 defaultMinZoom = Integer.parseInt(m.group(1)); 684 684 } 685 685 break; -
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r8130 r8365 93 93 94 94 public int compareTo(Changeset other) { 95 return Integer. valueOf(getId()).compareTo(other.getId());95 return Integer.compare(getId(), other.getId()); 96 96 } 97 97 -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r8291 r8365 296 296 @Override 297 297 public int compareTo(OsmPrimitive o) { 298 return o instanceof Node ? Long. valueOf(getUniqueId()).compareTo(o.getUniqueId()) : 1;298 return o instanceof Node ? Long.compare(getUniqueId(), o.getUniqueId()) : 1; 299 299 } 300 300 -
trunk/src/org/openstreetmap/josm/data/osm/NodeData.java
r6890 r8365 15 15 private double lon = Double.NaN; 16 16 17 public NodeData() {} 17 /** 18 * Constructs a new {@code NodeData}. 19 */ 20 public NodeData() { 18 21 22 } 23 24 /** 25 * Constructs a new {@code NodeData}. 26 * @param data node data to copy 27 */ 19 28 public NodeData(NodeData data) { 20 29 super(data); … … 44 53 @Override 45 54 public EastNorth getEastNorth() { 46 /* 47 * No internal caching of projected coordinates needed. In contrast to getEastNorth() 48 * on Node, this method is rarely used. Caching would be overkill. 49 */ 55 // No internal caching of projected coordinates needed. In contrast to getEastNorth() 56 // on Node, this method is rarely used. Caching would be overkill. 50 57 return Projections.project(getCoor()); 51 58 } … … 53 60 @Override 54 61 public void setEastNorth(EastNorth eastNorth) { 55 LatLon ll = Projections.inverseProject(eastNorth); 56 setCoor(ll); 62 setCoor(Projections.inverseProject(eastNorth)); 57 63 } 58 64 … … 76 82 visitor.visit(this); 77 83 } 78 79 84 } -
trunk/src/org/openstreetmap/josm/data/osm/NoteData.java
r8338 r8365 52 52 return -1; 53 53 } 54 return Long. valueOf(Math.abs(n1.getId())).compareTo(Long.valueOf(Math.abs(n2.getId())));54 return Long.compare(Math.abs(n1.getId()), Math.abs(n2.getId())); 55 55 } 56 56 }; -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r8338 r8365 300 300 @Override 301 301 public int compareTo(OsmPrimitive o) { 302 return o instanceof Relation ? Long.valueOf(getUniqueId()).compareTo(o.getUniqueId()) : -1; 303 } 304 302 return o instanceof Relation ? Long.compare(getUniqueId(), o.getUniqueId()) : -1; 303 } 304 305 /** 306 * Returns the first member. 307 * @return first member, or {@code null} 308 */ 305 309 public RelationMember firstMember() { 306 if (isIncomplete()) return null; 307 308 RelationMember[] members = this.members; 309 return (members.length == 0) ? null : members[0]; 310 } 310 return (isIncomplete() || members.length == 0) ? null : members[0]; 311 } 312 313 /** 314 * Returns the last member. 315 * @return last member, or {@code null} 316 */ 311 317 public RelationMember lastMember() { 312 if (isIncomplete()) return null; 313 314 RelationMember[] members = this.members; 315 return (members.length == 0) ? null : members[members.length - 1]; 318 return (isIncomplete() || members.length == 0) ? null : members[members.length - 1]; 316 319 } 317 320 -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r8345 r8365 351 351 if (o instanceof Relation) 352 352 return 1; 353 return o instanceof Way ? Long. valueOf(getUniqueId()).compareTo(o.getUniqueId()) : -1;353 return o instanceof Way ? Long.compare(getUniqueId(), o.getUniqueId()) : -1; 354 354 } 355 355 -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r8291 r8365 156 156 if (this.id != o.id) 157 157 throw new ClassCastException(tr("Cannot compare primitive with ID ''{0}'' to primitive with ID ''{1}''.", o.id, this.id)); 158 return Long. valueOf(this.version).compareTo(o.version);158 return Long.compare(this.version, o.version); 159 159 } 160 160 -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r8346 r8365 131 131 * Class to store relation data (keys are usually cleanup and may not be equal to original relation) 132 132 */ 133 private class RelationPair {133 private static class RelationPair { 134 134 /** Member objects of the relation */ 135 135 private RelationMembers members; -
trunk/src/org/openstreetmap/josm/data/validation/tests/SimilarNamedWays.java
r8338 r8365 223 223 } 224 224 225 public class RegExprRule implements NormalizeRule {225 public static class RegExprRule implements NormalizeRule { 226 226 private final Pattern regExpr; 227 227 private final String replacement; … … 243 243 } 244 244 245 public class SynonymRule implements NormalizeRule {245 public static class SynonymRule implements NormalizeRule { 246 246 247 247 private final String[] words; -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r8318 r8365 950 950 * When user presses Enter key then selected item of "searchResultsMenu" is triggered. 951 951 */ 952 private class SearchFieldKeyListener implements KeyListener {952 private static class SearchFieldKeyListener implements KeyListener { 953 953 954 954 @Override … … 970 970 971 971 @Override 972 public void keyTyped(KeyEvent e) { } 973 974 @Override 975 public void keyReleased(KeyEvent e) { } 972 public void keyTyped(KeyEvent e) { 973 // Not used 974 } 975 976 @Override 977 public void keyReleased(KeyEvent e) { 978 // Not used 979 } 976 980 } 977 981 -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r8318 r8365 509 509 } 510 510 // sort according to position in the list of layers, with one exception: 511 // an active data layer always becomes a higher Z-Order than all other 512 // data layers 513 // 511 // an active data layer always becomes a higher Z-Order than all other data layers 514 512 Collections.sort( 515 513 ret, 516 514 new Comparator<Layer>() { 517 @Override public int compare(Layer l1, Layer l2) { 515 @Override 516 public int compare(Layer l1, Layer l2) { 518 517 if (l1 instanceof OsmDataLayer && l2 instanceof OsmDataLayer) { 519 518 if (l1 == getActiveLayer()) return -1; 520 519 if (l2 == getActiveLayer()) return 1; 521 return Integer. valueOf(layers.indexOf(l1)).compareTo(layers.indexOf(l2));520 return Integer.compare(layers.indexOf(l1), layers.indexOf(l2)); 522 521 } else 523 return Integer. valueOf(layers.indexOf(l1)).compareTo(layers.indexOf(l2));522 return Integer.compare(layers.indexOf(l1), layers.indexOf(l2)); 524 523 } 525 524 } … … 540 539 * Draw the component. 541 540 */ 542 @Override public void paint(Graphics g) { 541 @Override 542 public void paint(Graphics g) { 543 543 if (initialViewport != null) { 544 544 zoomTo(initialViewport); -
trunk/src/org/openstreetmap/josm/gui/actionsupport/DeleteFromRelationConfirmationDialog.java
r8338 r8365 213 213 cmp = o1.getParent().getDisplayName(nf).compareTo(o2.getParent().getDisplayName(nf)); 214 214 if (cmp != 0) return cmp; 215 return Integer. valueOf(o1.getPosition()).compareTo(o2.getPosition());215 return Integer.compare(o1.getPosition(), o2.getPosition()); 216 216 } 217 217 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
r8318 r8365 222 222 } 223 223 224 private class NoteRenderer implements ListCellRenderer<Note> {224 private static class NoteRenderer implements ListCellRenderer<Note> { 225 225 226 226 private DefaultListCellRenderer defaultListCellRenderer = new DefaultListCellRenderer(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesCellRenderer.java
r8189 r8365 40 40 } 41 41 } 42 43 @Override 42 43 @Override 44 44 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 45 45 Component c = super.getTableCellRendererComponent(table, value, isSelected, false, row, column); … … 53 53 Map<?, ?> v = (Map<?, ?>) value; 54 54 if (v.size() != 1) { // Multiple values: give user a short summary of the values 55 Integer blank _count;56 Integer other _count;55 Integer blankCount; 56 Integer otherCount; 57 57 if (v.get("") == null) { 58 blank _count = 0;59 other _count = v.size();58 blankCount = 0; 59 otherCount = v.size(); 60 60 } else { 61 blank _count = (Integer)v.get("");62 other _count = v.size()-1;61 blankCount = (Integer)v.get(""); 62 otherCount = v.size()-1; 63 63 } 64 str = "<";65 if (other _count == 1) {64 StringBuilder sb = new StringBuilder("<"); 65 if (otherCount == 1) { 66 66 for (Map.Entry<?, ?> entry : v.entrySet()) { // Find the non-blank value in the map 67 67 if ( entry.getKey() != "") { 68 68 /* I18n: properties display partial string joined with comma, frst is count, second is value */ 69 s tr += tr("{0} ''{1}''", entry.getValue().toString(), entry.getKey());69 sb.append(tr("{0} ''{1}''", entry.getValue().toString(), entry.getKey())); 70 70 } 71 71 } 72 72 } else { 73 73 /* I18n: properties display partial string joined with comma */ 74 s tr += trn("{0} different", "{0} different", other_count, other_count);74 sb.append(trn("{0} different", "{0} different", otherCount, otherCount)); 75 75 } 76 if(blank _count > 0) {76 if(blankCount > 0) { 77 77 /* I18n: properties display partial string joined with comma */ 78 s tr += trn(", {0} unset", ", {0} unset", blank_count, blank_count);78 sb.append(trn(", {0} unset", ", {0} unset", blankCount, blankCount)); 79 79 } 80 str += ">"; 80 sb.append(">"); 81 str = sb.toString(); 81 82 c.setFont(c.getFont().deriveFont(Font.ITALIC)); 82 83 -
trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
r8345 r8365 4 4 import java.awt.BasicStroke; 5 5 import java.awt.Color; 6 import java.awt.Image;7 6 import java.awt.Rectangle; 8 7 import java.awt.Stroke; … … 29 28 public final RotationAngle mapImageAngle; 30 29 public final Symbol symbol; 31 32 private Image enabledNodeIcon;33 private Image disabledNodeIcon;34 35 private boolean enabledNodeIconIsTemporary;36 private boolean disabledNodeIconIsTemporary;37 30 38 31 public enum SymbolShape { SQUARE, CIRCLE, TRIANGLE, PENTAGON, HEXAGON, HEPTAGON, OCTAGON, NONAGON, DECAGON } -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
r8308 r8365 81 81 int num1 = Integer.parseInt(matcher1.group(2)); 82 82 int num2 = Integer.parseInt(matcher2.group(2)); 83 return Integer. valueOf(num1).compareTo(num2);83 return Integer.compare(num1, num2); 84 84 } else 85 85 return -1; -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java
r8358 r8365 1375 1375 if (rows != null) { 1376 1376 double height = renderer.getListCellRendererComponent(list, 1377 new PresetListEntry("x"), 0, false, false).getPreferredSize().getHeight() * Integer. valueOf(rows);1377 new PresetListEntry("x"), 0, false, false).getPreferredSize().getHeight() * Integer.parseInt(rows); 1378 1378 sp.setPreferredSize(new Dimension((int) sp.getPreferredSize().getWidth(), (int) height)); 1379 1379 } -
trunk/src/org/openstreetmap/josm/tools/ImageOverlay.java
r8290 r8365 72 72 int height = -1; 73 73 if (offsetRight > 0 && offsetLeft > 0) { 74 width = new Double(w*(offsetRight-offsetLeft)).intValue();74 width = (int) (w*(offsetRight-offsetLeft)); 75 75 } 76 76 if (offsetTop > 0 && offsetBottom > 0) { 77 width = new Double(h*(offsetBottom-offsetTop)).intValue();77 width = (int) (h*(offsetBottom-offsetTop)); 78 78 } 79 79 ImageIcon overlay; -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r8291 r8365 187 187 final Matcher m = Pattern.compile("(\\d+)x(\\d+)(([+-])(\\d+)([+-])(\\d+))?").matcher(arg); 188 188 if (m.matches()) { 189 int w = Integer. valueOf(m.group(1));190 int h = Integer. valueOf(m.group(2));189 int w = Integer.parseInt(m.group(1)); 190 int h = Integer.parseInt(m.group(2)); 191 191 int x = screenDimension.x, y = screenDimension.y; 192 192 if (m.group(3) != null) { 193 x = Integer. valueOf(m.group(5));194 y = Integer. valueOf(m.group(7));193 x = Integer.parseInt(m.group(5)); 194 y = Integer.parseInt(m.group(7)); 195 195 if ("-".equals(m.group(4))) { 196 196 x = screenDimension.x + screenDimension.width - x - w;
Note:
See TracChangeset
for help on using the changeset viewer.