Skip to content

Commit

Permalink
Compute actual string for leaf statements
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Oct 16, 2024
1 parent 140539c commit 54c8b75
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ public class StatementObject extends AbstractStatement {
private List<LeafExpression> castExpressions;
private List<TernaryOperatorExpression> ternaryOperatorExpressions;
private List<LambdaExpressionObject> lambdas;
private String actualSignature;

public StatementObject(CompilationUnit cu, String filePath, Statement statement, int depth, CodeElementType codeElementType, VariableDeclarationContainer container, String javaFileContent) {
super();
this.locationInfo = new LocationInfo(cu, filePath, statement, codeElementType);
Visitor visitor = new Visitor(cu, filePath, container, javaFileContent);
statement.accept(visitor);
int start = statement.getStartPosition();
int end = start + statement.getLength();
this.actualSignature = javaFileContent.substring(start, end);
this.variables = visitor.getVariables();
this.types = visitor.getTypes();
this.variableDeclarations = visitor.getVariableDeclarations();
Expand Down Expand Up @@ -147,6 +151,10 @@ else if(expression instanceof ClassInstanceCreation) {
}
}

public String getActualSignature() {
return actualSignature;
}

@Override
public List<AbstractCodeFragment> getLeaves() {
List<AbstractCodeFragment> leaves = new ArrayList<AbstractCodeFragment>();
Expand Down

0 comments on commit 54c8b75

Please sign in to comment.