Closed r0texx closed 5 months ago
Just compiling the Option.java with ECJ reveals the problem. On quick look, I see that there are two compiler errors in Option.java:
Now, despite (1), we mark the receiver of the constructor with T_JavaLangEnum
. And as a result of (2), the methodScope.referenceMethod().binding
is null in ExplicitConstructorCall
, line 352. Now put both these together, we hit the NPE. I wonder if we must do the type ID check. I see three ways out:
receiverType.erasure().id == TypeIds.T_JavaLangEnum
to receiverType.isEnum()
. The illegal enum declaration seems to have been taken care of by the isEnum() check.My choice is (2). @srikanth-sankaran What do you think?
Actually, I see the type ID check and isEnum() check both being used in an OR check. So, looks like it is expected for them to be out of sync.
Hello,
I'm trying to build a source, but JDT Core throws an exception:
For the following test source (save it to a directory and change the
ROOT
variable):I use the following code to parse it using JDT Core: