I\'ve noticed eclipse JDT uses void as a primitive type. Can this be considered correct?
From Java 6 API docs:
public boolean isPrimitive() - Determines if the specified Class object represents a primitive type.
Returns: true if and only if this class represents a primitive type
I checked for myself:
void.class.getName() // void (OK)
void.class.isPrimitive() // true (??)
Void.class.getName() // java.lang.Void (OK)
Void.class.isPrimitive() // false (OK)
Is it bug ? I know that void is not primitive type (I think it is just keyword), but why void.class.isPrimitive() returns true ?
edit: I think it should be clarified, so I suggested java:doc bug 7019906. In my opinion it should be:
public boolean isPrimitive() - Determines if the specified Class object represents a primitive type or a keyword void.
Returns: true if and only if this class represents a primitive type or a keyword void.