Changeset 9087 in josm
- Timestamp:
- 2015-12-05T16:09:41+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r9074 r9087 700 700 } 701 701 702 private abstract class InitializationTask implements Callable<Void> {702 private abstract static class InitializationTask implements Callable<Void> { 703 703 704 704 private final String name; -
trunk/src/org/openstreetmap/josm/actions/AlignInLineAction.java
r8870 r9087 81 81 * @param nodes Nodes to be aligned. 82 82 * @return A array of two nodes. 83 * @throws IllegalArgumentException if nodes is empty 83 84 */ 84 85 private static Node[] nodePairFurthestApart(List<Node> nodes) { … … 93 94 else 94 95 waysRef.retainAll(ref); 96 } 97 98 if (waysRef == null) { 99 throw new IllegalArgumentException(); 95 100 } 96 101 -
trunk/src/org/openstreetmap/josm/actions/DistributeAction.java
r8870 r9087 212 212 * @param nodes nodes to distribute 213 213 * @return Commands to execute to perform action 214 * @throws IllegalArgumentException if nodes is empty 214 215 */ 215 216 private static Collection<Command> distributeNodes(Collection<Node> nodes) { … … 234 235 } 235 236 237 if (nodea == null || nodeb == null) { 238 throw new IllegalArgumentException(); 239 } 240 236 241 // Remove the nodes A and B from the list of nodes to move 237 242 nodes.remove(nodea); … … 266 271 } 267 272 268 // First move the node to A's position, then move it towards B 269 double dx = ax - s.getEastNorth().east() + (bx-ax)*pos/num; 270 double dy = ay - s.getEastNorth().north() + (by-ay)*pos/num; 271 272 cmds.add(new MoveCommand(s, dx, dy)); 273 274 //remove moved node from the list 275 nodes.remove(s); 273 if (s != null) { 274 // First move the node to A's position, then move it towards B 275 double dx = ax - s.getEastNorth().east() + (bx-ax)*pos/num; 276 double dy = ay - s.getEastNorth().north() + (by-ay)*pos/num; 277 278 cmds.add(new MoveCommand(s, dx, dy)); 279 280 //remove moved node from the list 281 nodes.remove(s); 282 } 276 283 } 277 284 -
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r9067 r9087 765 765 * @param isInner - if true, reverts the direction (for multipolygon islands) 766 766 * @return list of parts, marked with the inside orientation. 767 * @throws IllegalArgumentException if parts is empty 767 768 */ 768 769 private List<WayInPolygon> markWayInsideSide(List<Way> parts, boolean isInner) { … … 796 797 } 797 798 } 799 } 800 801 if (topWay == null || topNode == null) { 802 throw new IllegalArgumentException(); 798 803 } 799 804 … … 855 860 856 861 //iterate till full circle is reached 857 while ( true) {862 while (curWay != null) { 858 863 859 864 //add cur way -
trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java
r8931 r9087 418 418 way = w; 419 419 } 420 } 421 if (way == null) { 422 return false; 420 423 } 421 424 List<Node> oldNodes = way.getNodes(); -
trunk/src/org/openstreetmap/josm/data/osm/MultipolygonBuilder.java
r8836 r9087 203 203 while (true) { 204 204 boolean curWayReverse = prevNode == curWay.lastNode(); 205 Node nextNode = (curWayReverse)? curWay.firstNode() : curWay.lastNode();205 Node nextNode = curWayReverse ? curWay.firstNode() : curWay.lastNode(); 206 206 207 207 //add cur way to the list -
trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
r9072 r9087 267 267 addError(r, new TestError(this, Severity.WARNING, tr("Multipolygon inner way is outside"), 268 268 INNER_WAY_OUTSIDE, Collections.singletonList(r), highlights)); 269 } else {269 } else if (outerWay != null) { 270 270 highlights.add(outerWay.getNodes()); 271 271 addError(r, new TestError(this, Severity.WARNING, tr("Intersection between multipolygon ways"), -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java
r9059 r9087 73 73 } 74 74 75 if (!RelationSortUtils.isOneway(m) ) {75 if (!RelationSortUtils.isOneway(m) && lastWct != null) { 76 76 wct.direction = determineDirection(i-1, lastWct.direction, i); 77 77 wct.linkPrev = (wct.direction != NONE); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r9073 r9087 140 140 return REGEX.equals(this) ? contains : !contains; 141 141 case ONE_OF: 142 return Arrays.asList(testString.split("\\s*;\\s*")).contains(prototypeString);142 return testString != null && Arrays.asList(testString.split("\\s*;\\s*")).contains(prototypeString); 143 143 case BEGINS_WITH: 144 return testString .startsWith(prototypeString);144 return testString != null && testString.startsWith(prototypeString); 145 145 case ENDS_WITH: 146 return testString .endsWith(prototypeString);146 return testString != null && testString.endsWith(prototypeString); 147 147 case CONTAINS: 148 return testString .contains(prototypeString);148 return testString != null && testString.contains(prototypeString); 149 149 } 150 150 -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r8926 r9087 370 370 if (key == null || value == null) { 371 371 throwException(tr("Missing key or value attribute in tag.")); 372 } 373 t.put(key.intern(), value.intern()); 372 } else { 373 t.put(key.intern(), value.intern()); 374 } 374 375 jumpToEnd(); 375 376 } -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r9078 r9087 413 413 if (e == null) { 414 414 error(tr("missing layer with index {0}", idx)); 415 }416 if (!e.hasAttribute("name")) {415 return; 416 } else if (!e.hasAttribute("name")) { 417 417 error(tr("missing mandatory attribute ''name'' for element ''layer''")); 418 return; 418 419 } 419 420 String name = e.getAttribute("name"); … … 421 422 if (!e.hasAttribute("type")) { 422 423 error(tr("missing mandatory attribute ''type'' for element ''layer''")); 424 return; 423 425 } 424 426 String type = e.getAttribute("type");
Note:
See TracChangeset
for help on using the changeset viewer.