-
Bug
-
Resolution: Fixed
-
P3
-
7u51, 7u60
-
b01
-
x86
-
windows_7
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8061106 | 7u79 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | b01 |
JDK-8057524 | 7u76 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | b01 |
JDK-8035484 | 7u65 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | b01 |
JDK-8035378 | 7u60 | Vicente Arturo Romero Zaldivar | P3 | Resolved | Fixed | b07 |
Attach a testcase for a compiler bug in JDK 7 update 51 and 7u60 that is probably a regression. However it works fine with JDK 8 latest build 124.
The compiler issues the following warnings:
-----------------
C:\Users\Gili\Documents\NetBeansProjects\UncheckedCast\src\uncheckedcast\NumberPreconditions.java:38: warning: [unchecked] unchecked cast
if (parameter instanceof BigDecimal) {
required: BigDecimal
found: T
where T is a type-variable:
T extends Number,Comparable<? super T> declared in class NumberPreconditions
C:\Users\Gili\Documents\NetBeansProjects\UncheckedCast\src\uncheckedcast\NumberPreconditions.java:40: warning: [unchecked] unchecked cast
BigDecimal decimal = (BigDecimal) parameter;
required: BigDecimal
found: T
where T is a type-variable:
T extends Number,Comparable<? super T> declared in class NumberPreconditions
2 warnings
-----------------
It's flagging "instanceof" as an unchecked cast, which is nonsense since "instanceof" does not do any casting. Another thing to notice is that this bug only occurs if NumberPreconditions extends Preconditions. Meaning, you must use class inheritance for this bug to occur. If you merge the two classes into one, the warning goes away.
Please mark this as a CAP issue.
Priority justification:
Impact: Medium impact, regression
Likelhood: Medium,intermittent
Workaround: Medium, unknown
ILW = MMM => P3
The compiler issues the following warnings:
-----------------
C:\Users\Gili\Documents\NetBeansProjects\UncheckedCast\src\uncheckedcast\NumberPreconditions.java:38: warning: [unchecked] unchecked cast
if (parameter instanceof BigDecimal) {
required: BigDecimal
found: T
where T is a type-variable:
T extends Number,Comparable<? super T> declared in class NumberPreconditions
C:\Users\Gili\Documents\NetBeansProjects\UncheckedCast\src\uncheckedcast\NumberPreconditions.java:40: warning: [unchecked] unchecked cast
BigDecimal decimal = (BigDecimal) parameter;
required: BigDecimal
found: T
where T is a type-variable:
T extends Number,Comparable<? super T> declared in class NumberPreconditions
2 warnings
-----------------
It's flagging "instanceof" as an unchecked cast, which is nonsense since "instanceof" does not do any casting. Another thing to notice is that this bug only occurs if NumberPreconditions extends Preconditions. Meaning, you must use class inheritance for this bug to occur. If you merge the two classes into one, the warning goes away.
Please mark this as a CAP issue.
Priority justification:
Impact: Medium impact, regression
Likelhood: Medium,intermittent
Workaround: Medium, unknown
ILW = MMM => P3
- backport of
-
JDK-8010101 Intersection type cast issues redundant unchecked warning
-
- Closed
-
- backported by
-
JDK-8035378 javac, spurious warning for instanceof operator
-
- Resolved
-
-
JDK-8035484 javac, spurious warning for instanceof operator
-
- Resolved
-
-
JDK-8057524 javac, spurious warning for instanceof operator
-
- Resolved
-
-
JDK-8061106 javac, spurious warning for instanceof operator
-
- Resolved
-