Open msteinbeck opened 5 years ago
Hello @msteinbeck ,
Thanks for the report.
From what I can read here, in noClasspath mode, when importing a static field, we create a class holding the field to be imported. So it seems to be intentional. But I get that it is weird that these types are listed byt getAllTypes()
I am not sure what behavior would be less misleading for spoon users. We could mark these types and filter them out in getAllTypes() but then it might lead to some other weird discrepancies.
WDYT @monperrus ?
Indeed, there is an ambiguity in the spec: "returns all top-level types of the model".
Two options to resolve this ambiguity:
I prefer the latter, and we can also add a method "getAllTypesInclShadowTypes()"
I think excluding shadow types (those built from binary classes) will break incremental builds, because previously compiled files are added to the classpath while creating a new increment. In the example stated above, a class which neither is created from a .class file nor has been added to the input source is returned by getAllTypes
.
OK.
Would it work if we change the incremental builder to call getAllTypesInclShadowTypes
instead of getAllTypes
(new version)?
@msteinbeck WDYT?
Steps to reproduce:
/path/to/repo
):Result:
If I use grep to search for
HttpVersion
:I get the following output:
So
HttpVersion
is not part of my input source. I tested version 7.4.0 and 7.5.0-beta-21.