Changeset 14231 in josm
- Timestamp:
- 2018-09-08T20:20:58+02:00 (6 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Changeset.java
r13625 r14231 43 43 /** the number of comments for this changeset */ 44 44 private int commentsCount; 45 /** the number of changes for this changeset */ 46 private int changesCount; 45 47 /** the map of tags */ 46 48 private Map<String, String> tags; … … 283 285 } 284 286 287 /** 288 * Replies the number of changes for this changeset. 289 * @return the number of changes for this changeset 290 * @since 14231 291 */ 292 public int getChangesCount() { 293 return changesCount; 294 } 295 296 /** 297 * Sets the number of changes for this changeset. 298 * @param changesCount the number of changes for this changeset 299 * @since 14231 300 */ 301 public void setChangesCount(int changesCount) { 302 this.changesCount = changesCount; 303 } 304 285 305 @Override 286 306 public Map<String, String> getKeys() { … … 346 366 */ 347 367 public boolean hasEqualSemanticAttributes(Changeset other) { 348 if (other == null) 349 return false; 350 if (closedAt == null) { 351 if (other.closedAt != null) 352 return false; 353 } else if (!closedAt.equals(other.closedAt)) 354 return false; 355 if (createdAt == null) { 356 if (other.createdAt != null) 357 return false; 358 } else if (!createdAt.equals(other.createdAt)) 359 return false; 360 if (id != other.id) 361 return false; 362 if (max == null) { 363 if (other.max != null) 364 return false; 365 } else if (!max.equals(other.max)) 366 return false; 367 if (min == null) { 368 if (other.min != null) 369 return false; 370 } else if (!min.equals(other.min)) 371 return false; 372 if (open != other.open) 373 return false; 374 if (!tags.equals(other.tags)) 375 return false; 376 if (user == null) { 377 if (other.user != null) 378 return false; 379 } else if (!user.equals(other.user)) 380 return false; 381 return commentsCount == other.commentsCount; 368 return other != null 369 && id == other.id 370 && open == other.open 371 && commentsCount == other.commentsCount 372 && changesCount == other.changesCount 373 && Objects.equals(closedAt, other.closedAt) 374 && Objects.equals(createdAt, other.createdAt) 375 && Objects.equals(min, other.min) 376 && Objects.equals(max, other.max) 377 && Objects.equals(tags, other.tags) 378 && Objects.equals(user, other.user); 382 379 } 383 380 … … 434 431 this.max = other.max; 435 432 this.commentsCount = other.commentsCount; 433 this.changesCount = other.changesCount; 436 434 this.tags = new HashMap<>(other.tags); 437 435 this.incomplete = other.incomplete; -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java
r12494 r14231 39 39 } 40 40 41 protected void renderChanges(Changeset cs) { 42 setText(Integer.toString(cs.getChangesCount())); 43 setToolTipText(null); 44 } 45 41 46 protected void renderDiscussions(Changeset cs) { 42 47 setText(Integer.toString(cs.getCommentsCount())); … … 59 64 case 4: /* created at */ renderDate(cs.getCreatedAt()); break; 60 65 case 5: /* closed at */ renderDate(cs.getClosedAt()); break; 61 case 6: /* discussions */ renderDiscussions(cs); break; 66 case 6: /* changes */ renderChanges(cs); break; 67 case 7: /* discussions */ renderDiscussions(cs); break; 62 68 default: // Do nothing 63 69 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableColumnModel.java
r7700 r14231 47 47 createColumn(5, tr("Closed at"), 100, -1); 48 48 49 // column 6 - Discussions 50 createColumn(6, tr("Discussions"), 25, -1); 49 // column 6 - Changes 50 createColumn(6, tr("Changes"), 25, -1); 51 52 // column 7 - Discussions 53 createColumn(7, tr("Discussions"), 25, -1); 51 54 } 52 55 -
trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java
r13901 r14231 160 160 if (commentsCount != null) { 161 161 current.setCommentsCount(parseNumericAttribute(commentsCount, 0)); 162 } 163 164 // -- changes_count 165 String changesCount = atts.getValue("changes_count"); 166 if (changesCount != null) { 167 current.setChangesCount(parseNumericAttribute(changesCount, 0)); 162 168 } 163 169 } -
trunk/test/unit/org/openstreetmap/josm/io/OsmChangesetParserTest.java
r11020 r14231 27 27 "<changeset id=\"36749147\" user=\"kesler\" uid=\"13908\" created_at=\"2016-01-22T21:55:37Z\" "+ 28 28 "closed_at=\"2016-01-22T21:56:39Z\" open=\"false\" min_lat=\"36.6649211\" min_lon=\"55.377015\" max_lat=\"38.1490357\" " + 29 "max_lon=\"60.3766983\" comments_count=\"2\" >" +29 "max_lon=\"60.3766983\" comments_count=\"2\" changes_count=\"9\">" + 30 30 "<tag k=\"created_by\" v=\"JOSM/1.5 (9329 en)\"/>" + 31 31 "<tag k=\"comment\" v=\"Fixing errors in North Khorasan\"/>"; … … 75 75 Changeset cs = parse(BEGIN + END).iterator().next(); 76 76 assertEquals(2, cs.getCommentsCount()); 77 assertEquals(9, cs.getChangesCount()); 77 78 assertTrue(cs.getDiscussion().isEmpty()); 78 79 } … … 87 88 Changeset cs = parse(BEGIN + DISCUSSION + END).iterator().next(); 88 89 assertEquals(2, cs.getCommentsCount()); 90 assertEquals(9, cs.getChangesCount()); 89 91 assertEquals(2, cs.getDiscussion().size()); 90 92 }
Note:
See TracChangeset
for help on using the changeset viewer.