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

Skip to content

Commit d2e626c

Browse files
smowtonigfoo
authored andcommitted
Add declaring type to test to distinguish ambiguously-named methods
1 parent fa9971c commit d2e626c

2 files changed

Lines changed: 49 additions & 49 deletions

File tree

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

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
methods
2-
| methods2.kt:4:1:5:1 | fooBarTopLevelMethod | fooBarTopLevelMethod(int,int) |
3-
| methods2.kt:7:1:10:1 | <obinit> | <obinit>() |
4-
| methods2.kt:7:1:10:1 | equals | equals(java.lang.Object) |
5-
| methods2.kt:7:1:10:1 | hashCode | hashCode() |
6-
| methods2.kt:7:1:10:1 | toString | toString() |
7-
| methods2.kt:8:5:9:5 | fooBarClassMethod | fooBarClassMethod(int,int) |
8-
| methods3.kt:3:1:3:42 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) |
9-
| methods3.kt:5:1:7:1 | <obinit> | <obinit>() |
10-
| methods3.kt:5:1:7:1 | equals | equals(java.lang.Object) |
11-
| methods3.kt:5:1:7:1 | hashCode | hashCode() |
12-
| methods3.kt:5:1:7:1 | toString | toString() |
13-
| methods3.kt:6:5:6:46 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) |
14-
| methods4.kt:3:1:11:1 | <obinit> | <obinit>() |
15-
| methods4.kt:3:1:11:1 | equals | equals(java.lang.Object) |
16-
| methods4.kt:3:1:11:1 | hashCode | hashCode() |
17-
| methods4.kt:3:1:11:1 | toString | toString() |
18-
| methods4.kt:5:3:9:3 | <obinit> | <obinit>() |
19-
| methods4.kt:5:3:9:3 | equals | equals(java.lang.Object) |
20-
| methods4.kt:5:3:9:3 | hashCode | hashCode() |
21-
| methods4.kt:5:3:9:3 | toString | toString() |
22-
| methods4.kt:7:5:7:34 | m | m(foo.bar.NestedTest.InsideNestedTest) |
23-
| methods5.kt:3:1:11:1 | x | x() |
24-
| methods5.kt:5:3:5:27 | a | a(int) |
25-
| methods5.kt:9:3:9:32 | f1 | f1(foo.bar.C1,int) |
26-
| methods5.kt:13:1:13:14 | <obinit> | <obinit>() |
27-
| methods5.kt:13:1:13:14 | equals | equals(java.lang.Object) |
28-
| methods5.kt:13:1:13:14 | equals | equals(java.lang.Object) |
29-
| methods5.kt:13:1:13:14 | hashCode | hashCode() |
30-
| methods5.kt:13:1:13:14 | hashCode | hashCode() |
31-
| methods5.kt:13:1:13:14 | toString | toString() |
32-
| methods5.kt:13:1:13:14 | toString | toString() |
33-
| methods.kt:2:1:3:1 | topLevelMethod | topLevelMethod(int,int) |
34-
| methods.kt:5:1:13:1 | <obinit> | <obinit>() |
35-
| methods.kt:5:1:13:1 | equals | equals(java.lang.Object) |
36-
| methods.kt:5:1:13:1 | hashCode | hashCode() |
37-
| methods.kt:5:1:13:1 | toString | toString() |
38-
| methods.kt:6:5:7:5 | classMethod | classMethod(int,int) |
39-
| methods.kt:9:5:12:5 | anotherClassMethod | anotherClassMethod(int,int) |
2+
| methods2.kt:0:0:0:0 | Methods2Kt | methods2.kt:4:1:5:1 | fooBarTopLevelMethod | fooBarTopLevelMethod(int,int) |
3+
| methods2.kt:7:1:10:1 | Class2 | methods2.kt:7:1:10:1 | <obinit> | <obinit>() |
4+
| methods2.kt:7:1:10:1 | Class2 | methods2.kt:7:1:10:1 | equals | equals(java.lang.Object) |
5+
| methods2.kt:7:1:10:1 | Class2 | methods2.kt:7:1:10:1 | hashCode | hashCode() |
6+
| methods2.kt:7:1:10:1 | Class2 | methods2.kt:7:1:10:1 | toString | toString() |
7+
| methods2.kt:7:1:10:1 | Class2 | methods2.kt:8:5:9:5 | fooBarClassMethod | fooBarClassMethod(int,int) |
8+
| methods3.kt:0:0:0:0 | Methods3Kt | methods3.kt:3:1:3:42 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) |
9+
| methods3.kt:5:1:7:1 | Class3 | methods3.kt:5:1:7:1 | <obinit> | <obinit>() |
10+
| methods3.kt:5:1:7:1 | Class3 | methods3.kt:5:1:7:1 | equals | equals(java.lang.Object) |
11+
| methods3.kt:5:1:7:1 | Class3 | methods3.kt:5:1:7:1 | hashCode | hashCode() |
12+
| methods3.kt:5:1:7:1 | Class3 | methods3.kt:5:1:7:1 | toString | toString() |
13+
| methods3.kt:5:1:7:1 | Class3 | methods3.kt:6:5:6:46 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) |
14+
| methods4.kt:3:1:11:1 | NestedTest | methods4.kt:3:1:11:1 | <obinit> | <obinit>() |
15+
| methods4.kt:3:1:11:1 | NestedTest | methods4.kt:3:1:11:1 | equals | equals(java.lang.Object) |
16+
| methods4.kt:3:1:11:1 | NestedTest | methods4.kt:3:1:11:1 | hashCode | hashCode() |
17+
| methods4.kt:3:1:11:1 | NestedTest | methods4.kt:3:1:11:1 | toString | toString() |
18+
| methods4.kt:5:3:9:3 | InsideNestedTest | methods4.kt:5:3:9:3 | <obinit> | <obinit>() |
19+
| methods4.kt:5:3:9:3 | InsideNestedTest | methods4.kt:5:3:9:3 | equals | equals(java.lang.Object) |
20+
| methods4.kt:5:3:9:3 | InsideNestedTest | methods4.kt:5:3:9:3 | hashCode | hashCode() |
21+
| methods4.kt:5:3:9:3 | InsideNestedTest | methods4.kt:5:3:9:3 | toString | toString() |
22+
| methods4.kt:5:3:9:3 | InsideNestedTest | methods4.kt:7:5:7:34 | m | m(foo.bar.NestedTest.InsideNestedTest) |
23+
| methods5.kt:0:0:0:0 | Methods5Kt | methods5.kt:3:1:11:1 | x | x() |
24+
| methods5.kt:5:3:5:27 | new Object(...) { ... } | methods5.kt:5:3:5:27 | a | a(int) |
25+
| methods5.kt:9:3:9:32 | new Object(...) { ... } | methods5.kt:9:3:9:32 | f1 | f1(foo.bar.C1,int) |
26+
| methods5.kt:13:1:13:14 | C1 | methods5.kt:13:1:13:14 | <obinit> | <obinit>() |
27+
| methods5.kt:13:1:13:14 | C1 | methods5.kt:13:1:13:14 | equals | equals(java.lang.Object) |
28+
| methods5.kt:13:1:13:14 | C1 | methods5.kt:13:1:13:14 | hashCode | hashCode() |
29+
| methods5.kt:13:1:13:14 | C1 | methods5.kt:13:1:13:14 | toString | toString() |
30+
| methods5.kt:13:1:13:14 | C1<Integer> | methods5.kt:13:1:13:14 | equals | equals(java.lang.Object) |
31+
| methods5.kt:13:1:13:14 | C1<Integer> | methods5.kt:13:1:13:14 | hashCode | hashCode() |
32+
| methods5.kt:13:1:13:14 | C1<Integer> | methods5.kt:13:1:13:14 | toString | toString() |
33+
| methods.kt:0:0:0:0 | MethodsKt | methods.kt:2:1:3:1 | topLevelMethod | topLevelMethod(int,int) |
34+
| methods.kt:5:1:13:1 | Class | methods.kt:5:1:13:1 | <obinit> | <obinit>() |
35+
| methods.kt:5:1:13:1 | Class | methods.kt:5:1:13:1 | equals | equals(java.lang.Object) |
36+
| methods.kt:5:1:13:1 | Class | methods.kt:5:1:13:1 | hashCode | hashCode() |
37+
| methods.kt:5:1:13:1 | Class | methods.kt:5:1:13:1 | toString | toString() |
38+
| methods.kt:5:1:13:1 | Class | methods.kt:6:5:7:5 | classMethod | classMethod(int,int) |
39+
| methods.kt:5:1:13:1 | Class | methods.kt:9:5:12:5 | anotherClassMethod | anotherClassMethod(int,int) |
4040
constructors
41-
| methods2.kt:7:1:10:1 | Class2 | Class2() |
42-
| methods3.kt:5:1:7:1 | Class3 | Class3() |
43-
| methods4.kt:3:1:11:1 | NestedTest | NestedTest() |
44-
| methods4.kt:5:3:9:3 | InsideNestedTest | InsideNestedTest() |
45-
| methods5.kt:5:3:5:27 | | |
46-
| methods5.kt:9:3:9:32 | | |
47-
| methods5.kt:13:1:13:14 | C1 | C1() |
48-
| methods5.kt:13:1:13:14 | C1<Integer> | C1<Integer>() |
49-
| methods.kt:5:1:13:1 | Class | Class() |
41+
| methods2.kt:7:1:10:1 | Class2 | methods2.kt:7:1:10:1 | Class2 | Class2() |
42+
| methods3.kt:5:1:7:1 | Class3 | methods3.kt:5:1:7:1 | Class3 | Class3() |
43+
| methods4.kt:3:1:11:1 | NestedTest | methods4.kt:3:1:11:1 | NestedTest | NestedTest() |
44+
| methods4.kt:5:3:9:3 | InsideNestedTest | methods4.kt:5:3:9:3 | InsideNestedTest | InsideNestedTest() |
45+
| methods5.kt:5:3:5:27 | new Object(...) { ... } | methods5.kt:5:3:5:27 | | |
46+
| methods5.kt:9:3:9:32 | new Object(...) { ... } | methods5.kt:9:3:9:32 | | |
47+
| methods5.kt:13:1:13:14 | C1 | methods5.kt:13:1:13:14 | C1 | C1() |
48+
| methods5.kt:13:1:13:14 | C1<Integer> | methods5.kt:13:1:13:14 | C1<Integer> | C1<Integer>() |
49+
| methods.kt:5:1:13:1 | Class | methods.kt:5:1:13:1 | Class | Class() |
5050
extensions
5151
| methods3.kt:3:1:3:42 | fooBarTopLevelMethodExt | file://:0:0:0:0 | int |
5252
| methods3.kt:6:5:6:46 | fooBarTopLevelMethodExt | file://:0:0:0:0 | int |
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import java
22

3-
query predicate methods(Method m, string signature) { m.fromSource() and signature = m.getSignature() }
3+
query predicate methods(RefType declType, Method m, string signature) { m.fromSource() and declType = m.getDeclaringType() and signature = m.getSignature() }
44

5-
query predicate constructors(Constructor c, string signature) { c.fromSource() and signature = c.getSignature() }
5+
query predicate constructors(RefType declType, Constructor c, string signature) { c.fromSource() and declType = c.getDeclaringType() and signature = c.getSignature() }
66

77
query predicate extensions(ExtensionMethod m, Type t) { m.getExtendedType() = t and m.fromSource() }

0 commit comments

Comments
 (0)