-
Bug
-
Resolution: Won't Fix
-
P2
-
None
-
5.0
-
x86
-
solaris_2.5.1
Name: gm110360 Date: 07/26/2004
FULL PRODUCT VERSION :
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Linux 2.4.21-openmosix-1 #4 Wed Jul 23 21:12:47 CEST 2003 i686 unknown
EXTRA RELEVANT SYSTEM CONFIGURATION :
does not have influence on bug
A DESCRIPTION OF THE PROBLEM :
Simply, code which was compiled correctly in 1.4 and previous does not compile in 1.5 because of generics stuffed in libraries.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Take following two classes and try to compile them with source 1.5 (syntax extensions enabled).
public class BuggyList extends java.util.ArrayList
{
public int find(Object x)
{
return java.util.Collections.binarySearch(this,x);
};
};
public class BuggyItem implements Comparable
{
public int compareTo(Object o)
{
return this.equals(o) ? 1: 0;
};
};
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Correct compilation (regardless of what those stupid classes do)
ACTUAL -
BuggyList.java:7: cannot find symbol
symbol : method binarySearch(BuggyList,java.lang.Object)
location: class java.util.Collections
return java.util.Collections.binarySearch(this,x);
^
1 error
or correct, if compiling with generics disabled ( -source 1.4 option)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
see above
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
see above
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Could not find. This is importand incompatibilty.
Release Regression From : 1.4.2
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
(Incident Review ID: 287034)
======================================================================
- relates to
-
JDK-5073079 Allow unchecked override of generified methods in parameterless classes
-
- Resolved
-
-
JDK-5078623 REGRESSION: Some calls to Collections.binarySearch no longer compile
-
- Resolved
-