In de.fraunhofer.aisec.cpg.frontends.java.DeclarationHandler::242:
// TODO: can field have more than one variable?
The answer is yes :)
Multi-variable declarations are wrapped in a DeclarationStatement, but statements only live inside of methods, so I guess multi-field declarations should be mapped to multiple independent FieldDeclarations. However, the most important thing is that the field declaration appears in the target RecordDeclaration.
Example:
public class Point {
int x, y;
...
}
results in RecordDeclaration with only one field x.
Any access to y will be mapped to a placeholder field declaration.
In
de.fraunhofer.aisec.cpg.frontends.java.DeclarationHandler::242
:The answer is yes :) Multi-variable declarations are wrapped in a DeclarationStatement, but statements only live inside of methods, so I guess multi-field declarations should be mapped to multiple independent FieldDeclarations. However, the most important thing is that the field declaration appears in the target RecordDeclaration.
Example:
results in RecordDeclaration with only one field
x
. Any access toy
will be mapped to a placeholder field declaration.