Changeset 16438 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
- Timestamp:
- 2020-05-17T14:18:22+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r15716 r16438 23 23 import java.util.Set; 24 24 import java.util.regex.Pattern; 25 import java.util.stream.Collectors; 26 import java.util.stream.IntStream; 25 27 26 28 import javax.swing.AbstractAction; … … 331 333 return requiresRestart; 332 334 } 333 for (PluginInformation pi : model.getNewlyActivatedPlugins()) { 334 if (!pi.canloadatruntime) 335 return true; 336 } 335 return model.getNewlyActivatedPlugins().stream().anyMatch(pi -> !pi.canloadatruntime); 337 336 } 338 337 return false; … … 436 435 if (pluginDownloadTask.isCanceled()) 437 436 return; 438 boolean restartRequired = false; 439 for (PluginInformation pi : pluginDownloadTask.getDownloadedPlugins()) { 440 if (!model.getNewlyActivatedPlugins().contains(pi) || !pi.canloadatruntime) { 441 restartRequired = true; 442 break; 443 } 444 } 437 boolean restartRequired = pluginDownloadTask.getDownloadedPlugins().stream() 438 .anyMatch(pi -> !(model.getNewlyActivatedPlugins().contains(pi) && pi.canloadatruntime)); 445 439 notifyDownloadResults(pnlPluginPreferences, pluginDownloadTask, restartRequired); 446 440 model.refreshLocalPluginVersion(pluginDownloadTask.getDownloadedPlugins()); … … 638 632 if (model.getSize() == 0) 639 633 return Collections.emptyList(); 640 List<String> ret = new ArrayList<>(model.getSize()); 641 for (int i = 0; i < model.getSize(); i++) { 642 ret.add(model.get(i)); 643 } 644 return ret; 634 return IntStream.range(0, model.getSize()) 635 .mapToObj(model::get) 636 .collect(Collectors.toList()); 645 637 } 646 638 }
Note:
See TracChangeset
for help on using the changeset viewer.