-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression: Superfluous TranslationUnits #136
Comments
This unknown declarations TU has been there long before the type system update, it just wasn't that visible, as it only exists for classes that are not present in the analysed files, like java.lang.Object. In order to reach the behavior described in #135, that we have record declarations for unknown classes, we need some place to store them, in order to be able to reach them from the graph root. Our current graph roots are translation units, thus the unknown declarations TU as a container for dummy records |
I understand. In 1.4.2 this was not present yet. The thing is - it makes CPG very unpleasant to use and complicates client code. A client now cannot simply assume that a This requires the client to a) know about the different forms and shapes in which a My suggestions would be to represent supertypes as |
This would only remove a single instance of unknown declarations. Even if supertypes are only present as types, any situation where a method is called or statically imported from a class that is unknown, dummies are still created. |
Closing this as we fixed the dummy creation behavior already, thus no unknown declarations TUs are created anymore |
With the revamped type system after version 1.4.2, a few things have changed which break the API/assumptions:
Attached to the new "implicit"
RecordDeclaration
nodes (see bug #135) is anunknown declarations
TranslationUnit
. It obviously does not refer to any existing file (TranslationUnit) and provides no value.For clients of CPG, this complicates things as it breaks the assumption that every
TranslationUnit
refers to an existing (analyzed) file.Is that change intended and what is it good for? How are clients expected to handle
TransationUnits
that do not refer to actual files?The text was updated successfully, but these errors were encountered: