Skip to content

Commit

Permalink
Improvement over previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tsantalis committed Mar 9, 2024
1 parent fa21c9e commit d3d96be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,11 @@ private boolean processArgument(AbstractCodeMapping mapping, AbstractCall call,
if(creation2 == null) {
creation2 = mapping.getFragment2().assignmentCreationCoveringEntireStatement();
}
List<LeafExpression> expressions1 = null;
if(argument.contains(JAVA.LAMBDA_ARROW)) {
List<LeafExpression> expressions1 = mapping.getFragment1().findExpression(argument);
if(expressions1.isEmpty() && argument.contains(JAVA.LAMBDA_ARROW)) {
String actualArgument = argument.substring(argument.indexOf(JAVA.LAMBDA_ARROW) + JAVA.LAMBDA_ARROW.length());
expressions1 = mapping.getFragment1().findExpression(actualArgument);
}
else {
expressions1 = mapping.getFragment1().findExpression(argument);
}
if(expressions1.size() > 0) {
List<AbstractCodeFragment> leaves = sourceOperationAfterExtraction.getBody().getCompositeStatement().getLeaves();
for(AbstractCodeFragment leaf : leaves) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,11 @@ private boolean processArgument(AbstractCodeMapping mapping, AbstractCall call,
if(creation2 == null) {
creation2 = mapping.getFragment2().assignmentCreationCoveringEntireStatement();
}
List<LeafExpression> expressions2 = null;
if(argument.contains(JAVA.LAMBDA_ARROW)) {
List<LeafExpression> expressions2 = mapping.getFragment2().findExpression(argument);
if(expressions2.isEmpty() && argument.contains(JAVA.LAMBDA_ARROW)) {
String actualArgument = argument.substring(argument.indexOf(JAVA.LAMBDA_ARROW) + JAVA.LAMBDA_ARROW.length());
expressions2 = mapping.getFragment2().findExpression(actualArgument);
}
else {
expressions2 = mapping.getFragment2().findExpression(argument);
}
if(expressions2.size() > 0) {
List<AbstractCodeFragment> leaves = targetOperationBeforeInline.getBody().getCompositeStatement().getLeaves();
for(AbstractCodeFragment leaf : leaves) {
Expand Down

0 comments on commit d3d96be

Please sign in to comment.