Ignore:
Timestamp:
2014-04-26T17:39:23+02:00 (6 years ago)
Author:
Don-vip
Message:

see #8465 - use diamond operator where applicable

Location:
trunk/src/org/openstreetmap/josm/io
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/AbstractReader.java

    r6248 r7005  
    4141     * to identify primitives unknown to the OSM server
    4242     */
    43     protected final Map<PrimitiveId, OsmPrimitive> externalIdMap = new HashMap<PrimitiveId, OsmPrimitive>();
     43    protected final Map<PrimitiveId, OsmPrimitive> externalIdMap = new HashMap<>();
    4444
    4545    /**
    4646     * Data structure for the remaining way objects
    4747     */
    48     protected final Map<Long, Collection<Long>> ways = new HashMap<Long, Collection<Long>>();
     48    protected final Map<Long, Collection<Long>> ways = new HashMap<>();
    4949
    5050    /**
    5151     * Data structure for relation objects
    5252     */
    53     protected final Map<Long, Collection<RelationMemberData>> relations = new HashMap<Long, Collection<RelationMemberData>>();
     53    protected final Map<Long, Collection<RelationMemberData>> relations = new HashMap<>();
    5454   
    5555    /**
     
    8484        for (Long externalWayId: ways.keySet()) {
    8585            Way w = (Way)externalIdMap.get(new SimplePrimitiveId(externalWayId, OsmPrimitiveType.WAY));
    86             List<Node> wayNodes = new ArrayList<Node>();
     86            List<Node> wayNodes = new ArrayList<>();
    8787            for (long id : ways.get(externalWayId)) {
    8888                Node n = (Node)externalIdMap.get(new SimplePrimitiveId(id, OsmPrimitiveType.NODE));
     
    137137                    new SimplePrimitiveId(externalRelationId, OsmPrimitiveType.RELATION)
    138138            );
    139             List<RelationMember> relationMembers = new ArrayList<RelationMember>();
     139            List<RelationMember> relationMembers = new ArrayList<>();
    140140            for (RelationMemberData rm : relations.get(externalRelationId)) {
    141141                OsmPrimitive primitive = null;
  • trunk/src/org/openstreetmap/josm/io/CacheFiles.java

    r6995 r7005  
    245245        if(!this.enabled || maxsize == -1) return;
    246246
    247         TreeMap<Long, File> modtime = new TreeMap<Long, File>();
     247        TreeMap<Long, File> modtime = new TreeMap<>();
    248248        long dirsize = 0;
    249249
  • trunk/src/org/openstreetmap/josm/io/Capabilities.java

    r6890 r7005  
    9595        } else {
    9696            if (! capabilities.containsKey(element))  {
    97                 HashMap<String,String> h = new HashMap<String, String>();
     97                HashMap<String,String> h = new HashMap<>();
    9898                capabilities.put(element, h);
    9999            }
     
    104104
    105105    public final void clear() {
    106         capabilities = new HashMap<String, HashMap<String,String>>();
    107         imageryBlacklist = new ArrayList<String>();
     106        capabilities = new HashMap<>();
     107        imageryBlacklist = new ArrayList<>();
    108108    }
    109109
  • trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java

    r6889 r7005  
    401401            return value == null || value.isEmpty()
    402402                    ? Collections.<Long>emptySet() :
    403                     new HashSet<Long>(Utils.transform(Arrays.asList(value.split(",")), new Utils.Function<String, Long>() {
     403                    new HashSet<>(Utils.transform(Arrays.asList(value.split(",")), new Utils.Function<String, Long>() {
    404404                        @Override
    405405                        public Long apply(String x) {
     
    457457
    458458        protected Map<String,String> createMapFromQueryString(String query) {
    459             Map<String,String> queryParams  = new HashMap<String, String>();
     459            Map<String,String> queryParams  = new HashMap<>();
    460460            String[] keyValuePairs = query.split("&");
    461461            for (String keyValuePair: keyValuePairs) {
  • trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java

    r6971 r7005  
    6464    private ProxySelector delegate;
    6565
    66     private final Set<String> errorResources = new HashSet<String>();
    67     private final Set<String> errorMessages = new HashSet<String>();
     66    private final Set<String> errorResources = new HashSet<>();
     67    private final Set<String> errorMessages = new HashSet<>();
    6868    private Set<String> proxyExceptions;
    6969
     
    140140            }
    141141        }
    142         proxyExceptions = new HashSet<String>(
     142        proxyExceptions = new HashSet<>(
    143143            Main.pref.getCollection(ProxyPreferencesPanel.PROXY_EXCEPTIONS,
    144144                    Arrays.asList(new String[]{"localhost", "127.0.0.1"}))
     
    161161     */
    162162    public final Set<String> getErrorResources() {
    163         return new TreeSet<String>(errorResources);
     163        return new TreeSet<>(errorResources);
    164164    }
    165165
     
    170170     */
    171171    public final Set<String> getErrorMessages() {
    172         return new TreeSet<String>(errorMessages);
     172        return new TreeSet<>(errorMessages);
    173173    }
    174174
  • trunk/src/org/openstreetmap/josm/io/DiffResultProcessor.java

    r7004 r7005  
    4242     * replied by the server
    4343     */
    44     private Map<PrimitiveId, DiffResultEntry> diffResults = new HashMap<PrimitiveId, DiffResultEntry>();
     44    private Map<PrimitiveId, DiffResultEntry> diffResults = new HashMap<>();
    4545    /**
    4646     * the set of processed primitives *after* the new id, the new version and the new changeset id
     
    6464        }
    6565        this.primitives = primitives;
    66         this.processed = new HashSet<IPrimitive>();
     66        this.processed = new HashSet<>();
    6767    }
    6868
  • trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java

    r6806 r7005  
    5858    public String write(boolean pretty) {
    5959        StringWriter stringWriter = new StringWriter();
    60         Map<String, Object> config = new HashMap<String, Object>(1);
     60        Map<String, Object> config = new HashMap<>(1);
    6161        config.put(JsonGenerator.PRETTY_PRINTING, pretty);
    6262        JsonWriter writer = Json.createWriterFactory(config).createWriter(stringWriter);
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r7001 r7005  
    290290                        "GNU Lesser Public License (LGPL)",
    291291                        "BSD License (MIT/X11)"};
    292                 JList<String> l = new JList<String>(licenses);
     292                JList<String> l = new JList<>(licenses);
    293293                l.setVisibleRowCount(licenses.length);
    294294                l.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  • trunk/src/org/openstreetmap/josm/io/GpxReader.java

    r6830 r7005  
    6767        private Extensions currentExtensions;
    6868        private Stack<State> states;
    69         private final Stack<String> elements = new Stack<String>();
     69        private final Stack<String> elements = new Stack<>();
    7070
    7171        private StringBuffer accumulator = new StringBuffer();
     
    7575        @Override public void startDocument() {
    7676            accumulator = new StringBuffer();
    77             states = new Stack<State>();
     77            states = new Stack<>();
    7878            data = new GpxData();
    7979        }
     
    123123                    states.push(currentState);
    124124                    currentState = State.trk;
    125                     currentTrack = new ArrayList<Collection<WayPoint>>();
    126                     currentTrackAttr = new HashMap<String, Object>();
     125                    currentTrack = new ArrayList<>();
     126                    currentTrackAttr = new HashMap<>();
    127127                } else if (localName.equals("extensions")) {
    128128                    states.push(currentState);
     
    164164                    states.push(currentState);
    165165                    currentState = State.trkseg;
    166                     currentTrackSeg = new ArrayList<WayPoint>();
     166                    currentTrackSeg = new ArrayList<>();
    167167                } else if (localName.equals("link")) {
    168168                    states.push(currentState);
     
    415415
    416416        public void tryToFinish() throws SAXException {
    417             List<String> remainingElements = new ArrayList<String>(elements);
     417            List<String> remainingElements = new ArrayList<>(elements);
    418418            for (int i=remainingElements.size() - 1; i >= 0; i--) {
    419419                endElement(null, remainingElements.get(i), remainingElements.get(i));
  • trunk/src/org/openstreetmap/josm/io/JpgImporter.java

    r6070 r7005  
    7171        progressMonitor.beginTask(tr("Looking for image files"), 1);
    7272        try {
    73             List<File> files = new ArrayList<File>();
    74             Set<String> visitedDirs = new HashSet<String>();
     73            List<File> files = new ArrayList<>();
     74            Set<String> visitedDirs = new HashSet<>();
    7575            addRecursiveFiles(files, visitedDirs, sel, progressMonitor.createSubTaskMonitor(1, true));
    7676
  • trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java

    r6985 r7005  
    236236            if (!url.getProtocol().equals("file")) {
    237237                String prefKey = getPrefKey(url, destDir);
    238                 List<String> localPath = new ArrayList<String>(Main.pref.getCollection(prefKey));
     238                List<String> localPath = new ArrayList<>(Main.pref.getCollection(prefKey));
    239239                if (localPath.size() == 2) {
    240240                    File lfile = new File(localPath.get(1));
     
    269269        long age = 0L;
    270270        File localFile = null;
    271         List<String> localPathEntry = new ArrayList<String>(Main.pref.getCollection(prefKey));
     271        List<String> localPathEntry = new ArrayList<>(Main.pref.getCollection(prefKey));
    272272        if (localPathEntry.size() == 2) {
    273273            localFile = new File(localPathEntry.get(1));
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r7004 r7005  
    7575     */
    7676    public MultiFetchServerObjectReader() {
    77         nodes = new LinkedHashSet<Long>();
    78         ways = new LinkedHashSet<Long>();
    79         relations = new LinkedHashSet<Long>();
     77        nodes = new LinkedHashSet<>();
     78        ways = new LinkedHashSet<>();
     79        relations = new LinkedHashSet<>();
    8080        this.outputDataSet = new DataSet();
    81         this.missingPrimitives = new LinkedHashSet<PrimitiveId>();
     81        this.missingPrimitives = new LinkedHashSet<>();
    8282    }
    8383
     
    238238     */
    239239    protected Set<Long> extractIdPackage(Set<Long> ids) {
    240         HashSet<Long> pkg = new HashSet<Long>();
     240        HashSet<Long> pkg = new HashSet<>();
    241241        if (ids.isEmpty())
    242242            return pkg;
     
    333333        progressMonitor.setTicks(0);
    334334        // The complete set containg all primitives to fetch
    335         Set<Long> toFetch = new HashSet<Long>(ids);
     335        Set<Long> toFetch = new HashSet<>(ids);
    336336        // Build a list of fetchers that will  download smaller sets containing only MAX_IDS_PER_REQUEST (200) primitives each.
    337337        // we will run up to MAX_DOWNLOAD_THREADS concurrent fetchers.
     
    339339        threadsNumber = Math.min(Math.max(threadsNumber, 1), OsmApi.MAX_DOWNLOAD_THREADS);
    340340        Executor exec = Executors.newFixedThreadPool(threadsNumber);
    341         CompletionService<FetchResult> ecs = new ExecutorCompletionService<FetchResult>(exec);
    342         List<Future<FetchResult>> jobs = new ArrayList<Future<FetchResult>>();
     341        CompletionService<FetchResult> ecs = new ExecutorCompletionService<>(exec);
     342        List<Future<FetchResult>> jobs = new ArrayList<>();
    343343        while (!toFetch.isEmpty()) {
    344344            jobs.add(ecs.submit(new Fetcher(type, extractIdPackage(toFetch), progressMonitor)));
     
    388388        progressMonitor.beginTask(trn("Downloading {0} object from ''{1}''", "Downloading {0} objects from ''{1}''", n, n, OsmApi.getOsmApi().getBaseUrl()));
    389389        try {
    390             missingPrimitives = new HashSet<PrimitiveId>();
     390            missingPrimitives = new HashSet<>();
    391391            if (isCanceled()) return null;
    392392            fetchPrimitives(ways,OsmPrimitiveType.WAY, progressMonitor);
  • trunk/src/org/openstreetmap/josm/io/NmeaReader.java

    r6995 r7005  
    172172        // create the data tree
    173173        data = new GpxData();
    174         Collection<Collection<WayPoint>> currentTrack = new ArrayList<Collection<WayPoint>>();
     174        Collection<Collection<WayPoint>> currentTrack = new ArrayList<>();
    175175
    176176        BufferedReader rd = null;
     
    214214    }
    215215    private static class NMEAParserState {
    216         protected Collection<WayPoint> waypoints = new ArrayList<WayPoint>();
     216        protected Collection<WayPoint> waypoints = new ArrayList<>();
    217217        protected String p_Time;
    218218        protected String p_Date;
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r7004 r7005  
    7676
    7777    // The collection of instantiated OSM APIs
    78     private static Map<String, OsmApi> instances = new HashMap<String, OsmApi>();
     78    private static Map<String, OsmApi> instances = new HashMap<>();
    7979
    8080    private URL url = null;
  • trunk/src/org/openstreetmap/josm/io/OsmChangesetParser.java

    r7004 r7005  
    4444
    4545    private OsmChangesetParser() {
    46         changesets = new LinkedList<Changeset>();
     46        changesets = new LinkedList<>();
    4747    }
    4848
  • trunk/src/org/openstreetmap/josm/io/OsmExporter.java

    r6716 r7005  
    66import java.io.File;
    77import java.io.FileNotFoundException;
    8 import java.io.FileOutputStream;
    98import java.io.IOException;
    109import java.io.OutputStream;
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r6936 r7005  
    6060    public static void registerPostprocessor(OsmServerReadPostprocessor pp) {
    6161        if (postprocessors == null) {
    62             postprocessors = new ArrayList<OsmServerReadPostprocessor>();
     62            postprocessors = new ArrayList<>();
    6363        }
    6464        postprocessors.add(pp);
     
    223223        externalIdMap.put(wd.getPrimitiveId(), w);
    224224
    225         Collection<Long> nodeIds = new ArrayList<Long>();
     225        Collection<Long> nodeIds = new ArrayList<>();
    226226        while (true) {
    227227            int event = parser.next();
     
    240240        if (w.isDeleted() && !nodeIds.isEmpty()) {
    241241            Main.info(tr("Deleted way {0} contains nodes", w.getUniqueId()));
    242             nodeIds = new ArrayList<Long>();
     242            nodeIds = new ArrayList<>();
    243243        }
    244244        ways.put(wd.getUniqueId(), nodeIds);
     
    270270        externalIdMap.put(rd.getPrimitiveId(), r);
    271271
    272         Collection<RelationMemberData> members = new ArrayList<RelationMemberData>();
     272        Collection<RelationMemberData> members = new ArrayList<>();
    273273        while (true) {
    274274            int event = parser.next();
     
    287287        if (r.isDeleted() && !members.isEmpty()) {
    288288            Main.info(tr("Deleted relation {0} contains members", r.getUniqueId()));
    289             members = new ArrayList<RelationMemberData>();
     289            members = new ArrayList<>();
    290290        }
    291291        relations.put(rd.getUniqueId(), members);
  • trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java

    r6830 r7005  
    213213        progressMonitor.beginTask(null, 2);
    214214        try {
    215             Collection<Way> waysToCheck = new ArrayList<Way>(ds.getWays());
     215            Collection<Way> waysToCheck = new ArrayList<>(ds.getWays());
    216216            if (isReadFull() ||primitiveType.equals(OsmPrimitiveType.NODE)) {
    217217                for (Way way: waysToCheck) {
     
    225225            }
    226226            if (isReadFull()) {
    227                 Collection<Relation> relationsToCheck  = new ArrayList<Relation>(ds.getRelations());
     227                Collection<Relation> relationsToCheck  = new ArrayList<>(ds.getRelations());
    228228                for (Relation relation: relationsToCheck) {
    229229                    if (!relation.isNew() && relation.hasIncompleteMembers()) {
  • trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java

    r6906 r7005  
    128128            monitor.beginTask(trn("Downloading {0} changeset ...", "Downloading {0} changesets ...",ids.size(),ids.size()));
    129129            monitor.setTicksCount(ids.size());
    130             List<Changeset> ret = new ArrayList<Changeset>();
     130            List<Changeset> ret = new ArrayList<>();
    131131            int i=0;
    132132            for (int id : ids) {
  • trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java

    r6906 r7005  
    106106            NodeList xmlNodeList = (NodeList)xpath.compile("/osm/user[1]/languages[1]/lang/text()").evaluate(document, XPathConstants.NODESET);
    107107            if (xmlNodeList != null) {
    108                 List<String> languages = new LinkedList<String>();
     108                List<String> languages = new LinkedList<>();
    109109                for (int i=0; i < xmlNodeList.getLength(); i++) {
    110110                    languages.add(xmlNodeList.item(i).getNodeValue());
  • trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java

    r6830 r7005  
    4040    public static void registerPostprocessor(OsmServerWritePostprocessor pp) {
    4141        if (postprocessors == null) {
    42             postprocessors = new ArrayList<OsmServerWritePostprocessor>();
     42            postprocessors = new ArrayList<>();
    4343        }
    4444        postprocessors.add(pp);
     
    152152        try {
    153153            progressMonitor.beginTask(tr("Starting to upload in chunks..."));
    154             List<IPrimitive> chunk = new ArrayList<IPrimitive>(chunkSize);
     154            List<IPrimitive> chunk = new ArrayList<>(chunkSize);
    155155            Iterator<? extends IPrimitive> it = primitives.iterator();
    156156            int numChunks = (int)Math.ceil((double)primitives.size() / (double)chunkSize);
     
    192192    public void uploadOsm(UploadStrategySpecification strategy, Collection<? extends IPrimitive> primitives, Changeset changeset, ProgressMonitor monitor) throws OsmTransferException {
    193193        CheckParameterUtil.ensureParameterNotNull(changeset, "changeset");
    194         processed = new LinkedList<IPrimitive>();
     194        processed = new LinkedList<>();
    195195        monitor = monitor == null ? NullProgressMonitor.INSTANCE : monitor;
    196196        monitor.beginTask(tr("Uploading data ..."));
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r6380 r7005  
    9494
    9595    protected <T extends OsmPrimitive> Collection<T> sortById(Collection<T> primitives) {
    96         List<T> result = new ArrayList<T>(primitives.size());
     96        List<T> result = new ArrayList<>(primitives.size());
    9797        result.addAll(primitives);
    9898        Collections.sort(result, byIdComparator);
     
    255255                out.println(">");
    256256            }
    257             List<Entry<String, String>> entries = new ArrayList<Entry<String,String>>(osm.getKeys().entrySet());
     257            List<Entry<String, String>> entries = new ArrayList<>(osm.getKeys().entrySet());
    258258            Collections.sort(entries, byKeyComparator);
    259259            for (Entry<String, String> e : entries) {
  • trunk/src/org/openstreetmap/josm/io/XmlWriter.java

    r6830 r7005  
    6666     * The output writer to save the values to.
    6767     */
    68     private static final Map<Character, String> encoding = new HashMap<Character, String>();
     68    private static final Map<Character, String> encoding = new HashMap<>();
    6969    static {
    7070        encoding.put('<', "&lt;");
  • trunk/src/org/openstreetmap/josm/io/auth/AbstractCredentialsAgent.java

    r6883 r7005  
    1212public abstract class AbstractCredentialsAgent implements CredentialsAgent {
    1313
    14     protected Map<RequestorType, PasswordAuthentication> memoryCredentialsCache = new HashMap<RequestorType, PasswordAuthentication>();
     14    protected Map<RequestorType, PasswordAuthentication> memoryCredentialsCache = new HashMap<>();
    1515
    1616    /**
  • trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java

    r6643 r7005  
    3333    }
    3434
    35     private final Map<RequestorType, Boolean> credentialsTried = new HashMap<RequestorType, Boolean>();
     35    private final Map<RequestorType, Boolean> credentialsTried = new HashMap<>();
    3636    private boolean enabled = true;
    3737
  • trunk/src/org/openstreetmap/josm/io/imagery/HTMLGrabber.java

    r6798 r7005  
    3333        Main.info("Grabbing HTML " + (attempt > 1? "(attempt " + attempt + ") ":"") + url);
    3434
    35         List<String> cmdParams = new ArrayList<String>();
     35        List<String> cmdParams = new ArrayList<>();
    3636        StringTokenizer st = new StringTokenizer(MessageFormat.format(PROP_BROWSER.get(), urlstring));
    3737        while (st.hasMoreTokens()) {
  • trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java

    r6968 r7005  
    22package org.openstreetmap.josm.io.imagery;
    33
    4 import static org.openstreetmap.josm.tools.I18n.tr;
    54import static org.openstreetmap.josm.tools.Utils.equal;
    65
     
    8584            accumulator = new StringBuffer();
    8685            skipEntry = false;
    87             states = new Stack<State>();
     86            states = new Stack<>();
    8887            states.push(State.INIT);
    89             entries = new ArrayList<ImageryInfo>();
     88            entries = new ArrayList<>();
    9089            entry = null;
    9190            bounds = null;
     
    141140                    newState = State.BOUNDS;
    142141                } else if (qName.equals("projections")) {
    143                     projections = new ArrayList<String>();
     142                    projections = new ArrayList<>();
    144143                    newState = State.PROJECTIONS;
    145144                }
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java

    r6995 r7005  
    4141    protected String baseURL;
    4242    private ImageryInfo info;
    43     private Map<String, String> props = new HashMap<String, String>();
     43    private Map<String, String> props = new HashMap<>();
    4444
    4545    public WMSGrabber(MapView mv, WMSLayer layer, boolean localOnly) {
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java

    r6930 r7005  
    175175            child = getChild(child, "GetMap");
    176176
    177             formats = new ArrayList<String>(Utils.filter(Utils.transform(getChildren(child, "Format"),
     177            formats = new ArrayList<>(Utils.filter(Utils.transform(getChildren(child, "Format"),
    178178                    new Utils.Function<Element, String>() {
    179179                        @Override
     
    226226        ImageryInfo i = new ImageryInfo(name, buildGetMapUrl(selectedLayers));
    227227        if (selectedLayers != null) {
    228             HashSet<String> proj = new HashSet<String>();
     228            HashSet<String> proj = new HashSet<>();
    229229            for (WMSImagery.LayerDetails l : selectedLayers) {
    230230                proj.addAll(l.getProjections());
     
    236236
    237237    private List<LayerDetails> parseLayers(List<Element> children, Set<String> parentCrs) {
    238         List<LayerDetails> details = new ArrayList<LayerDetails>(children.size());
     238        List<LayerDetails> details = new ArrayList<>(children.size());
    239239        for (Element element : children) {
    240240            details.add(parseLayer(element, parentCrs));
     
    248248
    249249        // The set of supported CRS/SRS for this layer
    250         Set<String> crsList = new HashSet<String>();
     250        Set<String> crsList = new HashSet<>();
    251251        // ...including this layer's already-parsed parent projections
    252252        crsList.addAll(parentCrs);
     
    332332
    333333    private static List<Element> getChildren(Element parent, String name) {
    334         List<Element> retVal = new ArrayList<Element>();
     334        List<Element> retVal = new ArrayList<>();
    335335        for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
    336336            if (child instanceof Element && name.equals(child.getNodeName())) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r6798 r7005  
    5959
    6060    String sender;
    61     static Set<String> trustedSenders = new HashSet<String>();
     61    static Set<String> trustedSenders = new HashSet<>();
    6262
    6363    /**
     
    8181        Map<String, Integer> valueCount;
    8282        public ExistingValues(String tag) {
    83             this.tag=tag; valueCount=new HashMap<String, Integer>();
     83            this.tag=tag; valueCount=new HashMap<>();
    8484        }
    8585
     
    303303                        throw new RuntimeException(e);
    304304                    }
    305                     Set<String> tagSet = new HashSet<String>();
     305                    Set<String> tagSet = new HashSet<>();
    306306                    for (String tag : tags) {
    307307                        if (!tag.trim().isEmpty() && tag.contains("=")) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r6995 r7005  
    6161     * can extend this list by using @see addRequestHandler
    6262     */
    63     private static Map<String, Class<? extends RequestHandler>> handlers = new TreeMap<String, Class<? extends RequestHandler>>();
     63    private static Map<String, Class<? extends RequestHandler>> handlers = new TreeMap<>();
    6464
    6565    /**
     
    174174            String command = questionPos < 0 ? url : url.substring(0, questionPos);
    175175
    176             Map <String,String> headers = new HashMap<String, String>();
     176            Map <String,String> headers = new HashMap<>();
    177177            int k=0, MAX_HEADERS=20;
    178178            while (k<MAX_HEADERS) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java

    r6536 r7005  
    3535    public static final String command = "add_way";
    3636
    37     private final List<LatLon> allCoordinates = new ArrayList<LatLon>();
     37    private final List<LatLon> allCoordinates = new ArrayList<>();
    3838
    3939    /**
     
    151151     */
    152152    private void addWay() {
    153         addedNodes = new HashMap<LatLon, Node>();
     153        addedNodes = new HashMap<>();
    154154        Way way = new Way();
    155         List<Command> commands = new LinkedList<Command>();
     155        List<Command> commands = new LinkedList<>();
    156156        for (LatLon ll : allCoordinates) {
    157157            Node node = findOrCreateNode(ll, commands);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java

    r6920 r7005  
    8686    @Override
    8787    protected void parseArgs() {
    88         HashMap<String, String> args = new HashMap<String, String>();
     88        HashMap<String, String> args = new HashMap<>();
    8989        if (request.indexOf('?') != -1) {
    9090            String query = request.substring(request.indexOf('?') + 1);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java

    r6986 r7005  
    8585    @Override
    8686    protected void parseArgs() {
    87         HashMap<String, String> args = new HashMap<String, String>();
     87        HashMap<String, String> args = new HashMap<>();
    8888        if (request.indexOf('?') != -1) {
    8989            String query = request.substring(request.indexOf('?') + 1);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r6798 r7005  
    5151
    5252    // Optional argument 'select'
    53     private final Set<SimplePrimitiveId> toSelect = new HashSet<SimplePrimitiveId>();
     53    private final Set<SimplePrimitiveId> toSelect = new HashSet<>();
    5454
    5555    @Override
     
    161161                @Override
    162162                public void run() {
    163                     Set<OsmPrimitive> newSel = new HashSet<OsmPrimitive>();
     163                    Set<OsmPrimitive> newSel = new HashSet<>();
    164164                    DataSet ds = Main.main.getCurrentDataSet();
    165165                    if(ds == null) // e.g. download failed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadObjectHandler.java

    r6973 r7005  
    2727    public static final String command = "load_object";
    2828
    29     private final List<PrimitiveId> ps = new LinkedList<PrimitiveId>();
     29    private final List<PrimitiveId> ps = new LinkedList<>();
    3030
    3131    @Override
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java

    r6883 r7005  
    194194        try {
    195195            String req = URLDecoder.decode(this.request, "UTF-8");
    196             HashMap<String, String> args = new HashMap<String, String>();
     196            HashMap<String, String> args = new HashMap<>();
    197197            if (req.indexOf('?') != -1) {
    198198                String query = req.substring(req.indexOf('?') + 1);
     
    217217        String[] mandatory = getMandatoryParams();
    218218        String[] optional = getOptionalParams();
    219         List<String> missingKeys = new LinkedList<String>();
     219        List<String> missingKeys = new LinkedList<>();
    220220        boolean error = false;
    221221        if(mandatory != null) for (String key : mandatory) {
     
    227227            }
    228228        }
    229         HashSet<String> knownParams = new HashSet<String>();
     229        HashSet<String> knownParams = new HashSet<>();
    230230        if (mandatory != null) Collections.addAll(knownParams, mandatory);
    231231        if (optional != null) Collections.addAll(knownParams, optional);
  • trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java

    r6990 r7005  
    3030        }
    3131
    32         List<ImageEntry> entries = new ArrayList<ImageEntry>();
     32        List<ImageEntry> entries = new ArrayList<>();
    3333        NodeList imgNodes = elem.getChildNodes();
    3434        boolean useThumbs = false;
  • trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java

    r6792 r7005  
    3131            throw new IllegalDataException(tr("Version ''{0}'' of meta data for imagery layer is not supported. Expected: 0.1", version));
    3232        }
    33         Map<String, String> attributes = new HashMap<String, String>();
     33        Map<String, String> attributes = new HashMap<>();
    3434
    3535        NodeList nodes = elem.getChildNodes();
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r7004 r7005  
    5757public class SessionReader {
    5858
    59     private static Map<String, Class<? extends SessionLayerImporter>> sessionLayerImporters = new HashMap<String, Class<? extends SessionLayerImporter>>();
     59    private static Map<String, Class<? extends SessionLayerImporter>> sessionLayerImporters = new HashMap<>();
    6060    static {
    6161        registerSessionLayerImporter("osm-data", OsmDataSessionImporter.class);
     
    8686    private boolean zip; // true, if session file is a .joz file; false if it is a .jos file
    8787    private ZipFile zipFile;
    88     private List<Layer> layers = new ArrayList<Layer>();
     88    private List<Layer> layers = new ArrayList<>();
    8989    private int active = -1;
    90     private List<Runnable> postLoadTasks = new ArrayList<Runnable>();
     90    private List<Runnable> postLoadTasks = new ArrayList<>();
    9191    private ViewportData viewport;
    9292
     
    346346        }
    347347
    348         MultiMap<Integer, Integer> deps = new MultiMap<Integer, Integer>();
    349         Map<Integer, Element> elems = new HashMap<Integer, Element>();
     348        MultiMap<Integer, Integer> deps = new MultiMap<>();
     349        Map<Integer, Element> elems = new HashMap<>();
    350350
    351351        NodeList nodes = layersEl.getChildNodes();
     
    394394
    395395        List<Integer> sorted = Utils.topologicalSort(deps);
    396         final Map<Integer, Layer> layersMap = new TreeMap<Integer, Layer>(Collections.reverseOrder());
    397         final Map<Integer, SessionLayerImporter> importers = new HashMap<Integer, SessionLayerImporter>();
    398         final Map<Integer, String> names = new HashMap<Integer, String>();
     396        final Map<Integer, Layer> layersMap = new TreeMap<>(Collections.reverseOrder());
     397        final Map<Integer, SessionLayerImporter> importers = new HashMap<>();
     398        final Map<Integer, String> names = new HashMap<>();
    399399
    400400        progressMonitor.setTicksCount(sorted.size());
     
    430430            } else {
    431431                importers.put(idx, imp);
    432                 List<LayerDependency> depsImp = new ArrayList<LayerDependency>();
     432                List<LayerDependency> depsImp = new ArrayList<>();
    433433                for (int d : deps.get(idx)) {
    434434                    SessionLayerImporter dImp = importers.get(d);
     
    481481        }
    482482
    483         layers = new ArrayList<Layer>();
     483        layers = new ArrayList<>();
    484484        for (int idx : layersMap.keySet()) {
    485485            Layer layer = layersMap.get(idx);
  • trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java

    r6552 r7005  
    4848public class SessionWriter {
    4949
    50     private static Map<Class<? extends Layer>, Class<? extends SessionLayerExporter>> sessionLayerExporters =
    51             new HashMap<Class<? extends Layer>, Class<? extends SessionLayerExporter>>();
     50    private static Map<Class<? extends Layer>, Class<? extends SessionLayerExporter>> sessionLayerExporters = new HashMap<>();
    5251    static {
    5352        registerSessionLayerExporter(OsmDataLayer.class , OsmDataSessionExporter.class);
     
    210209            Set<Layer> deps = dependencies.get(layer);
    211210            if (!deps.isEmpty()) {
    212                 List<Integer> depsInt = new ArrayList<Integer>();
     211                List<Integer> depsInt = new ArrayList<>();
    213212                for (Layer depLayer : deps) {
    214213                    int depIndex = layers.indexOf(depLayer);
Note: See TracChangeset for help on using the changeset viewer.