-
Notifications
You must be signed in to change notification settings - Fork 61
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: Semantics of RecordDeclaration has changed #135
Comments
It's actually not just supertypes of classes declared in the analyzed files, but more generally any classes that are used in the analyzed files but whose declarations are somewhere else that is not in scope of the analysed files. So, java.lang.Object is an implicit superclass of every java class, thus used in the code, but not declared in our analysed files. I would think that this behavior is beneficial, e.g. also method calls to methods that we don't have in our scope are routed to dummy methods. This signals that we do know about their existance, as they are needed by some part of the analyzed program, we just don't have their explicit declaration ready. And in this case, the current system doesn't differentiate between unknown methods of known classes and unknown methods of unknown ones. |
…known RecordDeclarations, fix tests to adapt to this behavior
With the revamped type system after version 1.4.2, a few things have changed which break the API/assumptions:
The semantics of
RecordDeclaration
has changed. Previously, it was "a C++ union/struct/class or Java class that is declared in the analyzed source code". Now it is that, plus "any class/union/struct that is a supertype of the declared classes". This does not really make sense, because for any Record that is not declared in the analyzed scope, the attributes ofRecordDeclaration
do not make sense:methods
,constructors
,fields
,importStatements
etc. cannot be filled.All clients of CPG will now have to distinguish between different "types" of
RecordDeclarations
: those that are "real" declarations and can be used as before and those that are only "implicit" Records whose attributes are not available and return null.Is that change intended? It seems to make life for CPG clients more complicated and dilutes the semantics of
RecordDeclaration
.See this example where
java.lang.Object
is aRecordDeclaration
but obviously not declared in the analyzed scope.The text was updated successfully, but these errors were encountered: