Changeset 11553 in josm for trunk/src/org/openstreetmap/josm/io/NoteReader.java
- Timestamp:
- 2017-02-12T16:32:18+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/NoteReader.java
r11453 r11553 10 10 import java.util.List; 11 11 import java.util.Locale; 12 import java.util.Optional; 12 13 13 14 import javax.xml.parsers.ParserConfigurationException; … … 110 111 break; 111 112 case "comment": 112 String uidStr = attrs.getValue("uid"); 113 if (uidStr == null) { 114 commentUid = 0; 115 } else { 116 commentUid = Long.parseLong(uidStr); 117 } 113 commentUid = Long.parseLong(Optional.ofNullable(attrs.getValue("uid")).orElse("0")); 118 114 commentUsername = attrs.getValue("user"); 119 115 noteAction = Action.valueOf(attrs.getValue("action").toUpperCase(Locale.ENGLISH)); 120 116 commentCreateDate = DateUtils.fromString(attrs.getValue("timestamp")); 121 String isNew = attrs.getValue("is_new"); 122 if (isNew == null) { 123 commentIsNew = false; 124 } else { 125 commentIsNew = Boolean.parseBoolean(isNew); 126 } 117 commentIsNew = Boolean.parseBoolean(Optional.ofNullable(attrs.getValue("is_new")).orElse("false")); 127 118 break; 128 119 default: // Do nothing
Note:
See TracChangeset
for help on using the changeset viewer.