Changeset 30532 in osm for applications/editors/josm/plugins/opendata/src/org/openstreetmap
- Timestamp:
- 2014-07-14T04:18:06+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/WayCombiner.java
r30340 r30532 56 56 57 57 // remove duplicates, preserving order 58 ways = new LinkedHashSet< Way>(ways);58 ways = new LinkedHashSet<>(ways); 59 59 60 60 // try to build a new way which includes all the combined … … 71 71 TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways); 72 72 73 List<Way> reversedWays = new LinkedList< Way>();74 List<Way> unreversedWays = new LinkedList< Way>();73 List<Way> reversedWays = new LinkedList<>(); 74 List<Way> unreversedWays = new LinkedList<>(); 75 75 for (Way w: ways) { 76 76 if ((path.indexOf(w.getNode(0)) + 1) == path.lastIndexOf(w.getNode(1))) { … … 99 99 // if there are still reversed ways with direction-dependent tags, reverse their tags 100 100 if (!reversedWays.isEmpty()) { 101 List<Way> unreversedTagWays = new ArrayList< Way>(ways);101 List<Way> unreversedTagWays = new ArrayList<>(ways); 102 102 unreversedTagWays.removeAll(reversedWays); 103 103 ReverseWayTagCorrector reverseWayTagCorrector = new ReverseWayTagCorrector(); 104 List<Way> reversedTagWays = new ArrayList< Way>();104 List<Way> reversedTagWays = new ArrayList<>(); 105 105 Collection<Command> changePropertyCommands = null; 106 106 for (Way w : reversedWays) { … … 149 149 } 150 150 151 LinkedList<Way> deletedWays = new LinkedList< Way>(ways);151 LinkedList<Way> deletedWays = new LinkedList<>(ways); 152 152 deletedWays.remove(targetWay); 153 153 -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreference.java
r30340 r30532 219 219 return false; 220 220 if (model.isActiveModulesChanged()) { 221 LinkedList<String> l = new LinkedList< String>(model.getSelectedModuleNames());221 LinkedList<String> l = new LinkedList<>(model.getSelectedModuleNames()); 222 222 Collections.sort(l); 223 223 Main.pref.putCollection(PREF_MODULES, l); … … 446 446 static private class ModuleConfigurationSitesPanel extends JPanel { 447 447 448 private DefaultListModel model;448 private DefaultListModel<String> model; 449 449 450 450 protected void build() { 451 451 setLayout(new GridBagLayout()); 452 452 add(new JLabel(tr("Add Open Data Module description URL.")), GBC.eol()); 453 model = new DefaultListModel ();453 model = new DefaultListModel<>(); 454 454 for (String s : OdPreferenceSetting.getModuleSites()) { 455 455 model.addElement(s); 456 456 } 457 final JList list = new JList(model);457 final JList<String> list = new JList<>(model); 458 458 add(new JScrollPane(list), GBC.std().fill()); 459 459 JPanel buttons = new JPanel(new GridBagLayout()); … … 519 519 public List<String> getUpdateSites() { 520 520 if (model.getSize() == 0) return Collections.emptyList(); 521 List<String> ret = new ArrayList< String>(model.getSize());521 List<String> ret = new ArrayList<>(model.getSize()); 522 522 for (int i=0; i< model.getSize();i++){ 523 ret.add( (String)model.get(i));523 ret.add(model.get(i)); 524 524 } 525 525 return ret; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreferencesModel.java
r30340 r30532 20 20 import org.openstreetmap.josm.plugins.opendata.core.modules.ModuleInformation; 21 21 22 /**23 * TODO24 *25 */26 22 public class ModulePreferencesModel extends Observable implements OdConstants { 27 private final ArrayList<ModuleInformation> availableModules = new ArrayList< ModuleInformation>();28 private final ArrayList<ModuleInformation> displayedModules = new ArrayList< ModuleInformation>();29 private final HashMap<ModuleInformation, Boolean> selectedModulesMap = new HashMap< ModuleInformation, Boolean>();30 private Set<String> pendingDownloads = new HashSet< String>();23 private final ArrayList<ModuleInformation> availableModules = new ArrayList<>(); 24 private final ArrayList<ModuleInformation> displayedModules = new ArrayList<>(); 25 private final HashMap<ModuleInformation, Boolean> selectedModulesMap = new HashMap<>(); 26 private Set<String> pendingDownloads = new HashSet<>(); 31 27 private String filterExpression; 32 28 private final Set<String> currentActiveModules; … … 37 33 38 34 public ModulePreferencesModel() { 39 currentActiveModules = new HashSet< String>();35 currentActiveModules = new HashSet<>(); 40 36 currentActiveModules.addAll(getModules(currentActiveModules)); 41 37 } … … 66 62 sort(); 67 63 filterDisplayedModules(filterExpression); 68 Set<String> activeModules = new HashSet< String>();64 Set<String> activeModules = new HashSet<>(); 69 65 activeModules.addAll(getModules(activeModules)); 70 66 for (ModuleInformation pi: availableModules) { … … 101 97 sort(); 102 98 filterDisplayedModules(filterExpression); 103 Set<String> activeModules = new HashSet< String>();99 Set<String> activeModules = new HashSet<>(); 104 100 activeModules.addAll(getModules(activeModules)); 105 101 for (ModuleInformation pi: availableModules) { … … 120 116 */ 121 117 public List<ModuleInformation> getSelectedModules() { 122 List<ModuleInformation> ret = new LinkedList< ModuleInformation>();118 List<ModuleInformation> ret = new LinkedList<>(); 123 119 for (ModuleInformation pi: availableModules) { 124 120 if (selectedModulesMap.get(pi) == null) { … … 138 134 */ 139 135 public Set<String> getSelectedModuleNames() { 140 Set<String> ret = new HashSet< String>();136 Set<String> ret = new HashSet<>(); 141 137 for (ModuleInformation pi: getSelectedModules()) { 142 138 ret.add(pi.name); … … 177 173 */ 178 174 public List<ModuleInformation> getModulesScheduledForUpdateOrDownload() { 179 List<ModuleInformation> ret = new ArrayList< ModuleInformation>();175 List<ModuleInformation> ret = new ArrayList<>(); 180 176 for (String module: pendingDownloads) { 181 177 ModuleInformation pi = getModuleInformation(module); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NeptuneReader.java
r30340 r30532 76 76 public static final String OSM_FERRY = "ferry"; 77 77 78 private static final List<URL> schemas = new ArrayList< URL>();78 private static final List<URL> schemas = new ArrayList<>(); 79 79 static { 80 80 schemas.add(NeptuneReader.class.getResource(NEPTUNE_XSD)); … … 83 83 private ChouettePTNetworkType root; 84 84 85 private final Map<String, OsmPrimitive> tridentObjects = new HashMap< String, OsmPrimitive>();85 private final Map<String, OsmPrimitive> tridentObjects = new HashMap<>(); 86 86 87 87 public static final boolean acceptsXmlNeptuneFile(File file) { … … 133 133 JAXBContext jc = JAXBContext.newInstance(packageName, NeptuneReader.class.getClassLoader()); 134 134 Unmarshaller u = jc.createUnmarshaller(); 135 JAXBElement<T> doc = (JAXBElement<T>)u.unmarshal(inputStream); 135 @SuppressWarnings("unchecked") 136 JAXBElement<T> doc = (JAXBElement<T>)u.unmarshal(inputStream); 136 137 return doc.getValue(); 137 138 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java
r30340 r30532 45 45 * File readers 46 46 */ 47 public static final Map<String, Class<? extends AbstractReader>> FILE_READERS = new HashMap< String, Class<? extends AbstractReader>>();47 public static final Map<String, Class<? extends AbstractReader>> FILE_READERS = new HashMap<>(); 48 48 static { 49 49 FILE_READERS.put(CSV_EXT, CsvReader.class); … … 58 58 } 59 59 60 public static final Map<String, Class<? extends AbstractReader>> FILE_AND_ARCHIVE_READERS = new HashMap< String, Class<? extends AbstractReader>>(FILE_READERS);60 public static final Map<String, Class<? extends AbstractReader>> FILE_AND_ARCHIVE_READERS = new HashMap<>(FILE_READERS); 61 61 static { 62 62 FILE_AND_ARCHIVE_READERS.put(ZIP_EXT, ZipReader.class); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/ProjectionChooser.java
r30340 r30532 18 18 import org.openstreetmap.josm.tools.GBC; 19 19 20 @SuppressWarnings("serial")21 20 public class ProjectionChooser extends ExtendedDialog { 22 21 … … 29 28 * Combobox with all projections available 30 29 */ 31 private final JComboBox projectionCombo = new JComboBox(ProjectionPreference.getProjectionChoices().toArray()); 30 private final JComboBox<ProjectionChoice> projectionCombo = new JComboBox<>( 31 ProjectionPreference.getProjectionChoices().toArray(new ProjectionChoice[0])); 32 32 33 33 public ProjectionChooser(Component parent) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ArchiveReader.java
r30340 r30532 59 59 60 60 final File temp = OdUtils.createTempDir(); 61 final List<File> candidates = new ArrayList< File>();61 final List<File> candidates = new ArrayList<>(); 62 62 63 63 try { … … 70 70 71 71 if (promptUser && candidates.size() > 1) { 72 DialogPrompter<CandidateChooser> prompt = new DialogPrompter () {72 DialogPrompter<CandidateChooser> prompt = new DialogPrompter<CandidateChooser>() { 73 73 @Override 74 74 protected CandidateChooser buildDialog() { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/CandidateChooser.java
r30340 r30532 27 27 private final JPanel projPanel = new JPanel(new GridBagLayout()); 28 28 29 //private final Map<JCheckBox, File> checkBoxes = new HashMap<JCheckBox, File>(); 30 private final JComboBox fileCombo; 29 private final JComboBox<File> fileCombo; 31 30 32 31 public CandidateChooser(Component parent, List<File> candidates) { … … 37 36 38 37 @Override 39 public Component getListCellRendererComponent(JList list, Object value,38 public Component getListCellRendererComponent(JList<?> list, Object value, 40 39 int index, boolean isSelected, boolean cellHasFocus) { 41 40 super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); … … 49 48 protected CandidateChooser(Component parent, String title, String[] buttonTexts, List<File> candidates) { 50 49 super(parent, title, buttonTexts); 51 this.fileCombo = new JComboBox (candidates.toArray());50 this.fileCombo = new JComboBox<>(candidates.toArray(new File[0])); 52 51 this.fileCombo.setRenderer(new Renderer()); 53 52 addGui(candidates); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/AbstractMapInfoReader.java
r30340 r30532 75 75 76 76 protected void parseColumns(String[] words) { 77 columns = new ArrayList< String>();77 columns = new ArrayList<>(); 78 78 numcolumns = Integer.parseInt(words[1]); 79 79 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultShpHandler.java
r30340 r30532 38 38 39 39 private static final List<Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>> 40 ellipsoids = new ArrayList< Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>>();40 ellipsoids = new ArrayList<>(); 41 41 static { 42 42 ellipsoids.add(new Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>(DefaultEllipsoid.GRS80, Ellipsoid.GRS80)); … … 44 44 } 45 45 46 protected static final Double get(ParameterValueGroup values, ParameterDescriptor desc) {46 protected static final Double get(ParameterValueGroup values, ParameterDescriptor<?> desc) { 47 47 return (Double) values.parameter(desc.getName().getCode()).getValue(); 48 48 } … … 64 64 return CRS.findMathTransform(getCrsFor(sourceCRS.getName().getCode()), targetCRS, lenient); 65 65 } else if (sourceCRS instanceof AbstractDerivedCRS && sourceCRS.getName().getCode().equalsIgnoreCase("Lambert_Conformal_Conic")) { 66 List<MathTransform> result = new ArrayList< MathTransform>();66 List<MathTransform> result = new ArrayList<>(); 67 67 AbstractDerivedCRS crs = (AbstractDerivedCRS) sourceCRS; 68 68 MathTransform transform = crs.getConversionFromBase().getMathTransform(); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicReader.java
r30340 r30532 72 72 73 73 public GeographicReader(GeographicHandler handler, GeographicHandler[] defaultHandlers) { 74 this.nodes = new HashMap< LatLon, Node>();74 this.nodes = new HashMap<>(); 75 75 this.handler = handler; 76 76 this.defaultHandlers = defaultHandlers; … … 256 256 257 257 if (findSimiliarCrs) { 258 List<CoordinateReferenceSystem> candidates = new ArrayList< CoordinateReferenceSystem>();258 List<CoordinateReferenceSystem> candidates = new ArrayList<>(); 259 259 260 260 // Find matching CRS with Bursa Wolf parameters in EPSG database -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GmlReader.java
r30340 r30532 144 144 145 145 private void parseFeatureMember(Component parent) throws XMLStreamException, GeoCrsException, FactoryException, UserCancelException, GeoMathTransformException, MismatchedDimensionException, TransformException { 146 List<OsmPrimitive> list = new ArrayList< OsmPrimitive>();146 List<OsmPrimitive> list = new ArrayList<>(); 147 147 Way way = null; 148 148 Node node = null; 149 Map<String, String> tags = new HashMap< String, String>();149 Map<String, String> tags = new HashMap<>(); 150 150 while (parser.hasNext()) { 151 151 int event = parser.next(); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReader.java
r30340 r30532 45 45 46 46 private XMLStreamReader parser; 47 private Map<LatLon, Node> nodes = new HashMap< LatLon, Node>();47 private Map<LatLon, Node> nodes = new HashMap<>(); 48 48 49 49 public KmlReader(XMLStreamReader parser) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java
r30508 r30532 9 9 import java.io.IOException; 10 10 import java.io.InputStream; 11 import java.io.Serializable; 11 12 import java.nio.charset.Charset; 12 13 import java.nio.charset.IllegalCharsetNameException; … … 56 57 57 58 private final ShpHandler handler; 58 private final Set<OsmPrimitive> featurePrimitives = new HashSet< OsmPrimitive>();59 private final Set<OsmPrimitive> featurePrimitives = new HashSet<>(); 59 60 60 61 public ShpReader(ShpHandler handler) { … … 174 175 try { 175 176 if (file != null) { 176 Map params = new HashMap();177 Map<String, Serializable> params = new HashMap<>(); 177 178 Charset charset = null; 178 179 params.put(ShapefileDataStoreFactory.URLP.key, file.toURI().toURL()); … … 194 195 if (charset != null) { 195 196 Main.info("Using charset "+charset); 196 params.put(ShapefileDataStoreFactory.DBFCHARSET.key, charset );197 params.put(ShapefileDataStoreFactory.DBFCHARSET.key, charset.name()); 197 198 } 198 DataStore dataStore = new ShapefileDataStoreFactory().createDataStore(params); //FIXME199 DataStore dataStore = new ShapefileDataStoreFactory().createDataStore(params); 199 200 if (dataStore == null) { 200 201 throw new IOException(tr("Unable to find a data store for file {0}", file.getName())); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/OdsReader.java
r30340 r30532 65 65 } 66 66 67 List<String> result = new ArrayList< String>();67 List<String> result = new ArrayList<>(); 68 68 boolean allFieldsBlank = true; 69 69 for (TableTableCell cell : row.getAllCells()) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetReader.java
r30340 r30532 97 97 System.out.println("Header: "+Arrays.toString(header)); 98 98 99 Map<ProjectionPatterns, List<CoordinateColumns>> projColumns = new HashMap< ProjectionPatterns, List<CoordinateColumns>>();99 Map<ProjectionPatterns, List<CoordinateColumns>> projColumns = new HashMap<>(); 100 100 101 101 for (int i = 0; i<header.length; i++) { … … 103 103 List<CoordinateColumns> columns = projColumns.get(pp); 104 104 if (columns == null) { 105 projColumns.put(pp, columns = new ArrayList< CoordinateColumns>());105 projColumns.put(pp, columns = new ArrayList<>()); 106 106 } 107 107 CoordinateColumns col = columns.isEmpty() ? null : columns.get(columns.size()-1); … … 116 116 } 117 117 118 final List<CoordinateColumns> columns = new ArrayList< CoordinateColumns>();118 final List<CoordinateColumns> columns = new ArrayList<>(); 119 119 120 120 for (ProjectionPatterns pp : projColumns.keySet()) { … … 180 180 } 181 181 182 final Map<CoordinateColumns, EastNorth> ens = new HashMap< CoordinateColumns, EastNorth>();183 final Map<CoordinateColumns, Node> nodes = new HashMap< CoordinateColumns, Node>();182 final Map<CoordinateColumns, EastNorth> ens = new HashMap<>(); 183 final Map<CoordinateColumns, Node> nodes = new HashMap<>(); 184 184 for (CoordinateColumns c : columns) { 185 185 nodes.put(c, new Node()); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/XlsReader.java
r30340 r30532 56 56 Row row = sheet.getRow(rowIndex++); 57 57 if (row != null) { 58 List<String> result = new ArrayList< String>();58 List<String> result = new ArrayList<>(); 59 59 for (Cell cell : row) { 60 60 switch (cell.getCellType()) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdDataLayer.java
r30340 r30532 124 124 @Override 125 125 public Action[] getMenuEntries() { 126 List<Action> result = new ArrayList< Action>();126 List<Action> result = new ArrayList<>(); 127 127 for (Action entry : super.getMenuEntries()) { 128 128 result.add(entry); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdDiffLayer.java
r30340 r30532 31 31 super(name); 32 32 this.dataLayer = dataLayer; 33 this.differentPrimitives = new ArrayList< Pair<OsmPrimitive,OsmPrimitive>>();34 this.onlyInTlsPrimitives = new ArrayList< OsmPrimitive>();35 this.onlyInOsmPrimitives = new ArrayList< OsmPrimitive>();33 this.differentPrimitives = new ArrayList<>(); 34 this.onlyInTlsPrimitives = new ArrayList<>(); 35 this.onlyInOsmPrimitives = new ArrayList<>(); 36 36 initDiff(dataLayer.data, dataLayer.osmLayer.data); 37 37 } … … 44 44 onlyInTlsPrimitives.add(p1); 45 45 } else if (!dataLayer.handler.equals(p1, p2)) { 46 differentPrimitives.add(new Pair< OsmPrimitive, OsmPrimitive>(p1, p2));46 differentPrimitives.add(new Pair<>(p1, p2)); 47 47 } 48 48 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdOsmDataLayer.java
r30340 r30532 41 41 if (nodes != null) { 42 42 for (Node n : nodes) { 43 List<OsmPrimitive> refferingAllowedWays = new ArrayList< OsmPrimitive>();43 List<OsmPrimitive> refferingAllowedWays = new ArrayList<>(); 44 44 for (OsmPrimitive referrer : n.getReferrers()) { 45 45 if (referrer instanceof Way && !dataLayer.handler.isForbidden(referrer)) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/licenses/License.java
r30340 r30532 17 17 public static final LOOL LOOL = new LOOL(); 18 18 19 private final Map<String, URL> urls = new HashMap< String, URL>();20 private final Map<String, URL> summaryURLs = new HashMap< String, URL>();19 private final Map<String, URL> urls = new HashMap<>(); 20 private final Map<String, URL> summaryURLs = new HashMap<>(); 21 21 22 22 private Icon icon; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/AbstractModule.java
r30340 r30532 19 19 public abstract class AbstractModule implements Module, OdConstants { 20 20 21 protected final List<Class<? extends AbstractDataSetHandler>> handlers = new ArrayList< Class <? extends AbstractDataSetHandler>>();21 protected final List<Class<? extends AbstractDataSetHandler>> handlers = new ArrayList<>(); 22 22 23 private final List<AbstractDataSetHandler> instanciatedHandlers = new ArrayList< AbstractDataSetHandler>();23 private final List<AbstractDataSetHandler> instanciatedHandlers = new ArrayList<>(); 24 24 25 25 protected final ModuleInformation info; … … 46 46 @Override 47 47 public SourceProvider getMapPaintStyleSourceProvider() { 48 final List<SourceEntry> sources = new ArrayList< SourceEntry>();48 final List<SourceEntry> sources = new ArrayList<>(); 49 49 for (AbstractDataSetHandler handler : getInstanciatedHandlers()) { 50 50 ExtendedSourceEntry src; … … 83 83 @Override 84 84 public SourceProvider getPresetSourceProvider() { 85 final List<SourceEntry> sources = new ArrayList< SourceEntry>();85 final List<SourceEntry> sources = new ArrayList<>(); 86 86 for (AbstractDataSetHandler handler : getInstanciatedHandlers()) { 87 87 if (handler != null && handler.getTaggingPreset() != null) { … … 99 99 @Override 100 100 public final List<AbstractDataSetHandler> getNewlyInstanciatedHandlers() { 101 List<AbstractDataSetHandler> result = new ArrayList< AbstractDataSetHandler>();101 List<AbstractDataSetHandler> result = new ArrayList<>(); 102 102 for (Class<? extends AbstractDataSetHandler> handlerClass : handlers) { 103 103 if (handlerClass != null) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleDownloadTask.java
r30436 r30532 32 32 */ 33 33 public class ModuleDownloadTask extends PleaseWaitRunnable{ 34 private final Collection<ModuleInformation> toUpdate = new LinkedList< ModuleInformation>();35 private final Collection<ModuleInformation> failed = new LinkedList< ModuleInformation>();36 private final Collection<ModuleInformation> downloaded = new LinkedList< ModuleInformation>();34 private final Collection<ModuleInformation> toUpdate = new LinkedList<>(); 35 private final Collection<ModuleInformation> failed = new LinkedList<>(); 36 private final Collection<ModuleInformation> downloaded = new LinkedList<>(); 37 37 //private Exception lastException; 38 38 private boolean canceled; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleHandler.java
r30340 r30532 61 61 * All installed and loaded modules (resp. their main classes) 62 62 */ 63 public final static Collection<Module> moduleList = new LinkedList< Module>();63 public final static Collection<Module> moduleList = new LinkedList<>(); 64 64 65 65 /** 66 66 * Add here all ClassLoader whose resource should be searched. 67 67 */ 68 private static final List<ClassLoader> sources = new LinkedList< ClassLoader>();68 private static final List<ClassLoader> sources = new LinkedList<>(); 69 69 70 70 static { … … 198 198 public static ClassLoader createClassLoader(Collection<ModuleInformation> modules) { 199 199 // iterate all modules and collect all libraries of all modules: 200 List<URL> allModuleLibraries = new LinkedList< URL>();200 List<URL> allModuleLibraries = new LinkedList<>(); 201 201 File moduleDir = OdPlugin.getInstance().getModulesDirectory(); 202 202 for (ModuleInformation info : modules) { … … 269 269 monitor.beginTask(tr("Loading modules ...")); 270 270 monitor.subTask(tr("Checking module preconditions...")); 271 List<ModuleInformation> toLoad = new LinkedList< ModuleInformation>();271 List<ModuleInformation> toLoad = new LinkedList<>(); 272 272 for (ModuleInformation pi: modules) { 273 273 if (checkLoadPreconditions(parent, modules, pi)) { … … 316 316 return null; 317 317 } 318 HashMap<String, ModuleInformation> ret = new HashMap< String, ModuleInformation>();318 HashMap<String, ModuleInformation> ret = new HashMap<>(); 319 319 for (ModuleInformation pi: task.getAvailableModules()) { 320 320 ret.put(pi.name, pi); … … 358 358 */ 359 359 public static List<ModuleInformation> buildListOfModulesToLoad(Component parent) { 360 Set<String> modules = new HashSet< String>();360 Set<String> modules = new HashSet<>(); 361 361 modules.addAll(Main.pref.getCollection(PREF_MODULES, new LinkedList<String>())); 362 362 if (System.getProperty("josm."+PREF_MODULES) != null) { … … 364 364 } 365 365 Map<String, ModuleInformation> infos = loadLocallyAvailableModuleInformation(null); 366 List<ModuleInformation> ret = new LinkedList< ModuleInformation>();366 List<ModuleInformation> ret = new LinkedList<>(); 367 367 for (Iterator<String> it = modules.iterator(); it.hasNext();) { 368 368 String module = it.next(); … … 448 448 // filter modules which actually have to be updated 449 449 // 450 Collection<ModuleInformation> modulesToUpdate = new ArrayList< ModuleInformation>();450 Collection<ModuleInformation> modulesToUpdate = new ArrayList<>(); 451 451 for(ModuleInformation pi: modules) { 452 452 if (pi.isUpdateRequired()) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleInformation.java
r30340 r30532 46 46 public String iconPath; 47 47 public ImageIcon icon; 48 public List<URL> libraries = new LinkedList< URL>();49 public final Map<String, String> attr = new TreeMap< String, String>();48 public List<URL> libraries = new LinkedList<>(); 49 public final Map<String, String> attr = new TreeMap<>(); 50 50 51 51 /** … … 245 245 * @return the loaded class 246 246 */ 247 @SuppressWarnings("unchecked") 247 248 public Class<? extends Module> loadClass(ClassLoader classLoader) throws ModuleException { 248 249 if (className == null) … … 265 266 public static Collection<String> getModuleLocations() { 266 267 Collection<String> locations = Main.pref.getAllPossiblePreferenceDirs(); 267 Collection<String> all = new ArrayList< String>(locations.size());268 Collection<String> all = new ArrayList<>(locations.size()); 268 269 for (String s : locations) { 269 270 all.add(s+"plugins/opendata/modules"); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleListParser.java
r30340 r30532 58 58 */ 59 59 public List<ModuleInformation> parse(InputStream in) throws ModuleListParseException{ 60 List<ModuleInformation> ret = new LinkedList< ModuleInformation>();60 List<ModuleInformation> ret = new LinkedList<>(); 61 61 BufferedReader r = null; 62 62 try { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadLocalModuleInformationTask.java
r30436 r30532 18 18 import org.openstreetmap.josm.io.OsmTransferException; 19 19 import org.openstreetmap.josm.tools.ImageProvider; 20 import org.openstreetmap.josm.tools.Utils;21 20 import org.xml.sax.SAXException; 22 21 … … 41 40 public ReadLocalModuleInformationTask() { 42 41 super(tr("Reading local module information.."), false); 43 availableModules = new HashMap< String, ModuleInformation>();42 availableModules = new HashMap<>(); 44 43 } 45 44 46 45 public ReadLocalModuleInformationTask(ProgressMonitor monitor) { 47 46 super(tr("Reading local module information.."),monitor, false); 48 availableModules = new HashMap< String, ModuleInformation>();47 availableModules = new HashMap<>(); 49 48 } 50 49 … … 225 224 */ 226 225 public List<ModuleInformation> getAvailableModules() { 227 return new ArrayList< ModuleInformation>(availableModules.values());226 return new ArrayList<>(availableModules.values()); 228 227 } 229 228 -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java
r30436 r30532 53 53 this.sites = Collections.emptySet(); 54 54 } 55 availableModules = new LinkedList< ModuleInformation>();55 availableModules = new LinkedList<>(); 56 56 57 57 } … … 297 297 298 298 // collect old cache files and remove if no longer in use 299 List<File> siteCacheFiles = new LinkedList< File>();299 List<File> siteCacheFiles = new LinkedList<>(); 300 300 for (String location : ModuleInformation.getModuleLocations()) { 301 301 File [] f = new File(location).listFiles( -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/NamesFrUtils.java
r30340 r30532 31 31 32 32 private static Map<String, String> initDictionary() { 33 Map<String, String> result = new HashMap< String, String>();33 Map<String, String> result = new HashMap<>(); 34 34 try { 35 35 BufferedReader reader = new BufferedReader(new InputStreamReader( -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/OdUtils.java
r30340 r30532 29 29 30 30 public static final String[] stripQuotesAndExtraChars(String[] split, String sep) { 31 List<String> result = new ArrayList< String>();31 List<String> result = new ArrayList<>(); 32 32 boolean append = false; 33 33 for (int i = 0; i<split.length; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.