Changeset 6199 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2013-08-27T01:17:02+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/io/AbstractUploadTask.java
r6046 r6199 25 25 import org.openstreetmap.josm.gui.ExceptionDialogUtil; 26 26 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 27 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 27 28 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 28 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;29 29 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 30 30 import org.openstreetmap.josm.gui.progress.ProgressMonitor; … … 250 250 */ 251 251 protected void handleUploadConflict(OsmApiException e) { 252 String pattern = "Version mismatch: Provided (\\d+), server had: (\\d+) of (\\S+) (\\d+)"; 253 Pattern p = Pattern.compile(pattern); 254 Matcher m = p.matcher(e.getErrorHeader()); 255 if (m.matches()) { 256 handleUploadConflictForKnownConflict(OsmPrimitiveType.from(m.group(3)), Long.parseLong(m.group(4)), m.group(2),m.group(1)); 257 return; 258 } 259 pattern ="The changeset (\\d+) was closed at (.*)"; 260 p = Pattern.compile(pattern); 261 m = p.matcher(e.getErrorHeader()); 262 if (m.matches()) { 263 handleUploadConflictForClosedChangeset(Long.parseLong(m.group(1)), DateUtils.fromString(m.group(2))); 264 return; 265 } 266 System.out.println(tr("Warning: error header \"{0}\" did not match with an expected pattern", e.getErrorHeader())); 252 final String errorHeader = e.getErrorHeader(); 253 if (errorHeader != null) { 254 Pattern p = Pattern.compile("Version mismatch: Provided (\\d+), server had: (\\d+) of (\\S+) (\\d+)"); 255 Matcher m = p.matcher(errorHeader); 256 if (m.matches()) { 257 handleUploadConflictForKnownConflict(OsmPrimitiveType.from(m.group(3)), Long.parseLong(m.group(4)), m.group(2),m.group(1)); 258 return; 259 } 260 p = Pattern.compile("The changeset (\\d+) was closed at (.*)"); 261 m = p.matcher(errorHeader); 262 if (m.matches()) { 263 handleUploadConflictForClosedChangeset(Long.parseLong(m.group(1)), DateUtils.fromString(m.group(2))); 264 return; 265 } 266 } 267 System.out.println(tr("Warning: error header \"{0}\" did not match with an expected pattern", errorHeader)); 267 268 handleUploadConflictForUnknownConflict(); 268 269 }
Note:
See TracChangeset
for help on using the changeset viewer.