diff --git a/src/main/java/gr/uom/java/xmi/decomposition/StatementObject.java b/src/main/java/gr/uom/java/xmi/decomposition/StatementObject.java index 7bc781542..d4a7408e7 100644 --- a/src/main/java/gr/uom/java/xmi/decomposition/StatementObject.java +++ b/src/main/java/gr/uom/java/xmi/decomposition/StatementObject.java @@ -49,12 +49,16 @@ public class StatementObject extends AbstractStatement { private List castExpressions; private List ternaryOperatorExpressions; private List 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(); @@ -147,6 +151,10 @@ else if(expression instanceof ClassInstanceCreation) { } } + public String getActualSignature() { + return actualSignature; + } + @Override public List getLeaves() { List leaves = new ArrayList();