Skip to content

Commit c8e2ae8

Browse files
committed
Accept integration test changes
These introduce newly-extracted annotations, and note that enum constants no longer get type-access expressions in some circumstances
1 parent 7a7c08b commit c8e2ae8

File tree

2 files changed

+113
-3
lines changed

2 files changed

+113
-3
lines changed

java/ql/integration-tests/all-platforms/kotlin/gradle_kotlinx_serialization/PrintAst.expected

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
app/src/main/kotlin/testProject/App.kt:
22
# 0| [CompilationUnit] App
33
# 7| 1: [Class] Project
4+
#-----| -3: (Annotations)
5+
# 7| 1: [Annotation] Serializable
46
# 0| 1: [Constructor] Project
7+
#-----| 1: (Annotations)
8+
# 0| 1: [Annotation] Deprecated
9+
# 0| 1: [StringLiteral] "This synthesized declaration should not be used directly"
10+
# 0| 2: [Annotation] ReplaceWith
11+
# 0| 1: [StringLiteral] ""
12+
# 0| 2: [ArrayInit] {...}
13+
# 0| 3: [VarAccess] DeprecationLevel.HIDDEN
14+
# 0| -1: [TypeAccess] DeprecationLevel
15+
# 0| 2: [Annotation] NotNull
516
#-----| 4: (Parameters)
617
# 0| 0: [Parameter] seen1
718
# 0| 0: [TypeAccess] int
@@ -41,6 +52,8 @@ app/src/main/kotlin/testProject/App.kt:
4152
# 7| 0: [TypeAccess] Project
4253
# 7| 1: [VarAccess] language
4354
# 0| 2: [Method] component1
55+
#-----| 1: (Annotations)
56+
# 0| 1: [Annotation] NotNull
4457
# 0| 3: [TypeAccess] String
4558
# 0| 5: [BlockStmt] { ... }
4659
# 0| 0: [ReturnStmt] return ...
@@ -53,9 +66,13 @@ app/src/main/kotlin/testProject/App.kt:
5366
# 0| 0: [VarAccess] this.language
5467
# 0| -1: [ThisAccess] this
5568
# 0| 4: [Method] copy
69+
#-----| 1: (Annotations)
70+
# 0| 1: [Annotation] NotNull
5671
# 0| 3: [TypeAccess] Project
5772
#-----| 4: (Parameters)
5873
# 8| 0: [Parameter] name
74+
#-----| -1: (Annotations)
75+
# 0| 1: [Annotation] NotNull
5976
# 8| 0: [TypeAccess] String
6077
# 8| 1: [Parameter] language
6178
# 8| 0: [TypeAccess] int
@@ -176,6 +193,8 @@ app/src/main/kotlin/testProject/App.kt:
176193
# 0| 2: [ReturnStmt] return ...
177194
# 0| 0: [VarAccess] result
178195
# 0| 8: [Method] toString
196+
#-----| 1: (Annotations)
197+
# 0| 1: [Annotation] NotNull
179198
# 0| 3: [TypeAccess] String
180199
# 0| 5: [BlockStmt] { ... }
181200
# 0| 0: [ReturnStmt] return ...
@@ -190,13 +209,21 @@ app/src/main/kotlin/testProject/App.kt:
190209
# 0| -1: [ThisAccess] this
191210
# 0| 6: [StringLiteral] ")"
192211
# 0| 9: [Method] write$Self
212+
#-----| 1: (Annotations)
213+
# 0| 1: [Annotation] JvmStatic
193214
# 0| 3: [TypeAccess] Unit
194215
#-----| 4: (Parameters)
195216
# 0| 0: [Parameter] self
217+
#-----| -1: (Annotations)
218+
# 0| 1: [Annotation] NotNull
196219
# 0| 0: [TypeAccess] Project
197220
# 0| 1: [Parameter] output
221+
#-----| -1: (Annotations)
222+
# 0| 1: [Annotation] NotNull
198223
# 0| 0: [TypeAccess] CompositeEncoder
199224
# 0| 2: [Parameter] serialDesc
225+
#-----| -1: (Annotations)
226+
# 0| 1: [Annotation] NotNull
200227
# 0| 0: [TypeAccess] SerialDescriptor
201228
# 7| 5: [BlockStmt] { ... }
202229
# 7| 0: [ExprStmt] <Expr>;
@@ -214,9 +241,19 @@ app/src/main/kotlin/testProject/App.kt:
214241
# 7| 2: [MethodAccess] getLanguage(...)
215242
# 7| -1: [VarAccess] self
216243
# 7| 10: [Class] $serializer
244+
#-----| -3: (Annotations)
245+
# 0| 1: [Annotation] Deprecated
246+
# 0| 1: [StringLiteral] "This synthesized declaration should not be used directly"
247+
# 0| 2: [Annotation] ReplaceWith
248+
# 0| 1: [StringLiteral] ""
249+
# 0| 2: [ArrayInit] {...}
250+
# 0| 3: [VarAccess] DeprecationLevel.HIDDEN
251+
# 0| -1: [TypeAccess] DeprecationLevel
217252
# 0| 1: [FieldDeclaration] SerialDescriptor descriptor;
218253
# 0| -1: [TypeAccess] SerialDescriptor
219254
# 0| 2: [Method] childSerializers
255+
#-----| 1: (Annotations)
256+
# 0| 1: [Annotation] NotNull
220257
# 0| 3: [TypeAccess] KSerializer<?>[]
221258
# 0| 0: [TypeAccess] KSerializer<?>
222259
# 0| 0: [WildcardTypeAccess] ? ...
@@ -227,9 +264,13 @@ app/src/main/kotlin/testProject/App.kt:
227264
# 7| -1: [TypeAccess] KSerializer<?>
228265
# 7| 0: [IntegerLiteral] 2
229266
# 0| 3: [Method] deserialize
267+
#-----| 1: (Annotations)
268+
# 0| 1: [Annotation] NotNull
230269
# 0| 3: [TypeAccess] Project
231270
#-----| 4: (Parameters)
232271
# 0| 0: [Parameter] decoder
272+
#-----| -1: (Annotations)
273+
# 0| 1: [Annotation] NotNull
233274
# 0| 0: [TypeAccess] Decoder
234275
# 7| 5: [BlockStmt] { ... }
235276
# 7| 0: [LocalVariableDeclStmt] var ...;
@@ -365,6 +406,8 @@ app/src/main/kotlin/testProject/App.kt:
365406
# 7| 2: [VarAccess] tmp5_local1
366407
# 7| 3: [NullLiteral] null
367408
# 0| 4: [Method] getDescriptor
409+
#-----| 1: (Annotations)
410+
# 0| 1: [Annotation] NotNull
368411
# 0| 3: [TypeAccess] SerialDescriptor
369412
# 0| 5: [BlockStmt] { ... }
370413
# 0| 0: [ReturnStmt] return ...
@@ -374,8 +417,12 @@ app/src/main/kotlin/testProject/App.kt:
374417
# 0| 3: [TypeAccess] Unit
375418
#-----| 4: (Parameters)
376419
# 0| 0: [Parameter] encoder
420+
#-----| -1: (Annotations)
421+
# 0| 1: [Annotation] NotNull
377422
# 0| 0: [TypeAccess] Encoder
378423
# 0| 1: [Parameter] value
424+
#-----| -1: (Annotations)
425+
# 0| 1: [Annotation] NotNull
379426
# 0| 0: [TypeAccess] Project
380427
# 7| 5: [BlockStmt] { ... }
381428
# 7| 0: [LocalVariableDeclStmt] var ...;
@@ -398,6 +445,8 @@ app/src/main/kotlin/testProject/App.kt:
398445
# 7| -1: [VarAccess] tmp1_output
399446
# 7| 0: [VarAccess] tmp0_desc
400447
# 7| 6: [Constructor] $serializer
448+
#-----| 1: (Annotations)
449+
# 0| 1: [Annotation] NotNull
401450
# 7| 5: [BlockStmt] { ... }
402451
# 7| 0: [SuperConstructorInvocationStmt] super(...)
403452
# 7| 1: [BlockStmt] { ... }
@@ -436,18 +485,26 @@ app/src/main/kotlin/testProject/App.kt:
436485
# 7| 0: [TypeAccess] GeneratedSerializer
437486
# 7| 11: [Class] Companion
438487
# 0| 1: [Method] serializer
488+
#-----| 1: (Annotations)
489+
# 0| 1: [Annotation] NotNull
439490
# 0| 3: [TypeAccess] KSerializer<Project>
440491
# 0| 0: [TypeAccess] Project
441492
# 7| 5: [BlockStmt] { ... }
442493
# 7| 0: [ReturnStmt] return ...
443494
# 7| 0: [VarAccess] INSTANCE
444495
# 7| 2: [Constructor] Companion
496+
#-----| 1: (Annotations)
497+
# 0| 1: [Annotation] NotNull
445498
# 7| 5: [BlockStmt] { ... }
446499
# 7| 0: [SuperConstructorInvocationStmt] super(...)
447500
# 7| 1: [BlockStmt] { ... }
448501
# 8| 12: [Constructor] Project
502+
#-----| 1: (Annotations)
503+
# 0| 1: [Annotation] NotNull
449504
#-----| 4: (Parameters)
450505
# 8| 0: [Parameter] name
506+
#-----| -1: (Annotations)
507+
# 0| 1: [Annotation] NotNull
451508
# 8| 0: [TypeAccess] String
452509
# 8| 1: [Parameter] language
453510
# 8| 0: [TypeAccess] int
@@ -464,6 +521,8 @@ app/src/main/kotlin/testProject/App.kt:
464521
# 8| -1: [TypeAccess] String
465522
# 8| 0: [VarAccess] name
466523
# 8| 14: [Method] getName
524+
#-----| 1: (Annotations)
525+
# 0| 1: [Annotation] NotNull
467526
# 8| 3: [TypeAccess] String
468527
# 8| 5: [BlockStmt] { ... }
469528
# 8| 0: [ReturnStmt] return ...
@@ -480,9 +539,22 @@ app/src/main/kotlin/testProject/App.kt:
480539
# 8| 0: [VarAccess] language
481540
# 10| 2: [Interface] Base
482541
# 11| 1: [Method] getId
542+
#-----| 1: (Annotations)
543+
# 0| 1: [Annotation] NotNull
483544
# 11| 3: [TypeAccess] String
484545
# 14| 3: [Class] X
546+
#-----| -3: (Annotations)
547+
# 14| 1: [Annotation] Serializable
485548
# 0| 1: [Constructor] X
549+
#-----| 1: (Annotations)
550+
# 0| 1: [Annotation] Deprecated
551+
# 0| 1: [StringLiteral] "This synthesized declaration should not be used directly"
552+
# 0| 2: [Annotation] ReplaceWith
553+
# 0| 1: [StringLiteral] ""
554+
# 0| 2: [ArrayInit] {...}
555+
# 0| 3: [VarAccess] DeprecationLevel.HIDDEN
556+
# 0| -1: [TypeAccess] DeprecationLevel
557+
# 0| 2: [Annotation] NotNull
486558
#-----| 4: (Parameters)
487559
# 0| 0: [Parameter] seen1
488560
# 0| 0: [TypeAccess] int
@@ -530,13 +602,21 @@ app/src/main/kotlin/testProject/App.kt:
530602
# 14| 0: [TypeAccess] X
531603
# 14| 1: [VarAccess] id
532604
# 0| 2: [Method] write$Self
605+
#-----| 1: (Annotations)
606+
# 0| 1: [Annotation] JvmStatic
533607
# 0| 3: [TypeAccess] Unit
534608
#-----| 4: (Parameters)
535609
# 0| 0: [Parameter] self
610+
#-----| -1: (Annotations)
611+
# 0| 1: [Annotation] NotNull
536612
# 0| 0: [TypeAccess] X
537613
# 0| 1: [Parameter] output
614+
#-----| -1: (Annotations)
615+
# 0| 1: [Annotation] NotNull
538616
# 0| 0: [TypeAccess] CompositeEncoder
539617
# 0| 2: [Parameter] serialDesc
618+
#-----| -1: (Annotations)
619+
# 0| 1: [Annotation] NotNull
540620
# 0| 0: [TypeAccess] SerialDescriptor
541621
# 14| 5: [BlockStmt] { ... }
542622
# 14| 0: [ExprStmt] <Expr>;
@@ -565,9 +645,19 @@ app/src/main/kotlin/testProject/App.kt:
565645
# 14| 2: [MethodAccess] getId(...)
566646
# 14| -1: [VarAccess] self
567647
# 14| 3: [Class] $serializer
648+
#-----| -3: (Annotations)
649+
# 0| 1: [Annotation] Deprecated
650+
# 0| 1: [StringLiteral] "This synthesized declaration should not be used directly"
651+
# 0| 2: [Annotation] ReplaceWith
652+
# 0| 1: [StringLiteral] ""
653+
# 0| 2: [ArrayInit] {...}
654+
# 0| 3: [VarAccess] DeprecationLevel.HIDDEN
655+
# 0| -1: [TypeAccess] DeprecationLevel
568656
# 0| 1: [FieldDeclaration] SerialDescriptor descriptor;
569657
# 0| -1: [TypeAccess] SerialDescriptor
570658
# 0| 2: [Method] childSerializers
659+
#-----| 1: (Annotations)
660+
# 0| 1: [Annotation] NotNull
571661
# 0| 3: [TypeAccess] KSerializer<?>[]
572662
# 0| 0: [TypeAccess] KSerializer<?>
573663
# 0| 0: [WildcardTypeAccess] ? ...
@@ -578,9 +668,13 @@ app/src/main/kotlin/testProject/App.kt:
578668
# 14| -1: [TypeAccess] KSerializer<?>
579669
# 14| 0: [IntegerLiteral] 1
580670
# 0| 3: [Method] deserialize
671+
#-----| 1: (Annotations)
672+
# 0| 1: [Annotation] NotNull
581673
# 0| 3: [TypeAccess] X
582674
#-----| 4: (Parameters)
583675
# 0| 0: [Parameter] decoder
676+
#-----| -1: (Annotations)
677+
# 0| 1: [Annotation] NotNull
584678
# 0| 0: [TypeAccess] Decoder
585679
# 14| 5: [BlockStmt] { ... }
586680
# 14| 0: [LocalVariableDeclStmt] var ...;
@@ -680,6 +774,8 @@ app/src/main/kotlin/testProject/App.kt:
680774
# 14| 1: [VarAccess] tmp4_local0
681775
# 14| 2: [NullLiteral] null
682776
# 0| 4: [Method] getDescriptor
777+
#-----| 1: (Annotations)
778+
# 0| 1: [Annotation] NotNull
683779
# 0| 3: [TypeAccess] SerialDescriptor
684780
# 0| 5: [BlockStmt] { ... }
685781
# 0| 0: [ReturnStmt] return ...
@@ -689,8 +785,12 @@ app/src/main/kotlin/testProject/App.kt:
689785
# 0| 3: [TypeAccess] Unit
690786
#-----| 4: (Parameters)
691787
# 0| 0: [Parameter] encoder
788+
#-----| -1: (Annotations)
789+
# 0| 1: [Annotation] NotNull
692790
# 0| 0: [TypeAccess] Encoder
693791
# 0| 1: [Parameter] value
792+
#-----| -1: (Annotations)
793+
# 0| 1: [Annotation] NotNull
694794
# 0| 0: [TypeAccess] X
695795
# 14| 5: [BlockStmt] { ... }
696796
# 14| 0: [LocalVariableDeclStmt] var ...;
@@ -713,6 +813,8 @@ app/src/main/kotlin/testProject/App.kt:
713813
# 14| -1: [VarAccess] tmp1_output
714814
# 14| 0: [VarAccess] tmp0_desc
715815
# 14| 6: [Constructor] $serializer
816+
#-----| 1: (Annotations)
817+
# 0| 1: [Annotation] NotNull
716818
# 14| 5: [BlockStmt] { ... }
717819
# 14| 0: [SuperConstructorInvocationStmt] super(...)
718820
# 14| 1: [BlockStmt] { ... }
@@ -746,16 +848,22 @@ app/src/main/kotlin/testProject/App.kt:
746848
# 14| 0: [TypeAccess] GeneratedSerializer
747849
# 14| 4: [Class] Companion
748850
# 0| 1: [Method] serializer
851+
#-----| 1: (Annotations)
852+
# 0| 1: [Annotation] NotNull
749853
# 0| 3: [TypeAccess] KSerializer<X>
750854
# 0| 0: [TypeAccess] X
751855
# 14| 5: [BlockStmt] { ... }
752856
# 14| 0: [ReturnStmt] return ...
753857
# 14| 0: [VarAccess] INSTANCE
754858
# 14| 2: [Constructor] Companion
859+
#-----| 1: (Annotations)
860+
# 0| 1: [Annotation] NotNull
755861
# 14| 5: [BlockStmt] { ... }
756862
# 14| 0: [SuperConstructorInvocationStmt] super(...)
757863
# 14| 1: [BlockStmt] { ... }
758864
# 15| 5: [Constructor] X
865+
#-----| 1: (Annotations)
866+
# 0| 1: [Annotation] NotNull
759867
# 14| 5: [BlockStmt] { ... }
760868
# 14| 0: [SuperConstructorInvocationStmt] super(...)
761869
# 15| 1: [BlockStmt] { ... }
@@ -766,6 +874,8 @@ app/src/main/kotlin/testProject/App.kt:
766874
# 16| -1: [TypeAccess] String
767875
# 16| 0: [StringLiteral] "X"
768876
# 16| 7: [Method] getId
877+
#-----| 1: (Annotations)
878+
# 0| 1: [Annotation] NotNull
769879
# 16| 3: [TypeAccess] String
770880
# 16| 5: [BlockStmt] { ... }
771881
# 16| 0: [ReturnStmt] return ...

java/ql/integration-tests/all-platforms/kotlin/repeatable-annotations/test.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
| JavaUser.java:9:14:9:21 | JavaUser | out2/JavaUser.class:0:0:0:0 | JavaDefinedContainer | value | out2/JavaUser.class:0:0:0:0 | {...} |
44
| JavaUser.java:9:14:9:21 | JavaUser | out2/JavaUser.class:0:0:0:0 | KtDefinedContainer | value | out2/JavaUser.class:0:0:0:0 | {...} |
55
| out/ExplicitContainerRepeatable.class:0:0:0:0 | ExplicitContainerRepeatable | out/ExplicitContainerRepeatable.class:0:0:0:0 | Repeatable | value | out/ExplicitContainerRepeatable.class:0:0:0:0 | KtDefinedContainer.class |
6-
| out/ExplicitContainerRepeatable.class:0:0:0:0 | ExplicitContainerRepeatable | out/ExplicitContainerRepeatable.class:0:0:0:0 | Retention | value | out/ExplicitContainerRepeatable.class:0:0:0:0 | RetentionPolicy.RUNTIME |
6+
| out/ExplicitContainerRepeatable.class:0:0:0:0 | ExplicitContainerRepeatable | out/ExplicitContainerRepeatable.class:0:0:0:0 | Retention | value | out/ExplicitContainerRepeatable.class:0:0:0:0 | RUNTIME |
77
| out/JavaDefinedRepeatable.class:0:0:0:0 | JavaDefinedRepeatable | out/JavaDefinedRepeatable.class:0:0:0:0 | Repeatable | value | out/JavaDefinedRepeatable.class:0:0:0:0 | JavaDefinedContainer.class |
8-
| out/KtDefinedContainer.class:0:0:0:0 | KtDefinedContainer | out/KtDefinedContainer.class:0:0:0:0 | Retention | value | out/KtDefinedContainer.class:0:0:0:0 | RetentionPolicy.RUNTIME |
8+
| out/KtDefinedContainer.class:0:0:0:0 | KtDefinedContainer | out/KtDefinedContainer.class:0:0:0:0 | Retention | value | out/KtDefinedContainer.class:0:0:0:0 | RUNTIME |
99
| out/LibRepeatable.class:0:0:0:0 | LibRepeatable | out/LibRepeatable.class:0:0:0:0 | Repeatable | value | out/LibRepeatable.class:0:0:0:0 | Container.class |
10-
| out/LibRepeatable.class:0:0:0:0 | LibRepeatable | out/LibRepeatable.class:0:0:0:0 | Retention | value | out/LibRepeatable.class:0:0:0:0 | RetentionPolicy.RUNTIME |
10+
| out/LibRepeatable.class:0:0:0:0 | LibRepeatable | out/LibRepeatable.class:0:0:0:0 | Retention | value | out/LibRepeatable.class:0:0:0:0 | RUNTIME |
1111
| test.kt:1:1:2:43 | LocalRepeatable | test.kt:0:0:0:0 | Repeatable | value | test.kt:0:0:0:0 | Container.class |
1212
| test.kt:1:1:2:43 | LocalRepeatable | test.kt:0:0:0:0 | Retention | value | test.kt:0:0:0:0 | RetentionPolicy.RUNTIME |
1313
| test.kt:4:1:12:21 | User | test.kt:0:0:0:0 | Container | value | test.kt:0:0:0:0 | {...} |

0 commit comments

Comments
 (0)