Commit Graph

59 Commits

Author SHA1 Message Date
Anders Schack-Mulligen
6f40ac15b4 Java: Rename ReturnStmt.getResult to getExpr. 2026-02-04 14:43:31 +01:00
Kasper Svendsen
9cc6e9c8a9 Overlay: Add discarding for Java classes, interfaces & fields 2025-08-27 12:07:59 +02:00
Anders Schack-Mulligen
e94f018e14 Kotlin: Support kotlin Throws annotations. 2025-08-08 10:28:58 +02:00
Kasper Svendsen
64f27e2adf Java: Add abstraction for discardable locatables 2025-06-26 11:35:37 +02:00
Kasper Svendsen
0ee6a78a4a Java: Allow methods with empty bodies for overlay 2025-06-24 10:38:07 +02:00
Kasper Svendsen
6e92d7e247 Java: Add entity discard predicates 2025-06-24 10:38:06 +02:00
Kasper Svendsen
c207cfdeb7 Overlay: Add overlay annotations to Java & shared libraries 2025-06-24 10:25:06 +02:00
Ian Lynagh
bda779a58d Java: Deprecate Field.getSourceDeclaration() and Field.isSourceDeclaration()
Also follows the removal of the sourceid column of fields.
2024-09-24 14:06:54 +01:00
Chris Smowton
293cc67494 Fix stringifying record fields 2023-11-30 11:23:59 +00:00
Chris Smowton
ac38d4c9c6 Mass rename L/RValue -> VarWrite/Read 2023-10-24 10:58:29 +01:00
Chris Smowton
f552a15aae Mass-rename MethodAccess -> MethodCall 2023-10-24 10:30:26 +01:00
Anders Schack-Mulligen
410c09270f Java: Use nested names in MaD signatures. 2023-08-23 13:17:52 +02:00
Chuan-kai Lin
ce464a7d69 Remove pragma[assume_small_delta] 2023-06-30 11:09:29 -07:00
Anders Schack-Mulligen
9df2ee00d6 Java: Add SrcCallable.isImplicitlyPublic convenience predicate. 2023-04-27 15:20:49 +02:00
Anders Schack-Mulligen
934a455908 Apply suggestions from code review
Update qldoc.
2023-04-25 09:35:26 +02:00
Jami Cogswell
2ca8103a7e Java: remove isImplicitlyPublic predicate since not needed for this use-case 2023-04-20 16:19:15 -04:00
Jami Cogswell
5dbd11a584 Java: move veryPublic predicate 2023-04-20 16:19:15 -04:00
Jami Cogswell
2e76e12316 Java: add class and predicates to approximate an effectively public method 2023-04-20 16:19:15 -04:00
Chris Smowton
62d10f91d8 Improve join ordering 2023-02-14 17:21:24 +00:00
Tony Torralba
32471d326e Java: Remove omittable exists variables 2023-01-10 13:37:19 +01:00
Jami Cogswell
5113041623 Java: add isParameterless predicate to Constructor class 2022-12-12 13:28:00 -05:00
Tamas Vajk
6bcfdfca88 Adjust getExtensionReceiverParameterIndex predicate name and change note 2022-12-09 10:29:52 +01:00
Tamas Vajk
d93dce0fa9 Kotlin: Fix extension and dispatch parameter order in $default functions 2022-12-09 10:29:51 +01:00
Anders Schack-Mulligen
331b8c0144 Merge pull request #10904 from aschackmull/java/joinorders
Java: Fix some join-orders.
2022-11-04 09:24:31 +01:00
Chris Smowton
b9f4856d47 Merge pull request #10876 from smowton/smowton/feature/kotlin-default-method-auto-mad
Java models-as-data: infer Kotlin $default models from that of its parent function
2022-10-25 11:58:54 +01:00
Chris Smowton
1fe9e8457f Kotlin: Fix varargs dataflow, and varargs default handling
Dataflow requires accounting for the fact that the varargs parameter isn't necessarily last in the parameter list in a couple more places. Default handling just requires that if the only null parameter is the varargs argument, and it has no default value, then no $default method is required-- the caller is expected to simply pass nothing (at QL
/ source level) or an empty array (at JVM level).
2022-10-21 11:14:41 +01:00
Anders Schack-Mulligen
9ebcaf80e7 Java: Fix some join-orders. 2022-10-20 14:23:36 +02:00
Chris Smowton
b148e3168f Java models-as-data: infer Kotlin $default models from that of its parent function 2022-10-18 18:17:08 +01:00
Chris Smowton
e8a35983ee Implement Kotlin default interface method forwarding
Kotlin's implementation of defaults depends on the -Xjvm-default setting (or the @JvmDefault deprecated annotation, not implemented here): by default, actual interface class files don't use default method, and any class that would inherit one instead implements the interface calling a static method defined on TheInterface$DefaultImpls. With
-Xjvm-default=all or =all-compatibility, real interface default methods are emitted, with the latter retaining the DefaultImpls methods so that other Kotlin can use it.

Here I adopt a hybrid solution: create a real default method implementation, but also emit a forwarding method like `@override int f(int x) { return super.TheInterface.f(x); }`, because the Java extractor will see `MyClass.f` in the emitted class file and try to dispatch directly to it. The only downside is that we emit a default interface
method body for a prototype that will appear to be `abstract` to the Java extractor and which it will extract as such. I work around this by tolerating the combination `default abstract` in QL. The alternative would be to fully mimic the DefaultImpls approach, giving 100% fidelity to kotlinc's strategy and therefore no clash with the Java
extractor's view of the world.
2022-10-17 18:38:13 +01:00
Chris Smowton
3b49594c20 Kotlin: Add Callable.getKotlinParameterDefaultsProxy 2022-10-12 11:29:55 +01:00
Ian Lynagh
d735b9e6f2 Java: Format QL 2022-09-14 11:56:13 +01:00
Ian Lynagh
6a63b86f8a Java: Member.getQualifiedName() tweaked
It now includes the qualified name of the declaring type.
2022-09-13 16:05:51 +01:00
Ian Lynagh
501a9b3c6b Make *.qll non-executable 2022-08-24 16:36:15 +01:00
Tamas Vajk
b66a3141f6 Extract functions using their name from JvmName annotation 2022-05-10 19:51:30 +01:00
Tamas Vajk
d4701d72d9 Add DelegatedProperty QL class and use it in tests 2022-05-10 19:51:22 +01:00
Chris Smowton
13cd145a76 Retain Member.getInitializer for Kotlin programs
I opt to identify any syntactic initializer. These are broader in scope than Java's member initializers, which are necessarily context-free, whereas in Kotlin the primary constructor's parameters can be referred to.
2022-05-10 19:51:20 +01:00
Ian Lynagh
7862229807 Kotlin: Pull Kotlin type for params out into its own table 2022-05-10 19:51:15 +01:00
Ian Lynagh
dc26abe341 Kotlin: Pull Kotlin type for methods/constrs out into their own tables 2022-05-10 19:51:15 +01:00
Ian Lynagh
ee008773dc Kotlin: Pull Kotlin type for fields out into its own table 2022-05-10 19:51:15 +01:00
Tamas Vajk
ef2795c88b Add ktLocalFunction relation and tests for local and anonymous classes 2022-05-10 19:51:11 +01:00
Ian Lynagh
fb90c70e2e Kotlin: Extract visibility for properties 2022-05-10 19:51:11 +01:00
Ian Lynagh
e6e56238c5 Kotlin: Handle properties better 2022-05-10 19:51:03 +01:00
Ian Lynagh
e61ff60bf8 Kotlin: Add KotlinType to ExtensionMethod 2022-05-10 19:51:00 +01:00
Ian Lynagh
06a41b3923 Kotlin: Add KotlinTypes to arrays 2022-05-10 19:51:00 +01:00
Ian Lynagh
ef22194eed Kotlin: Add KotlinType to params 2022-05-10 19:51:00 +01:00
Ian Lynagh
0d5e471b96 Kotlin: Give methods and constructors a KotlinType 2022-05-10 19:51:00 +01:00
Ian Lynagh
c20ee76826 Kotlin: Give fields a Kotlin type
This meant refactoring the EnumEntry extraction a bit. The IR doesn't
give us a type for fields, so we have to make it up based on the parent.
2022-05-10 19:51:00 +01:00
Tamas Vajk
bf4fb13326 Revert extracting this and this@TYPE parameters 2022-05-10 18:45:58 +01:00
Tamas Vajk
3bfc93daab Add ExtensionMethod class 2022-05-10 18:45:58 +01:00
Tamas Vajk
b9e0310aa2 Java: Fix toString on field declarations with single field 2022-01-12 09:22:16 +01:00