Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
FindBugs notes that the Type class tries to use the ObjectType class before it has been initialised:
public static final BasicType CHAR = new BasicType(Constants.T_CHAR); public static final ObjectType OBJECT = ObjectType.getInstance("java.lang.Object");
Now both BasicType and ObjectType are sub-classes of Type.
However FindBugs only complains about the ObjectType call.
Perhaps this is because it uses a static method?
The getInstance() method could be replaced with the equivalent:
public static final ObjectType OBJECT = new ObjectType("java.lang.Object");
But why does FindBugs not complain about the other references?
Surely BasicType cannot be constructed until Type has been constructed?
It's not (yet) clear what is going on here...