Changeset 9880 in josm


Ignore:
Timestamp:
2016-02-25T00:50:30+01:00 (9 years ago)
Author:
Don-vip
Message:

findbugs

Location:
trunk
Files:
6 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/build.xml

    r9842 r9880  
    619619    <target name="taginfo" depends="dist">
    620620        <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};tools/commons-cli-1.3.1.jar"/>
    621         <property name="taginfoextract" value="scripts/taginfoextract.groovy"/>
     621        <property name="taginfoextract" value="scripts/TagInfoExtract.groovy"/>
    622622        <property name="imgurlprefix" value="http://josm.openstreetmap.de/download/taginfo/taginfo-img"/>
    623623        <_taginfo type="mappaint" output="taginfo_style.json"/>
     
    629629        <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpath="${groovy.jar};tools/commons-cli-1.3.1.jar"/>
    630630        <echo message="Checking editor imagery difference"/>
    631         <groovy src="scripts/sync_editor_imagery_index.groovy" classpath="${dist.dir}/josm-custom.jar">
     631        <groovy src="scripts/SyncEditorImageryIndex.groovy" classpath="${dist.dir}/josm-custom.jar">
    632632            <arg value="-nomissingeii"/>
    633633        </groovy>
  • trunk/scripts/SyncEditorImageryIndex.groovy

    r9879 r9880  
    2929import org.openstreetmap.josm.tools.Utils
    3030
    31 class sync_editor_imagery_index {
     31class SyncEditorImageryIndex {
    3232
    3333    List<ImageryInfo> josmEntries;
     
    5151    static main(def args) {
    5252        parse_command_line_arguments(args)
    53         def script = new sync_editor_imagery_index()
     53        def script = new SyncEditorImageryIndex()
    5454        script.loadSkip()
    5555        script.start()
  • trunk/scripts/TagInfoExtract.groovy

    r9879 r9880  
    4747import org.openstreetmap.josm.tools.Utils
    4848
    49 class taginfoextract {
     49class TagInfoExtract {
    5050
    5151    static def options
     
    187187    static main(def args) {
    188188        parse_command_line_arguments(args)
    189         def script = new taginfoextract()
     189        def script = new TagInfoExtract()
    190190        if (!options.t || options.t == 'mappaint') {
    191191            script.run()
  • trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java

    r9067 r9880  
    202202            double distanceFirst = firstPosition.distance(refPoint);
    203203            double distanceSecond = secondPosition.distance(refPoint);
    204             double difference =  distanceFirst - distanceSecond;
    205 
    206             if (difference > 0.0) return 1;
    207             if (difference < 0.0) return -1;
    208             return 0;
     204            return Double.compare(distanceFirst, distanceSecond);
    209205        }
    210206    }
  • trunk/src/org/openstreetmap/josm/data/osm/NodePositionComparator.java

    r8393 r9880  
    2020            return 0;
    2121
    22         double dLat = n1.getCoor().lat() - n2.getCoor().lat();
    23         if (dLat > 0)
    24             return 1;
    25         if (dLat < 0)
    26             return -1;
    27         double dLon = n1.getCoor().lon() - n2.getCoor().lon();
    28         if (dLon == 0)
    29             return 0;
    30         return dLon > 0 ? 1 : -1;
     22        int dLat = Double.compare(n1.getCoor().lat(), n2.getCoor().lat());
     23        return dLat != 0 ? dLat : Double.compare(n1.getCoor().lon(), n2.getCoor().lon());
    3124    }
    3225}
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r9850 r9880  
    14781478
    14791479        Pair<Timezone, Offset> splitOutTimezone() {
    1480             // In hours, rounded to two decimal places
    1481             double tz = (withoutDayOffset().getSeconds() * 100L / 3600.0) / 100.0;
     1480            // In hours
     1481            double tz = withoutDayOffset().getSeconds() / 3600.0;
    14821482
    14831483            // Due to imprecise clocks we might get a "+3:28" timezone, which should obviously be 3:30 with
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java

    r9804 r9880  
    100100        @Override
    101101        public int compare(TrackLength l0, TrackLength l1) {
    102             if (l0.value < l1.value)
    103                 return -1;
    104             else if (l0.value > l1.value)
    105                 return 1;
    106             return 0;
     102            return Double.compare(l0.value, l1.value);
    107103        }
    108104    }
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImagesTest.java

    r9753 r9880  
    1111import org.junit.BeforeClass;
    1212import org.junit.Test;
     13import org.openstreetmap.josm.JOSMFixture;
    1314import org.openstreetmap.josm.data.coor.LatLon;
    1415import org.openstreetmap.josm.data.gpx.GpxData;
     
    2829    @BeforeClass
    2930    public static void setUp() {
     31        JOSMFixture.createUnitTestFixture().init();
    3032        DateUtilsTest.setTimeZone(TimeZone.getTimeZone("UTC"));
    3133    }
Note: See TracChangeset for help on using the changeset viewer.