TestDescription::equals compares only each 2nd value from 'fields' array, it doesn't compare rrurl and rootRelativePath. so two different tests will be considered equal if they have the same values (even if keys are different) , for example, the following two jtreg tests will have equal TestDescription objects:
foo/test.java
/*
* @test
* @run main Test
*/
public class Test { public static void main(String[]args) { throw new Error(); } }
and
bar/test.java
/*
* @test
* @run main Test
*/
public class Test { public static void main(String[]args) { } }
foo/test.java
/*
* @test
* @run main Test
*/
public class Test { public static void main(String[]args) { throw new Error(); } }
and
bar/test.java
/*
* @test
* @run main Test
*/
public class Test { public static void main(String[]args) { } }
- relates to
-
CODETOOLS-7098097 FindBugs violations: HE: Equal objects must have equal hashcodes
-
- Closed
-
-
CODETOOLS-7902067 CachingTestFilter caches based on the content of a test description, not the location
-
- Closed
-
-
CODETOOLS-7902343 TestDescription should document or unimplement equals/hashCode
-
- New
-