File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed
main/java/co/elastic/indytransformer
java/co/elastic/indytransformer Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -414,8 +414,9 @@ private static void simplifyReturnStatement(ReturnStmt returnStmt) {
414414 .toList ();
415415
416416 if (matchingReturnValues .size () == 1 ) {
417+ NameExpr replacedReturnExpression = matchingReturnValues .get (0 );
417418 Set <String > otherVarNames = returnedVariables .stream ()
418- .filter (name -> name != matchingReturnValues )
419+ .filter (name -> name != replacedReturnExpression )
419420 .map (name -> name .getNameAsString ())
420421 .collect (Collectors .toSet ());
421422
@@ -432,7 +433,6 @@ private static void simplifyReturnStatement(ReturnStmt returnStmt) {
432433 additionalOrphanComments .add (0 , comment );
433434 }
434435 prevStatement .remove ();
435- NameExpr replacedReturnExpression = matchingReturnValues .get (0 );
436436 replacedReturnExpression .replace (assignExpr .getValue ());
437437 returnedVariables .remove (replacedReturnExpression );
438438 continueOptimizing = true ;
Original file line number Diff line number Diff line change @@ -98,6 +98,11 @@ public void complexEnter() {
9898 transformAndPrintDiff ("/ComplexEnter.java" );
9999 }
100100
101+ @ Test
102+ public void wrapArgumentAdvice () {
103+ transformAndPrintDiff ("/WrapArgumentAdvice.java" );
104+ }
105+
101106 @ Test
102107 public void preserveAssignmentOrderInReturn () {
103108 transformAndPrintDiff ("/PreserveOrderInOptimizedReturns.java" );
Original file line number Diff line number Diff line change 1+ import net .bytebuddy .asm .Advice ;
2+
3+ public class SingleLocalAdvice {
4+
5+ @ Advice .OnMethodEnter (suppress = Throwable .class )
6+ public static void enterSchedule (
7+ @ Advice .Argument (value = 2 , readOnly = false ) Runnable runnable ) {
8+ runnable = AkkaSchedulerTaskWrapper .wrap (runnable );
9+ }
10+
11+ }
You can’t perform that action at this time.
0 commit comments