Ignore:
Timestamp:
2014-07-14T04:18:06+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix compilation warnings

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  
    5656
    5757        // remove duplicates, preserving order
    58         ways = new LinkedHashSet<Way>(ways);
     58        ways = new LinkedHashSet<>(ways);
    5959
    6060        // try to build a new way which includes all the combined
     
    7171        TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways);
    7272
    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<>();
    7575        for (Way w: ways) {
    7676            if ((path.indexOf(w.getNode(0)) + 1) == path.lastIndexOf(w.getNode(1))) {
     
    9999            // if there are still reversed ways with direction-dependent tags, reverse their tags
    100100            if (!reversedWays.isEmpty()) {
    101                 List<Way> unreversedTagWays = new ArrayList<Way>(ways);
     101                List<Way> unreversedTagWays = new ArrayList<>(ways);
    102102                unreversedTagWays.removeAll(reversedWays);
    103103                ReverseWayTagCorrector reverseWayTagCorrector = new ReverseWayTagCorrector();
    104                 List<Way> reversedTagWays = new ArrayList<Way>();
     104                List<Way> reversedTagWays = new ArrayList<>();
    105105                Collection<Command> changePropertyCommands =  null;
    106106                for (Way w : reversedWays) {
     
    149149        }
    150150
    151         LinkedList<Way> deletedWays = new LinkedList<Way>(ways);
     151        LinkedList<Way> deletedWays = new LinkedList<>(ways);
    152152        deletedWays.remove(targetWay);
    153153
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreference.java

    r30340 r30532  
    219219            return false;
    220220        if (model.isActiveModulesChanged()) {
    221             LinkedList<String> l = new LinkedList<String>(model.getSelectedModuleNames());
     221            LinkedList<String> l = new LinkedList<>(model.getSelectedModuleNames());
    222222            Collections.sort(l);
    223223            Main.pref.putCollection(PREF_MODULES, l);
     
    446446    static private class ModuleConfigurationSitesPanel extends JPanel {
    447447
    448         private DefaultListModel model;
     448        private DefaultListModel<String> model;
    449449
    450450        protected void build() {
    451451            setLayout(new GridBagLayout());
    452452            add(new JLabel(tr("Add Open Data Module description URL.")), GBC.eol());
    453             model = new DefaultListModel();
     453            model = new DefaultListModel<>();
    454454            for (String s : OdPreferenceSetting.getModuleSites()) {
    455455                model.addElement(s);
    456456            }
    457             final JList list = new JList(model);
     457            final JList<String> list = new JList<>(model);
    458458            add(new JScrollPane(list), GBC.std().fill());
    459459            JPanel buttons = new JPanel(new GridBagLayout());
     
    519519        public List<String> getUpdateSites() {
    520520            if (model.getSize() == 0) return Collections.emptyList();
    521             List<String> ret = new ArrayList<String>(model.getSize());
     521            List<String> ret = new ArrayList<>(model.getSize());
    522522            for (int i=0; i< model.getSize();i++){
    523                 ret.add((String)model.get(i));
     523                ret.add(model.get(i));
    524524            }
    525525            return ret;
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreferencesModel.java

    r30340 r30532  
    2020import org.openstreetmap.josm.plugins.opendata.core.modules.ModuleInformation;
    2121
    22 /**
    23  * TODO
    24  *
    25  */
    2622public 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<>();
    3127    private String filterExpression;
    3228    private final Set<String> currentActiveModules;
     
    3733   
    3834    public ModulePreferencesModel() {
    39         currentActiveModules = new HashSet<String>();
     35        currentActiveModules = new HashSet<>();
    4036        currentActiveModules.addAll(getModules(currentActiveModules));
    4137    }
     
    6662        sort();
    6763        filterDisplayedModules(filterExpression);
    68         Set<String> activeModules = new HashSet<String>();
     64        Set<String> activeModules = new HashSet<>();
    6965        activeModules.addAll(getModules(activeModules));
    7066        for (ModuleInformation pi: availableModules) {
     
    10197        sort();
    10298        filterDisplayedModules(filterExpression);
    103         Set<String> activeModules = new HashSet<String>();
     99        Set<String> activeModules = new HashSet<>();
    104100        activeModules.addAll(getModules(activeModules));
    105101        for (ModuleInformation pi: availableModules) {
     
    120116     */
    121117    public List<ModuleInformation> getSelectedModules() {
    122         List<ModuleInformation> ret = new LinkedList<ModuleInformation>();
     118        List<ModuleInformation> ret = new LinkedList<>();
    123119        for (ModuleInformation pi: availableModules) {
    124120            if (selectedModulesMap.get(pi) == null) {
     
    138134     */
    139135    public Set<String> getSelectedModuleNames() {
    140         Set<String> ret = new HashSet<String>();
     136        Set<String> ret = new HashSet<>();
    141137        for (ModuleInformation pi: getSelectedModules()) {
    142138            ret.add(pi.name);
     
    177173     */
    178174    public List<ModuleInformation> getModulesScheduledForUpdateOrDownload() {
    179         List<ModuleInformation> ret = new ArrayList<ModuleInformation>();
     175        List<ModuleInformation> ret = new ArrayList<>();
    180176        for (String module: pendingDownloads) {
    181177            ModuleInformation pi = getModuleInformation(module);
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NeptuneReader.java

    r30340 r30532  
    7676        public static final String OSM_FERRY = "ferry";
    7777
    78         private static final List<URL> schemas = new ArrayList<URL>();
     78        private static final List<URL> schemas = new ArrayList<>();
    7979        static {
    8080                schemas.add(NeptuneReader.class.getResource(NEPTUNE_XSD));
     
    8383        private ChouettePTNetworkType root;
    8484       
    85         private final Map<String, OsmPrimitive> tridentObjects = new HashMap<String, OsmPrimitive>();
     85        private final Map<String, OsmPrimitive> tridentObjects = new HashMap<>();
    8686       
    8787        public static final boolean acceptsXmlNeptuneFile(File file) {
     
    133133                JAXBContext jc = JAXBContext.newInstance(packageName, NeptuneReader.class.getClassLoader());
    134134                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);
    136137                return doc.getValue();
    137138        }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java

    r30340 r30532  
    4545     * File readers
    4646     */
    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<>();
    4848    static {
    4949        FILE_READERS.put(CSV_EXT, CsvReader.class);
     
    5858    }
    5959   
    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);
    6161    static {
    6262        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  
    1818import org.openstreetmap.josm.tools.GBC;
    1919
    20 @SuppressWarnings("serial")
    2120public class ProjectionChooser extends ExtendedDialog {
    2221
     
    2928     * Combobox with all projections available
    3029     */
    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]));
    3232
    3333        public ProjectionChooser(Component parent) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ArchiveReader.java

    r30340 r30532  
    5959       
    6060        final File temp = OdUtils.createTempDir();
    61         final List<File> candidates = new ArrayList<File>();
     61        final List<File> candidates = new ArrayList<>();
    6262       
    6363        try {
     
    7070           
    7171            if (promptUser && candidates.size() > 1) {
    72                 DialogPrompter<CandidateChooser> prompt = new DialogPrompter() {
     72                DialogPrompter<CandidateChooser> prompt = new DialogPrompter<CandidateChooser>() {
    7373                    @Override
    7474                    protected CandidateChooser buildDialog() {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/CandidateChooser.java

    r30340 r30532  
    2727    private final JPanel projPanel = new JPanel(new GridBagLayout());
    2828
    29     //private final Map<JCheckBox, File> checkBoxes = new HashMap<JCheckBox, File>();
    30     private final JComboBox fileCombo;
     29    private final JComboBox<File> fileCombo;
    3130
    3231        public CandidateChooser(Component parent, List<File> candidates) {
     
    3736
    3837                @Override
    39                 public Component getListCellRendererComponent(JList list, Object value,
     38                public Component getListCellRendererComponent(JList<?> list, Object value,
    4039                                int index, boolean isSelected, boolean cellHasFocus) {
    4140                        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
     
    4948        protected CandidateChooser(Component parent, String title, String[] buttonTexts, List<File> candidates) {
    5049                super(parent, title, buttonTexts);
    51                 this.fileCombo = new JComboBox(candidates.toArray());
     50                this.fileCombo = new JComboBox<>(candidates.toArray(new File[0]));
    5251                this.fileCombo.setRenderer(new Renderer());
    5352                addGui(candidates);
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/AbstractMapInfoReader.java

    r30340 r30532  
    7575       
    7676        protected void parseColumns(String[] words) {
    77                 columns = new ArrayList<String>();
     77                columns = new ArrayList<>();
    7878                numcolumns = Integer.parseInt(words[1]);
    7979        }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultShpHandler.java

    r30340 r30532  
    3838
    3939        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<>();
    4141        static {
    4242                ellipsoids.add(new Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>(DefaultEllipsoid.GRS80, Ellipsoid.GRS80));
     
    4444        }
    4545       
    46         protected static final Double get(ParameterValueGroup values, ParameterDescriptor desc) {
     46        protected static final Double get(ParameterValueGroup values, ParameterDescriptor<?> desc) {
    4747                return (Double) values.parameter(desc.getName().getCode()).getValue();
    4848        }
     
    6464                        return CRS.findMathTransform(getCrsFor(sourceCRS.getName().getCode()), targetCRS, lenient);
    6565                } 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<>();
    6767                        AbstractDerivedCRS crs = (AbstractDerivedCRS) sourceCRS;
    6868                        MathTransform transform = crs.getConversionFromBase().getMathTransform();
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicReader.java

    r30340 r30532  
    7272
    7373        public GeographicReader(GeographicHandler handler, GeographicHandler[] defaultHandlers) {
    74                 this.nodes = new HashMap<LatLon, Node>();
     74                this.nodes = new HashMap<>();
    7575                this.handler = handler;
    7676                this.defaultHandlers = defaultHandlers;
     
    256256                       
    257257                        if (findSimiliarCrs) {
    258                                 List<CoordinateReferenceSystem> candidates = new ArrayList<CoordinateReferenceSystem>();
     258                                List<CoordinateReferenceSystem> candidates = new ArrayList<>();
    259259                               
    260260                                // 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  
    144144       
    145145        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<>();
    147147                Way way = null;
    148148                Node node = null;
    149                 Map<String, String> tags = new HashMap<String, String>();
     149                Map<String, String> tags = new HashMap<>();
    150150                while (parser.hasNext()) {
    151151            int event = parser.next();
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReader.java

    r30340 r30532  
    4545
    4646    private XMLStreamReader parser;
    47     private Map<LatLon, Node> nodes = new HashMap<LatLon, Node>();
     47    private Map<LatLon, Node> nodes = new HashMap<>();
    4848   
    4949    public KmlReader(XMLStreamReader parser) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java

    r30508 r30532  
    99import java.io.IOException;
    1010import java.io.InputStream;
     11import java.io.Serializable;
    1112import java.nio.charset.Charset;
    1213import java.nio.charset.IllegalCharsetNameException;
     
    5657
    5758        private final ShpHandler handler;
    58         private final Set<OsmPrimitive> featurePrimitives = new HashSet<OsmPrimitive>();
     59        private final Set<OsmPrimitive> featurePrimitives = new HashSet<>();
    5960       
    6061        public ShpReader(ShpHandler handler) {
     
    174175                try {
    175176                        if (file != null) {
    176                         Map params = new HashMap();
     177                        Map<String, Serializable> params = new HashMap<>();
    177178                        Charset charset = null;
    178179                        params.put(ShapefileDataStoreFactory.URLP.key, file.toURI().toURL());
     
    194195                        if (charset != null) {
    195196                            Main.info("Using charset "+charset);
    196                             params.put(ShapefileDataStoreFactory.DBFCHARSET.key, charset);
     197                            params.put(ShapefileDataStoreFactory.DBFCHARSET.key, charset.name());
    197198                        }
    198                                 DataStore dataStore = new ShapefileDataStoreFactory().createDataStore(params);//FIXME
     199                                DataStore dataStore = new ShapefileDataStoreFactory().createDataStore(params);
    199200                                if (dataStore == null) {
    200201                                        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  
    6565                        }
    6666
    67                         List<String> result = new ArrayList<String>();
     67                        List<String> result = new ArrayList<>();
    6868                        boolean allFieldsBlank = true;
    6969                        for (TableTableCell cell : row.getAllCells()) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetReader.java

    r30340 r30532  
    9797                System.out.println("Header: "+Arrays.toString(header));
    9898               
    99                 Map<ProjectionPatterns, List<CoordinateColumns>> projColumns = new HashMap<ProjectionPatterns, List<CoordinateColumns>>();
     99                Map<ProjectionPatterns, List<CoordinateColumns>> projColumns = new HashMap<>();
    100100               
    101101                for (int i = 0; i<header.length; i++) {
     
    103103                            List<CoordinateColumns> columns = projColumns.get(pp);
    104104                            if (columns == null) {
    105                                 projColumns.put(pp, columns = new ArrayList<CoordinateColumns>());
     105                                projColumns.put(pp, columns = new ArrayList<>());
    106106                            }
    107107                                CoordinateColumns col = columns.isEmpty() ? null : columns.get(columns.size()-1);
     
    116116                }
    117117
    118                 final List<CoordinateColumns> columns = new ArrayList<CoordinateColumns>();
     118                final List<CoordinateColumns> columns = new ArrayList<>();
    119119               
    120120                for (ProjectionPatterns pp : projColumns.keySet()) {
     
    180180                        }
    181181                       
    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<>();
    184184                        for (CoordinateColumns c : columns) {
    185185                            nodes.put(c, new Node());
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/XlsReader.java

    r30340 r30532  
    5656                        Row row = sheet.getRow(rowIndex++);
    5757                        if (row != null) {
    58                                 List<String> result = new ArrayList<String>();
     58                                List<String> result = new ArrayList<>();
    5959                                for (Cell cell : row) {
    6060                            switch (cell.getCellType()) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdDataLayer.java

    r30340 r30532  
    124124        @Override
    125125        public Action[] getMenuEntries() {
    126                 List<Action> result = new ArrayList<Action>();
     126                List<Action> result = new ArrayList<>();
    127127                for (Action entry : super.getMenuEntries()) {
    128128                        result.add(entry);
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdDiffLayer.java

    r30340 r30532  
    3131                super(name);
    3232                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<>();
    3636                initDiff(dataLayer.data, dataLayer.osmLayer.data);
    3737        }
     
    4444                                        onlyInTlsPrimitives.add(p1);
    4545                                } else if (!dataLayer.handler.equals(p1, p2)) {
    46                                         differentPrimitives.add(new Pair<OsmPrimitive, OsmPrimitive>(p1, p2));
     46                                        differentPrimitives.add(new Pair<>(p1, p2));
    4747                                }
    4848                        }
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdOsmDataLayer.java

    r30340 r30532  
    4141                                                        if (nodes != null) {
    4242                                                                for (Node n : nodes) {
    43                                                                         List<OsmPrimitive> refferingAllowedWays = new ArrayList<OsmPrimitive>();
     43                                                                        List<OsmPrimitive> refferingAllowedWays = new ArrayList<>();
    4444                                                                        for (OsmPrimitive referrer : n.getReferrers()) {
    4545                                                                                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  
    1717        public static final LOOL LOOL = new LOOL();
    1818       
    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<>();
    2121       
    2222        private Icon icon;
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/AbstractModule.java

    r30340 r30532  
    1919public abstract class AbstractModule implements Module, OdConstants {
    2020
    21         protected final List<Class<? extends AbstractDataSetHandler>> handlers = new ArrayList<Class <? extends AbstractDataSetHandler>>();
     21        protected final List<Class<? extends AbstractDataSetHandler>> handlers = new ArrayList<>();
    2222
    23         private final List<AbstractDataSetHandler> instanciatedHandlers = new ArrayList<AbstractDataSetHandler>();
     23        private final List<AbstractDataSetHandler> instanciatedHandlers = new ArrayList<>();
    2424
    2525        protected final ModuleInformation info;
     
    4646        @Override
    4747        public SourceProvider getMapPaintStyleSourceProvider() {
    48                 final List<SourceEntry> sources = new ArrayList<SourceEntry>();
     48                final List<SourceEntry> sources = new ArrayList<>();
    4949                for (AbstractDataSetHandler handler : getInstanciatedHandlers()) {
    5050                        ExtendedSourceEntry src;
     
    8383        @Override
    8484        public SourceProvider getPresetSourceProvider() {
    85                 final List<SourceEntry> sources = new ArrayList<SourceEntry>();
     85                final List<SourceEntry> sources = new ArrayList<>();
    8686                for (AbstractDataSetHandler handler : getInstanciatedHandlers()) {
    8787                        if (handler != null && handler.getTaggingPreset() != null) {
     
    9999        @Override
    100100        public final List<AbstractDataSetHandler> getNewlyInstanciatedHandlers() {
    101                 List<AbstractDataSetHandler> result = new ArrayList<AbstractDataSetHandler>();
     101                List<AbstractDataSetHandler> result = new ArrayList<>();
    102102                for (Class<? extends AbstractDataSetHandler> handlerClass : handlers) {
    103103                        if (handlerClass != null) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleDownloadTask.java

    r30436 r30532  
    3232 */
    3333public 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<>();
    3737    //private Exception lastException;
    3838    private boolean canceled;
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleHandler.java

    r30340 r30532  
    6161     * All installed and loaded modules (resp. their main classes)
    6262     */
    63     public final static Collection<Module> moduleList = new LinkedList<Module>();
     63    public final static Collection<Module> moduleList = new LinkedList<>();
    6464
    6565    /**
    6666     * Add here all ClassLoader whose resource should be searched.
    6767     */
    68     private static final List<ClassLoader> sources = new LinkedList<ClassLoader>();
     68    private static final List<ClassLoader> sources = new LinkedList<>();
    6969
    7070    static {
     
    198198    public static ClassLoader createClassLoader(Collection<ModuleInformation> modules) {
    199199        // iterate all modules and collect all libraries of all modules:
    200         List<URL> allModuleLibraries = new LinkedList<URL>();
     200        List<URL> allModuleLibraries = new LinkedList<>();
    201201        File moduleDir = OdPlugin.getInstance().getModulesDirectory();
    202202        for (ModuleInformation info : modules) {
     
    269269            monitor.beginTask(tr("Loading modules ..."));
    270270            monitor.subTask(tr("Checking module preconditions..."));
    271             List<ModuleInformation> toLoad = new LinkedList<ModuleInformation>();
     271            List<ModuleInformation> toLoad = new LinkedList<>();
    272272            for (ModuleInformation pi: modules) {
    273273                if (checkLoadPreconditions(parent, modules, pi)) {
     
    316316                return null;
    317317            }
    318             HashMap<String, ModuleInformation> ret = new HashMap<String, ModuleInformation>();
     318            HashMap<String, ModuleInformation> ret = new HashMap<>();
    319319            for (ModuleInformation pi: task.getAvailableModules()) {
    320320                ret.put(pi.name, pi);
     
    358358     */
    359359    public static List<ModuleInformation> buildListOfModulesToLoad(Component parent) {
    360         Set<String> modules = new HashSet<String>();
     360        Set<String> modules = new HashSet<>();
    361361        modules.addAll(Main.pref.getCollection(PREF_MODULES,  new LinkedList<String>()));
    362362        if (System.getProperty("josm."+PREF_MODULES) != null) {
     
    364364        }
    365365        Map<String, ModuleInformation> infos = loadLocallyAvailableModuleInformation(null);
    366         List<ModuleInformation> ret = new LinkedList<ModuleInformation>();
     366        List<ModuleInformation> ret = new LinkedList<>();
    367367        for (Iterator<String> it = modules.iterator(); it.hasNext();) {
    368368            String module = it.next();
     
    448448            // filter modules which actually have to be updated
    449449            //
    450             Collection<ModuleInformation> modulesToUpdate = new ArrayList<ModuleInformation>();
     450            Collection<ModuleInformation> modulesToUpdate = new ArrayList<>();
    451451            for(ModuleInformation pi: modules) {
    452452                if (pi.isUpdateRequired()) {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleInformation.java

    r30340 r30532  
    4646    public String iconPath;
    4747    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<>();
    5050
    5151    /**
     
    245245     * @return the loaded class
    246246     */
     247    @SuppressWarnings("unchecked")
    247248    public Class<? extends Module> loadClass(ClassLoader classLoader) throws ModuleException {
    248249        if (className == null)
     
    265266    public static Collection<String> getModuleLocations() {
    266267        Collection<String> locations = Main.pref.getAllPossiblePreferenceDirs();
    267         Collection<String> all = new ArrayList<String>(locations.size());
     268        Collection<String> all = new ArrayList<>(locations.size());
    268269        for (String s : locations) {
    269270            all.add(s+"plugins/opendata/modules");
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleListParser.java

    r30340 r30532  
    5858     */
    5959    public List<ModuleInformation> parse(InputStream in) throws ModuleListParseException{
    60         List<ModuleInformation> ret = new LinkedList<ModuleInformation>();
     60        List<ModuleInformation> ret = new LinkedList<>();
    6161        BufferedReader r = null;
    6262        try {
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadLocalModuleInformationTask.java

    r30436 r30532  
    1818import org.openstreetmap.josm.io.OsmTransferException;
    1919import org.openstreetmap.josm.tools.ImageProvider;
    20 import org.openstreetmap.josm.tools.Utils;
    2120import org.xml.sax.SAXException;
    2221
     
    4140    public ReadLocalModuleInformationTask() {
    4241        super(tr("Reading local module information.."), false);
    43         availableModules = new HashMap<String, ModuleInformation>();
     42        availableModules = new HashMap<>();
    4443    }
    4544
    4645    public ReadLocalModuleInformationTask(ProgressMonitor monitor) {
    4746        super(tr("Reading local module information.."),monitor, false);
    48         availableModules = new HashMap<String, ModuleInformation>();
     47        availableModules = new HashMap<>();
    4948    }
    5049
     
    225224     */
    226225    public List<ModuleInformation> getAvailableModules() {
    227         return new ArrayList<ModuleInformation>(availableModules.values());
     226        return new ArrayList<>(availableModules.values());
    228227    }
    229228
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java

    r30436 r30532  
    5353            this.sites = Collections.emptySet();
    5454        }
    55         availableModules = new LinkedList<ModuleInformation>();
     55        availableModules = new LinkedList<>();
    5656
    5757    }
     
    297297
    298298        // collect old cache files and remove if no longer in use
    299         List<File> siteCacheFiles = new LinkedList<File>();
     299        List<File> siteCacheFiles = new LinkedList<>();
    300300        for (String location : ModuleInformation.getModuleLocations()) {
    301301            File [] f = new File(location).listFiles(
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/NamesFrUtils.java

    r30340 r30532  
    3131       
    3232        private static Map<String, String> initDictionary() {
    33                 Map<String, String> result = new HashMap<String, String>();
     33                Map<String, String> result = new HashMap<>();
    3434                try {
    3535                        BufferedReader reader = new BufferedReader(new InputStreamReader(
  • applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/OdUtils.java

    r30340 r30532  
    2929   
    3030        public static final String[] stripQuotesAndExtraChars(String[] split, String sep) {
    31                 List<String> result = new ArrayList<String>();
     31                List<String> result = new ArrayList<>();
    3232                boolean append = false;
    3333                for (int i = 0; i<split.length; i++) {
Note: See TracChangeset for help on using the changeset viewer.