I have the following abstract generic data holder in my project (simplified):
public abstract static class Value {
E value;
public void se
A known Eclipse bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=440019
Fixed in Eclipse 4.5 M3.
According to the JLS for Java 8 this should not happen:
5.1.2. Widening Primitive Conversion
19 specific conversions on primitive types are called the widening primitive conversions:
[..]
- int to long, float, or double
[..]
5.1.8. Unboxing Conversion
[..]
- From type Integer to type int
What should happen is an unboxing from Integer
to int
, and then a widening conversion to long
. This is actually happening as expected in Oracle JDK (1.8.0.25).
I believe you came across a compiler bug into your JDK. You should probably try an updated version or file a bug with the maintainers.