Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 44b731c

Browse files
tamasvajkigfoo
authored andcommitted
Exclude extraction of fake overridden properties
1 parent 55b8e44 commit 44b731c

3 files changed

Lines changed: 7 additions & 49 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,12 @@ open class KotlinFileExtractor(
577577
}
578578

579579
fun extractProperty(p: IrProperty, parentId: Label<out DbReftype>, extractBackingField: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgs: List<IrTypeArgument>?) {
580+
581+
val visibility = p.visibility
582+
if (visibility is DelegatedDescriptorVisibility && visibility.delegate == Visibilities.InvisibleFake) {
583+
return
584+
}
585+
580586
val id = useProperty(p, parentId)
581587
val locId = tw.getLocation(p)
582588
tw.writeKtProperties(id, p.name.asString())
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import java
22

33
from string mod, Location l
4-
where
5-
diagnostics(_, _, _, _, "Unexpected visibility: " + mod, _, l) and
6-
not mod in ["invisible_fake"]
4+
where diagnostics(_, _, _, _, "Unexpected visibility: " + mod, _, l)
75
select mod, l

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

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
| ? extends AttributedCharacterIterator | Wildcard |
1010
| ? extends BasicType | Wildcard |
1111
| ? extends BigInteger | Wildcard |
12-
| ? extends BoundMethodHandle | Wildcard |
1312
| ? extends ByteBuffer | Wildcard |
1413
| ? extends Callable<T> | Wildcard |
1514
| ? extends Certificate | Wildcard |
@@ -27,12 +26,9 @@
2726
| ? extends DoubleStream | Wildcard |
2827
| ? extends E | Wildcard |
2928
| ? extends Entry<? extends K,? extends V> | Wildcard |
30-
| ? extends Entry<?,?> | Wildcard |
3129
| ? extends Entry<?> | Wildcard |
32-
| ? extends Entry<Identity,Entry<?>> | Wildcard |
3330
| ? extends Entry<K,V> | Wildcard |
3431
| ? extends Enum<?> | Wildcard |
35-
| ? extends ExceptionNode | Wildcard |
3632
| ? extends Field | Wildcard |
3733
| ? extends FieldTypeSignature | Wildcard |
3834
| ? extends File | Wildcard |
@@ -93,8 +89,6 @@
9389
| ? extends WorkQueue | Wildcard |
9490
| ? extends X | Wildcard |
9591
| ? super A | Wildcard |
96-
| ? super Class<?> | Wildcard |
97-
| ? super Cleaner | Wildcard |
9892
| ? super Double | Wildcard |
9993
| ? super E | Wildcard |
10094
| ? super Entry<K,V> | Wildcard |
@@ -110,10 +104,8 @@
110104
| ? super StackFrame | Wildcard |
111105
| ? super Stream<StackFrame> | Wildcard |
112106
| ? super T | Wildcard |
113-
| ? super ThreadLocal<?> | Wildcard |
114107
| ? super U | Wildcard |
115108
| ? super V | Wildcard |
116-
| ? super Version<T> | Wildcard |
117109
| A | TypeVariable |
118110
| A[] | Array |
119111
| AbstractChronology | Class |
@@ -126,9 +118,6 @@
126118
| AbstractMap<?,?> | Class, ParameterizedType |
127119
| AbstractMap<Identity,Entry<?>> | Class, ParameterizedType |
128120
| AbstractMap<K,V> | Class, ParameterizedType |
129-
| AbstractMap<Object,Object> | Class, ParameterizedType |
130-
| AbstractMap<String,Chronology> | Class, ParameterizedType |
131-
| AbstractMap<String,Object> | Class, ParameterizedType |
132121
| AbstractOwnableSynchronizer | Class |
133122
| AbstractQueuedSynchronizer | Class |
134123
| AbstractRepository | Class, GenericType, ParameterizedType |
@@ -182,12 +171,9 @@
182171
| Array<? extends DateTimePrinterParser> | Class, ParameterizedType |
183172
| Array<? extends E> | Class, ParameterizedType |
184173
| Array<? extends Entry<? extends K,? extends V>> | Class, ParameterizedType |
185-
| Array<? extends Entry<?,?>> | Class, ParameterizedType |
186174
| Array<? extends Entry<?>> | Class, ParameterizedType |
187-
| Array<? extends Entry<Identity,Entry<?>>> | Class, ParameterizedType |
188175
| Array<? extends Entry<K,V>> | Class, ParameterizedType |
189176
| Array<? extends Enum<?>> | Class, ParameterizedType |
190-
| Array<? extends ExceptionNode> | Class, ParameterizedType |
191177
| Array<? extends Field> | Class, ParameterizedType |
192178
| Array<? extends FieldTypeSignature> | Class, ParameterizedType |
193179
| Array<? extends File> | Class, ParameterizedType |
@@ -265,14 +251,11 @@
265251
| Array<DayOfWeek> | Class, ParameterizedType |
266252
| Array<E> | Class, ParameterizedType |
267253
| Array<Entry<? extends K,? extends V>> | Class, ParameterizedType |
268-
| Array<Entry<?,?>> | Class, ParameterizedType |
269254
| Array<Entry<?>> | Class, ParameterizedType |
270-
| Array<Entry<Identity,Entry<?>>> | Class, ParameterizedType |
271255
| Array<Entry<K,V>> | Class, ParameterizedType |
272256
| Array<Entry> | Class, ParameterizedType |
273257
| Array<Enum<?>> | Class, ParameterizedType |
274258
| Array<Enum> | Class, ParameterizedType |
275-
| Array<ExceptionNode> | Class, ParameterizedType |
276259
| Array<ExtendedOption> | Class, ParameterizedType |
277260
| Array<Field> | Class, ParameterizedType |
278261
| Array<FieldTypeSignature> | Class, ParameterizedType |
@@ -510,7 +493,6 @@
510493
| Class<> | Class, RawType |
511494
| Class<>[] | Array |
512495
| Class<? extends Annotation> | Class, ParameterizedType |
513-
| Class<? extends BoundMethodHandle> | Class, ParameterizedType |
514496
| Class<? extends FileAttributeView> | Class, ParameterizedType |
515497
| Class<? extends T> | Class, ParameterizedType |
516498
| Class<? extends Throwable> | Class, ParameterizedType |
@@ -520,7 +502,6 @@
520502
| Class<?>[] | Array |
521503
| Class<A> | Class, ParameterizedType |
522504
| Class<Boolean> | Class, ParameterizedType |
523-
| Class<BoundMethodHandle> | Class, ParameterizedType |
524505
| Class<Byte> | Class, ParameterizedType |
525506
| Class<Character> | Class, ParameterizedType |
526507
| Class<Double> | Class, ParameterizedType |
@@ -532,8 +513,6 @@
532513
| Class<NoSuchMemberException> | Class, ParameterizedType |
533514
| Class<S> | Class, ParameterizedType |
534515
| Class<Short> | Class, ParameterizedType |
535-
| Class<SpeciesData> | Class, ParameterizedType |
536-
| Class<String> | Class, ParameterizedType |
537516
| Class<T> | Class, ParameterizedType |
538517
| Class<U> | Class, ParameterizedType |
539518
| Class<V> | Class, ParameterizedType |
@@ -606,7 +585,6 @@
606585
| Collection<MemberName> | Interface, ParameterizedType |
607586
| Collection<Method> | Interface, ParameterizedType |
608587
| Collection<MethodHandle> | Interface, ParameterizedType |
609-
| Collection<MethodType> | Interface, ParameterizedType |
610588
| Collection<Modifier> | Interface, ParameterizedType |
611589
| Collection<Module> | Interface, ParameterizedType |
612590
| Collection<ModuleDescriptor> | Interface, ParameterizedType |
@@ -748,16 +726,10 @@
748726
| ConcurrentHashMap | Class, GenericType, ParameterizedType |
749727
| ConcurrentHashMap<?,?> | Class, ParameterizedType |
750728
| ConcurrentHashMap<K,V> | Class, ParameterizedType |
751-
| ConcurrentHashMap<Object,Object> | Class, ParameterizedType |
752-
| ConcurrentHashMap<String,Chronology> | Class, ParameterizedType |
753-
| ConcurrentHashMap<String,Object> | Class, ParameterizedType |
754729
| ConcurrentMap | GenericType, Interface, ParameterizedType |
755730
| ConcurrentMap<? extends WeakReference<Class<?>>,?> | Interface, ParameterizedType |
756731
| ConcurrentMap<?,?> | Interface, ParameterizedType |
757732
| ConcurrentMap<K,V> | Interface, ParameterizedType |
758-
| ConcurrentMap<Object,Object> | Interface, ParameterizedType |
759-
| ConcurrentMap<String,Chronology> | Interface, ParameterizedType |
760-
| ConcurrentMap<String,Object> | Interface, ParameterizedType |
761733
| ConcurrentWeakInternSet | Class, GenericType, ParameterizedType |
762734
| ConcurrentWeakInternSet<MethodType> | Class, ParameterizedType |
763735
| Condition | Interface |
@@ -861,15 +833,9 @@
861833
| Entry | GenericType, Interface, ParameterizedType |
862834
| Entry<? extends K,? extends V> | Interface, ParameterizedType |
863835
| Entry<? extends K,? extends V>[] | Array |
864-
| Entry<?,?> | Class, ParameterizedType |
865-
| Entry<?,?> | Interface, ParameterizedType |
866-
| Entry<?,?>[] | Array |
867836
| Entry<?> | Class, ParameterizedType |
868837
| Entry<?>[] | Array |
869-
| Entry<Identity,Entry<?>> | Class, ParameterizedType |
870838
| Entry<Identity,Entry<?>> | Interface, ParameterizedType |
871-
| Entry<Identity,Entry<?>>[] | Array |
872-
| Entry<Integer,PrefixTree> | Interface, ParameterizedType |
873839
| Entry<K,V> | Class, ParameterizedType |
874840
| Entry<K,V> | Interface, ParameterizedType |
875841
| Entry<K,V>[] | Array |
@@ -937,7 +903,6 @@
937903
| Error | Class |
938904
| Exception | Class |
939905
| ExceptionNode | Class |
940-
| ExceptionNode[] | Array |
941906
| Executable | Class |
942907
| Executor | Interface |
943908
| ExecutorService | Interface |
@@ -1057,7 +1022,6 @@
10571022
| Function<Float> | Interface, ParameterizedType |
10581023
| Function<Integer> | Interface, ParameterizedType |
10591024
| Function<Long> | Interface, ParameterizedType |
1060-
| Function<Object,Object> | Interface, ParameterizedType |
10611025
| Function<R> | Interface, ParameterizedType |
10621026
| Function<Short> | Interface, ParameterizedType |
10631027
| Function<String,ClassLoader> | Interface, ParameterizedType |
@@ -1183,7 +1147,6 @@
11831147
| Iterable<MemberName> | Interface, ParameterizedType |
11841148
| Iterable<Method> | Interface, ParameterizedType |
11851149
| Iterable<MethodHandle> | Interface, ParameterizedType |
1186-
| Iterable<MethodType> | Interface, ParameterizedType |
11871150
| Iterable<Modifier> | Interface, ParameterizedType |
11881151
| Iterable<Module> | Interface, ParameterizedType |
11891152
| Iterable<ModuleDescriptor> | Interface, ParameterizedType |
@@ -1275,7 +1238,6 @@
12751238
| List<MemberName> | Interface, ParameterizedType |
12761239
| List<Method> | Interface, ParameterizedType |
12771240
| List<MethodHandle> | Interface, ParameterizedType |
1278-
| List<MethodType> | Interface, ParameterizedType |
12791241
| List<ModuleLayer> | Interface, ParameterizedType |
12801242
| List<NamedFunction> | Interface, ParameterizedType |
12811243
| List<Runnable> | Interface, ParameterizedType |
@@ -1340,10 +1302,8 @@
13401302
| Map<Object,Object> | Interface, ParameterizedType |
13411303
| Map<String,?> | Interface, ParameterizedType |
13421304
| Map<String,AccessMode> | Interface, ParameterizedType |
1343-
| Map<String,Attribute> | Interface, ParameterizedType |
13441305
| Map<String,Boolean> | Interface, ParameterizedType |
13451306
| Map<String,Charset> | Interface, ParameterizedType |
1346-
| Map<String,Chronology> | Interface, ParameterizedType |
13471307
| Map<String,Class<?>> | Interface, ParameterizedType |
13481308
| Map<String,Exports> | Interface, ParameterizedType |
13491309
| Map<String,List<String>> | Interface, ParameterizedType |
@@ -1593,13 +1553,7 @@
15931553
| Reference<Version<?>> | Class, ParameterizedType |
15941554
| Reference<Version<T>> | Class, ParameterizedType |
15951555
| ReferenceQueue | Class, GenericType, ParameterizedType |
1596-
| ReferenceQueue<? super Class<?>> | Class, ParameterizedType |
1597-
| ReferenceQueue<? super Cleaner> | Class, ParameterizedType |
1598-
| ReferenceQueue<? super ForkJoinTask<?>> | Class, ParameterizedType |
1599-
| ReferenceQueue<? super Object> | Class, ParameterizedType |
16001556
| ReferenceQueue<? super T> | Class, ParameterizedType |
1601-
| ReferenceQueue<? super ThreadLocal<?>> | Class, ParameterizedType |
1602-
| ReferenceQueue<? super Version<T>> | Class, ParameterizedType |
16031557
| ReferenceQueue<Class<?>> | Class, ParameterizedType |
16041558
| ReferenceQueue<ForkJoinTask<?>> | Class, ParameterizedType |
16051559
| ReferenceQueue<Object> | Class, ParameterizedType |

0 commit comments

Comments
 (0)