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
  • 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 Availabitlity Release.

To download the current JDK release, click here.
Other JDK 6
5.0u26-revFixed 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
2005-12-05

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

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

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

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