Changeset 12574 in josm for trunk/src/org/openstreetmap/josm/actions/downloadtasks
- Timestamp:
- 2017-08-06T20:13:06+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
r12307 r12574 12 12 import java.util.concurrent.ExecutionException; 13 13 import java.util.concurrent.Future; 14 import java.util.function.Consumer; 14 15 15 16 import javax.swing.JOptionPane; … … 29 30 private final DownloadTask task; 30 31 private final Future<?> future; 32 private Consumer<Collection> errorReporter; 31 33 32 34 /** … … 38 40 this.task = task; 39 41 this.future = future; 42 } 43 44 /** 45 * constructor 46 * @param task the asynchronous download task 47 * @param future the future on which the completion of the download task can be synchronized 48 * @param errorReporter a callback to inform about the number errors happened during the download 49 * task 50 */ 51 public PostDownloadHandler(DownloadTask task, Future<?> future, Consumer<Collection> errorReporter) { 52 this(task, future); 53 this.errorReporter = errorReporter; 40 54 } 41 55 … … 54 68 // 55 69 Set<Object> errors = new LinkedHashSet<>(task.getErrorObjects()); 56 if (errors.isEmpty()) 70 if (this.errorReporter != null) { 71 errorReporter.accept(errors); 72 } 73 74 if (errors.isEmpty()) { 57 75 return; 76 } 58 77 59 78 // just one error object?
Note:
See TracChangeset
for help on using the changeset viewer.