Skip to content

Commit

Permalink
Improve actual string generation for composite statements
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Nov 2, 2024
1 parent b8ac889 commit da713f2
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,17 @@ public CompositeStatementObject(CompilationUnit cu, String sourceFolder, String
this.actualSignature = whole.substring(0, whole.indexOf("{") + 1);
}
else {
if(whole.contains("\n"))
this.actualSignature = whole.substring(0, whole.indexOf("\n"));
if(whole.contains("\n")) {
String[] lineArray = whole.split("\\r?\\n");
int chars = 0;
for(String line : lineArray) {
chars += line.length();
if(line.endsWith(")")) {
break;
}
}
this.actualSignature = whole.substring(0, chars);
}
else
this.actualSignature = whole;
}
Expand Down

0 comments on commit da713f2

Please sign in to comment.