Skip to content

Commit d3e64f5

Browse files
committed
Kotlin: extract non-private members of class supertypes
1 parent b0c6db4 commit d3e64f5

File tree

4 files changed

+64
-2
lines changed

4 files changed

+64
-2
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,7 @@ open class KotlinFileExtractor(
404404
}
405405

406406
extractClassModifiers(c, id)
407-
val forceExtractSupertypeMembers = !isExternalDeclaration(c)
408-
extractClassSupertypes(c, id, inReceiverContext = forceExtractSupertypeMembers)
407+
extractClassSupertypes(c, id, inReceiverContext = true) // inReceiverContext = true is specified to force extraction of member prototypes of base types
409408

410409
return id
411410
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| list.kt:6:23:6:23 | a | list.kt:7:14:7:14 | l |
22
| list.kt:6:23:6:23 | a | list.kt:8:14:8:17 | get(...) |
3+
| list.kt:6:23:6:23 | a | list.kt:10:18:10:18 | s |
34
| list.kt:13:32:13:32 | a | list.kt:14:14:14:14 | a |
45
| list.kt:13:32:13:32 | a | list.kt:15:14:15:17 | ...[...] |
56
| list.kt:13:32:13:32 | a | list.kt:17:18:17:18 | s |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
test
2+
| file:///modules/java.base/java/util/List.class:0:0:0:0 | iterator | file:///modules/java.base/java/util/Collection.class:0:0:0:0 | iterator |
23
test1
34
| file:///modules/java.base/java/util/List.class:0:0:0:0 | iterator |

java/ql/test/kotlin/library-tests/types/types.expected

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
| ? extends BaseLocale | Wildcard |
1111
| ? extends BasicType | Wildcard |
1212
| ? extends BigInteger | Wildcard |
13+
| ? extends BoundMethodHandle | Wildcard |
1314
| ? extends ByteBuffer | Wildcard |
1415
| ? extends Callable<T> | Wildcard |
1516
| ? extends Certificate | Wildcard |
@@ -41,6 +42,7 @@
4142
| ? extends FileAttributeView | Wildcard |
4243
| ? extends ForkJoinTask<?> | Wildcard |
4344
| ? extends FormalTypeParameter | Wildcard |
45+
| ? extends Identity | Wildcard |
4446
| ? extends InetAddress | Wildcard |
4547
| ? extends IntStream | Wildcard |
4648
| ? extends K | Wildcard |
@@ -97,13 +99,18 @@
9799
| ? extends WorkQueue | Wildcard |
98100
| ? extends X | Wildcard |
99101
| ? super A | Wildcard |
102+
| ? super Byte | Wildcard |
103+
| ? super Class<?> | Wildcard |
104+
| ? super Cleaner | Wildcard |
100105
| ? super Consumer<R> | Wildcard |
101106
| ? super Double | Wildcard |
102107
| ? super DoubleConsumer | Wildcard |
103108
| ? super E | Wildcard |
109+
| ? super Entry<?> | Wildcard |
104110
| ? super Entry<K,V> | Wildcard |
105111
| ? super ForkJoinPool | Wildcard |
106112
| ? super ForkJoinTask<?> | Wildcard |
113+
| ? super Identity | Wildcard |
107114
| ? super IntConsumer | Wildcard |
108115
| ? super Integer | Wildcard |
109116
| ? super K | Wildcard |
@@ -119,6 +126,7 @@
119126
| ? super T | Wildcard |
120127
| ? super U | Wildcard |
121128
| ? super V | Wildcard |
129+
| ? super Version<T> | Wildcard |
122130
| A | TypeVariable |
123131
| A[] | Array |
124132
| AbstractChronology | Class |
@@ -388,10 +396,12 @@
388396
| BaseStream<Double,DoubleStream> | Interface, ParameterizedType |
389397
| BaseStream<Double,Stream<Double>> | Interface, ParameterizedType |
390398
| BaseStream<E,Stream<E>> | Interface, ParameterizedType |
399+
| BaseStream<Entry<K,V>,Stream<Entry<K,V>>> | Interface, ParameterizedType |
391400
| BaseStream<InetAddress,Stream<InetAddress>> | Interface, ParameterizedType |
392401
| BaseStream<Integer,IntStream> | Interface, ParameterizedType |
393402
| BaseStream<Integer,Stream<Integer>> | Interface, ParameterizedType |
394403
| BaseStream<JumpableGenerator,Stream<JumpableGenerator>> | Interface, ParameterizedType |
404+
| BaseStream<K,Stream<K>> | Interface, ParameterizedType |
395405
| BaseStream<LocalDate,Stream<LocalDate>> | Interface, ParameterizedType |
396406
| BaseStream<Long,LongStream> | Interface, ParameterizedType |
397407
| BaseStream<Long,Stream<Long>> | Interface, ParameterizedType |
@@ -408,13 +418,15 @@
408418
| BaseStream<T,Stream> | Interface, ParameterizedType |
409419
| BaseStream<U,Stream<U>> | Interface, ParameterizedType |
410420
| BaseStream<URL,Stream<URL>> | Interface, ParameterizedType |
421+
| BaseStream<V,Stream<V>> | Interface, ParameterizedType |
411422
| BaseType | Interface |
412423
| BasicFileAttributes | Interface |
413424
| BasicPermission | Class |
414425
| BasicType | Class |
415426
| BasicType[] | Array |
416427
| BiConsumer | GenericType, Interface, ParameterizedType |
417428
| BiConsumer<> | Interface, RawType |
429+
| BiConsumer<? super Identity,? super Entry<?>> | Interface, ParameterizedType |
418430
| BiConsumer<? super K,? super V> | Interface, ParameterizedType |
419431
| BiConsumer<? super Object,? super Object> | Interface, ParameterizedType |
420432
| BiConsumer<? super T,? super Consumer<R>> | Interface, ParameterizedType |
@@ -428,6 +440,8 @@
428440
| BiConsumer<R,T> | Interface, ParameterizedType |
429441
| BiFunction | GenericType, Interface, ParameterizedType |
430442
| BiFunction<> | Interface, RawType |
443+
| BiFunction<? super Entry<?>,? super Entry<?>,? extends Entry<?>> | Interface, ParameterizedType |
444+
| BiFunction<? super Identity,? super Entry<?>,? extends Entry<?>> | Interface, ParameterizedType |
431445
| BiFunction<? super K,? super K,? extends K> | Interface, ParameterizedType |
432446
| BiFunction<? super K,? super V,? extends U> | Interface, ParameterizedType |
433447
| BiFunction<? super K,? super V,? extends V> | Interface, ParameterizedType |
@@ -441,6 +455,7 @@
441455
| BiFunction<R,R,R> | Interface, ParameterizedType |
442456
| BiFunction<String,List<Number>,ArrayIndexOutOfBoundsException> | Interface, ParameterizedType |
443457
| BiFunction<T,T,T> | Interface, ParameterizedType |
458+
| BiFunction<T,T,V> | Interface, ParameterizedType |
444459
| BiFunction<T,U,V> | Interface, ParameterizedType |
445460
| BiFunction<U,? super T,U> | Interface, ParameterizedType |
446461
| BiFunction<U,U,U> | Interface, ParameterizedType |
@@ -554,6 +569,7 @@
554569
| Class<> | Class, RawType |
555570
| Class<>[] | Array |
556571
| Class<? extends Annotation> | Class, ParameterizedType |
572+
| Class<? extends BoundMethodHandle> | Class, ParameterizedType |
557573
| Class<? extends FileAttributeView> | Class, ParameterizedType |
558574
| Class<? extends M> | Class, ParameterizedType |
559575
| Class<? extends T> | Class, ParameterizedType |
@@ -566,8 +582,10 @@
566582
| Class<?>[] | Array |
567583
| Class<A> | Class, ParameterizedType |
568584
| Class<Boolean> | Class, ParameterizedType |
585+
| Class<BoundMethodHandle> | Class, ParameterizedType |
569586
| Class<Byte> | Class, ParameterizedType |
570587
| Class<Character> | Class, ParameterizedType |
588+
| Class<ClassOption> | Class, ParameterizedType |
571589
| Class<Double> | Class, ParameterizedType |
572590
| Class<E> | Class, ParameterizedType |
573591
| Class<Float> | Class, ParameterizedType |
@@ -579,8 +597,11 @@
579597
| Class<S> | Class, ParameterizedType |
580598
| Class<Sh> | Class, ParameterizedType |
581599
| Class<Short> | Class, ParameterizedType |
600+
| Class<SpeciesData> | Class, ParameterizedType |
601+
| Class<String> | Class, ParameterizedType |
582602
| Class<T> | Class, ParameterizedType |
583603
| Class<U> | Class, ParameterizedType |
604+
| Class<UnicodeScript> | Class, ParameterizedType |
584605
| Class<V> | Class, ParameterizedType |
585606
| Class<Void> | Class, ParameterizedType |
586607
| ClassDataSlot | Class |
@@ -628,8 +649,11 @@
628649
| Collection<? extends Callable<T>> | Interface, ParameterizedType |
629650
| Collection<? extends Certificate> | Interface, ParameterizedType |
630651
| Collection<? extends E> | Interface, ParameterizedType |
652+
| Collection<? extends Entry<K,V>> | Interface, ParameterizedType |
653+
| Collection<? extends K> | Interface, ParameterizedType |
631654
| Collection<? extends OpenOption> | Interface, ParameterizedType |
632655
| Collection<? extends Principal> | Interface, ParameterizedType |
656+
| Collection<? extends V> | Interface, ParameterizedType |
633657
| Collection<? super ForkJoinTask<?>> | Interface, ParameterizedType |
634658
| Collection<?> | Interface, ParameterizedType |
635659
| Collection<Attribute> | Interface, ParameterizedType |
@@ -645,13 +669,16 @@
645669
| Collection<ConstantDesc> | Interface, ParameterizedType |
646670
| Collection<DateTimePrinterParser> | Interface, ParameterizedType |
647671
| Collection<E> | Interface, ParameterizedType |
672+
| Collection<Entry<?>> | Interface, ParameterizedType |
673+
| Collection<Entry<Identity,Entry<?>>> | Interface, ParameterizedType |
648674
| Collection<Entry<K,V>> | Interface, ParameterizedType |
649675
| Collection<Entry<Object,Object>> | Interface, ParameterizedType |
650676
| Collection<Era> | Interface, ParameterizedType |
651677
| Collection<Exports> | Interface, ParameterizedType |
652678
| Collection<F> | Interface, ParameterizedType |
653679
| Collection<FileSystemProvider> | Interface, ParameterizedType |
654680
| Collection<Future<T>> | Interface, ParameterizedType |
681+
| Collection<Identity> | Interface, ParameterizedType |
655682
| Collection<InterfaceAddress> | Interface, ParameterizedType |
656683
| Collection<K> | Interface, ParameterizedType |
657684
| Collection<LanguageRange> | Interface, ParameterizedType |
@@ -789,6 +816,8 @@
789816
| Comparator | GenericType, Interface, ParameterizedType |
790817
| Comparator<> | Interface, RawType |
791818
| Comparator<? super E> | Interface, ParameterizedType |
819+
| Comparator<? super Entry<K,V>> | Interface, ParameterizedType |
820+
| Comparator<? super Integer> | Interface, ParameterizedType |
792821
| Comparator<? super K> | Interface, ParameterizedType |
793822
| Comparator<? super T> | Interface, ParameterizedType |
794823
| Comparator<? super U> | Interface, ParameterizedType |
@@ -840,6 +869,7 @@
840869
| ConstructorRepository | Class |
841870
| Consumer | GenericType, Interface, ParameterizedType |
842871
| Consumer<> | Interface, RawType |
872+
| Consumer<? super Byte> | Interface, ParameterizedType |
843873
| Consumer<? super Double> | Interface, ParameterizedType |
844874
| Consumer<? super E> | Interface, ParameterizedType |
845875
| Consumer<? super Entry<K,V>> | Interface, ParameterizedType |
@@ -932,9 +962,11 @@
932962
| DynamicConstantDesc<Boolean> | Class, ParameterizedType |
933963
| DynamicConstantDesc<Byte> | Class, ParameterizedType |
934964
| DynamicConstantDesc<Character> | Class, ParameterizedType |
965+
| DynamicConstantDesc<ClassOption> | Class, ParameterizedType |
935966
| DynamicConstantDesc<E> | Class, ParameterizedType |
936967
| DynamicConstantDesc<Short> | Class, ParameterizedType |
937968
| DynamicConstantDesc<T> | Class, ParameterizedType |
969+
| DynamicConstantDesc<UnicodeScript> | Class, ParameterizedType |
938970
| DynamicConstantDesc<VarHandle> | Class, ParameterizedType |
939971
| E | TypeVariable |
940972
| E[] | Array |
@@ -949,6 +981,8 @@
949981
| Entry<? extends K,? extends V>[] | Array |
950982
| Entry<?> | Class, ParameterizedType |
951983
| Entry<?>[] | Array |
984+
| Entry<Identity,Entry<?>> | Class, ParameterizedType |
985+
| Entry<Identity,Entry<?>> | Interface, ParameterizedType |
952986
| Entry<K,V> | Class, ParameterizedType |
953987
| Entry<K,V> | Interface, ParameterizedType |
954988
| Entry<K,V>[] | Array |
@@ -1003,7 +1037,9 @@
10031037
| EnumCompanionObject | Class |
10041038
| EnumDesc | Class, GenericType, ParameterizedType |
10051039
| EnumDesc<> | Class, RawType |
1040+
| EnumDesc<ClassOption> | Class, ParameterizedType |
10061041
| EnumDesc<E> | Class, ParameterizedType |
1042+
| EnumDesc<UnicodeScript> | Class, ParameterizedType |
10071043
| EnumSet | Class, GenericType, ParameterizedType |
10081044
| EnumSet<> | Class, RawType |
10091045
| EnumSet<E> | Class, ParameterizedType |
@@ -1121,6 +1157,7 @@
11211157
| Function1<Integer,Short> | Interface, ParameterizedType |
11221158
| Function1<Integer,T> | Interface, ParameterizedType |
11231159
| Function<> | Interface, RawType |
1160+
| Function<? super Identity,? extends Entry<?>> | Interface, ParameterizedType |
11241161
| Function<? super K,? extends U> | Interface, ParameterizedType |
11251162
| Function<? super K,? extends V> | Interface, ParameterizedType |
11261163
| Function<? super Object,? extends Object> | Interface, ParameterizedType |
@@ -1135,6 +1172,7 @@
11351172
| Function<? super T,? extends R> | Interface, ParameterizedType |
11361173
| Function<? super T,? extends Stream<? extends R>> | Interface, ParameterizedType |
11371174
| Function<? super T,? extends U> | Interface, ParameterizedType |
1175+
| Function<? super T,? extends V> | Interface, ParameterizedType |
11381176
| Function<? super V,? extends T> | Interface, ParameterizedType |
11391177
| Function<? super V,? extends U> | Interface, ParameterizedType |
11401178
| Function<A,R> | Interface, ParameterizedType |
@@ -1157,6 +1195,7 @@
11571195
| Function<T> | Interface, ParameterizedType |
11581196
| Function<V,Long> | Interface, ParameterizedType |
11591197
| Function<V,R> | Interface, ParameterizedType |
1198+
| Function<V,T> | Interface, ParameterizedType |
11601199
| Function<V,V> | Interface, ParameterizedType |
11611200
| Function<VM,VM> | Interface, ParameterizedType |
11621201
| Future | GenericType, Interface, ParameterizedType |
@@ -1257,8 +1296,11 @@
12571296
| Iterable<? extends Callable<T>> | Interface, ParameterizedType |
12581297
| Iterable<? extends Certificate> | Interface, ParameterizedType |
12591298
| Iterable<? extends E> | Interface, ParameterizedType |
1299+
| Iterable<? extends Entry<K,V>> | Interface, ParameterizedType |
1300+
| Iterable<? extends K> | Interface, ParameterizedType |
12601301
| Iterable<? extends OpenOption> | Interface, ParameterizedType |
12611302
| Iterable<? extends Principal> | Interface, ParameterizedType |
1303+
| Iterable<? extends V> | Interface, ParameterizedType |
12621304
| Iterable<? super ForkJoinTask<?>> | Interface, ParameterizedType |
12631305
| Iterable<?> | Interface, ParameterizedType |
12641306
| Iterable<Attribute> | Interface, ParameterizedType |
@@ -1275,6 +1317,8 @@
12751317
| Iterable<ConstantDesc> | Interface, ParameterizedType |
12761318
| Iterable<DateTimePrinterParser> | Interface, ParameterizedType |
12771319
| Iterable<E> | Interface, ParameterizedType |
1320+
| Iterable<Entry<?>> | Interface, ParameterizedType |
1321+
| Iterable<Entry<Identity,Entry<?>>> | Interface, ParameterizedType |
12781322
| Iterable<Entry<K,V>> | Interface, ParameterizedType |
12791323
| Iterable<Entry<Object,Object>> | Interface, ParameterizedType |
12801324
| Iterable<Era> | Interface, ParameterizedType |
@@ -1283,6 +1327,7 @@
12831327
| Iterable<FileStore> | Interface, ParameterizedType |
12841328
| Iterable<FileSystemProvider> | Interface, ParameterizedType |
12851329
| Iterable<Future<T>> | Interface, ParameterizedType |
1330+
| Iterable<Identity> | Interface, ParameterizedType |
12861331
| Iterable<Integer> | Interface, ParameterizedType |
12871332
| Iterable<InterfaceAddress> | Interface, ParameterizedType |
12881333
| Iterable<K> | Interface, ParameterizedType |
@@ -1451,8 +1496,12 @@
14511496
| ManagedBlocker | Interface |
14521497
| Map | GenericType, Interface, ParameterizedType |
14531498
| Map<> | Interface, RawType |
1499+
| Map<? extends Identity,? extends Entry<?>> | Interface, ParameterizedType |
1500+
| Map<? extends Identity,Entry<?>> | Interface, ParameterizedType |
14541501
| Map<? extends K,? extends V> | Interface, ParameterizedType |
14551502
| Map<? extends K,V> | Interface, ParameterizedType |
1503+
| Map<? extends Object,? extends Object> | Interface, ParameterizedType |
1504+
| Map<? extends Object,Object> | Interface, ParameterizedType |
14561505
| Map<? extends WeakReference<Class<?>>,?> | Interface, ParameterizedType |
14571506
| Map<?,?> | Interface, ParameterizedType |
14581507
| Map<Attribute,Object> | Interface, ParameterizedType |
@@ -1621,7 +1670,9 @@
16211670
| Optional<DynamicConstantDesc<Byte>> | Class, ParameterizedType |
16221671
| Optional<DynamicConstantDesc<Character>> | Class, ParameterizedType |
16231672
| Optional<DynamicConstantDesc<Short>> | Class, ParameterizedType |
1673+
| Optional<EnumDesc<ClassOption>> | Class, ParameterizedType |
16241674
| Optional<EnumDesc<E>> | Class, ParameterizedType |
1675+
| Optional<EnumDesc<UnicodeScript>> | Class, ParameterizedType |
16251676
| Optional<Float> | Class, ParameterizedType |
16261677
| Optional<InputStream> | Class, ParameterizedType |
16271678
| Optional<Integer> | Class, ParameterizedType |
@@ -1677,6 +1728,7 @@
16771728
| Predicate<? super E> | Interface, ParameterizedType |
16781729
| Predicate<? super Entry<K,V>> | Interface, ParameterizedType |
16791730
| Predicate<? super ForkJoinPool> | Interface, ParameterizedType |
1731+
| Predicate<? super K> | Interface, ParameterizedType |
16801732
| Predicate<? super T> | Interface, ParameterizedType |
16811733
| Predicate<? super V> | Interface, ParameterizedType |
16821734
| Predicate<Class<?>> | Interface, ParameterizedType |
@@ -1735,7 +1787,11 @@
17351787
| Reference<Version<T>> | Class, ParameterizedType |
17361788
| Reference<Version> | Class, ParameterizedType |
17371789
| ReferenceQueue | Class, GenericType, ParameterizedType |
1790+
| ReferenceQueue<? super Class<?>> | Class, ParameterizedType |
1791+
| ReferenceQueue<? super Cleaner> | Class, ParameterizedType |
1792+
| ReferenceQueue<? super Object> | Class, ParameterizedType |
17381793
| ReferenceQueue<? super T> | Class, ParameterizedType |
1794+
| ReferenceQueue<? super Version<T>> | Class, ParameterizedType |
17391795
| ReferenceQueue<Class<?>> | Class, ParameterizedType |
17401796
| ReferenceQueue<Object> | Class, ParameterizedType |
17411797
| ReflectionFactory | Class |
@@ -1787,9 +1843,11 @@
17871843
| Set<Chronology> | Interface, ParameterizedType |
17881844
| Set<ClassOption> | Interface, ParameterizedType |
17891845
| Set<E> | Interface, ParameterizedType |
1846+
| Set<Entry<Identity,Entry<?>>> | Interface, ParameterizedType |
17901847
| Set<Entry<K,V>> | Interface, ParameterizedType |
17911848
| Set<Entry<Object,Object>> | Interface, ParameterizedType |
17921849
| Set<Exports> | Interface, ParameterizedType |
1850+
| Set<Identity> | Interface, ParameterizedType |
17931851
| Set<K> | Interface, ParameterizedType |
17941852
| Set<Locale> | Interface, ParameterizedType |
17951853
| Set<Modifier> | Interface, ParameterizedType |
@@ -1881,9 +1939,11 @@
18811939
| Stream<Configuration> | Interface, ParameterizedType |
18821940
| Stream<Double> | Interface, ParameterizedType |
18831941
| Stream<E> | Interface, ParameterizedType |
1942+
| Stream<Entry<K,V>> | Interface, ParameterizedType |
18841943
| Stream<InetAddress> | Interface, ParameterizedType |
18851944
| Stream<Integer> | Interface, ParameterizedType |
18861945
| Stream<JumpableGenerator> | Interface, ParameterizedType |
1946+
| Stream<K> | Interface, ParameterizedType |
18871947
| Stream<LocalDate> | Interface, ParameterizedType |
18881948
| Stream<Long> | Interface, ParameterizedType |
18891949
| Stream<ModuleLayer> | Interface, ParameterizedType |
@@ -1898,6 +1958,7 @@
18981958
| Stream<T> | Interface, ParameterizedType |
18991959
| Stream<U> | Interface, ParameterizedType |
19001960
| Stream<URL> | Interface, ParameterizedType |
1961+
| Stream<V> | Interface, ParameterizedType |
19011962
| StreamableGenerator | Interface |
19021963
| String | Class |
19031964
| StringBuffer | Class |

0 commit comments

Comments
 (0)