Ignore:
Timestamp:
2013-04-20T15:50:18+02:00 (11 years ago)
Author:
Don-vip
Message:

fix potential bugs detected by FindBugs

Location:
trunk/src/org/openstreetmap/josm/data
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/AutosaveTask.java

    r5874 r5889  
    295295                        try {
    296296                            String jvmId = reader.readLine();
    297                             String pid = jvmId.split("@")[0];
    298                             skipFile = jvmPerfDataFileExists(pid);
     297                            if (jvmId != null) {
     298                                String pid = jvmId.split("@")[0];
     299                                skipFile = jvmPerfDataFileExists(pid);
     300                            }
    299301                        } catch (Throwable t) {
    300302                            System.err.println(t.getClass()+":"+t.getMessage());
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r5548 r5889  
    366366
    367367    public static double parseDouble(Map<String, String> parameters, String parameterName) throws ProjectionConfigurationException {
     368        if (!parameters.containsKey(parameterName))
     369            throw new IllegalArgumentException(tr("Unknown parameter ''{0}''", parameterName));
    368370        String doubleStr = parameters.get(parameterName);
    369         if (doubleStr == null && parameters.containsKey(parameterName))
     371        if (doubleStr == null)
    370372            throw new ProjectionConfigurationException(
    371373                    tr("Expected number argument for parameter ''{0}''", parameterName));
  • trunk/src/org/openstreetmap/josm/data/projection/Projections.java

    r5634 r5889  
    165165        if (proj != null) return proj;
    166166        ProjectionChoice pc = allProjectionChoicesByCode.get(code);
    167         if (pc != null) {
     167        if (pc == null) {
    168168            Pair<String, String> pair = inits.get(code);
    169169            if (pair == null) return null;
     
    183183        return Collections.unmodifiableCollection(allCodes);
    184184    }
    185 
    186185}
Note: See TracChangeset for help on using the changeset viewer.