55import static org .junit .jupiter .api .Assertions .assertEquals ;
66import static org .junit .jupiter .api .Assertions .assertFalse ;
77import static org .junit .jupiter .api .Assertions .assertNull ;
8+ import static org .junit .jupiter .api .Assertions .assertTrue ;
89import static org .mockito .Mockito .when ;
910import static utils .InstrumentationTestHelper .compileAndLoadClass ;
1011
@@ -521,7 +522,7 @@ public void symbolExtraction09() throws IOException, URISyntaxException {
521522 19 );
522523 Scope supplierClosureScope = classScope .getScopes ().get (3 );
523524 assertScope (
524- supplierClosureScope , ScopeType .CLOSURE , "lambda$process$1 " , 20 , 21 , SOURCE_FILE , 1 , 0 );
525+ supplierClosureScope , ScopeType .CLOSURE , "lambda$process$* " , 20 , 21 , SOURCE_FILE , 1 , 0 );
525526 Scope supplierClosureLocalScope = supplierClosureScope .getScopes ().get (0 );
526527 assertScope (supplierClosureLocalScope , ScopeType .LOCAL , null , 20 , 21 , SOURCE_FILE , 0 , 1 );
527528 assertSymbol (
@@ -676,7 +677,7 @@ public void symbolExtraction12() throws IOException, URISyntaxException {
676677 fooMethodScope .getSymbols ().get (0 ), SymbolType .ARG , "arg" , Integer .TYPE .getTypeName (), 17 );
677678 Scope lambdaFoo3MethodScope = classScope .getScopes ().get (3 );
678679 assertScope (
679- lambdaFoo3MethodScope , ScopeType .CLOSURE , "lambda$foo$3 " , 19 , 19 , SOURCE_FILE , 0 , 1 );
680+ lambdaFoo3MethodScope , ScopeType .CLOSURE , "lambda$foo$* " , 19 , 19 , SOURCE_FILE , 0 , 1 );
680681 assertSymbol (
681682 lambdaFoo3MethodScope .getSymbols ().get (0 ),
682683 SymbolType .ARG ,
@@ -685,7 +686,7 @@ public void symbolExtraction12() throws IOException, URISyntaxException {
685686 19 );
686687 Scope lambdaFoo2MethodScope = classScope .getScopes ().get (4 );
687688 assertScope (
688- lambdaFoo2MethodScope , ScopeType .CLOSURE , "lambda$foo$2 " , 19 , 19 , SOURCE_FILE , 0 , 1 );
689+ lambdaFoo2MethodScope , ScopeType .CLOSURE , "lambda$foo$* " , 19 , 19 , SOURCE_FILE , 0 , 1 );
689690 assertSymbol (
690691 lambdaFoo2MethodScope .getSymbols ().get (0 ),
691692 SymbolType .ARG ,
@@ -856,7 +857,7 @@ public void symbolExtraction14() throws IOException, URISyntaxException {
856857 }
857858
858859 @ Test
859- @ EnabledOnJre ({JRE .JAVA_17 , JRE .JAVA_21 })
860+ @ EnabledOnJre ({JRE .JAVA_17 , JRE .JAVA_21 , JRE . JAVA_24 })
860861 @ DisabledIf (
861862 value = "datadog.environment.JavaVirtualMachine#isJ9" ,
862863 disabledReason = "Flaky on J9 JVMs" )
@@ -991,7 +992,12 @@ private static void assertScope(
991992 int nbScopes ,
992993 int nbSymbols ) {
993994 assertEquals (scopeType , scope .getScopeType ());
994- assertEquals (name , scope .getName ());
995+ if (name != null && name .endsWith ("*" )) {
996+ name = name .substring (0 , name .length () - 1 );
997+ assertTrue (scope .getName ().startsWith (name ));
998+ } else {
999+ assertEquals (name , scope .getName ());
1000+ }
9951001 assertEquals (startLine , scope .getStartLine ());
9961002 assertEquals (endLine , scope .getEndLine ());
9971003 assertEquals (sourceFile , scope .getSourceFile ());
0 commit comments