Description
This test just started to fail in the jdk8/tl repo, as of 22nd Jan 2013. A recent langtools change may be the cause:
8005166: Add support for static interface methods
8005851: Remove support for synchronized interface methods
8006566: Remove transient lambda-related guards from JavacParser
8005244: Implement overload resolution as per latest spec EDR
A simple test, stripped from BigBinarySearch.java, shows the same problem:
ashtown : cat Test.java
import java.util.*;
public class Test {
static void test(List<Integer> l, int i) {
equal(i, Collections.binarySearch(l, l.get(i)));
}
static void equal(Object x, Object y) {}
}
ashtown : ../../../../../build/linux-x86_64-normal-server-release/jdk/bin/javac Test.java
Test.java:4: error: method equal in class Test cannot be applied to given types;
equal(i, Collections.binarySearch(l, l.get(i)));
^
required: Object,Object
found: int,int
reason: argument mismatch; no instance(s) of type variable(s) T exist so that int conforms to Object
where T is a type-variable:
T extends Object declared in method <T>binarySearch(List<? extends Comparable<? super T>>,T)
1 error
Sample jtreg output:
--------------------------------------------------
TEST: java/util/Collections/BigBinarySearch.java
JDK under test: (/opt/jprt/T/P1/133524.chhegar/testproduct/linux_i586_2.6-product)
java version "1.8.0-internal"
Java(TM) SE Runtime Environment (build 1.8.0-internal-jprtadm_2013_01_22_06_09-b00)
Java HotSpot(TM) Server VM (build 25.0-b15, mixed mode)
ACTION: build -- Failed. Compilation failed: Compilation failed
REASON: Named class compiled on demand
TIME: 0.133 seconds
messages:
command: build BigBinarySearch
reason: Named class compiled on demand
elapsed time (seconds): 0.133
ACTION: compile -- Failed. Compilation failed: Compilation failed
REASON: .class file out of date or does not exist
TIME: 0.133 seconds
messages:
command: compile /opt/jprt/T/P1/133524.chhegar/s/jdk/test/java/util/Collections/BigBinarySearch.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.133
direct:
/opt/jprt/T/P1/133524.chhegar/s/jdk/test/java/util/Collections/BigBinarySearch.java:66: error: method equal in class BigBinarySearch cannot be applied to given types;
try { equal(i, Collections.binarySearch(l, l.get(i))); }
^
required: Object,Object
found: int,int
reason: argument mismatch; no instance(s) of type variable(s) T exist so that int conforms to Object
where T is a type-variable:
T extends Object declared in method <T>binarySearch(List<? extends Comparable<? super T>>,T)
/opt/jprt/T/P1/133524.chhegar/s/jdk/test/java/util/Collections/BigBinarySearch.java:73: error: method equal in class BigBinarySearch cannot be applied to given types;
try { equal(i, Collections.binarySearch(l, l.get(i), comparator)); }
^
required: Object,Object
found: int,int
reason: argument mismatch; no instance(s) of type variable(s) T exist so that int conforms to Object
where T is a type-variable:
T extends Object declared in method <T>binarySearch(List<? extends T>,T,Comparator<? super T>)
2 errors
TEST RESULT: Failed. Compilation failed: Compilation failed
8005166: Add support for static interface methods
8005851: Remove support for synchronized interface methods
8006566: Remove transient lambda-related guards from JavacParser
8005244: Implement overload resolution as per latest spec EDR
A simple test, stripped from BigBinarySearch.java, shows the same problem:
ashtown : cat Test.java
import java.util.*;
public class Test {
static void test(List<Integer> l, int i) {
equal(i, Collections.binarySearch(l, l.get(i)));
}
static void equal(Object x, Object y) {}
}
ashtown : ../../../../../build/linux-x86_64-normal-server-release/jdk/bin/javac Test.java
Test.java:4: error: method equal in class Test cannot be applied to given types;
equal(i, Collections.binarySearch(l, l.get(i)));
^
required: Object,Object
found: int,int
reason: argument mismatch; no instance(s) of type variable(s) T exist so that int conforms to Object
where T is a type-variable:
T extends Object declared in method <T>binarySearch(List<? extends Comparable<? super T>>,T)
1 error
Sample jtreg output:
--------------------------------------------------
TEST: java/util/Collections/BigBinarySearch.java
JDK under test: (/opt/jprt/T/P1/133524.chhegar/testproduct/linux_i586_2.6-product)
java version "1.8.0-internal"
Java(TM) SE Runtime Environment (build 1.8.0-internal-jprtadm_2013_01_22_06_09-b00)
Java HotSpot(TM) Server VM (build 25.0-b15, mixed mode)
ACTION: build -- Failed. Compilation failed: Compilation failed
REASON: Named class compiled on demand
TIME: 0.133 seconds
messages:
command: build BigBinarySearch
reason: Named class compiled on demand
elapsed time (seconds): 0.133
ACTION: compile -- Failed. Compilation failed: Compilation failed
REASON: .class file out of date or does not exist
TIME: 0.133 seconds
messages:
command: compile /opt/jprt/T/P1/133524.chhegar/s/jdk/test/java/util/Collections/BigBinarySearch.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.133
direct:
/opt/jprt/T/P1/133524.chhegar/s/jdk/test/java/util/Collections/BigBinarySearch.java:66: error: method equal in class BigBinarySearch cannot be applied to given types;
try { equal(i, Collections.binarySearch(l, l.get(i))); }
^
required: Object,Object
found: int,int
reason: argument mismatch; no instance(s) of type variable(s) T exist so that int conforms to Object
where T is a type-variable:
T extends Object declared in method <T>binarySearch(List<? extends Comparable<? super T>>,T)
/opt/jprt/T/P1/133524.chhegar/s/jdk/test/java/util/Collections/BigBinarySearch.java:73: error: method equal in class BigBinarySearch cannot be applied to given types;
try { equal(i, Collections.binarySearch(l, l.get(i), comparator)); }
^
required: Object,Object
found: int,int
reason: argument mismatch; no instance(s) of type variable(s) T exist so that int conforms to Object
where T is a type-variable:
T extends Object declared in method <T>binarySearch(List<? extends T>,T,Comparator<? super T>)
2 errors
TEST RESULT: Failed. Compilation failed: Compilation failed