Sebb created BCEL-245:
-------------------------

             Summary: Type class includes constants that reference subclasses
                 Key: BCEL-245
                 URL: https://issues.apache.org/jira/browse/BCEL-245
             Project: Commons BCEL
          Issue Type: Bug
            Reporter: Sebb


FindBugs notes that the Type classe tries to use the ObjectType class before it 
has been initialised:

{code}
public static final BasicType CHAR = new BasicType(Constants.T_CHAR);
public static final ObjectType OBJECT = 
ObjectType.getInstance("java.lang.Object");
{code}

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:

{code}
public static final ObjectType OBJECT = new ObjectType("java.lang.Object");
{code}

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...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to