Ignore:
Timestamp:
2014-10-18T23:07:52+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix Java 7 / unused code warnings

Location:
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/CzechAddressPlugin.java

    r29957 r30737  
    5858
    5959    private JMenu czechMenu;
    60     private List<JMenuItem> menuItems = new ArrayList<JMenuItem>();
     60    private List<JMenuItem> menuItems = new ArrayList<>();
    6161    private static Logger logger = Logger.getLogger(CzechAddressPlugin.class.getName());
    6262
     
    174174    }
    175175
    176     static private final Set<StatusListener> listeners = new HashSet<StatusListener>();
     176    static private final Set<StatusListener> listeners = new HashSet<>();
    177177    static public synchronized void addStatusListener(StatusListener l)    {listeners.add(l);}
    178178    static public synchronized void removeStatusListener(StatusListener l) {listeners.remove(l);}
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/StringUtils.java

    r30346 r30737  
    6363        s2 = anglicize(s2);
    6464
    65         List<Integer> beg1 = new ArrayList<Integer>(4);
    66         List<Integer> beg2 = new ArrayList<Integer>(4);
     65        List<Integer> beg1 = new ArrayList<>(4);
     66        List<Integer> beg2 = new ArrayList<>(4);
    6767
    6868        char lastChar = ' ';
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/actions/SplitAreaByEmptyWayAction.java

    r29778 r30737  
    5555
    5656        Collection<Way> selectedWays = Main.main.getCurrentDataSet().getSelectedWays();
    57         Collection<Way> newSelection = new LinkedList<Way>(Main.main.getCurrentDataSet().getSelectedWays());
     57        Collection<Way> newSelection = new LinkedList<>(Main.main.getCurrentDataSet().getSelectedWays());
    5858
    5959        for (Way area : selectedWays) {
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/Database.java

    r23190 r30737  
    2929     * List of regions, which are in this database.
    3030     */
    31     public ArrayList<Region> regions = new ArrayList<Region>();
     31    public ArrayList<Region> regions = new ArrayList<>();
    3232
    3333    public Region findRegion(String name, String nuts3, String nuts4) {
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ElementWithHouses.java

    r30532 r30737  
    1818    }
    1919
    20     protected List<House> houses = new ArrayList<House>(30);
     20    protected List<House> houses = new ArrayList<>(30);
    2121
    2222    /**
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ElementWithStreets.java

    r23190 r30737  
    1313public abstract class ElementWithStreets extends ElementWithHouses {
    1414
    15     private ArrayList<Street> streets = new ArrayList<Street>();
     15    private ArrayList<Street> streets = new ArrayList<>();
    1616
    1717    public ElementWithStreets(String name) {
     
    7878    public List<House> getAllHouses() {
    7979        // We make an conservative estimate...
    80         List<House> result = new ArrayList<House>(20 * streets.size());
     80        List<House> result = new ArrayList<>(20 * streets.size());
    8181
    8282        result.addAll(this.houses);
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/House.java

    r26509 r30737  
    189189    public List<Proposal> getDiff(OsmPrimitive prim) {
    190190
    191         List<Proposal> props = new NotNullList<Proposal>();
     191        List<Proposal> props = new NotNullList<>();
    192192        ParentResolver resolver = new ParentResolver(this);
    193193
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/Region.java

    r23190 r30737  
    1212
    1313    private ArrayList<ViToCi> vitocis
    14             = new ArrayList<ViToCi>();
     14            = new ArrayList<>();
    1515
    1616    /**
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/Street.java

    r23190 r30737  
    4343    @Override
    4444    public List<Proposal> getDiff(OsmPrimitive prim) {
    45         List<Proposal> props = new NotNullList<Proposal>();
     45        List<Proposal> props = new NotNullList<>();
    4646
    4747        props.add(getStringFieldDiff(PrimUtils.KEY_NAME, prim.get(PrimUtils.KEY_NAME), getName()));
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ViToCi.java

    r23190 r30737  
    1111public class ViToCi extends ElementWithStreets {
    1212
    13     private ArrayList<Suburb> suburbs = new ArrayList<Suburb>();
     13    private ArrayList<Suburb> suburbs = new ArrayList<>();
    1414
    1515    /**
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ConflictResolver.java

    r30532 r30737  
    327327    private class ConflictsModel implements ComboBoxModel<Object> {
    328328
    329         ArrayList<AddressElement> elements = new ArrayList<AddressElement>();
    330         ArrayList<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>();
    331         Set<ListDataListener> listeners = new HashSet<ListDataListener>();
     329        ArrayList<AddressElement> elements = new ArrayList<>();
     330        ArrayList<OsmPrimitive> primitives = new ArrayList<>();
     331        Set<ListDataListener> listeners = new HashSet<>();
    332332
    333333        Object selected = null;
     
    470470        if (selected instanceof AddressElement) {
    471471            AddressElement selElem = (AddressElement) selected;
    472             List<OsmPrimitive> conflPrims = new NotNullList<OsmPrimitive>();
     472            List<OsmPrimitive> conflPrims = new NotNullList<>();
    473473            conflPrims.addAll(Reasoner.getInstance().getCandidates(selElem));
    474474            Collections.sort(conflPrims, PrimUtils.comparator);
     
    477477        } else if (selected instanceof OsmPrimitive) {
    478478            OsmPrimitive selElem = (OsmPrimitive) selected;
    479             List<AddressElement> conflElems = new NotNullList<AddressElement>();
     479            List<AddressElement> conflElems = new NotNullList<>();
    480480            conflElems.addAll(Reasoner.getInstance().getCandidates(selElem));
    481481            Collections.sort(conflElems);
     
    514514    private class CandidatesModel<E> implements ComboBoxModel<E> {
    515515
    516         Set<ListDataListener> listeners = new HashSet<ListDataListener>();
     516        Set<ListDataListener> listeners = new HashSet<>();
    517517        List<? extends E> primitives;
    518518        Object selected = null;
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/FactoryDialog.java

    r30532 r30737  
    473473
    474474        private List<ElementWithHouses> metaElem
    475                 = new ArrayList<ElementWithHouses>();
     475                = new ArrayList<>();
    476476
    477477        public StreetListModel() {
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java

    r30532 r30737  
    3333
    3434    protected ElementWithStreets selectedElement;
    35     protected ArrayList<ItemListener> listeners = new ArrayList<ItemListener>();
     35    protected ArrayList<ItemListener> listeners = new ArrayList<>();
    3636    int regionHlIndex, vitociHlIndex, suburbHlIndex;
    37     protected ArrayList<AddressElement> hlRegions = new ArrayList<AddressElement>();
    38     protected ArrayList<AddressElement> hlViToCis = new ArrayList<AddressElement>();
    39     protected ArrayList<AddressElement> hlSuburbs = new ArrayList<AddressElement>();
     37    protected ArrayList<AddressElement> hlRegions = new ArrayList<>();
     38    protected ArrayList<AddressElement> hlViToCis = new ArrayList<>();
     39    protected ArrayList<AddressElement> hlSuburbs = new ArrayList<>();
    4040
    4141
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ManagerDialog.java

    r29854 r30737  
    3636public class ManagerDialog extends ExtendedDialog {
    3737
    38     RenameModel<Street> streetModel = new RenameModel<Street>();
     38    RenameModel<Street> streetModel = new RenameModel<>();
    3939
    4040    public ManagerDialog() {
     
    382382    private class RenameModel<Element> implements TableModel {
    383383
    384         List<Element> elems = new ArrayList<Element>();
    385         List<String>  names = new ArrayList<String>();
     384        List<Element> elems = new ArrayList<>();
     385        List<String>  names = new ArrayList<>();
    386386
    387387        public int getRowCount() {
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java

    r30532 r30737  
    137137        OsmPrimitive prim = this.proposalContainer.getTarget();
    138138        Reasoner r = Reasoner.getInstance();
    139         List<AddressElement> elems = new NotNullList<AddressElement>();
     139        List<AddressElement> elems = new NotNullList<>();
    140140
    141141        synchronized (r) {
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedComboBoxModel.java

    r30532 r30737  
    1818public abstract class HalfCookedComboBoxModel<E> implements ComboBoxModel<E> {
    1919
    20     List<ListDataListener> listeners = new ArrayList<ListDataListener>();
     20    List<ListDataListener> listeners = new ArrayList<>();
    2121
    2222    @Override
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedListModel.java

    r30532 r30737  
    1818public abstract class HalfCookedListModel<E> implements ListModel<E> {
    1919
    20     List<ListDataListener> listeners = new ArrayList<ListDataListener>();
     20    List<ListDataListener> listeners = new ArrayList<>();
    2121
    2222    @Override
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedTreeModel.java

    r15585 r30737  
    2020public abstract class HalfCookedTreeModel implements TreeModel {
    2121
    22     List<TreeModelListener> listeneres = new ArrayList<TreeModelListener>();
     22    List<TreeModelListener> listeneres = new ArrayList<>();
    2323
    2424    protected String root;
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/intelligence/Capitalizator.java

    r18503 r30737  
    3333        int expResults = elems.size()/2;
    3434
    35         map  = new HashMap<Street, OsmPrimitive>(expResults);
     35        map  = new HashMap<>(expResults);
    3636        ExecutorService serv = Executors.newCachedThreadPool();
    3737        Map<Street, Future<OsmPrimitive>> results
    38                 = new HashMap<Street, Future<OsmPrimitive>>(expResults);
     38                = new HashMap<>(expResults);
    3939
    4040        for (Street elem : elems)
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/intelligence/Reasoner.java

    r26509 r30737  
    4444
    4545    private     Map<OsmPrimitive, AddressElement> primBestIndex
    46       = new HashMap<OsmPrimitive, AddressElement> ();
     46      = new HashMap<> ();
    4747    private     Map<AddressElement, OsmPrimitive> elemBestIndex
    48       = new HashMap<AddressElement, OsmPrimitive> ();
     48      = new HashMap<> ();
    4949
    5050    private     Map<OsmPrimitive,   Map<AddressElement, Integer>> primMatchIndex
    51       = new HashMap<OsmPrimitive,   Map<AddressElement, Integer>> ();
     51      = new HashMap<> ();
    5252    private     Map<AddressElement, Map<OsmPrimitive,   Integer>> elemMatchIndex
    53       = new HashMap<AddressElement, Map<OsmPrimitive,   Integer>> ();
    54 
    55     private Set<OsmPrimitive>   primToUpdate = new HashSet<OsmPrimitive>();
    56     private Set<AddressElement> elemToUpdate = new HashSet<AddressElement>();
     53      = new HashMap<> ();
     54
     55    private Set<OsmPrimitive>   primToUpdate = new HashSet<>();
     56    private Set<AddressElement> elemToUpdate = new HashSet<>();
    5757
    5858    public static Logger logger = Logger.getLogger(Reasoner.class.getName());
     
    127127        assert transactionOpened;
    128128
    129         Set<AddressElement> elemChanges = new HashSet<AddressElement>();
    130         Set<OsmPrimitive>   primChanges = new HashSet<OsmPrimitive>();
     129        Set<AddressElement> elemChanges = new HashSet<>();
     130        Set<OsmPrimitive>   primChanges = new HashSet<>();
    131131
    132132        for (OsmPrimitive prim : primToUpdate) {
     
    204204        if (matches == null) {
    205205            logger.log(Level.FINE, "new primitive detected", AddressElement.getName(prim));
    206             matches = new HashMap<AddressElement, Integer>();
     206            matches = new HashMap<>();
    207207            primMatchIndex.put(prim, matches);
    208208            primToUpdate.add(prim);
     
    232232        if (matches == null) {
    233233            logger.log(Level.FINE, "new element detected", elem);
    234             matches = new HashMap<OsmPrimitive, Integer>();
     234            matches = new HashMap<>();
    235235            elemMatchIndex.put(elem, matches);
    236236            elemToUpdate.add(elem);
     
    472472    public Set<AddressElement> getCandidates(OsmPrimitive prim) {
    473473
    474         Set<AddressElement> result = new HashSet<AddressElement>();
     474        Set<AddressElement> result = new HashSet<>();
    475475        if (primMatchIndex.get(prim) == null) return result;
    476476
     
    506506    public Set<OsmPrimitive> getCandidates(AddressElement elem) {
    507507
    508         Set<OsmPrimitive> result = new HashSet<OsmPrimitive>();
     508        Set<OsmPrimitive> result = new HashSet<>();
    509509        if (elemMatchIndex.get(elem) == null) return result;
    510510
     
    627627     */
    628628    public Set<AddressElement> getUnassignedElements() {
    629         Set<AddressElement> result = new HashSet<AddressElement>();
     629        Set<AddressElement> result = new HashSet<>();
    630630        for (AddressElement elem : elemMatchIndex.keySet())
    631631            if (translate(elem) == null)
     
    638638     */
    639639    public Set<OsmPrimitive> getUnassignedPrimitives() {
    640         Set<OsmPrimitive> result = new HashSet<OsmPrimitive>();
     640        Set<OsmPrimitive> result = new HashSet<>();
    641641        for (OsmPrimitive prim : primMatchIndex.keySet())
    642642            if (translate(prim) == null)
     
    650650     */
    651651    public Set<AddressElement> getAllElements() {
    652         Set<AddressElement> result = new HashSet<AddressElement>();
     652        Set<AddressElement> result = new HashSet<>();
    653653        result.addAll(elemMatchIndex.keySet());
    654654        return result;
     
    660660     */
    661661    public Set<OsmPrimitive> getAllPrimitives() {
    662         Set<OsmPrimitive> result = new HashSet<OsmPrimitive>();
     662        Set<OsmPrimitive> result = new HashSet<>();
    663663        result.addAll(primMatchIndex.keySet());
    664664        return result;
     
    695695     * Set of listeners currently hooked to changes in this reasoner.
    696696     */
    697     private Set<ReasonerListener> listeners = new HashSet<ReasonerListener>();
     697    private Set<ReasonerListener> listeners = new HashSet<>();
    698698
    699699    /**
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/intelligence/SelectionMonitor.java

    r26299 r30737  
    2020public class SelectionMonitor implements SelectionChangedListener {
    2121
    22     Collection<OsmPrimitive> lastSelection = new NotNullList<OsmPrimitive>();
     22    Collection<OsmPrimitive> lastSelection = new NotNullList<>();
    2323
    2424    private SelectionMonitor() {}
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ProposalContainer.java

    r30532 r30737  
    2929     */
    3030    private List<ListDataListener> listeners =
    31             new ArrayList<ListDataListener>();
     31            new ArrayList<>();
    3232
    3333    /**
     
    6464     * The list of proposals to be applied to encapsulated primitive.
    6565     */
    66     protected List<Proposal> proposals = new ArrayList<Proposal>();
     66    protected List<Proposal> proposals = new ArrayList<>();
    6767
    6868    /**
  • applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ProposalDatabase.java

    r23190 r30737  
    2525     */
    2626    protected List<ProposalContainer> changeSet =
    27              new ArrayList<ProposalContainer>();
     27             new ArrayList<>();
    2828
    2929    /**
     
    3131     */
    3232    protected List<TreeModelListener> listeners =
    33             new ArrayList<TreeModelListener>();
     33            new ArrayList<>();
    3434
    3535    /**
Note: See TracChangeset for help on using the changeset viewer.