Skip to content

Commit 0446145

Browse files
committed
Accept test changes
These are due to changing string literal representation, omitting empty annotations blocks, and changes to how annotation classes are represented in the database.
1 parent d530817 commit 0446145

File tree

5 files changed

+40
-82
lines changed

5 files changed

+40
-82
lines changed
Lines changed: 6 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,9 @@
11
test.kt:
22
# 0| [CompilationUnit] test
33
# 1| 1: [Interface] Ann
4-
# 1| 1: [Constructor] Ann
5-
#-----| 4: (Parameters)
6-
# 1| 0: [Parameter] arr1
7-
# 1| 0: [TypeAccess] String[]
8-
# 1| 0: [TypeAccess] String
9-
# 1| 1: [Parameter] arr2
10-
# 1| 0: [TypeAccess] int[]
11-
# 1| 5: [BlockStmt] { ... }
12-
# 1| 0: [SuperConstructorInvocationStmt] super(...)
13-
# 1| 1: [BlockStmt] { ... }
14-
# 1| 0: [ExprStmt] <Expr>;
15-
# 1| 0: [KtInitializerAssignExpr] ...=...
16-
# 1| 0: [VarAccess] arr1
17-
# 1| 1: [ExprStmt] <Expr>;
18-
# 1| 0: [KtInitializerAssignExpr] ...=...
19-
# 1| 0: [VarAccess] arr2
20-
# 1| 2: [Constructor] Ann
21-
#-----| 4: (Parameters)
22-
# 1| 0: [Parameter] p0
23-
# 1| 0: [TypeAccess] String[]
24-
# 1| 1: [Parameter] p1
25-
# 1| 0: [TypeAccess] int[]
26-
# 1| 2: [Parameter] p2
27-
# 1| 0: [TypeAccess] int
28-
# 1| 3: [Parameter] p3
29-
# 1| 0: [TypeAccess] DefaultConstructorMarker
30-
# 1| 5: [BlockStmt] { ... }
31-
# 1| 0: [IfStmt] if (...)
32-
# 1| 0: [EQExpr] ... == ...
33-
# 1| 0: [AndBitwiseExpr] ... & ...
34-
# 1| 0: [IntegerLiteral] 1
35-
# 1| 1: [VarAccess] p2
36-
# 1| 1: [IntegerLiteral] 0
37-
# 1| 1: [ExprStmt] <Expr>;
38-
# 1| 0: [AssignExpr] ...=...
39-
# 1| 0: [VarAccess] p0
40-
# 0| 1: [ArrayCreationExpr] new String[]
41-
# 0| -2: [ArrayInit] {...}
42-
# 0| 0: [StringLiteral] "hello"
43-
# 0| 1: [StringLiteral] "world"
44-
# 0| -1: [TypeAccess] String
45-
# 0| 0: [IntegerLiteral] 2
46-
# 1| 1: [IfStmt] if (...)
47-
# 1| 0: [EQExpr] ... == ...
48-
# 1| 0: [AndBitwiseExpr] ... & ...
49-
# 1| 0: [IntegerLiteral] 2
50-
# 1| 1: [VarAccess] p2
51-
# 1| 1: [IntegerLiteral] 0
52-
# 1| 1: [ExprStmt] <Expr>;
53-
# 1| 0: [AssignExpr] ...=...
54-
# 1| 0: [VarAccess] p1
55-
# 0| 1: [ArrayCreationExpr] new int[]
56-
# 0| -2: [ArrayInit] {...}
57-
# 0| 0: [IntegerLiteral] 1
58-
# 0| 1: [IntegerLiteral] 2
59-
# 0| 2: [IntegerLiteral] 3
60-
# 0| -1: [TypeAccess] int
61-
# 0| 0: [IntegerLiteral] 3
62-
# 1| 2: [ThisConstructorInvocationStmt] this(...)
63-
# 1| 0: [VarAccess] p0
64-
# 1| 1: [VarAccess] p1
65-
# 1| 3: [FieldDeclaration] String[] arr1;
66-
# 1| -1: [TypeAccess] String[]
67-
# 1| 0: [TypeAccess] String
68-
# 1| 0: [VarAccess] arr1
69-
# 1| 4: [Method] arr1
70-
# 1| 3: [TypeAccess] String[]
71-
# 1| 0: [TypeAccess] String
72-
# 1| 5: [BlockStmt] { ... }
73-
# 1| 0: [ReturnStmt] return ...
74-
# 1| 0: [VarAccess] this.arr1
75-
# 1| -1: [ThisAccess] this
76-
# 1| 5: [Method] arr2
77-
# 1| 3: [TypeAccess] int[]
78-
# 1| 5: [BlockStmt] { ... }
79-
# 1| 0: [ReturnStmt] return ...
80-
# 1| 0: [VarAccess] this.arr2
81-
# 1| -1: [ThisAccess] this
82-
# 1| 6: [FieldDeclaration] int[] arr2;
83-
# 1| -1: [TypeAccess] int[]
84-
# 1| 0: [VarAccess] arr2
4+
#-----| -3: (Annotations)
5+
# 0| 1: [Annotation] Retention
6+
# 0| 1: [VarAccess] RetentionPolicy.RUNTIME
7+
# 0| -1: [TypeAccess] RetentionPolicy
8+
# 1| 1: [Method] arr1
9+
# 1| 2: [Method] arr2
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
| exprs.kt:278:52:278:66 | <error expr> | ErrorExpr | unexpected dead end |
21
| exprs.kt:278:52:278:66 | { ... } | BlockStmt | unexpected dead end |

java/ql/test/kotlin/library-tests/jvmoverloads-annotation/PrintAst.expected

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ test.kt:
5555
# 1| 6: [IntegerLiteral] 23
5656
# 1| 7: [NullLiteral] null
5757
# 45| 4: [ExtensionMethod] testExtensionFunction
58+
#-----| 1: (Annotations)
59+
# 44| 1: [Annotation] JvmOverloads
5860
# 45| 3: [TypeAccess] int
5961
#-----| 4: (Parameters)
6062
# 45| 0: [Parameter] <this>
@@ -170,6 +172,9 @@ test.kt:
170172
# 1| 5: [IntegerLiteral] 23
171173
# 1| 6: [NullLiteral] null
172174
# 6| 4: [Method] testStaticFunction
175+
#-----| 1: (Annotations)
176+
# 5| 1: [Annotation] JvmOverloads
177+
# 5| 2: [Annotation] JvmStatic
173178
# 6| 3: [TypeAccess] int
174179
#-----| 4: (Parameters)
175180
# 6| 0: [Parameter] a
@@ -277,6 +282,8 @@ test.kt:
277282
# 1| 6: [IntegerLiteral] 23
278283
# 1| 7: [NullLiteral] null
279284
# 9| 8: [Method] testMemberFunction
285+
#-----| 1: (Annotations)
286+
# 8| 1: [Annotation] JvmOverloads
280287
# 9| 3: [TypeAccess] int
281288
#-----| 4: (Parameters)
282289
# 9| 0: [Parameter] a
@@ -394,6 +401,8 @@ test.kt:
394401
# 1| 7: [IntegerLiteral] 23
395402
# 1| 8: [NullLiteral] null
396403
# 12| 12: [ExtensionMethod] testMemberExtensionFunction
404+
#-----| 1: (Annotations)
405+
# 11| 1: [Annotation] JvmOverloads
397406
# 12| 3: [TypeAccess] int
398407
#-----| 4: (Parameters)
399408
# 12| 0: [Parameter] <this>
@@ -501,6 +510,8 @@ test.kt:
501510
# 1| 5: [IntegerLiteral] 23
502511
# 1| 6: [NullLiteral] null
503512
# 16| 3: [Constructor] Test2
513+
#-----| 1: (Annotations)
514+
# 16| 1: [Annotation] JvmOverloads
504515
#-----| 4: (Parameters)
505516
# 16| 0: [Parameter] a
506517
# 16| 0: [TypeAccess] int
@@ -609,6 +620,8 @@ test.kt:
609620
# 1| 6: [IntegerLiteral] 23
610621
# 1| 7: [NullLiteral] null
611622
# 21| 4: [Method] testCompanionFunction
623+
#-----| 1: (Annotations)
624+
# 20| 1: [Annotation] JvmOverloads
612625
# 21| 3: [TypeAccess] int
613626
#-----| 4: (Parameters)
614627
# 21| 0: [Parameter] a
@@ -718,6 +731,9 @@ test.kt:
718731
# 1| 6: [IntegerLiteral] 23
719732
# 1| 7: [NullLiteral] null
720733
# 24| 8: [Method] testStaticCompanionFunction
734+
#-----| 1: (Annotations)
735+
# 23| 1: [Annotation] JvmOverloads
736+
# 23| 2: [Annotation] JvmStatic
721737
# 24| 3: [TypeAccess] int
722738
#-----| 4: (Parameters)
723739
# 24| 0: [Parameter] a
@@ -883,6 +899,8 @@ test.kt:
883899
# 1| 4: [IntegerLiteral] 11
884900
# 1| 5: [NullLiteral] null
885901
# 30| 3: [Constructor] GenericTest
902+
#-----| 1: (Annotations)
903+
# 30| 1: [Annotation] JvmOverloads
886904
#-----| 4: (Parameters)
887905
# 30| 0: [Parameter] a
888906
# 30| 0: [TypeAccess] int
@@ -974,6 +992,8 @@ test.kt:
974992
# 1| 5: [IntegerLiteral] 11
975993
# 1| 6: [NullLiteral] null
976994
# 33| 7: [Method] testMemberFunction
995+
#-----| 1: (Annotations)
996+
# 32| 1: [Annotation] JvmOverloads
977997
# 33| 3: [TypeAccess] int
978998
#-----| 4: (Parameters)
979999
# 33| 0: [Parameter] a

java/ql/test/kotlin/library-tests/jvmstatic-annotation/PrintAst.expected

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ test.kt:
157157
# 17| 0: [KtInitializerAssignExpr] ...=...
158158
# 17| 0: [VarAccess] nonStaticProp
159159
# 13| 2: [Method] staticMethod
160+
#-----| 1: (Annotations)
161+
# 13| 1: [Annotation] JvmStatic
160162
# 13| 3: [TypeAccess] String
161163
#-----| 4: (Parameters)
162164
# 13| 0: [Parameter] s
@@ -217,6 +219,8 @@ test.kt:
217219
# 17| -1: [ThisAccess] this
218220
# 17| 1: [VarAccess] <set-?>
219221
# 20| 10: [Method] getPropWithStaticGetter
222+
#-----| 1: (Annotations)
223+
# 20| 1: [Annotation] JvmStatic
220224
# 20| 3: [TypeAccess] String
221225
# 20| 5: [BlockStmt] { ... }
222226
# 20| 0: [ReturnStmt] return ...
@@ -239,6 +243,8 @@ test.kt:
239243
# 24| 0: [MethodAccess] getPropWithStaticGetter(...)
240244
# 24| -1: [ThisAccess] this
241245
# 25| 13: [Method] setPropWithStaticSetter
246+
#-----| 1: (Annotations)
247+
# 25| 1: [Annotation] JvmStatic
242248
# 25| 3: [TypeAccess] Unit
243249
#-----| 4: (Parameters)
244250
# 25| 0: [Parameter] s
@@ -307,6 +313,8 @@ test.kt:
307313
# 37| 0: [KtInitializerAssignExpr] ...=...
308314
# 37| 0: [VarAccess] nonStaticProp
309315
# 33| 2: [Method] staticMethod
316+
#-----| 1: (Annotations)
317+
# 33| 1: [Annotation] JvmStatic
310318
# 33| 3: [TypeAccess] String
311319
#-----| 4: (Parameters)
312320
# 33| 0: [Parameter] s
@@ -370,6 +378,8 @@ test.kt:
370378
# 37| -1: [ThisAccess] this
371379
# 37| 1: [VarAccess] <set-?>
372380
# 40| 10: [Method] getPropWithStaticGetter
381+
#-----| 1: (Annotations)
382+
# 40| 1: [Annotation] JvmStatic
373383
# 40| 3: [TypeAccess] String
374384
# 40| 5: [BlockStmt] { ... }
375385
# 40| 0: [ReturnStmt] return ...
@@ -393,6 +403,8 @@ test.kt:
393403
# 44| 0: [MethodAccess] getPropWithStaticGetter(...)
394404
# 44| -1: [TypeAccess] NonCompanion
395405
# 45| 13: [Method] setPropWithStaticSetter
406+
#-----| 1: (Annotations)
407+
# 45| 1: [Annotation] JvmStatic
396408
# 45| 3: [TypeAccess] Unit
397409
#-----| 4: (Parameters)
398410
# 45| 0: [Parameter] s

java/ql/test/kotlin/library-tests/parameter-defaults/PrintAst.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,8 @@ test.kt:
609609
# 32| 0: [SuperConstructorInvocationStmt] super(...)
610610
# 32| 1: [BlockStmt] { ... }
611611
# 34| 2: [Method] f
612+
#-----| 1: (Annotations)
613+
# 34| 1: [Annotation] JvmStatic
612614
# 34| 3: [TypeAccess] Unit
613615
#-----| 4: (Parameters)
614616
# 34| 0: [Parameter] x

0 commit comments

Comments
 (0)