Ignore:
Timestamp:
2013-10-07T20:18:17+02:00 (11 years ago)
Author:
Don-vip
Message:

Sonar/FindBugs - Loose coupling

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r6296 r6316  
    5151        int n = ways.size();
    5252        @SuppressWarnings("unchecked")
    53         ArrayList<Node>[] newNodes = new ArrayList[n];
     53        List<Node>[] newNodes = new ArrayList[n];
    5454        BBox[] wayBounds = new BBox[n];
    5555        boolean[] changedWays = new boolean[n];
     
    7474                }
    7575
    76                 ArrayList<Node> way1Nodes = newNodes[seg1Way];
    77                 ArrayList<Node> way2Nodes = newNodes[seg2Way];
     76                List<Node> way1Nodes = newNodes[seg1Way];
     77                List<Node> way2Nodes = newNodes[seg2Way];
    7878
    7979                //iterate over primary segmemt
     
    195195    }
    196196
    197     private static BBox getNodesBounds(ArrayList<Node> nodes) {
     197    private static BBox getNodesBounds(List<Node> nodes) {
    198198
    199199        BBox bounds = new BBox(nodes.get(0));
    200         for(Node n: nodes) {
     200        for (Node n: nodes) {
    201201            bounds.add(n.getCoor());
    202202        }
  • trunk/src/org/openstreetmap/josm/tools/I18n.java

    r6248 r6316  
    1515import java.util.HashMap;
    1616import java.util.Locale;
     17import java.util.Map;
    1718import java.util.jar.JarInputStream;
    1819import java.util.zip.ZipEntry;
     
    121122        "OptionPane.cancelButtonText"
    122123    };
    123     private static HashMap<String, String> strings = null;
    124     private static HashMap<String, String[]> pstrings = null;
    125     private static HashMap<String, PluralMode> languages = new HashMap<String, PluralMode>();
     124    private static Map<String, String> strings = null;
     125    private static Map<String, String[]> pstrings = null;
     126    private static Map<String, PluralMode> languages = new HashMap<String, PluralMode>();
    126127
    127128    /**
     
    476477    }
    477478
    478     private static boolean load(InputStream en, InputStream tr, boolean add)
    479     {
    480         HashMap<String, String> s;
    481         HashMap<String, String[]> p;
    482         if(add)
    483         {
     479    private static boolean load(InputStream en, InputStream tr, boolean add) {
     480        Map<String, String> s;
     481        Map<String, String[]> p;
     482        if (add) {
    484483            s = strings;
    485484            p = pstrings;
    486         }
    487         else
    488         {
     485        } else {
    489486            s = new HashMap<String, String>();
    490487            p = new HashMap<String, String[]>();
  • trunk/src/org/openstreetmap/josm/tools/ImageResource.java

    r6290 r6316  
    66import java.awt.image.BufferedImage;
    77import java.util.HashMap;
     8import java.util.Map;
    89
    910import javax.swing.ImageIcon;
     
    2425     * Caches the image data for resized versions of the same image.
    2526     */
    26     private HashMap<Dimension, Image> imgCache = new HashMap<Dimension, Image>();
     27    private Map<Dimension, Image> imgCache = new HashMap<Dimension, Image>();
    2728    private SVGDiagram svg;
    2829    public static final Dimension DEFAULT_DIMENSION = new Dimension(-1, -1);
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r6248 r6316  
    156156    // create a shortcut object from an string as saved in the preferences
    157157    private Shortcut(String prefString) {
    158         ArrayList<String> s = (new ArrayList<String>(Main.pref.getCollection(prefString)));
     158        List<String> s = (new ArrayList<String>(Main.pref.getCollection(prefString)));
    159159        this.shortText = prefString.substring(15);
    160160        this.longText = s.get(0);
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r6248 r6316  
    1212import java.util.Iterator;
    1313import java.util.LinkedList;
     14import java.util.List;
    1415import java.util.Locale;
    1516import java.util.Map;
     
    4647        private int lineNumber;
    4748
     49        /**
     50         * Constructs a new {@code PresetParsingException}.
     51         */
    4852        public PresetParsingException() {
    4953            super();
     
    274278     * The queue of already parsed items from the parsing thread.
    275279     */
    276     private LinkedList<Object> queue = new LinkedList<Object>();
     280    private List<Object> queue = new LinkedList<Object>();
    277281    private Iterator<Object> queueIterator = null;
    278282
Note: See TracChangeset for help on using the changeset viewer.