SUGGESTED FIX
Index: src/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -830,8 +830,10 @@
elsetype = types.boxedClass(elsetype).type;
}
- if (types.isSubType(thentype, elsetype)) return elsetype;
- if (types.isSubType(elsetype, thentype)) return thentype;
+ if (types.isSubType(thentype, elsetype))
+ return elsetype.baseType();
+ if (types.isSubType(elsetype, thentype))
+ return thentype.baseType();
if (!allowBoxing || thentype.tag == VOID || elsetype.tag == VOID) {
log.error(pos, "neither.conditional.subtype",
@@ -842,7 +844,7 @@
// both are known to be reference types. The result is
// lub(thentype,elsetype). This cannot fail, as it will
// always be possible to infer "Object" if nothing better.
- return types.lub(thentype, elsetype);
+ return types.lub(thentype.baseType(), elsetype.baseType());
}
public void visitIf(If tree) {
###@###.### 2004-09-29
|