Changeset 10218 in josm


Ignore:
Timestamp:
2016-05-15T18:36:50+02:00 (9 years ago)
Author:
Don-vip
Message:

findbugs - RC_REF_COMPARISON

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/.settings/edu.umd.cs.findbugs.core.prefs

    r8656 r10218  
    11#FindBugs User Preferences
    2 #Sat Aug 01 23:18:50 CEST 2015
     2#Sun May 15 18:27:24 CEST 2016
    33cloud_id=edu.umd.cs.findbugs.cloud.doNothingCloud
    44detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true
     
    1010detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true
    1111detectorBooleanReturnNull=BooleanReturnNull|true
    12 detectorCallToUnsupportedMethod=CallToUnsupportedMethod|false
     12detectorCallToUnsupportedMethod=CallToUnsupportedMethod|true
    1313detectorCheckExpectedWarnings=CheckExpectedWarnings|false
    1414detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true
     
    1919detectorConfusedInheritance=ConfusedInheritance|true
    2020detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true
    21 detectorCovariantArrayAssignment=CovariantArrayAssignment|false
     21detectorCovariantArrayAssignment=CovariantArrayAssignment|true
    2222detectorCrossSiteScripting=CrossSiteScripting|true
    2323detectorDefaultEncodingDetector=DefaultEncodingDetector|true
     
    8181detectorIncompatMask=IncompatMask|true
    8282detectorInconsistentAnnotations=InconsistentAnnotations|true
    83 detectorInefficientIndexOf=InefficientIndexOf|false
    84 detectorInefficientInitializationInsideLoop=InefficientInitializationInsideLoop|false
    85 detectorInefficientMemberAccess=InefficientMemberAccess|false
     83detectorInefficientIndexOf=InefficientIndexOf|true
     84detectorInefficientInitializationInsideLoop=InefficientInitializationInsideLoop|true
     85detectorInefficientMemberAccess=InefficientMemberAccess|true
    8686detectorInefficientToArray=InefficientToArray|true
    8787detectorInfiniteLoop=InfiniteLoop|true
     
    108108detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true
    109109detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true
    110 detectorPublicSemaphores=PublicSemaphores|false
     110detectorPublicSemaphores=PublicSemaphores|true
    111111detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true
    112112detectorReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass=ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass|true
     
    131131detectorUnnecessaryMath=UnnecessaryMath|true
    132132detectorUnreadFields=UnreadFields|true
    133 detectorUselessSubclassMethod=UselessSubclassMethod|false
     133detectorUselessSubclassMethod=UselessSubclassMethod|true
    134134detectorVarArgsProblems=VarArgsProblems|true
    135135detectorVolatileUsage=VolatileUsage|true
     
    137137detectorWrongMapIterator=WrongMapIterator|true
    138138detectorXMLFactoryBypass=XMLFactoryBypass|true
    139 detector_threshold=2
     139detector_threshold=3
    140140effort=max
    141141excludefilter0=tools/findbugs/josm-filter.xml|true
    142 filter_settings=Medium|BAD_PRACTICE,CORRECTNESS,EXPERIMENTAL,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false|16
     142filter_settings=Low|BAD_PRACTICE,CORRECTNESS,EXPERIMENTAL,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false|20
    143143filter_settings_neg=NOISE|
    144144run_at_full_build=true
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/NameMismatchTest.java

    r8624 r10218  
    33
    44import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertSame;
    65
    76import java.util.List;
     
    3837    public void test0() {
    3938        final List<TestError> errors = test("node name:de=Europa");
    40         assertSame(1, errors.size());
     39        assertEquals(1, errors.size());
    4140        assertEquals("A name is missing, even though name:* exists.", errors.get(0).getMessage());
    4241    }
     
    4847    public void test1() {
    4948        final List<TestError> errors = test("node name=Europe name:de=Europa");
    50         assertSame(1, errors.size());
     49        assertEquals(1, errors.size());
    5150        assertEquals("Missing name:*=Europe. Add tag with correct language key.", errors.get(0).getDescription());
    5251    }
     
    5857    public void test2() {
    5958        final List<TestError> errors = test("node name=Europe name:de=Europa name:en=Europe");
    60         assertSame(0, errors.size());
     59        assertEquals(0, errors.size());
    6160    }
    6261
     
    6867        List<TestError> errors;
    6968        errors = test("node \"name\"=\"Italia - Italien - Italy\"");
    70         assertSame(0, errors.size());
     69        assertEquals(0, errors.size());
    7170        errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia");
    72         assertSame(2, errors.size());
     71        assertEquals(2, errors.size());
    7372        errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia name:de=Italien");
    74         assertSame(1, errors.size());
     73        assertEquals(1, errors.size());
    7574        assertEquals("Missing name:*=Italy. Add tag with correct language key.", errors.get(0).getDescription());
    7675        errors = test("node name=\"Italia - Italien - Italy\" name:it=Italia name:de=Italien name:en=Italy");
    77         assertSame(0, errors.size());
     76        assertEquals(0, errors.size());
    7877    }
    7978}
  • trunk/test/unit/org/openstreetmap/josm/gui/DefaultNameFormatterTest.java

    r9489 r10218  
    33
    44import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertSame;
    65
    76import java.io.IOException;
     
    6867            System.out.println("p3: "+DefaultNameFormatter.getInstance().format(p3)+" - "+p3);
    6968
    70             assertSame(comparator.compare(p1, p2), -1); // p1 < p2
    71             assertSame(comparator.compare(p2, p1),  1); // p2 > p1
     69            assertEquals(comparator.compare(p1, p2), -1); // p1 < p2
     70            assertEquals(comparator.compare(p2, p1),  1); // p2 > p1
    7271
    73             assertSame(comparator.compare(p1, p3), -1); // p1 < p3
    74             assertSame(comparator.compare(p3, p1),  1); // p3 > p1
    75             assertSame(comparator.compare(p2, p3),  1); // p2 > p3
    76             assertSame(comparator.compare(p3, p2), -1); // p3 < p2
     72            assertEquals(comparator.compare(p1, p3), -1); // p1 < p3
     73            assertEquals(comparator.compare(p3, p1),  1); // p3 > p1
     74            assertEquals(comparator.compare(p2, p3),  1); // p2 > p3
     75            assertEquals(comparator.compare(p3, p2), -1); // p3 < p2
    7776
    7877            Relation[] relations = new ArrayList<>(ds.getRelations()).toArray(new Relation[0]);
  • trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java

    r9942 r10218  
    44import static org.junit.Assert.assertEquals;
    55import static org.junit.Assert.assertNotNull;
    6 import static org.junit.Assert.assertSame;
    76import static org.junit.Assert.assertTrue;
    87
     
    6968        for (String file : new String[]{"osm.jos", "osm.joz"}) {
    7069            List<Layer> layers = testRead(file);
    71             assertSame(layers.size(), 1);
     70            assertEquals(layers.size(), 1);
    7271            assertTrue(layers.get(0) instanceof OsmDataLayer);
    7372            OsmDataLayer osm = (OsmDataLayer) layers.get(0);
     
    8584        for (String file : new String[]{"gpx.jos", "gpx.joz", "nmea.jos"}) {
    8685            List<Layer> layers = testRead(file);
    87             assertSame(layers.size(), 1);
     86            assertEquals(layers.size(), 1);
    8887            assertTrue(layers.get(0) instanceof GpxLayer);
    8988            GpxLayer gpx = (GpxLayer) layers.get(0);
     
    10099    public void testReadGpxAndMarker() throws IOException, IllegalDataException {
    101100        List<Layer> layers = testRead("gpx_markers.joz");
    102         assertSame(layers.size(), 2);
     101        assertEquals(layers.size(), 2);
    103102        GpxLayer gpx = null;
    104103        MarkerLayer marker = null;
     
    124123    public void testReadImage() throws IOException, IllegalDataException {
    125124        final List<Layer> layers = testRead("bing.jos");
    126         assertSame(layers.size(), 1);
     125        assertEquals(layers.size(), 1);
    127126        assertTrue(layers.get(0) instanceof ImageryLayer);
    128127        final ImageryLayer image = (ImageryLayer) layers.get(0);
     
    145144        }
    146145        final List<Layer> layers = testRead("notes.joz");
    147         assertSame(layers.size(), 1);
     146        assertEquals(layers.size(), 1);
    148147        assertTrue(layers.get(0) instanceof NoteLayer);
    149148        final NoteLayer layer = (NoteLayer) layers.get(0);
Note: See TracChangeset for help on using the changeset viewer.