JDK-4941882 : incorrect inference for result of lub(int[], float[])
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0,6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS:
    generic,linux,solaris_8,solaris_9,windows_xp generic,linux,solaris_8,solaris_9,windows_xp
  • CPU: generic,x86,sparc
  • Submitted: 2003-10-22
  • Updated: 2006-03-15
  • Resolved: 2005-12-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other JDK 6
5.0u26-revFixed 5.0u27Fixed 6 b65Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Description
The following program is improperly accepted by javac.

class Z {
    static <T> T f(T a, T b) {
        return a;
    }
    static Object[] main(int[] a, float[] b) {
        return f(a, b);
    }
}

Comments
EVALUATION This fixes all the following issues (of which some are regressions): 4942040 improper handling of lub type for arrays, classes 5070671 Arrays.binarySearch can't infer int[] 6222762 Primitive arrays and varargs inference leads to crash in TreeMaker.Type(TreeMaker.java:531) 6332204 com.sun.tools.javac.code.Types.lub() throws NPE 6346876 Java compiler (javac) crashes on ternary operator type mismatch. 6355728 javac crashes with NullPointerException
05-12-2005

SUGGESTED FIX Webrev: http://sa.sfbay/projects/langtools_data/mustang/6332204/
05-12-2005

EVALUATION This leads to a number of related problems which can cause the compiler to reject incorrect programs or crash.
24-11-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon mustang
07-09-2004

EVALUATION Correct. This is a loophole in the implementation of the type system, not the spec. ###@###.### 2003-10-22
22-10-2003