5
5
import static org .junit .jupiter .api .Assertions .assertEquals ;
6
6
import static org .junit .jupiter .api .Assertions .assertFalse ;
7
7
import static org .junit .jupiter .api .Assertions .assertNull ;
8
+ import static org .junit .jupiter .api .Assertions .assertTrue ;
8
9
import static org .mockito .Mockito .when ;
9
10
import static utils .InstrumentationTestHelper .compileAndLoadClass ;
10
11
@@ -521,7 +522,7 @@ public void symbolExtraction09() throws IOException, URISyntaxException {
521
522
19 );
522
523
Scope supplierClosureScope = classScope .getScopes ().get (3 );
523
524
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 );
525
526
Scope supplierClosureLocalScope = supplierClosureScope .getScopes ().get (0 );
526
527
assertScope (supplierClosureLocalScope , ScopeType .LOCAL , null , 20 , 21 , SOURCE_FILE , 0 , 1 );
527
528
assertSymbol (
@@ -676,7 +677,7 @@ public void symbolExtraction12() throws IOException, URISyntaxException {
676
677
fooMethodScope .getSymbols ().get (0 ), SymbolType .ARG , "arg" , Integer .TYPE .getTypeName (), 17 );
677
678
Scope lambdaFoo3MethodScope = classScope .getScopes ().get (3 );
678
679
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 );
680
681
assertSymbol (
681
682
lambdaFoo3MethodScope .getSymbols ().get (0 ),
682
683
SymbolType .ARG ,
@@ -685,7 +686,7 @@ public void symbolExtraction12() throws IOException, URISyntaxException {
685
686
19 );
686
687
Scope lambdaFoo2MethodScope = classScope .getScopes ().get (4 );
687
688
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 );
689
690
assertSymbol (
690
691
lambdaFoo2MethodScope .getSymbols ().get (0 ),
691
692
SymbolType .ARG ,
@@ -856,7 +857,7 @@ public void symbolExtraction14() throws IOException, URISyntaxException {
856
857
}
857
858
858
859
@ Test
859
- @ EnabledOnJre ({JRE .JAVA_17 , JRE .JAVA_21 })
860
+ @ EnabledOnJre ({JRE .JAVA_17 , JRE .JAVA_21 , JRE . JAVA_24 })
860
861
@ DisabledIf (
861
862
value = "datadog.environment.JavaVirtualMachine#isJ9" ,
862
863
disabledReason = "Flaky on J9 JVMs" )
@@ -991,7 +992,12 @@ private static void assertScope(
991
992
int nbScopes ,
992
993
int nbSymbols ) {
993
994
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
+ }
995
1001
assertEquals (startLine , scope .getStartLine ());
996
1002
assertEquals (endLine , scope .getEndLine ());
997
1003
assertEquals (sourceFile , scope .getSourceFile ());
0 commit comments