Closed GoogleCodeExporter closed 9 years ago
I looked at EclipseCFG. Suspected problem is that the enumerator has a
constructor, and apparently EnumDeclarations are not TypeDeclarations (lame).
However, the problem code in trunk is on line 666 and the reporte problem is on
line 662. I'm going to check the diff between trunk and what we have in the
latest release to make sure this problem wasn't fixed elsewhere.
if (node.isConstructor()) {
TypeDeclaration type = (TypeDeclaration) node.getParent();
for (FieldDeclaration field : type.getFields()) {
if (!Modifier.isStatic(field.getModifiers()))
field.accept(this);
}
}
Original comment by ciera.christopher
on 18 Mar 2011 at 4:03
Students did not know Crystal version number, but they're using Plural 1.1.5.
Attached the problem files.
Original comment by ciera.christopher
on 24 Mar 2011 at 3:31
Attachments:
Indeed, problem was due to Piece having a constructor. The CFG was trying to
access fields to do the constructor initialization, which of course an enum
doesn't have.
Made modification to check whether the declaring type is a class first (as
opposed to an enum or an annotation) before doing anything with fields and
constructors. This appears to be the only place where we make that assumption.
Original comment by ciera.christopher
on 24 Mar 2011 at 4:17
Original issue reported on code.google.com by
ciera.christopher
on 18 Mar 2011 at 1:26