Changeset 7005 in josm for trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
- Timestamp:
- 2014-04-26T17:39:23+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r7004 r7005 195 195 * All installed and loaded plugins (resp. their main classes) 196 196 */ 197 public static final Collection<PluginProxy> pluginList = new LinkedList< PluginProxy>();197 public static final Collection<PluginProxy> pluginList = new LinkedList<>(); 198 198 199 199 /** 200 200 * Add here all ClassLoader whose resource should be searched. 201 201 */ 202 private static final List<ClassLoader> sources = new LinkedList< ClassLoader>();202 private static final List<ClassLoader> sources = new LinkedList<>(); 203 203 204 204 static { … … 227 227 */ 228 228 private static void filterDeprecatedPlugins(Component parent, Collection<String> plugins) { 229 Set<DeprecatedPlugin> removedPlugins = new TreeSet< DeprecatedPlugin>();229 Set<DeprecatedPlugin> removedPlugins = new TreeSet<>(); 230 230 for (DeprecatedPlugin depr : DEPRECATED_PLUGINS) { 231 231 if (plugins.contains(depr.name)) { … … 461 461 462 462 // Add all plugins already loaded (to include early plugins when checking late ones) 463 Collection<PluginInformation> allPlugins = new HashSet< PluginInformation>(plugins);463 Collection<PluginInformation> allPlugins = new HashSet<>(plugins); 464 464 for (PluginProxy proxy : pluginList) { 465 465 allPlugins.add(proxy.getPluginInformation()); … … 487 487 // 488 488 if (requires != null) { 489 Set<String> pluginNames = new HashSet< String>();489 Set<String> pluginNames = new HashSet<>(); 490 490 for (PluginInformation pi: plugins) { 491 491 pluginNames.add(pi.name); 492 492 } 493 Set<String> missingPlugins = new HashSet< String>();493 Set<String> missingPlugins = new HashSet<>(); 494 494 List<String> requiredPlugins = local ? plugin.getLocalRequiredPlugins() : plugin.getRequiredPlugins(); 495 495 for (String requiredPlugin : requiredPlugins) { … … 515 515 public static ClassLoader createClassLoader(Collection<PluginInformation> plugins) { 516 516 // iterate all plugins and collect all libraries of all plugins: 517 List<URL> allPluginLibraries = new LinkedList< URL>();517 List<URL> allPluginLibraries = new LinkedList<>(); 518 518 File pluginDir = Main.pref.getPluginsDirectory(); 519 519 520 520 // Add all plugins already loaded (to include early plugins in the classloader, allowing late plugins to rely on early ones) 521 Collection<PluginInformation> allPlugins = new HashSet< PluginInformation>(plugins);521 Collection<PluginInformation> allPlugins = new HashSet<>(plugins); 522 522 for (PluginProxy proxy : pluginList) { 523 523 allPlugins.add(proxy.getPluginInformation()); … … 592 592 monitor.beginTask(tr("Loading plugins ...")); 593 593 monitor.subTask(tr("Checking plugin preconditions...")); 594 List<PluginInformation> toLoad = new LinkedList< PluginInformation>();594 List<PluginInformation> toLoad = new LinkedList<>(); 595 595 for (PluginInformation pi: plugins) { 596 596 if (checkLoadPreconditions(parent, plugins, pi)) { … … 636 636 */ 637 637 public static void loadEarlyPlugins(Component parent, Collection<PluginInformation> plugins, ProgressMonitor monitor) { 638 List<PluginInformation> earlyPlugins = new ArrayList< PluginInformation>(plugins.size());638 List<PluginInformation> earlyPlugins = new ArrayList<>(plugins.size()); 639 639 for (PluginInformation pi: plugins) { 640 640 if (pi.early) { … … 654 654 */ 655 655 public static void loadLatePlugins(Component parent, Collection<PluginInformation> plugins, ProgressMonitor monitor) { 656 List<PluginInformation> latePlugins = new ArrayList< PluginInformation>(plugins.size());656 List<PluginInformation> latePlugins = new ArrayList<>(plugins.size()); 657 657 for (PluginInformation pi: plugins) { 658 658 if (!pi.early) { … … 688 688 return null; 689 689 } 690 HashMap<String, PluginInformation> ret = new HashMap< String, PluginInformation>();690 HashMap<String, PluginInformation> ret = new HashMap<>(); 691 691 for (PluginInformation pi: task.getAvailablePlugins()) { 692 692 ret.put(pi.name, pi); … … 733 733 try { 734 734 monitor.beginTask(tr("Determine plugins to load...")); 735 Set<String> plugins = new HashSet< String>();735 Set<String> plugins = new HashSet<>(); 736 736 plugins.addAll(Main.pref.getCollection("plugins", new LinkedList<String>())); 737 737 if (System.getProperty("josm.plugins") != null) { … … 743 743 filterUnmaintainedPlugins(parent, plugins); 744 744 Map<String, PluginInformation> infos = loadLocallyAvailablePluginInformation(monitor.createSubTaskMonitor(1,false)); 745 List<PluginInformation> ret = new LinkedList< PluginInformation>();745 List<PluginInformation> ret = new LinkedList<>(); 746 746 for (Iterator<String> it = plugins.iterator(); it.hasNext();) { 747 747 String plugin = it.next(); … … 791 791 private static Set<PluginInformation> findRequiredPluginsToDownload( 792 792 Collection<PluginInformation> pluginsToUpdate, List<PluginInformation> allPlugins, Set<PluginInformation> pluginsToDownload) { 793 Set<PluginInformation> result = new HashSet< PluginInformation>();793 Set<PluginInformation> result = new HashSet<>(); 794 794 for (PluginInformation pi : pluginsToUpdate) { 795 795 for (String name : pi.getRequiredPlugins()) { … … 880 880 // filter plugins which actually have to be updated 881 881 // 882 Collection<PluginInformation> pluginsToUpdate = new ArrayList< PluginInformation>();882 Collection<PluginInformation> pluginsToUpdate = new ArrayList<>(); 883 883 for (PluginInformation pi: plugins) { 884 884 if (pi.isUpdateRequired()) { … … 889 889 if (!pluginsToUpdate.isEmpty()) { 890 890 891 Set<PluginInformation> pluginsToDownload = new HashSet< PluginInformation>(pluginsToUpdate);891 Set<PluginInformation> pluginsToDownload = new HashSet<>(pluginsToUpdate); 892 892 893 893 if (allPlugins != null) { … … 1150 1150 1151 1151 try { 1152 FutureTask<Integer> task = new FutureTask< Integer>(new Callable<Integer>() {1152 FutureTask<Integer> task = new FutureTask<>(new Callable<Integer>() { 1153 1153 @Override 1154 1154 public Integer call() { … … 1218 1218 return null; 1219 1219 1220 Set<String> plugins = new HashSet< String>(1220 Set<String> plugins = new HashSet<>( 1221 1221 Main.pref.getCollection("plugins",Collections.<String> emptySet()) 1222 1222 ); … … 1260 1260 public static String getBugReportText() { 1261 1261 StringBuilder text = new StringBuilder(); 1262 LinkedList <String> pl = new LinkedList< String>(Main.pref.getCollection("plugins", new LinkedList<String>()));1262 LinkedList <String> pl = new LinkedList<>(Main.pref.getCollection("plugins", new LinkedList<String>())); 1263 1263 for (final PluginProxy pp : pluginList) { 1264 1264 PluginInformation pi = pp.getPluginInformation();
Note:
See TracChangeset
for help on using the changeset viewer.
