Changeset 3001 in josm for trunk/src/org/openstreetmap/josm/plugins
- Timestamp:
- 2010-02-17T08:43:05+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
r2826 r3001 16 16 import java.net.MalformedURLException; 17 17 import java.net.URL; 18 import java.util.ArrayList; 19 import java.util.Arrays; 18 20 import java.util.Collection; 19 21 import java.util.Collections; 22 import java.util.HashSet; 20 23 import java.util.LinkedList; 21 24 import java.util.List; … … 182 185 183 186 /** 187 * Filter information about deprecated plugins from the list of downloaded 188 * plugins 189 * 190 * @param plugins the plugin informations 191 * @return the plugin informations, without deprecated plugins 192 */ 193 protected List<PluginInformation> filterDeprecatedPlugins(List<PluginInformation> plugins) { 194 List<PluginInformation> ret = new ArrayList<PluginInformation>(plugins.size()); 195 HashSet<String> deprecatedPluginNames = new HashSet<String>(Arrays.asList(PluginHandler.DEPRECATED_PLUGINS)); 196 for (PluginInformation plugin: plugins) { 197 if (deprecatedPluginNames.contains(plugin.name)) { 198 continue; 199 } 200 ret.add(plugin); 201 } 202 return ret; 203 } 204 205 /** 184 206 * Parses the plugin list 185 207 * … … 192 214 InputStream in = new ByteArrayInputStream(doc.getBytes("UTF-8")); 193 215 List<PluginInformation> pis = new PluginListParser().parse(in); 194 availabePlugins.addAll( pis);216 availabePlugins.addAll(filterDeprecatedPlugins(pis)); 195 217 } catch(UnsupportedEncodingException e) { 196 218 System.err.println(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString()));
Note:
See TracChangeset
for help on using the changeset viewer.