Changeset 8533 in josm


Ignore:
Timestamp:
2015-06-25T01:20:24+02:00 (6 years ago)
Author:
Don-vip
Message:

findbugs

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CreateMultipolygonAction.java

    r8513 r8533  
    332332    }
    333333
    334     public static final List<String> DEFAULT_LINEAR_TAGS = Arrays.asList("barrier", "fence_type", "source");
     334    private static final List<String> DEFAULT_LINEAR_TAGS = Arrays.asList("barrier", "fence_type", "source");
    335335
    336336    /**
  • trunk/src/org/openstreetmap/josm/data/osm/event/DatasetEventManager.java

    r8510 r8533  
    3333        public void run() {
    3434            while (!eventsInEDT.isEmpty()) {
    35                 List<AbstractDatasetChangedEvent> events = new ArrayList<>(eventsInEDT);
    36 
    3735                DataSet dataSet = null;
    3836                AbstractDatasetChangedEvent consolidatedEvent = null;
     
    126124    }
    127125
     126    /**
     127     * Replies the unique instance.
     128     * @return the unique instance
     129     */
    128130    public static DatasetEventManager getInstance() {
    129131        return instance;
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r8510 r8533  
    103103
    104104        /** Map of all parameters by key */
    105         public static final Map<String, Param> paramsByKey = new HashMap<>();
     105        static final Map<String, Param> paramsByKey = new HashMap<>();
    106106        static {
    107107            for (Param p : Param.values()) {
  • trunk/src/org/openstreetmap/josm/data/projection/Projections.java

    r8451 r8533  
    77import java.io.InputStreamReader;
    88import java.nio.charset.StandardCharsets;
     9import java.util.ArrayList;
    910import java.util.Collection;
    1011import java.util.Collections;
    1112import java.util.HashMap;
    1213import java.util.HashSet;
     14import java.util.List;
    1315import java.util.Locale;
    1416import java.util.Map;
     
    3638import org.openstreetmap.josm.io.CachedFile;
    3739import org.openstreetmap.josm.tools.Pair;
     40import org.openstreetmap.josm.tools.Utils;
    3841
    3942/**
     
    6265     * should be compatible to PROJ.4
    6366     */
    64     public static final Map<String, ProjFactory> projs = new HashMap<>();
    65     public static final Map<String, Ellipsoid> ellipsoids = new HashMap<>();
    66     public static final Map<String, Datum> datums = new HashMap<>();
    67     public static final Map<String, NTV2GridShiftFileWrapper> nadgrids = new HashMap<>();
    68     public static final Map<String, Pair<String, String>> inits = new HashMap<>();
     67    static final Map<String, ProjFactory> projs = new HashMap<>();
     68    static final Map<String, Ellipsoid> ellipsoids = new HashMap<>();
     69    static final Map<String, Datum> datums = new HashMap<>();
     70    static final Map<String, NTV2GridShiftFileWrapper> nadgrids = new HashMap<>();
     71    static final Map<String, Pair<String, String>> inits = new HashMap<>();
    6972
    7073    static {
     
    216219        return Collections.unmodifiableCollection(allCodes);
    217220    }
     221
     222    private static String listKeys(Map<String, ?> map) {
     223        List<String> keys = new ArrayList<>(map.keySet());
     224        Collections.sort(keys);
     225        return Utils.join(", ", keys);
     226    }
     227
     228    /**
     229     * Replies the list of projections as string (comma separated).
     230     * @return the list of projections as string (comma separated)
     231     * @since 8533
     232     */
     233    public static String listProjs() {
     234        return listKeys(projs);
     235    }
     236
     237    /**
     238     * Replies the list of ellipsoids as string (comma separated).
     239     * @return the list of ellipsoids as string (comma separated)
     240     * @since 8533
     241     */
     242    public static String listEllipsoids() {
     243        return listKeys(ellipsoids);
     244    }
     245
     246    /**
     247     * Replies the list of datums as string (comma separated).
     248     * @return the list of datums as string (comma separated)
     249     * @since 8533
     250     */
     251    public static String listDatums() {
     252        return listKeys(datums);
     253    }
     254
     255    /**
     256     * Replies the list of nadgrids as string (comma separated).
     257     * @return the list of nadgrids as string (comma separated)
     258     * @since 8533
     259     */
     260    public static String listNadgrids() {
     261        return listKeys(nadgrids);
     262    }
    218263}
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java

    r8512 r8533  
    99import java.awt.event.ActionEvent;
    1010import java.awt.event.ActionListener;
    11 import java.util.ArrayList;
    1211import java.util.Arrays;
    1312import java.util.Collection;
     
    1514import java.util.LinkedList;
    1615import java.util.List;
    17 import java.util.Map;
    1816
    1917import javax.swing.JButton;
     
    3634import org.openstreetmap.josm.tools.GBC;
    3735import org.openstreetmap.josm.tools.ImageProvider;
    38 import org.openstreetmap.josm.tools.Utils;
    3936
    4037public class CustomProjectionChoice extends AbstractProjectionChoice implements SubPrefsOptions {
     
    171168            s.append("<b>+proj=...</b> - <i>").append(tr("Projection name"))
    172169             .append("</i><br>&nbsp;&nbsp;&nbsp;&nbsp;").append(tr("Supported values:")).append(' ')
    173              .append(listKeys(Projections.projs))
     170             .append(Projections.listProjs())
    174171             .append("<br><b>+lat_0=..., +lat_1=..., +lat_2=...</b> - <i>").append(tr("Projection parameters"))
    175172             .append("</i><br><b>+x_0=..., +y_0=...</b> - <i>").append(tr("False easting and false northing"))
     
    178175             .append("</i><br><b>+ellps=...</b> - <i>").append(tr("Ellipsoid name"))
    179176             .append("</i><br>&nbsp;&nbsp;&nbsp;&nbsp;").append(tr("Supported values:")).append(' ')
    180              .append(listKeys(Projections.ellipsoids))
     177             .append(Projections.listEllipsoids())
    181178             .append("<br><b>+a=..., +b=..., +rf=..., +f=..., +es=...</b> - <i>").append(tr("Ellipsoid parameters"))
    182179             .append("</i><br><b>+datum=...</b> - <i>").append(tr("Datum name"))
    183180             .append("</i><br>&nbsp;&nbsp;&nbsp;&nbsp;").append(tr("Supported values:")).append(' ')
    184              .append(listKeys(Projections.datums))
     181             .append(Projections.listDatums())
    185182             .append("<br><b>+towgs84=...</b> - <i>").append(tr("3 or 7 term datum transform parameters"))
    186183             .append("</i><br><b>+nadgrids=...</b> - <i>").append(tr("NTv2 grid file"))
    187184             .append("</i><br>&nbsp;&nbsp;&nbsp;&nbsp;").append(tr("Built-in:")).append(' ')
    188              .append(listKeys(Projections.nadgrids))
     185             .append(Projections.listNadgrids())
    189186             .append("<br><b>+bounds=</b>minlon,minlat,maxlon,maxlat - <i>").append(tr("Projection bounds (in degrees)"))
    190187             .append("</i><br><b>+wmssrs=</b>EPSG:123456 - <i>").append(tr("Sets the SRS=... parameter in the WMS request"))
     
    192189
    193190            return new HtmlPanel(s.toString());
    194         }
    195 
    196         private String listKeys(Map<String, ?> map) {
    197             List<String> keys = new ArrayList<>(map.keySet());
    198             Collections.sort(keys);
    199             return Utils.join(", ", keys);
    200191        }
    201192    }
Note: See TracChangeset for help on using the changeset viewer.