Commit Graph

6082 Commits

Author SHA1 Message Date
Tamas Vajk
8282e57db5 Fix CFG construction of ExprStmt and StmtExpr 2022-05-10 19:51:28 +01:00
Tamas Vajk
81cb81366b Add test case for CFG issue with && in if condition 2022-05-10 19:51:28 +01:00
Tamas Vajk
953c6fdb7b Fix expected test file 2022-05-10 19:51:28 +01:00
Tamas Vajk
47799ae040 Code quality improvements + add dedicated DeadRefTypes test 2022-05-10 19:51:28 +01:00
Tamas Vajk
cdc7ed0e14 Extract container of adapter function as compiler generated 2022-05-10 19:51:28 +01:00
Tamas Vajk
7f94495601 Add test for adapter function 2022-05-10 19:51:28 +01:00
Tamas Vajk
fc66b73e3b Extract override modifier for lambda and reflection-like constructs 2022-05-10 19:51:28 +01:00
Tamas Vajk
505ccbbcf6 Extract override modifier 2022-05-10 19:51:28 +01:00
Tamas Vajk
92de139805 Add override tests 2022-05-10 19:51:27 +01:00
Tamas Vajk
ca99cb4999 Code quality improvements 2022-05-10 19:51:27 +01:00
Tamas Vajk
22af7f0e89 Remove duplications of locatable and element in the DB scheme 2022-05-10 19:51:27 +01:00
Ian Lynagh
400654d326 Kotlin: Add latest-url to kotlin_plugin_versions.py 2022-05-10 19:51:27 +01:00
Tamas Vajk
6ab86a1f46 Fix expected test files after 1.6.20 upgrade 2022-05-10 19:51:27 +01:00
Tamas Vajk
4e93134225 Add 1.6.20 support 2022-05-10 19:51:27 +01:00
Ian Lynagh
ff35088b49 Java: Add an upgrade script 2022-05-10 19:51:27 +01:00
Ian Lynagh
843310c466 Kotlin: Remove incorrect upgrade 2022-05-10 19:51:27 +01:00
Tamas Vajk
ad11b3e84a Add consistency query to verify we always have qualifier for calls 2022-05-10 19:51:27 +01:00
Tamas Vajk
4f3e89dd49 Fix expected test file 2022-05-10 19:51:27 +01:00
Tamas Vajk
a1842f9f17 Remove ExtensionMethodAccess and revert all dataflow changes 2022-05-10 19:51:27 +01:00
Tamas Vajk
95cb0149a3 Fix data flow through ExtensionMethodAccess 2022-05-10 19:51:27 +01:00
Tamas Vajk
38ab7acf3e Revert "Remove ExtensionMethodAccess to see extension method flows"
This reverts commit 9df4f2074379ba4668054a2a66eaaaaf5cb9b6c8.
2022-05-10 19:51:27 +01:00
Tamas Vajk
a9711b8c88 Remove ExtensionMethodAccess to see extension method flows 2022-05-10 19:51:27 +01:00
Tamas Vajk
6fccbaa93b Add extension method dataflow tests 2022-05-10 19:51:27 +01:00
Ian Lynagh
fac3699a5b Kotlin: Generate stats 2022-05-10 19:51:27 +01:00
Ian Lynagh
19270369c8 Java: Add an upgrade script 2022-05-10 19:51:27 +01:00
Ian Lynagh
c1629530e5 Kotlin: Fix build on Windows 2022-05-10 19:51:27 +01:00
Chris Smowton
de9648e515 Accept test changes
- generics gains extra excluded generic "specialisations" (specifically raw types)
- java_properties stops overwriting the Java extractor's output, which specifically flags isDefConstructor which kotlinc does not
- types naturally gains a lot of new raw types
2022-05-10 19:51:27 +01:00
Chris Smowton
239aab67b6 Populate the files table for generic class instances
This is because different instances might see the code in different locations (e.g., the class file exists in more than one jar) or with no location (seen as a .java file passed to kotlinc).

While I'm there, improve the order of checks and fix a trivial bug in withFileOfClass
2022-05-10 19:51:26 +01:00
Chris Smowton
db9ab22437 Erasure: produce raw types, not unbound types
This affects the trap labels for methods, and therefore consistency with the Java extractor.

TODO: check whether we can unify `erase` and `toRawType` entirely.
2022-05-10 19:51:26 +01:00
Chris Smowton
97d44d9583 Ensure external class extractions without a VirtualFile are lowest priority
Previously by using major version 0 to represent the no-virtual-file case these got highest priority. This meant that a class extracted relating to a .java file seen by the Kotlin compiler, which necessarily lacks a useful source-location, was highest priority. Now that should get overwritten whenever anybody sees it in the form of a .class
file, since this will have version information.

This should in particular eliminate the case where a generic class is extracted with no useful source location (based on .java source), then generic instances are extracted with a useful source location (based on a .class source), but the location isn't in the database.
2022-05-10 19:51:26 +01:00
Tamas Vajk
613d81d231 Extract static modifier and missing type access qualifier for static calls 2022-05-10 19:51:26 +01:00
Ian Lynagh
4cfda638cb Kotlin: Use -Xopt-in=kotlin.RequiresOptIn when compiling 2022-05-10 19:51:26 +01:00
Ian Lynagh
37cf36bc33 Kotlin: useDeclarationParent: Don't use fakeLabel 2022-05-10 19:51:26 +01:00
Ian Lynagh
5c8e0ff49b Kotlin: extractTypeParameter: Don't use fakeLabel 2022-05-10 19:51:26 +01:00
Tamás Vajk
48b6c61fdb Quality improvement: add explicit this in QL
Co-authored-by: Tony Torralba <atorralba@users.noreply.github.com>
2022-05-10 19:51:26 +01:00
Tamas Vajk
e0afaa462e Fix Parameter.getACallArgument for parameters of extension methods 2022-05-10 19:51:26 +01:00
Ian Lynagh
1e8d077522 Kotlin: Fix some warnings 2022-05-10 19:51:26 +01:00
Ian Lynagh
f75e711474 Kotlin: Make the build noisier
We need to capture output for some commands we run during the build,
but this ended up being refactored so that we ate the output for all
commands. This means that we don't see warnings from the compiler.

Now we not only show the output, but we also print what commands we are
running.
2022-05-10 19:51:26 +01:00
Ian Lynagh
05c062da99 Kotlin: Stop useValueDeclaration returning fakeLabel 2022-05-10 19:51:26 +01:00
Ian Lynagh
c5e73cd6df Kotlin: Add TypeResult.cast() 2022-05-10 19:51:26 +01:00
Ian Lynagh
86c31cb2e8 Kotlin: Add Label.cast() 2022-05-10 19:51:26 +01:00
Tamas Vajk
c89f3163f9 Revert PrintAst changes related to wrong locations 2022-05-10 19:51:26 +01:00
Tamas Vajk
026ce2a27a Fix location of parameters in methods of parameterized types 2022-05-10 19:51:26 +01:00
Tamas Vajk
bfcd553c6c Change location of properties inside parameterized types 2022-05-10 19:51:26 +01:00
Tamas Vajk
0726b6410f Change location of methods inside parameterized types 2022-05-10 19:51:26 +01:00
Tamas Vajk
3813e6fc10 Fix expected files 2022-05-10 19:51:26 +01:00
Tamas Vajk
acb310e46a Change parameterized type location to the class file 2022-05-10 19:51:26 +01:00
Tamas Vajk
53f484cd98 Add test for inconsistent generic instantiation locations 2022-05-10 19:51:26 +01:00
Tamas Vajk
49bf53da5d Make extracted file class public and final 2022-05-10 19:51:25 +01:00
Ian Lynagh
77fec17a36 Kotlin: Autoformat QL 2022-05-10 19:51:25 +01:00