diff --git a/.github/workflows/swift-codegen.yml b/.github/workflows/swift-codegen.yml index d5d74af87c2..46a27709717 100644 --- a/.github/workflows/swift-codegen.yml +++ b/.github/workflows/swift-codegen.yml @@ -15,18 +15,22 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/fetch-codeql - uses: bazelbuild/setup-bazelisk@v2 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 + name: Check that python code is properly formatted + with: + extra_args: autopep8 --all-files - name: Run unit tests run: | bazel test //swift/codegen/test --test_output=errors - - name: Check that QL generated code was checked in - run: | - bazel run //swift/codegen - git add swift - git diff --exit-code HEAD + - uses: pre-commit/action@v3.0.0 + name: Check that QL generated code was checked in + with: + extra_args: swift-codegen --all-files - name: Generate C++ files run: | - bazel run //swift/codegen:codegen -- --generate=trap,cpp --cpp-output=$PWD/swift-generated-headers + bazel run //swift/codegen:codegen -- --generate=trap,cpp --cpp-output=$PWD/swift-generated-cpp-files - uses: actions/upload-artifact@v3 with: - name: swift-generated-headers - path: swift-generated-headers/*.h + name: swift-generated-cpp-files + path: swift-generated-cpp-files/** diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b44de000fb..d51681aa65c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,6 +15,12 @@ repos: - id: clang-format files: ^swift/.*\.(h|c|cpp)$ + - repo: https://github.com/pre-commit/mirrors-autopep8 + rev: v1.6.0 + hooks: + - id: autopep8 + files: ^swift/codegen/.*\.py + - repo: local hooks: - id: codeql-format diff --git a/config/identical-files.json b/config/identical-files.json index 53d3b74b3b0..81e07fe48cf 100644 --- a/config/identical-files.json +++ b/config/identical-files.json @@ -454,11 +454,11 @@ "python/ql/src/Lexical/CommentedOutCodeReferences.inc.qhelp" ], "IDE Contextual Queries": [ - "cpp/ql/src/IDEContextual.qll", - "csharp/ql/src/IDEContextual.qll", - "java/ql/src/IDEContextual.qll", - "javascript/ql/src/IDEContextual.qll", - "python/ql/src/analysis/IDEContextual.qll" + "cpp/ql/lib/IDEContextual.qll", + "csharp/ql/lib/IDEContextual.qll", + "java/ql/lib/IDEContextual.qll", + "javascript/ql/lib/IDEContextual.qll", + "python/ql/lib/analysis/IDEContextual.qll" ], "SSA C#": [ "csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImplCommon.qll", diff --git a/cpp/ql/lib/CHANGELOG.md b/cpp/ql/lib/CHANGELOG.md index 52dd2c7a843..c1cefbed8f9 100644 --- a/cpp/ql/lib/CHANGELOG.md +++ b/cpp/ql/lib/CHANGELOG.md @@ -1,3 +1,13 @@ +## 0.3.0 + +### Deprecated APIs + +* The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module. + +### Bug Fixes + +* `UserType.getADeclarationEntry()` now yields all forward declarations when the user type is a `class`, `struct`, or `union`. + ## 0.2.3 ### New Features diff --git a/cpp/ql/src/IDEContextual.qll b/cpp/ql/lib/IDEContextual.qll similarity index 100% rename from cpp/ql/src/IDEContextual.qll rename to cpp/ql/lib/IDEContextual.qll diff --git a/cpp/ql/lib/change-notes/2022-05-30-braced-initializers.md b/cpp/ql/lib/change-notes/2022-05-30-braced-initializers.md deleted file mode 100644 index 8a31f06ab98..00000000000 --- a/cpp/ql/lib/change-notes/2022-05-30-braced-initializers.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: feature ---- -* An `isBraced` predicate was added to the `Initializer` class which holds when a C++ braced initializer was used in the initialization. diff --git a/cpp/ql/lib/change-notes/2022-06-22-class-declaration-entry-fix.md b/cpp/ql/lib/change-notes/2022-06-22-class-declaration-entry-fix.md deleted file mode 100644 index fb301705e79..00000000000 --- a/cpp/ql/lib/change-notes/2022-06-22-class-declaration-entry-fix.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: fix ---- -* `UserType.getADeclarationEntry()` now yields all forward declarations when the user type is a `class`, `struct`, or `union`. diff --git a/cpp/ql/lib/change-notes/released/0.3.0.md b/cpp/ql/lib/change-notes/released/0.3.0.md new file mode 100644 index 00000000000..8c45dc21817 --- /dev/null +++ b/cpp/ql/lib/change-notes/released/0.3.0.md @@ -0,0 +1,9 @@ +## 0.3.0 + +### Deprecated APIs + +* The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module. + +### Bug Fixes + +* `UserType.getADeclarationEntry()` now yields all forward declarations when the user type is a `class`, `struct`, or `union`. diff --git a/cpp/ql/lib/codeql-pack.release.yml b/cpp/ql/lib/codeql-pack.release.yml index 0b605901b42..95f6e3a0ba6 100644 --- a/cpp/ql/lib/codeql-pack.release.yml +++ b/cpp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.2.3 +lastReleaseVersion: 0.3.0 diff --git a/cpp/ql/src/definitions.qll b/cpp/ql/lib/definitions.qll similarity index 100% rename from cpp/ql/src/definitions.qll rename to cpp/ql/lib/definitions.qll diff --git a/cpp/ql/src/localDefinitions.ql b/cpp/ql/lib/localDefinitions.ql similarity index 100% rename from cpp/ql/src/localDefinitions.ql rename to cpp/ql/lib/localDefinitions.ql diff --git a/cpp/ql/src/localReferences.ql b/cpp/ql/lib/localReferences.ql similarity index 100% rename from cpp/ql/src/localReferences.ql rename to cpp/ql/lib/localReferences.ql diff --git a/cpp/ql/src/printAst.ql b/cpp/ql/lib/printAst.ql similarity index 100% rename from cpp/ql/src/printAst.ql rename to cpp/ql/lib/printAst.ql diff --git a/cpp/ql/lib/qlpack.yml b/cpp/ql/lib/qlpack.yml index 28cddcb3b00..a20077271d7 100644 --- a/cpp/ql/lib/qlpack.yml +++ b/cpp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-all -version: 0.3.0-dev +version: 0.3.1-dev groups: cpp dbscheme: semmlecode.cpp.dbscheme extractor: cpp diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl4.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplLocal.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl2.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl3.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowImpl4.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/cpp/ql/src/CHANGELOG.md b/cpp/ql/src/CHANGELOG.md index 449af46b6b8..2b404ff5288 100644 --- a/cpp/ql/src/CHANGELOG.md +++ b/cpp/ql/src/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.2.0 + ## 0.1.4 ## 0.1.3 diff --git a/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql b/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql index c72e25f61df..bd55008677c 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql @@ -18,7 +18,7 @@ import semmle.code.cpp.ir.IR import semmle.code.cpp.ir.dataflow.MustFlow import PathGraph -/** Holds if `f` has a name that we intrepret as evidence of intentionally returning the value of the stack pointer. */ +/** Holds if `f` has a name that we interpret as evidence of intentionally returning the value of the stack pointer. */ predicate intentionallyReturnsStackPointer(Function f) { f.getName().toLowerCase().matches(["%stack%", "%sp%"]) } diff --git a/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql b/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql index 27aeabbaf49..3f3997315d4 100644 --- a/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql +++ b/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql @@ -133,7 +133,9 @@ TGlobalAddress globalAddress(Instruction instr) { ) or exists(FieldAddressInstruction fai | instr = fai | - result = TFieldAddress(globalAddress(fai.getObjectAddress()), fai.getField()) + result = + TFieldAddress(globalAddress(pragma[only_bind_into](fai.getObjectAddress())), + pragma[only_bind_out](fai.getField())) ) or result = globalAddress(instr.(PointerOffsetInstruction).getLeft()) diff --git a/cpp/ql/src/change-notes/2022-06-29-move-contextual-queries.md b/cpp/ql/src/change-notes/2022-06-29-move-contextual-queries.md new file mode 100644 index 00000000000..cc5464d58b3 --- /dev/null +++ b/cpp/ql/src/change-notes/2022-06-29-move-contextual-queries.md @@ -0,0 +1,4 @@ +--- +category: breaking +--- +* Contextual queries and the query libraries they depend on have been moved to the `codeql/cpp-all` package. diff --git a/cpp/ql/src/change-notes/released/0.2.0.md b/cpp/ql/src/change-notes/released/0.2.0.md new file mode 100644 index 00000000000..79a5f33514f --- /dev/null +++ b/cpp/ql/src/change-notes/released/0.2.0.md @@ -0,0 +1 @@ +## 0.2.0 diff --git a/cpp/ql/src/codeql-pack.release.yml b/cpp/ql/src/codeql-pack.release.yml index e8ee3af8ef9..5274e27ed52 100644 --- a/cpp/ql/src/codeql-pack.release.yml +++ b/cpp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.1.4 +lastReleaseVersion: 0.2.0 diff --git a/cpp/ql/src/qlpack.yml b/cpp/ql/src/qlpack.yml index a373e4717d8..62cac967801 100644 --- a/cpp/ql/src/qlpack.yml +++ b/cpp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/cpp-queries -version: 0.2.0-dev +version: 0.2.1-dev groups: - cpp - queries diff --git a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md index 0bb47844d19..30c583ee913 100644 --- a/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.2.0 + ## 1.1.4 ## 1.1.3 diff --git a/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.2.0.md b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.2.0.md new file mode 100644 index 00000000000..0ff42339575 --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/lib/change-notes/released/1.2.0.md @@ -0,0 +1 @@ +## 1.2.0 diff --git a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml index 26cbcd3f123..75430e73d1c 100644 --- a/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.4 +lastReleaseVersion: 1.2.0 diff --git a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml index 9cb7bec181f..bc7eaf4142c 100644 --- a/csharp/ql/campaigns/Solorigate/lib/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-all -version: 1.2.0-dev +version: 1.2.1-dev groups: - csharp - solorigate diff --git a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md index 0bb47844d19..30c583ee913 100644 --- a/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md +++ b/csharp/ql/campaigns/Solorigate/src/CHANGELOG.md @@ -1,3 +1,5 @@ +## 1.2.0 + ## 1.1.4 ## 1.1.3 diff --git a/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.2.0.md b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.2.0.md new file mode 100644 index 00000000000..0ff42339575 --- /dev/null +++ b/csharp/ql/campaigns/Solorigate/src/change-notes/released/1.2.0.md @@ -0,0 +1 @@ +## 1.2.0 diff --git a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml index 26cbcd3f123..75430e73d1c 100644 --- a/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml +++ b/csharp/ql/campaigns/Solorigate/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 1.1.4 +lastReleaseVersion: 1.2.0 diff --git a/csharp/ql/campaigns/Solorigate/src/qlpack.yml b/csharp/ql/campaigns/Solorigate/src/qlpack.yml index 07419f1b469..00725e23666 100644 --- a/csharp/ql/campaigns/Solorigate/src/qlpack.yml +++ b/csharp/ql/campaigns/Solorigate/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-solorigate-queries -version: 1.2.0-dev +version: 1.2.1-dev groups: - csharp - solorigate diff --git a/csharp/ql/lib/CHANGELOG.md b/csharp/ql/lib/CHANGELOG.md index 3df8b95eeb6..3f49fe5ade3 100644 --- a/csharp/ql/lib/CHANGELOG.md +++ b/csharp/ql/lib/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.3.0 + +### Deprecated APIs + +* The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module. + ## 0.2.3 ## 0.2.2 diff --git a/csharp/ql/src/IDEContextual.qll b/csharp/ql/lib/IDEContextual.qll similarity index 100% rename from csharp/ql/src/IDEContextual.qll rename to csharp/ql/lib/IDEContextual.qll diff --git a/go/ql/lib/change-notes/2022-06-21-barrierguard-deprecation.md b/csharp/ql/lib/change-notes/released/0.3.0.md similarity index 83% rename from go/ql/lib/change-notes/2022-06-21-barrierguard-deprecation.md rename to csharp/ql/lib/change-notes/released/0.3.0.md index 2bd95798f89..54af6e00ac0 100644 --- a/go/ql/lib/change-notes/2022-06-21-barrierguard-deprecation.md +++ b/csharp/ql/lib/change-notes/released/0.3.0.md @@ -1,4 +1,5 @@ ---- -category: deprecated ---- +## 0.3.0 + +### Deprecated APIs + * The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module. diff --git a/csharp/ql/lib/codeql-pack.release.yml b/csharp/ql/lib/codeql-pack.release.yml index 0b605901b42..95f6e3a0ba6 100644 --- a/csharp/ql/lib/codeql-pack.release.yml +++ b/csharp/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.2.3 +lastReleaseVersion: 0.3.0 diff --git a/csharp/ql/src/definitions.qll b/csharp/ql/lib/definitions.qll similarity index 100% rename from csharp/ql/src/definitions.qll rename to csharp/ql/lib/definitions.qll diff --git a/csharp/ql/src/localDefinitions.ql b/csharp/ql/lib/localDefinitions.ql similarity index 100% rename from csharp/ql/src/localDefinitions.ql rename to csharp/ql/lib/localDefinitions.ql diff --git a/csharp/ql/src/localReferences.ql b/csharp/ql/lib/localReferences.ql similarity index 100% rename from csharp/ql/src/localReferences.ql rename to csharp/ql/lib/localReferences.ql diff --git a/csharp/ql/src/printAst.ql b/csharp/ql/lib/printAst.ql similarity index 100% rename from csharp/ql/src/printAst.ql rename to csharp/ql/lib/printAst.ql diff --git a/csharp/ql/lib/qlpack.yml b/csharp/ql/lib/qlpack.yml index 2e2d17e36fa..3f371c01e92 100644 --- a/csharp/ql/lib/qlpack.yml +++ b/csharp/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-all -version: 0.3.0-dev +version: 0.3.1-dev groups: csharp dbscheme: semmlecode.csharp.dbscheme extractor: csharp diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl2.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl3.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl4.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImpl5.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplForContentDataFlow.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplForContentDataFlow.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplForContentDataFlow.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplForContentDataFlow.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/csharp/ql/src/CHANGELOG.md b/csharp/ql/src/CHANGELOG.md index bc553b74fe4..e7ce0b0b471 100644 --- a/csharp/ql/src/CHANGELOG.md +++ b/csharp/ql/src/CHANGELOG.md @@ -1,3 +1,14 @@ +## 0.2.0 + +### Query Metadata Changes + +* The `kind` query metadata was changed to `diagnostic` on `cs/compilation-error`, `cs/compilation-message`, `cs/extraction-error`, and `cs/extraction-message`. + +### Minor Analysis Improvements + +* The syntax of the (source|sink|summary)model CSV format has been changed slightly for Java and C#. A new column called `provenance` has been introduced, where the allowed values are `manual` and `generated`. The value used to indicate whether a model as been written by hand (`manual`) or create by the CSV model generator (`generated`). +* All auto implemented public properties with public getters and setters on ASP.NET Core remote flow sources are now also considered to be tainted. + ## 0.1.4 ## 0.1.3 diff --git a/csharp/ql/src/change-notes/2022-06-02-aspnetcoretaintedmembers.md b/csharp/ql/src/change-notes/2022-06-02-aspnetcoretaintedmembers.md deleted file mode 100644 index b80e90e0434..00000000000 --- a/csharp/ql/src/change-notes/2022-06-02-aspnetcoretaintedmembers.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* All auto implemented public properties with public getters and setters on ASP.NET Core remote flow sources are now also considered to be tainted. \ No newline at end of file diff --git a/csharp/ql/src/change-notes/2022-06-14-madformatchange.md b/csharp/ql/src/change-notes/2022-06-14-madformatchange.md deleted file mode 100644 index 1dd215a89c7..00000000000 --- a/csharp/ql/src/change-notes/2022-06-14-madformatchange.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -* The syntax of the (source|sink|summary)model CSV format has been changed slightly for Java and C#. A new column called `provenance` has been introduced, where the allowed values are `manual` and `generated`. The value used to indicate whether a model as been written by hand (`manual`) or create by the CSV model generator (`generated`). \ No newline at end of file diff --git a/csharp/ql/src/change-notes/2022-06-15-diagnostic-query-metadata.md b/csharp/ql/src/change-notes/2022-06-15-diagnostic-query-metadata.md deleted file mode 100644 index d5cfc4d35e1..00000000000 --- a/csharp/ql/src/change-notes/2022-06-15-diagnostic-query-metadata.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: queryMetadata ---- -* The `kind` query metadata was changed to `diagnostic` on `cs/compilation-error`, `cs/compilation-message`, `cs/extraction-error`, and `cs/extraction-message`. diff --git a/csharp/ql/src/change-notes/2022-06-29-move-contextual-queries.md b/csharp/ql/src/change-notes/2022-06-29-move-contextual-queries.md new file mode 100644 index 00000000000..a27c68766c0 --- /dev/null +++ b/csharp/ql/src/change-notes/2022-06-29-move-contextual-queries.md @@ -0,0 +1,4 @@ +--- +category: breaking +--- +* Contextual queries and the query libraries they depend on have been moved to the `codeql/csharp-all` package. diff --git a/csharp/ql/src/change-notes/released/0.2.0.md b/csharp/ql/src/change-notes/released/0.2.0.md new file mode 100644 index 00000000000..1b7d3928c1c --- /dev/null +++ b/csharp/ql/src/change-notes/released/0.2.0.md @@ -0,0 +1,10 @@ +## 0.2.0 + +### Query Metadata Changes + +* The `kind` query metadata was changed to `diagnostic` on `cs/compilation-error`, `cs/compilation-message`, `cs/extraction-error`, and `cs/extraction-message`. + +### Minor Analysis Improvements + +* The syntax of the (source|sink|summary)model CSV format has been changed slightly for Java and C#. A new column called `provenance` has been introduced, where the allowed values are `manual` and `generated`. The value used to indicate whether a model as been written by hand (`manual`) or create by the CSV model generator (`generated`). +* All auto implemented public properties with public getters and setters on ASP.NET Core remote flow sources are now also considered to be tainted. diff --git a/csharp/ql/src/codeql-pack.release.yml b/csharp/ql/src/codeql-pack.release.yml index e8ee3af8ef9..5274e27ed52 100644 --- a/csharp/ql/src/codeql-pack.release.yml +++ b/csharp/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.1.4 +lastReleaseVersion: 0.2.0 diff --git a/csharp/ql/src/qlpack.yml b/csharp/ql/src/qlpack.yml index a9d6dcf0e69..1002c6a56ad 100644 --- a/csharp/ql/src/qlpack.yml +++ b/csharp/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/csharp-queries -version: 0.2.0-dev +version: 0.2.1-dev groups: - csharp - queries diff --git a/docs/codeql/reusables/beta-note-package-management.rst b/docs/codeql/reusables/beta-note-package-management.rst index a4fd362a70c..7697c9a47d9 100644 --- a/docs/codeql/reusables/beta-note-package-management.rst +++ b/docs/codeql/reusables/beta-note-package-management.rst @@ -2,4 +2,4 @@ Note - The CodeQL package management functionality, including CodeQL packs, is currently available as a beta release and is subject to change. During the beta release, CodeQL packs are available only using GitHub Packages - the GitHub Container registry. To use this beta functionality, install version 2.6.0 or higher of the CodeQL CLI bundle from: https://github.com/github/codeql-action/releases. \ No newline at end of file + The CodeQL package management functionality, including CodeQL packs, is currently available as a beta release and is subject to change. During the beta release, CodeQL packs are available only using GitHub Packages - the GitHub Container registry. To use this beta functionality, install the latest version of the CodeQL CLI bundle from: https://github.com/github/codeql-action/releases. diff --git a/go/ql/lib/CHANGELOG.md b/go/ql/lib/CHANGELOG.md index 1767b297fc6..112f4fab585 100644 --- a/go/ql/lib/CHANGELOG.md +++ b/go/ql/lib/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.2.0 + +### Deprecated APIs + +* The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module. + ## 0.1.4 ## 0.1.3 diff --git a/cpp/ql/lib/change-notes/2022-06-21-barrierguard-deprecation.md b/go/ql/lib/change-notes/released/0.2.0.md similarity index 83% rename from cpp/ql/lib/change-notes/2022-06-21-barrierguard-deprecation.md rename to go/ql/lib/change-notes/released/0.2.0.md index 2bd95798f89..ded60d11b7e 100644 --- a/cpp/ql/lib/change-notes/2022-06-21-barrierguard-deprecation.md +++ b/go/ql/lib/change-notes/released/0.2.0.md @@ -1,4 +1,5 @@ ---- -category: deprecated ---- +## 0.2.0 + +### Deprecated APIs + * The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module. diff --git a/go/ql/lib/codeql-pack.release.yml b/go/ql/lib/codeql-pack.release.yml index e8ee3af8ef9..5274e27ed52 100644 --- a/go/ql/lib/codeql-pack.release.yml +++ b/go/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.1.4 +lastReleaseVersion: 0.2.0 diff --git a/go/ql/lib/qlpack.yml b/go/ql/lib/qlpack.yml index f416a2612a8..964f5d4dd13 100644 --- a/go/ql/lib/qlpack.yml +++ b/go/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-all -version: 0.2.0-dev +version: 0.2.1-dev groups: go dbscheme: go.dbscheme extractor: go diff --git a/go/ql/src/CHANGELOG.md b/go/ql/src/CHANGELOG.md index 541c8c95377..bed2509f5d3 100644 --- a/go/ql/src/CHANGELOG.md +++ b/go/ql/src/CHANGELOG.md @@ -1,3 +1,5 @@ +## 0.2.0 + ## 0.1.4 ## 0.1.3 diff --git a/go/ql/src/change-notes/released/0.2.0.md b/go/ql/src/change-notes/released/0.2.0.md new file mode 100644 index 00000000000..79a5f33514f --- /dev/null +++ b/go/ql/src/change-notes/released/0.2.0.md @@ -0,0 +1 @@ +## 0.2.0 diff --git a/go/ql/src/codeql-pack.release.yml b/go/ql/src/codeql-pack.release.yml index e8ee3af8ef9..5274e27ed52 100644 --- a/go/ql/src/codeql-pack.release.yml +++ b/go/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.1.4 +lastReleaseVersion: 0.2.0 diff --git a/go/ql/src/qlpack.yml b/go/ql/src/qlpack.yml index 062631cb68b..80a4430b8da 100644 --- a/go/ql/src/qlpack.yml +++ b/go/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/go-queries -version: 0.2.0-dev +version: 0.2.1-dev groups: - go - queries diff --git a/java/documentation/library-coverage/coverage.csv b/java/documentation/library-coverage/coverage.csv index b9d52d9d75e..06ec8d978d4 100644 --- a/java/documentation/library-coverage/coverage.csv +++ b/java/documentation/library-coverage/coverage.csv @@ -1,121 +1,121 @@ -package,sink,source,summary,sink:bean-validation,sink:create-file,sink:groovy,sink:header-splitting,sink:information-leak,sink:intent-start,sink:jdbc-url,sink:jexl,sink:jndi-injection,sink:ldap,sink:logging,sink:mvel,sink:ognl-injection,sink:open-url,sink:pending-intent-sent,sink:regex-use[-1],sink:regex-use[0],sink:regex-use[],sink:regex-use[f-1],sink:regex-use[f1],sink:regex-use[f],sink:set-hostname-verifier,sink:sql,sink:url-open-stream,sink:url-redirect,sink:write-file,sink:xpath,sink:xslt,sink:xss,source:android-widget,source:contentprovider,source:remote,summary:taint,summary:value -android.app,16,,103,,,,,,7,,,,,,,,,9,,,,,,,,,,,,,,,,,,18,85 -android.content,24,27,108,,,,,,16,,,,,,,,,,,,,,,,,8,,,,,,,,27,,31,77 -android.database,59,,30,,,,,,,,,,,,,,,,,,,,,,,59,,,,,,,,,,30, -android.net,,,60,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,45,15 -android.os,,,122,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,41,81 -android.util,6,16,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,16,, -android.webkit,3,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,,,2,, -android.widget,,1,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1, -androidx.slice,2,5,88,,,,,,,,,,,,,,,2,,,,,,,,,,,,,,,,5,,27,61 -cn.hutool.core.codec,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, -com.esotericsoftware.kryo.io,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, -com.esotericsoftware.kryo5.io,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, -com.fasterxml.jackson.core,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, -com.fasterxml.jackson.databind,,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6, -com.google.common.base,4,,85,,,,,,,,,,,,,,,,,3,1,,,,,,,,,,,,,,,62,23 -com.google.common.cache,,,17,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,17 -com.google.common.collect,,,553,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,551 -com.google.common.flogger,29,,,,,,,,,,,,,29,,,,,,,,,,,,,,,,,,,,,,, -com.google.common.io,6,,73,,,,,,,,,,,,,,,,,,,,,,,,6,,,,,,,,,72,1 -com.opensymphony.xwork2.ognl,3,,,,,,,,,,,,,,,3,,,,,,,,,,,,,,,,,,,,, -com.rabbitmq.client,,21,7,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,21,7, -com.unboundid.ldap.sdk,17,,,,,,,,,,,,17,,,,,,,,,,,,,,,,,,,,,,,, -com.zaxxer.hikari,2,,,,,,,,,2,,,,,,,,,,,,,,,,,,,,,,,,,,, -flexjson,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1 -groovy.lang,26,,,,,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -groovy.util,5,,,,,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -jakarta.faces.context,2,7,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,,,7,, -jakarta.json,,,123,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100,23 -jakarta.ws.rs.client,1,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,, -jakarta.ws.rs.container,,9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9,, -jakarta.ws.rs.core,2,,149,,,,,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,94,55 -java.beans,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, -java.io,37,,39,,15,,,,,,,,,,,,,,,,,,,,,,,,22,,,,,,,39, -java.lang,13,,58,,,,,,,,,,,8,,,,,4,,,1,,,,,,,,,,,,,,46,12 -java.net,10,3,7,,,,,,,,,,,,,,10,,,,,,,,,,,,,,,,,,3,7, -java.nio,15,,6,,13,,,,,,,,,,,,,,,,,,,,,,,,2,,,,,,,6, -java.sql,11,,,,,,,,,4,,,,,,,,,,,,,,,,7,,,,,,,,,,, -java.util,44,,438,,,,,,,,,,,34,,,,,,5,2,,1,2,,,,,,,,,,,,24,414 -javax.faces.context,2,7,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,,,7,, -javax.jms,,9,57,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9,57, -javax.json,,,123,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100,23 -javax.management.remote,2,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,,,,,,,, -javax.naming,7,,,,,,,,,,,6,1,,,,,,,,,,,,,,,,,,,,,,,, -javax.net.ssl,2,,,,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,,,,, -javax.script,1,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,, -javax.servlet,4,21,2,,,,3,1,,,,,,,,,,,,,,,,,,,,,,,,,,,21,2, -javax.validation,1,1,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,, -javax.ws.rs.client,1,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,, -javax.ws.rs.container,,9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9,, -javax.ws.rs.core,3,,149,,,,1,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,94,55 -javax.xml.transform,1,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,,,6, -javax.xml.xpath,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,,,,,,, -jodd.json,,,10,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10 -kotlin.jvm.internal,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1 -net.sf.saxon.s9api,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,5,,,,,, -ognl,6,,,,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,, -okhttp3,2,,47,,,,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,,22,25 -org.apache.commons.codec,,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6, -org.apache.commons.collections,,,800,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,17,783 -org.apache.commons.collections4,,,800,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,17,783 -org.apache.commons.io,104,,561,,89,,,,,,,,,,,,15,,,,,,,,,,,,,,,,,,,547,14 -org.apache.commons.jexl2,15,,,,,,,,,,15,,,,,,,,,,,,,,,,,,,,,,,,,, -org.apache.commons.jexl3,15,,,,,,,,,,15,,,,,,,,,,,,,,,,,,,,,,,,,, -org.apache.commons.lang3,,,424,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,293,131 -org.apache.commons.logging,6,,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,,, -org.apache.commons.ognl,6,,,,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,, -org.apache.commons.text,,,272,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,220,52 -org.apache.directory.ldap.client.api,1,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,, -org.apache.hc.core5.function,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, -org.apache.hc.core5.http,1,2,39,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,2,39, -org.apache.hc.core5.net,,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2, -org.apache.hc.core5.util,,,24,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,18,6 -org.apache.http,27,3,70,,,,,,,,,,,,,,25,,,,,,,,,,,,,,,2,,,3,62,8 -org.apache.ibatis.jdbc,6,,57,,,,,,,,,,,,,,,,,,,,,,,6,,,,,,,,,,57, -org.apache.log4j,11,,,,,,,,,,,,,11,,,,,,,,,,,,,,,,,,,,,,, -org.apache.logging.log4j,359,,8,,,,,,,,,,,359,,,,,,,,,,,,,,,,,,,,,,4,4 -org.apache.shiro.codec,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, -org.apache.shiro.jndi,1,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,, -org.codehaus.groovy.control,1,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -org.dom4j,20,,,,,,,,,,,,,,,,,,,,,,,,,,,,,20,,,,,,, -org.hibernate,7,,,,,,,,,,,,,,,,,,,,,,,,,7,,,,,,,,,,, -org.jboss.logging,324,,,,,,,,,,,,,324,,,,,,,,,,,,,,,,,,,,,,, -org.jdbi.v3.core,6,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,,,,,,, -org.jooq,1,,,,,,,,,,,,,,,,,,,,,,,,,1,,,,,,,,,,, -org.json,,,236,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,198,38 -org.mvel2,16,,,,,,,,,,,,,,16,,,,,,,,,,,,,,,,,,,,,, -org.scijava.log,13,,,,,,,,,,,,,13,,,,,,,,,,,,,,,,,,,,,,, -org.slf4j,55,,6,,,,,,,,,,,55,,,,,,,,,,,,,,,,,,,,,,2,4 -org.springframework.beans,,,30,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,30 -org.springframework.boot.jdbc,1,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,, -org.springframework.cache,,,13,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,13 -org.springframework.context,,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3, -org.springframework.http,14,,70,,,,,,,,,,,,,,14,,,,,,,,,,,,,,,,,,,60,10 -org.springframework.jdbc.core,10,,,,,,,,,,,,,,,,,,,,,,,,,10,,,,,,,,,,, -org.springframework.jdbc.datasource,4,,,,,,,,,4,,,,,,,,,,,,,,,,,,,,,,,,,,, -org.springframework.jdbc.object,9,,,,,,,,,,,,,,,,,,,,,,,,,9,,,,,,,,,,, -org.springframework.jndi,1,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,, -org.springframework.ldap,47,,,,,,,,,,,33,14,,,,,,,,,,,,,,,,,,,,,,,, -org.springframework.security.web.savedrequest,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6,, -org.springframework.ui,,,32,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,32 -org.springframework.util,,,139,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,87,52 -org.springframework.validation,,,13,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,13, -org.springframework.web.client,13,3,,,,,,,,,,,,,,,13,,,,,,,,,,,,,,,,,,3,, -org.springframework.web.context.request,,8,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,, -org.springframework.web.multipart,,12,13,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,13, -org.springframework.web.reactive.function.client,2,,,,,,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,,, -org.springframework.web.util,,,163,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,138,25 -org.xml.sax,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, -org.xmlpull.v1,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,, -play.mvc,,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,, -ratpack.core.form,,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3, -ratpack.core.handling,,6,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6,4, -ratpack.core.http,,10,10,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10, -ratpack.exec,,,48,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,48 -ratpack.form,,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3, -ratpack.func,,,35,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,35 -ratpack.handling,,6,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6,4, -ratpack.http,,10,10,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10, -ratpack.util,,,35,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,35 -retrofit2,1,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,, +package,sink,source,summary,sink:bean-validation,sink:create-file,sink:groovy,sink:header-splitting,sink:information-leak,sink:intent-start,sink:jdbc-url,sink:jexl,sink:jndi-injection,sink:ldap,sink:logging,sink:mvel,sink:ognl-injection,sink:open-url,sink:pending-intent-sent,sink:regex-use[-1],sink:regex-use[0],sink:regex-use[],sink:regex-use[f-1],sink:regex-use[f1],sink:regex-use[f],sink:set-hostname-verifier,sink:sql,sink:url-open-stream,sink:url-redirect,sink:write-file,sink:xpath,sink:xslt,sink:xss,source:android-external-storage-dir,source:android-widget,source:contentprovider,source:remote,summary:taint,summary:value +android.app,16,,103,,,,,,7,,,,,,,,,9,,,,,,,,,,,,,,,,,,,18,85 +android.content,24,31,108,,,,,,16,,,,,,,,,,,,,,,,,8,,,,,,,4,,27,,31,77 +android.database,59,,30,,,,,,,,,,,,,,,,,,,,,,,59,,,,,,,,,,,30, +android.net,,,60,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,45,15 +android.os,,2,122,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,,,,41,81 +android.util,6,16,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,,16,, +android.webkit,3,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,,,,2,, +android.widget,,1,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,1, +androidx.slice,2,5,88,,,,,,,,,,,,,,,2,,,,,,,,,,,,,,,,,5,,27,61 +cn.hutool.core.codec,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, +com.esotericsoftware.kryo.io,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, +com.esotericsoftware.kryo5.io,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, +com.fasterxml.jackson.core,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, +com.fasterxml.jackson.databind,,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6, +com.google.common.base,4,,85,,,,,,,,,,,,,,,,,3,1,,,,,,,,,,,,,,,,62,23 +com.google.common.cache,,,17,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,17 +com.google.common.collect,,,553,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,551 +com.google.common.flogger,29,,,,,,,,,,,,,29,,,,,,,,,,,,,,,,,,,,,,,, +com.google.common.io,6,,73,,,,,,,,,,,,,,,,,,,,,,,,6,,,,,,,,,,72,1 +com.opensymphony.xwork2.ognl,3,,,,,,,,,,,,,,,3,,,,,,,,,,,,,,,,,,,,,, +com.rabbitmq.client,,21,7,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,21,7, +com.unboundid.ldap.sdk,17,,,,,,,,,,,,17,,,,,,,,,,,,,,,,,,,,,,,,, +com.zaxxer.hikari,2,,,,,,,,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,, +flexjson,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1 +groovy.lang,26,,,,,26,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +groovy.util,5,,,,,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +jakarta.faces.context,2,7,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,,,,7,, +jakarta.json,,,123,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100,23 +jakarta.ws.rs.client,1,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,, +jakarta.ws.rs.container,,9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9,, +jakarta.ws.rs.core,2,,149,,,,,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,,94,55 +java.beans,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, +java.io,37,,39,,15,,,,,,,,,,,,,,,,,,,,,,,,22,,,,,,,,39, +java.lang,13,,58,,,,,,,,,,,8,,,,,4,,,1,,,,,,,,,,,,,,,46,12 +java.net,10,3,7,,,,,,,,,,,,,,10,,,,,,,,,,,,,,,,,,,3,7, +java.nio,15,,6,,13,,,,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,6, +java.sql,11,,,,,,,,,4,,,,,,,,,,,,,,,,7,,,,,,,,,,,, +java.util,44,,438,,,,,,,,,,,34,,,,,,5,2,,1,2,,,,,,,,,,,,,24,414 +javax.faces.context,2,7,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2,,,,7,, +javax.jms,,9,57,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9,57, +javax.json,,,123,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,100,23 +javax.management.remote,2,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,,,,,,,,, +javax.naming,7,,,,,,,,,,,6,1,,,,,,,,,,,,,,,,,,,,,,,,, +javax.net.ssl,2,,,,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,,,,,, +javax.script,1,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,, +javax.servlet,4,21,2,,,,3,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,21,2, +javax.validation,1,1,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,, +javax.ws.rs.client,1,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,, +javax.ws.rs.container,,9,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9,, +javax.ws.rs.core,3,,149,,,,1,,,,,,,,,,,,,,,,,,,,,2,,,,,,,,,94,55 +javax.xml.transform,1,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,,,,6, +javax.xml.xpath,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,,,,,,,, +jodd.json,,,10,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10 +kotlin.jvm.internal,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1 +net.sf.saxon.s9api,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,5,,,,,,, +ognl,6,,,,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,, +okhttp3,2,,47,,,,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,,,22,25 +org.apache.commons.codec,,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6, +org.apache.commons.collections,,,800,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,17,783 +org.apache.commons.collections4,,,800,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,17,783 +org.apache.commons.io,104,,561,,89,,,,,,,,,,,,15,,,,,,,,,,,,,,,,,,,,547,14 +org.apache.commons.jexl2,15,,,,,,,,,,15,,,,,,,,,,,,,,,,,,,,,,,,,,, +org.apache.commons.jexl3,15,,,,,,,,,,15,,,,,,,,,,,,,,,,,,,,,,,,,,, +org.apache.commons.lang3,,,424,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,293,131 +org.apache.commons.logging,6,,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,,,, +org.apache.commons.ognl,6,,,,,,,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,, +org.apache.commons.text,,,272,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,220,52 +org.apache.directory.ldap.client.api,1,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,, +org.apache.hc.core5.function,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, +org.apache.hc.core5.http,1,2,39,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,,,2,39, +org.apache.hc.core5.net,,,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2, +org.apache.hc.core5.util,,,24,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,18,6 +org.apache.http,27,3,70,,,,,,,,,,,,,,25,,,,,,,,,,,,,,,2,,,,3,62,8 +org.apache.ibatis.jdbc,6,,57,,,,,,,,,,,,,,,,,,,,,,,6,,,,,,,,,,,57, +org.apache.log4j,11,,,,,,,,,,,,,11,,,,,,,,,,,,,,,,,,,,,,,, +org.apache.logging.log4j,359,,8,,,,,,,,,,,359,,,,,,,,,,,,,,,,,,,,,,,4,4 +org.apache.shiro.codec,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, +org.apache.shiro.jndi,1,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,, +org.codehaus.groovy.control,1,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +org.dom4j,20,,,,,,,,,,,,,,,,,,,,,,,,,,,,,20,,,,,,,, +org.hibernate,7,,,,,,,,,,,,,,,,,,,,,,,,,7,,,,,,,,,,,, +org.jboss.logging,324,,,,,,,,,,,,,324,,,,,,,,,,,,,,,,,,,,,,,, +org.jdbi.v3.core,6,,,,,,,,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,, +org.jooq,1,,,,,,,,,,,,,,,,,,,,,,,,,1,,,,,,,,,,,, +org.json,,,236,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,198,38 +org.mvel2,16,,,,,,,,,,,,,,16,,,,,,,,,,,,,,,,,,,,,,, +org.scijava.log,13,,,,,,,,,,,,,13,,,,,,,,,,,,,,,,,,,,,,,, +org.slf4j,55,,6,,,,,,,,,,,55,,,,,,,,,,,,,,,,,,,,,,,2,4 +org.springframework.beans,,,30,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,30 +org.springframework.boot.jdbc,1,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,, +org.springframework.cache,,,13,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,13 +org.springframework.context,,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3, +org.springframework.http,14,,70,,,,,,,,,,,,,,14,,,,,,,,,,,,,,,,,,,,60,10 +org.springframework.jdbc.core,10,,,,,,,,,,,,,,,,,,,,,,,,,10,,,,,,,,,,,, +org.springframework.jdbc.datasource,4,,,,,,,,,4,,,,,,,,,,,,,,,,,,,,,,,,,,,, +org.springframework.jdbc.object,9,,,,,,,,,,,,,,,,,,,,,,,,,9,,,,,,,,,,,, +org.springframework.jndi,1,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,, +org.springframework.ldap,47,,,,,,,,,,,33,14,,,,,,,,,,,,,,,,,,,,,,,,, +org.springframework.security.web.savedrequest,,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6,, +org.springframework.ui,,,32,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,32 +org.springframework.util,,,139,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,87,52 +org.springframework.validation,,,13,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,13, +org.springframework.web.client,13,3,,,,,,,,,,,,,,,13,,,,,,,,,,,,,,,,,,,3,, +org.springframework.web.context.request,,8,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,8,, +org.springframework.web.multipart,,12,13,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,12,13, +org.springframework.web.reactive.function.client,2,,,,,,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,,,, +org.springframework.web.util,,,163,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,138,25 +org.xml.sax,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1, +org.xmlpull.v1,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,, +play.mvc,,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,, +ratpack.core.form,,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3, +ratpack.core.handling,,6,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6,4, +ratpack.core.http,,10,10,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10, +ratpack.exec,,,48,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,48 +ratpack.form,,,3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3, +ratpack.func,,,35,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,35 +ratpack.handling,,6,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6,4, +ratpack.http,,10,10,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,10,10, +ratpack.util,,,35,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,35 +retrofit2,1,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,, diff --git a/java/documentation/library-coverage/coverage.rst b/java/documentation/library-coverage/coverage.rst index cd8995b77d5..7b45a3115b1 100644 --- a/java/documentation/library-coverage/coverage.rst +++ b/java/documentation/library-coverage/coverage.rst @@ -7,7 +7,7 @@ Java framework & library support :widths: auto Framework / library,Package,Flow sources,Taint & value steps,Sinks (total),`CWE‑022` :sub:`Path injection`,`CWE‑036` :sub:`Path traversal`,`CWE‑079` :sub:`Cross-site scripting`,`CWE‑089` :sub:`SQL injection`,`CWE‑090` :sub:`LDAP injection`,`CWE‑094` :sub:`Code injection`,`CWE‑319` :sub:`Cleartext transmission` - Android,``android.*``,46,424,108,,,3,67,,, + Android,``android.*``,52,424,108,,,3,67,,, `Apache Commons Collections `_,"``org.apache.commons.collections``, ``org.apache.commons.collections4``",,1600,,,,,,,, `Apache Commons IO `_,``org.apache.commons.io``,,561,104,89,,,,,,15 `Apache Commons Lang `_,``org.apache.commons.lang3``,,424,,,,,,,, @@ -19,5 +19,5 @@ Java framework & library support Java extensions,"``javax.*``, ``jakarta.*``",63,609,32,,,4,,1,1,2 `Spring `_,``org.springframework.*``,29,476,101,,,,19,14,,29 Others,"``androidx.slice``, ``cn.hutool.core.codec``, ``com.esotericsoftware.kryo.io``, ``com.esotericsoftware.kryo5.io``, ``com.fasterxml.jackson.core``, ``com.fasterxml.jackson.databind``, ``com.opensymphony.xwork2.ognl``, ``com.rabbitmq.client``, ``com.unboundid.ldap.sdk``, ``com.zaxxer.hikari``, ``flexjson``, ``groovy.lang``, ``groovy.util``, ``jodd.json``, ``kotlin.jvm.internal``, ``net.sf.saxon.s9api``, ``ognl``, ``okhttp3``, ``org.apache.commons.codec``, ``org.apache.commons.jexl2``, ``org.apache.commons.jexl3``, ``org.apache.commons.logging``, ``org.apache.commons.ognl``, ``org.apache.directory.ldap.client.api``, ``org.apache.ibatis.jdbc``, ``org.apache.log4j``, ``org.apache.logging.log4j``, ``org.apache.shiro.codec``, ``org.apache.shiro.jndi``, ``org.codehaus.groovy.control``, ``org.dom4j``, ``org.hibernate``, ``org.jboss.logging``, ``org.jdbi.v3.core``, ``org.jooq``, ``org.mvel2``, ``org.scijava.log``, ``org.slf4j``, ``org.xml.sax``, ``org.xmlpull.v1``, ``play.mvc``, ``ratpack.core.form``, ``ratpack.core.handling``, ``ratpack.core.http``, ``ratpack.exec``, ``ratpack.form``, ``ratpack.func``, ``ratpack.handling``, ``ratpack.http``, ``ratpack.util``, ``retrofit2``",65,395,932,,,,14,18,,3 - Totals,,211,6410,1474,117,6,10,107,33,1,84 + Totals,,217,6410,1474,117,6,10,107,33,1,84 diff --git a/java/kotlin-extractor/build.gradle b/java/kotlin-extractor/build.gradle index a4bf5748c29..3926962fd3d 100644 --- a/java/kotlin-extractor/build.gradle +++ b/java/kotlin-extractor/build.gradle @@ -35,8 +35,8 @@ sourceSets { "utils/versions/v_1_5_21/*.kt", "utils/versions/v_1_5_31/*.kt", "utils/versions/v_1_6_10/*.kt", - "utils/versions/v_1_7_0-RC/*.kt", - // "utils/versions/v_1_6_20/*.kt", + "utils/versions/v_1_6_20/*.kt", + // "utils/versions/v_1_7_0/*.kt", ] } } diff --git a/java/kotlin-extractor/gradle.properties b/java/kotlin-extractor/gradle.properties index 69e0a36ba4c..16f621c2d74 100644 --- a/java/kotlin-extractor/gradle.properties +++ b/java/kotlin-extractor/gradle.properties @@ -1,5 +1,5 @@ kotlin.code.style=official -kotlinVersion=1.6.20 +kotlinVersion=1.7.0 GROUP=com.github.codeql VERSION_NAME=0.0.1 diff --git a/java/kotlin-extractor/kotlin_plugin_versions.py b/java/kotlin-extractor/kotlin_plugin_versions.py index bd60c019236..e84764dbefc 100755 --- a/java/kotlin-extractor/kotlin_plugin_versions.py +++ b/java/kotlin-extractor/kotlin_plugin_versions.py @@ -21,7 +21,7 @@ def version_string_to_tuple(version): m = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)(.*)', version) return tuple([int(m.group(i)) for i in range(1, 4)] + [m.group(4)]) -many_versions = [ '1.4.32', '1.5.0', '1.5.10', '1.5.21', '1.5.31', '1.6.10', '1.7.0-RC', '1.6.20' ] +many_versions = [ '1.4.32', '1.5.0', '1.5.10', '1.5.21', '1.5.31', '1.6.10', '1.6.20', '1.7.0' ] many_versions_tuples = [version_string_to_tuple(v) for v in many_versions] diff --git a/java/kotlin-extractor/src/main/kotlin/ExternalDeclExtractor.kt b/java/kotlin-extractor/src/main/kotlin/ExternalDeclExtractor.kt index 5edb16271c1..b1b2823b6b5 100644 --- a/java/kotlin-extractor/src/main/kotlin/ExternalDeclExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/ExternalDeclExtractor.kt @@ -6,9 +6,11 @@ import com.semmle.extractor.java.OdasaOutput import com.semmle.util.data.StringDigestor import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.util.fqNameWhenAvailable import org.jetbrains.kotlin.ir.util.isFileClass import org.jetbrains.kotlin.ir.util.packageFqName import org.jetbrains.kotlin.ir.util.parentClassOrNull +import org.jetbrains.kotlin.name.FqName import java.io.File import java.util.ArrayList import java.util.HashSet @@ -16,18 +18,20 @@ import java.util.zip.GZIPOutputStream class ExternalDeclExtractor(val logger: FileLogger, val invocationTrapFile: String, val sourceFilePath: String, val primitiveTypeMapping: PrimitiveTypeMapping, val pluginContext: IrPluginContext, val globalExtensionState: KotlinExtractorGlobalState, val diagnosticTrapWriter: TrapWriter) { - val externalDeclsDone = HashSet() + val declBinaryNames = HashMap() + val externalDeclsDone = HashSet>() val externalDeclWorkList = ArrayList>() val propertySignature = ";property" val fieldSignature = ";field" - fun extractLater(d: IrDeclaration, signature: String): Boolean { + fun extractLater(d: IrDeclarationWithName, signature: String): Boolean { if (d !is IrClass && !isExternalFileClassMember(d)) { logger.errorElement("External declaration is neither a class, nor a top-level declaration", d) return false } - val ret = externalDeclsDone.add(d) + val declBinaryName = declBinaryNames.getOrPut(d) { getIrDeclBinaryName(d) } + val ret = externalDeclsDone.add(Pair(declBinaryName, signature)) if (ret) externalDeclWorkList.add(Pair(d, signature)) return ret } diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt index 743c04bd33f..21b35fbcdd1 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt @@ -6,6 +6,7 @@ import com.github.codeql.utils.versions.functionN import com.github.codeql.utils.versions.getIrStubFromDescriptor import com.semmle.extractor.java.OdasaOutput import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext +import org.jetbrains.kotlin.backend.common.lower.parents import org.jetbrains.kotlin.backend.common.pop import org.jetbrains.kotlin.builtins.functions.BuiltInFunctionArity import org.jetbrains.kotlin.descriptors.* @@ -41,7 +42,7 @@ open class KotlinFileExtractor( globalExtensionState: KotlinExtractorGlobalState ): KotlinUsesExtractor(logger, tw, dependencyCollector, externalClassExtractor, primitiveTypeMapping, pluginContext, globalExtensionState) { - inline fun with(kind: String, element: IrElement, f: () -> T): T { + private inline fun with(kind: String, element: IrElement, f: () -> T): T { val name = when (element) { is IrFile -> element.name is IrDeclarationWithName -> element.name.asString() @@ -80,12 +81,13 @@ open class KotlinFileExtractor( } } - file.declarations.map { extractDeclaration(it, extractPrivateMembers = true, extractFunctionBodies = true) } + file.declarations.forEach { extractDeclaration(it, extractPrivateMembers = true, extractFunctionBodies = true) } extractStaticInitializer(file, null) CommentExtractor(this, file, tw.fileId).extract() } } + @OptIn(ObsoleteDescriptorBasedAPI::class) private fun isFake(d: IrDeclarationWithVisibility): Boolean { val visibility = d.visibility if (visibility is DelegatedDescriptorVisibility && visibility.delegate == Visibilities.InvisibleFake) { @@ -94,6 +96,9 @@ open class KotlinFileExtractor( if (d.isFakeOverride) { return true } + if ((d as? IrFunction)?.descriptor?.isHiddenToOvercomeSignatureClash == true) { + return true + } return false } @@ -177,7 +182,7 @@ open class KotlinFileExtractor( } } - fun extractTypeParameter(tp: IrTypeParameter, apparentIndex: Int, javaTypeParameter: JavaTypeParameter?): Label? { + private fun extractTypeParameter(tp: IrTypeParameter, apparentIndex: Int, javaTypeParameter: JavaTypeParameter?): Label? { with("type parameter", tp) { val parentId = getTypeParameterParentLabel(tp) ?: return null val id = tw.getLabelFor(getTypeParameterLabel(tp)) @@ -212,7 +217,7 @@ open class KotlinFileExtractor( } } - fun extractVisibility(elementForLocation: IrElement, id: Label, v: DescriptorVisibility) { + private fun extractVisibility(elementForLocation: IrElement, id: Label, v: DescriptorVisibility) { with("visibility", elementForLocation) { when (v) { DescriptorVisibilities.PRIVATE -> addModifiers(id, "private") @@ -246,7 +251,7 @@ open class KotlinFileExtractor( } } - fun extractClassModifiers(c: IrClass, id: Label) { + private fun extractClassModifiers(c: IrClass, id: Label) { with("class modifiers", c) { when (c.modality) { Modality.FINAL -> addModifiers(id, "final") @@ -310,8 +315,21 @@ open class KotlinFileExtractor( val locId = getLocation(c, argsIncludingOuterClasses) tw.writeHasLocation(id, locId) - // Extract the outer <-> inner class relationship, passing on any type arguments in excess to this class' parameters. - extractEnclosingClass(c, id, locId, argsIncludingOuterClasses?.drop(c.typeParameters.size) ?: listOf()) + // Extract the outer <-> inner class relationship, passing on any type arguments in excess to this class' parameters if this is an inner class. + // For example, in `class Outer { inner class Inner { } }`, `Inner` nests within `Outer` and raw `Inner<>` within `Outer<>`, + // but for a similar non-`inner` (in Java terms, static nested) class both `Inner` and `Inner<>` nest within the unbound type `Outer`. + val useBoundOuterType = (c.isInner || c.isLocal) && (c.parents.map { // Would use `firstNotNullOfOrNull`, but this doesn't exist in Kotlin 1.4 + when(it) { + is IrClass -> when { + it.typeParameters.isNotEmpty() -> true // Type parameters visible to this class -- extract an enclosing bound or raw type. + !(it.isInner || it.isLocal) -> false // No type parameters seen yet, and this is a static class -- extract an enclosing unbound type. + else -> null // No type parameters seen here, but may be visible enclosing type parameters; keep searching. + } + else -> null // Look through enclosing non-class entities (this may need to change) + } + }.firstOrNull { it != null } ?: false) + + extractEnclosingClass(c, id, locId, if (useBoundOuterType) argsIncludingOuterClasses?.drop(c.typeParameters.size) else listOf()) return id } @@ -367,6 +385,29 @@ open class KotlinFileExtractor( tw.writeHasLocation(stmtId, locId) } + private fun extractObinitFunction(c: IrClass, parentId: Label) { + // add method: + val obinitLabel = getObinitLabel(c) + val obinitId = tw.getLabelFor(obinitLabel) + val returnType = useType(pluginContext.irBuiltIns.unitType, TypeContext.RETURN) + tw.writeMethods(obinitId, "", "()", returnType.javaResult.id, parentId, obinitId) + tw.writeMethodsKotlinType(obinitId, returnType.kotlinResult.id) + + val locId = tw.getLocation(c) + tw.writeHasLocation(obinitId, locId) + + addModifiers(obinitId, "private") + + // add body: + val blockId = tw.getFreshIdLabel() + tw.writeStmts_block(blockId, obinitId, 0, obinitId) + tw.writeHasLocation(blockId, locId) + + extractDeclInitializers(c.declarations, false) { Pair(blockId, obinitId) } + } + + val jvmStaticFqName = FqName("kotlin.jvm.JvmStatic") + fun extractClassSource(c: IrClass, extractDeclarations: Boolean, extractStaticInitializer: Boolean, extractPrivateMembers: Boolean, extractFunctionBodies: Boolean): Label { with("class source", c) { DeclarationStackAdjuster(c).use { @@ -403,9 +444,10 @@ open class KotlinFileExtractor( c.typeParameters.mapIndexed { idx, param -> extractTypeParameter(param, idx, javaClass?.typeParameters?.getOrNull(idx)) } if (extractDeclarations) { - c.declarations.map { extractDeclaration(it, extractPrivateMembers = extractPrivateMembers, extractFunctionBodies = extractFunctionBodies) } + c.declarations.forEach { extractDeclaration(it, extractPrivateMembers = extractPrivateMembers, extractFunctionBodies = extractFunctionBodies) } if (extractStaticInitializer) extractStaticInitializer(c, id) + extractJvmStaticProxyMethods(c, id, extractPrivateMembers, extractFunctionBodies) } if (c.isNonCompanionObject) { // For `object MyObject { ... }`, the .class has an @@ -421,6 +463,9 @@ open class KotlinFileExtractor( addModifiers(instance.id, "public", "static", "final") tw.writeClass_object(id.cast(), instance.id) } + if (extractFunctionBodies && needsObinitFunction(c)) { + extractObinitFunction(c, id) + } extractClassModifiers(c, id) extractClassSupertypes(c, id, inReceiverContext = true) // inReceiverContext = true is specified to force extraction of member prototypes of base types @@ -430,7 +475,78 @@ open class KotlinFileExtractor( } } - private fun extractEnclosingClass(innerDeclaration: IrDeclaration, innerId: Label, innerLocId: Label, parentClassTypeArguments: List) { + private fun extractJvmStaticProxyMethods(c: IrClass, classId: Label, extractPrivateMembers: Boolean, extractFunctionBodies: Boolean) { + + // Add synthetic forwarders for any JvmStatic methods or properties: + val companionObject = c.companionObject() ?: return + + val cType = c.typeWith() + val companionType = companionObject.typeWith() + + fun makeProxyFunction(f: IrFunction) { + // Emit a function in class `c` that delegates to the same function defined on `c.CompanionInstance`. + val proxyFunctionId = tw.getLabelFor(getFunctionLabel(f, classId, listOf())) + // We extract the function prototype with its ID overridden to belong to `c` not the companion object, + // but suppress outputting the body, which we will replace with a delegating call below. + forceExtractFunction(f, classId, extractBody = false, extractMethodAndParameterTypeAccesses = extractFunctionBodies, typeSubstitution = null, classTypeArgsIncludingOuterClasses = listOf(), idOverride = proxyFunctionId, locOverride = null, extractOrigin = false) + addModifiers(proxyFunctionId, "static") + tw.writeCompiler_generated(proxyFunctionId, CompilerGeneratedKinds.JVMSTATIC_PROXY_METHOD.kind) + if (extractFunctionBodies) { + val realFunctionLocId = tw.getLocation(f) + extractExpressionBody(proxyFunctionId, realFunctionLocId).also { returnId -> + extractRawMethodAccess( + f, + realFunctionLocId, + f.returnType, + proxyFunctionId, + returnId, + 0, + returnId, + f.valueParameters.size, + { argParent, idxOffset -> + f.valueParameters.forEachIndexed { idx, param -> + val syntheticParamId = useValueParameter(param, proxyFunctionId) + extractVariableAccess(syntheticParamId, param.type, realFunctionLocId, argParent, idxOffset + idx, proxyFunctionId, returnId) + } + }, + companionType, + { callId -> + val companionField = useCompanionObjectClassInstance(companionObject)?.id + extractVariableAccess(companionField, companionType, realFunctionLocId, callId, -1, proxyFunctionId, returnId).also { varAccessId -> + extractTypeAccessRecursive(cType, realFunctionLocId, varAccessId, -1, proxyFunctionId, returnId) + } + }, + null + ) + } + } + } + + companionObject.declarations.forEach { + if (shouldExtractDecl(it, extractPrivateMembers)) { + val wholeDeclAnnotated = it.hasAnnotation(jvmStaticFqName) + when(it) { + is IrFunction -> { + if (wholeDeclAnnotated) + makeProxyFunction(it) + } + is IrProperty -> { + it.getter?.let { getter -> + if (wholeDeclAnnotated || getter.hasAnnotation(jvmStaticFqName)) + makeProxyFunction(getter) + } + it.setter?.let { setter -> + if (wholeDeclAnnotated || setter.hasAnnotation(jvmStaticFqName)) + makeProxyFunction(setter) + } + } + } + } + } + } + + // If `parentClassTypeArguments` is null, the parent class is a raw type. + private fun extractEnclosingClass(innerDeclaration: IrDeclaration, innerId: Label, innerLocId: Label, parentClassTypeArguments: List?) { with("enclosing class", innerDeclaration) { var parent: IrDeclarationParent? = innerDeclaration.parent while (parent != null) { @@ -478,7 +594,7 @@ open class KotlinFileExtractor( data class FieldResult(val id: Label, val name: String) - fun useCompanionObjectClassInstance(c: IrClass): FieldResult? { + private fun useCompanionObjectClassInstance(c: IrClass): FieldResult? { val parent = c.parent if(!c.isCompanion) { logger.error("Using companion instance for non-companion class") @@ -496,7 +612,7 @@ open class KotlinFileExtractor( } } - fun useObjectClassInstance(c: IrClass): FieldResult { + private fun useObjectClassInstance(c: IrClass): FieldResult { if(!c.isNonCompanionObject) { logger.error("Using instance for non-object class") } @@ -567,6 +683,8 @@ open class KotlinFileExtractor( tw.writeMethods(clinitId, "", "()", returnType.javaResult.id, parentId, clinitId) tw.writeMethodsKotlinType(clinitId, returnType.kotlinResult.id) + tw.writeCompiler_generated(clinitId, CompilerGeneratedKinds.CLASS_INITIALISATION_METHOD.kind) + val locId = tw.getWholeFileLocation() tw.writeHasLocation(clinitId, locId) @@ -689,13 +807,13 @@ open class KotlinFileExtractor( } } - fun extractFunction(f: IrFunction, parentId: Label, extractBody: Boolean, extractMethodAndParameterTypeAccesses: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List?) = + private fun extractFunction(f: IrFunction, parentId: Label, extractBody: Boolean, extractMethodAndParameterTypeAccesses: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List?) = if (isFake(f)) null else forceExtractFunction(f, parentId, extractBody, extractMethodAndParameterTypeAccesses, typeSubstitution, classTypeArgsIncludingOuterClasses, null, null) - fun forceExtractFunction(f: IrFunction, parentId: Label, extractBody: Boolean, extractMethodAndParameterTypeAccesses: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List?, idOverride: Label?, locOverride: Label?): Label { + private fun forceExtractFunction(f: IrFunction, parentId: Label, extractBody: Boolean, extractMethodAndParameterTypeAccesses: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List?, idOverride: Label?, locOverride: Label?, extractOrigin: Boolean = true): Label { with("function", f) { DeclarationStackAdjuster(f).use { @@ -704,12 +822,9 @@ open class KotlinFileExtractor( val id = idOverride - ?: if (f.isLocalFunction()) - getLocallyVisibleFunctionLabels(f).function - else - // If this is a class that would ordinarily be replaced by a Java equivalent (e.g. kotlin.Map -> java.util.Map), - // don't replace here, really extract the Kotlin version: - useFunction(f, parentId, classTypeArgsIncludingOuterClasses, noReplace = true) + ?: // If this is a class that would ordinarily be replaced by a Java equivalent (e.g. kotlin.Map -> java.util.Map), + // don't replace here, really extract the Kotlin version: + useFunction(f, parentId, classTypeArgsIncludingOuterClasses, noReplace = true) val sourceDeclaration = if (typeSubstitution != null && idOverride == null) @@ -755,6 +870,16 @@ open class KotlinFileExtractor( val methodId = id.cast() tw.writeMethods(methodId, shortName.nameInDB, "${shortName.nameInDB}$paramsSignature", returnType.javaResult.id, parentId, sourceDeclaration.cast()) tw.writeMethodsKotlinType(methodId, returnType.kotlinResult.id) + if (extractOrigin) { + when (f.origin) { + IrDeclarationOrigin.GENERATED_DATA_CLASS_MEMBER -> + tw.writeCompiler_generated(methodId, CompilerGeneratedKinds.GENERATED_DATA_CLASS_MEMBER.kind) + IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR -> + tw.writeCompiler_generated(methodId, CompilerGeneratedKinds.DEFAULT_PROPERTY_ACCESSOR.kind) + IrDeclarationOrigin.ENUM_CLASS_SPECIAL_MEMBER -> + tw.writeCompiler_generated(methodId, CompilerGeneratedKinds.ENUM_CLASS_SPECIAL_MEMBER.kind) + } + } if (extractMethodAndParameterTypeAccesses) { extractTypeAccessRecursive(substReturnType, locId, id, -1) @@ -774,10 +899,13 @@ open class KotlinFileExtractor( } extractVisibility(f, id, f.visibility) - if (isStaticFunction(f)) { + + if (f.isInline) { + addModifiers(id, "inline") + } + if (f.shouldExtractAsStatic) { addModifiers(id, "static") } - if (f is IrSimpleFunction && f.overriddenSymbols.isNotEmpty()) { addModifiers(id, "override") } @@ -793,7 +921,7 @@ open class KotlinFileExtractor( && f.symbol !is IrConstructorSymbol // not a constructor } - fun extractField(f: IrField, parentId: Label): Label { + private fun extractField(f: IrField, parentId: Label): Label { with("field", f) { DeclarationStackAdjuster(f).use { declarationStack.push(f) @@ -827,7 +955,7 @@ open class KotlinFileExtractor( return id } - fun extractProperty(p: IrProperty, parentId: Label, extractBackingField: Boolean, extractFunctionBodies: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List?) { + private fun extractProperty(p: IrProperty, parentId: Label, extractBackingField: Boolean, extractFunctionBodies: Boolean, typeSubstitution: TypeSubstitution?, classTypeArgsIncludingOuterClasses: List?) { with("property", p) { if (isFake(p)) return @@ -846,6 +974,9 @@ open class KotlinFileExtractor( val getterId = extractFunction(getter, parentId, extractBody = extractFunctionBodies, extractMethodAndParameterTypeAccesses = extractFunctionBodies, typeSubstitution, classTypeArgsIncludingOuterClasses)?.cast() if (getterId != null) { tw.writeKtPropertyGetters(id, getterId) + if (getter.origin == IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR) { + tw.writeCompiler_generated(getterId, CompilerGeneratedKinds.DELEGATED_PROPERTY_GETTER.kind) + } } } else { if (p.modality != Modality.FINAL || !isExternalDeclaration(p)) { @@ -860,6 +991,9 @@ open class KotlinFileExtractor( val setterId = extractFunction(setter, parentId, extractBody = extractFunctionBodies, extractMethodAndParameterTypeAccesses = extractFunctionBodies, typeSubstitution, classTypeArgsIncludingOuterClasses)?.cast() if (setterId != null) { tw.writeKtPropertySetters(id, setterId) + if (setter.origin == IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR) { + tw.writeCompiler_generated(setterId, CompilerGeneratedKinds.DELEGATED_PROPERTY_SETTER.kind) + } } } else { if (p.isVar && !isExternalDeclaration(p)) { @@ -896,7 +1030,7 @@ open class KotlinFileExtractor( } } - fun extractEnumEntry(ee: IrEnumEntry, parentId: Label, extractTypeAccess: Boolean) { + private fun extractEnumEntry(ee: IrEnumEntry, parentId: Label, extractTypeAccess: Boolean) { with("enum entry", ee) { DeclarationStackAdjuster(ee).use { val id = useEnumEntry(ee) @@ -918,7 +1052,7 @@ open class KotlinFileExtractor( } } - fun extractTypeAlias(ta: IrTypeAlias) { + private fun extractTypeAlias(ta: IrTypeAlias) { with("type alias", ta) { if (ta.typeParameters.isNotEmpty()) { // TODO: Extract this information @@ -933,7 +1067,7 @@ open class KotlinFileExtractor( } } - fun extractBody(b: IrBody, callable: Label) { + private fun extractBody(b: IrBody, callable: Label) { with("body", b) { when (b) { is IrBlockBody -> extractBlockBody(b, callable) @@ -946,7 +1080,7 @@ open class KotlinFileExtractor( } } - fun extractBlockBody(b: IrBlockBody, callable: Label) { + private fun extractBlockBody(b: IrBlockBody, callable: Label) { with("block body", b) { val id = tw.getFreshIdLabel() val locId = tw.getLocation(b) @@ -958,7 +1092,7 @@ open class KotlinFileExtractor( } } - fun extractSyntheticBody(b: IrSyntheticBody, callable: Label) { + private fun extractSyntheticBody(b: IrSyntheticBody, callable: Label) { with("synthetic body", b) { when (b.kind) { IrSyntheticBodyKind.ENUM_VALUES -> tw.writeKtSyntheticBody(callable, 1) @@ -967,17 +1101,23 @@ open class KotlinFileExtractor( } } - fun extractExpressionBody(b: IrExpressionBody, callable: Label) { + private fun extractExpressionBody(b: IrExpressionBody, callable: Label) { with("expression body", b) { - val blockId = tw.getFreshIdLabel() val locId = tw.getLocation(b) - tw.writeStmts_block(blockId, callable, 0, callable) - tw.writeHasLocation(blockId, locId) + extractExpressionBody(callable, locId).also { returnId -> + extractExpressionExpr(b.expression, callable, returnId, 0, returnId) + } + } + } - val returnId = tw.getFreshIdLabel() + fun extractExpressionBody(callable: Label, locId: Label): Label { + val blockId = tw.getFreshIdLabel() + tw.writeStmts_block(blockId, callable, 0, callable) + tw.writeHasLocation(blockId, locId) + + return tw.getFreshIdLabel().also { returnId -> tw.writeStmts_returnstmt(returnId, blockId, 0, callable) tw.writeHasLocation(returnId, locId) - extractExpressionExpr(b.expression, callable, returnId, 0, returnId) } } @@ -991,7 +1131,7 @@ open class KotlinFileExtractor( return v } - fun extractVariable(v: IrVariable, callable: Label, parent: Label, idx: Int) { + private fun extractVariable(v: IrVariable, callable: Label, parent: Label, idx: Int) { with("variable", v) { val stmtId = tw.getFreshIdLabel() val locId = tw.getLocation(getVariableLocationProvider(v)) @@ -1001,7 +1141,7 @@ open class KotlinFileExtractor( } } - fun extractVariableExpr(v: IrVariable, callable: Label, parent: Label, idx: Int, enclosingStmt: Label) { + private fun extractVariableExpr(v: IrVariable, callable: Label, parent: Label, idx: Int, enclosingStmt: Label) { with("variable expr", v) { val varId = useVariable(v) val exprId = tw.getFreshIdLabel() @@ -1025,7 +1165,7 @@ open class KotlinFileExtractor( } } - fun extractStatement(s: IrStatement, callable: Label, parent: Label, idx: Int) { + private fun extractStatement(s: IrStatement, callable: Label, parent: Label, idx: Int) { with("statement", s) { when(s) { is IrExpression -> { @@ -1045,7 +1185,7 @@ open class KotlinFileExtractor( tw.writeKtLocalFunction(ids.function) if (s.origin == IrDeclarationOrigin.ADAPTER_FOR_CALLABLE_REFERENCE) { - tw.writeCompiler_generated(classId, 1) + tw.writeCompiler_generated(classId, CompilerGeneratedKinds.DECLARING_CLASSES_OF_ADAPTER_FUNCTIONS.kind) } } else { logger.errorElement("Expected to find local function", s) @@ -1248,10 +1388,48 @@ open class KotlinFileExtractor( typeArguments: List = listOf(), extractClassTypeArguments: Boolean = false) { + val locId = tw.getLocation(callsite) + + extractRawMethodAccess( + syntacticCallTarget, + locId, + callsite.type, + enclosingCallable, + callsiteParent, + childIdx, + enclosingStmt, + valueArguments.size, + { argParent, idxOffset -> extractCallValueArguments(argParent, valueArguments, enclosingStmt, enclosingCallable, idxOffset) }, + dispatchReceiver?.type, + dispatchReceiver?.let { { callId -> extractExpressionExpr(dispatchReceiver, enclosingCallable, callId, -1, enclosingStmt) } }, + extensionReceiver?.let { { argParent -> extractExpressionExpr(extensionReceiver, enclosingCallable, argParent, 0, enclosingStmt) } }, + typeArguments, + extractClassTypeArguments + ) + + } + + + fun extractRawMethodAccess( + syntacticCallTarget: IrFunction, + locId: Label, + returnType: IrType, + enclosingCallable: Label, + callsiteParent: Label, + childIdx: Int, + enclosingStmt: Label, + nValueArguments: Int, + extractValueArguments: (Label, Int) -> Unit, + drType: IrType?, + extractDispatchReceiver: ((Label) -> Unit)?, + extractExtensionReceiver: ((Label) -> Unit)?, + typeArguments: List = listOf(), + extractClassTypeArguments: Boolean = false) { + val callTarget = syntacticCallTarget.target.realOverrideTarget val id = tw.getFreshIdLabel() - val type = useType(callsite.type) - val locId = tw.getLocation(callsite) + val type = useType(returnType) + tw.writeExprs_methodaccess(id, type.javaResult.id, callsiteParent, childIdx) tw.writeExprsKotlinType(id, type.kotlinResult.id) tw.writeHasLocation(id, locId) @@ -1261,8 +1439,6 @@ open class KotlinFileExtractor( // type arguments at index -2, -3, ... extractTypeArguments(typeArguments, locId, id, enclosingCallable, enclosingStmt, -2, true) - val drType = dispatchReceiver?.type - val isFunctionInvoke = drType != null && drType is IrSimpleType && drType.isFunctionOrKFunction() @@ -1305,44 +1481,48 @@ open class KotlinFileExtractor( tw.writeCallableBinding(id, methodId) - if (dispatchReceiver != null) { - extractExpressionExpr(dispatchReceiver, enclosingCallable, id, -1, enclosingStmt) - } else if (isStaticFunction(callTarget)) { + if (callTarget.shouldExtractAsStatic) { extractStaticTypeAccessQualifier(callTarget, id, locId, enclosingCallable, enclosingStmt) + } else if (extractDispatchReceiver != null) { + extractDispatchReceiver(id) } } - val idxOffset = if (extensionReceiver != null) 1 else 0 + val idxOffset = if (extractExtensionReceiver != null) 1 else 0 val argParent = if (isBigArityFunctionInvoke) { - extractArrayCreationWithInitializer(id, valueArguments.size + idxOffset, locId, enclosingCallable, enclosingStmt) + extractArrayCreationWithInitializer(id, nValueArguments + idxOffset, locId, enclosingCallable, enclosingStmt) } else { id } - if (extensionReceiver != null) { - extractExpressionExpr(extensionReceiver, enclosingCallable, argParent, 0, enclosingStmt) + if (extractExtensionReceiver != null) { + extractExtensionReceiver(argParent) } - extractCallValueArguments(argParent, valueArguments, enclosingStmt, enclosingCallable, idxOffset) + extractValueArguments(argParent, idxOffset) } private fun extractStaticTypeAccessQualifier(target: IrDeclaration, parentExpr: Label, locId: Label, enclosingCallable: Label, enclosingStmt: Label) { - if (target.isStaticOfClass) { + if (target.shouldExtractAsStaticMemberOfClass) { extractTypeAccessRecursive(target.parentAsClass.toRawType(), locId, parentExpr, -1, enclosingCallable, enclosingStmt) - } else if (target.isStaticOfFile) { + } else if (target.shouldExtractAsStaticMemberOfFile) { extractTypeAccess(useFileClassType(target.parent as IrFile), locId, parentExpr, -1, enclosingCallable, enclosingStmt) } } - private val IrDeclaration.isStaticOfClass: Boolean - get() = this.isStatic && parent is IrClass + private val IrDeclaration.shouldExtractAsStaticMemberOfClass: Boolean + get() = this.shouldExtractAsStatic && parent is IrClass - private val IrDeclaration.isStaticOfFile: Boolean - get() = this.isStatic && parent is IrFile + private val IrDeclaration.shouldExtractAsStaticMemberOfFile: Boolean + get() = this.shouldExtractAsStatic && parent is IrFile - private val IrDeclaration.isStatic: Boolean - get() = this is IrSimpleFunction && dispatchReceiverParameter == null || + private fun isStaticAnnotatedNonCompanionMember(f: IrSimpleFunction) = + f.parentClassOrNull?.isNonCompanionObject == true && + (f.hasAnnotation(jvmStaticFqName) || f.correspondingPropertySymbol?.owner?.hasAnnotation(jvmStaticFqName) == true) + + private val IrDeclaration.shouldExtractAsStatic: Boolean + get() = this is IrSimpleFunction && (isStaticFunction(this) || isStaticAnnotatedNonCompanionMember(this)) || this is IrField && this.isStatic || this is IrEnumEntry @@ -1364,7 +1544,7 @@ open class KotlinFileExtractor( } } - fun findFunction(cls: IrClass, name: String): IrFunction? = cls.declarations.find { it is IrFunction && it.name.asString() == name } as IrFunction? + private fun findFunction(cls: IrClass, name: String): IrFunction? = cls.declarations.find { it is IrFunction && it.name.asString() == name } as IrFunction? val jvmIntrinsicsClass by lazy { val result = pluginContext.referenceClass(FqName("kotlin.jvm.internal.Intrinsics"))?.owner @@ -1372,7 +1552,7 @@ open class KotlinFileExtractor( result } - fun findJdkIntrinsicOrWarn(name: String, warnAgainstElement: IrElement): IrFunction? { + private fun findJdkIntrinsicOrWarn(name: String, warnAgainstElement: IrElement): IrFunction? { val result = jvmIntrinsicsClass?.let { findFunction(it, name) } if(result == null) { logger.errorElement("Couldn't find JVM intrinsic function $name", warnAgainstElement) @@ -1466,7 +1646,7 @@ open class KotlinFileExtractor( result } - fun isFunction(target: IrFunction, pkgName: String, classNameLogged: String, classNamePredicate: (String) -> Boolean, fName: String, hasQuestionMark: Boolean? = false): Boolean { + private fun isFunction(target: IrFunction, pkgName: String, classNameLogged: String, classNamePredicate: (String) -> Boolean, fName: String, hasQuestionMark: Boolean? = false): Boolean { val verbose = false fun verboseln(s: String) { if(verbose) println(s) } verboseln("Attempting match for $pkgName $classNameLogged $fName") @@ -1510,10 +1690,10 @@ open class KotlinFileExtractor( return true } - fun isFunction(target: IrFunction, pkgName: String, className: String, fName: String, hasQuestionMark: Boolean? = false) = + private fun isFunction(target: IrFunction, pkgName: String, className: String, fName: String, hasQuestionMark: Boolean? = false) = isFunction(target, pkgName, className, { it == className }, fName, hasQuestionMark) - fun isNumericFunction(target: IrFunction, fName: String): Boolean { + private fun isNumericFunction(target: IrFunction, fName: String): Boolean { return isFunction(target, "kotlin", "Int", fName) || isFunction(target, "kotlin", "Byte", fName) || isFunction(target, "kotlin", "Short", fName) || @@ -1522,7 +1702,7 @@ open class KotlinFileExtractor( isFunction(target, "kotlin", "Double", fName) } - fun isArrayType(typeName: String) = + private fun isArrayType(typeName: String) = when(typeName) { "Array" -> true "IntArray" -> true @@ -1536,7 +1716,7 @@ open class KotlinFileExtractor( else -> false } - fun extractCall(c: IrCall, callable: Label, stmtExprParent: StmtExprParent) { + private fun extractCall(c: IrCall, callable: Label, stmtExprParent: StmtExprParent) { with("call", c) { val target = tryReplaceSyntheticFunction(c.symbol.owner) @@ -2101,6 +2281,22 @@ open class KotlinFileExtractor( enclosingStmt: Label ): Label = extractNewExpr(useFunction(calledConstructor, constructorTypeArgs), constructedType, locId, parent, idx, callable, enclosingStmt) + private fun needsObinitFunction(c: IrClass) = c.primaryConstructor == null && c.constructors.count() > 1 + + private fun getObinitLabel(c: IrClass) = getFunctionLabel( + c, + null, + "", + listOf(), + pluginContext.irBuiltIns.unitType, + null, + functionTypeParameters = listOf(), + classTypeArgsIncludingOuterClasses = listOf(), + overridesCollectionsMethod = false, + javaSignature = null, + addParameterWildcardsByDefault = false + ) + private fun extractConstructorCall( e: IrFunctionAccessExpression, parent: Label, @@ -2153,8 +2349,6 @@ open class KotlinFileExtractor( } } - private val loopIdMap: MutableMap> = mutableMapOf() - // todo: calculating the enclosing ref type could be done through this, instead of walking up the declaration parent chain private val declarationStack: Stack = Stack() @@ -2192,7 +2386,7 @@ open class KotlinFileExtractor( } } - fun getStatementOriginOperator(origin: IrStatementOrigin?) = when (origin) { + private fun getStatementOriginOperator(origin: IrStatementOrigin?) = when (origin) { IrStatementOrigin.PLUSEQ -> "plus" IrStatementOrigin.MINUSEQ -> "minus" IrStatementOrigin.MULTEQ -> "times" @@ -2201,7 +2395,7 @@ open class KotlinFileExtractor( else -> null } - fun getUpdateInPlaceRHS(origin: IrStatementOrigin?, isExpectedLhs: (IrExpression?) -> Boolean, updateRhs: IrExpression): IrExpression? { + private fun getUpdateInPlaceRHS(origin: IrStatementOrigin?, isExpectedLhs: (IrExpression?) -> Boolean, updateRhs: IrExpression): IrExpression? { // Check for a desugared in-place update operator, such as "v += e": return getStatementOriginOperator(origin)?.let { if (updateRhs is IrCall && @@ -2216,7 +2410,7 @@ open class KotlinFileExtractor( } } - fun writeUpdateInPlaceExpr(origin: IrStatementOrigin, tw: TrapWriter, id: Label, type: TypeResults, exprParent: ExprParent): Boolean { + private fun writeUpdateInPlaceExpr(origin: IrStatementOrigin, tw: TrapWriter, id: Label, type: TypeResults, exprParent: ExprParent): Boolean { when(origin) { IrStatementOrigin.PLUSEQ -> tw.writeExprs_assignaddexpr(id.cast(), type.javaResult.id, exprParent.parent, exprParent.idx) IrStatementOrigin.MINUSEQ -> tw.writeExprs_assignsubexpr(id.cast(), type.javaResult.id, exprParent.parent, exprParent.idx) @@ -2228,7 +2422,7 @@ open class KotlinFileExtractor( return true } - fun tryExtractArrayUpdate(e: IrContainerExpression, callable: Label, parent: StmtExprParent): Boolean { + private fun tryExtractArrayUpdate(e: IrContainerExpression, callable: Label, parent: StmtExprParent): Boolean { /* * We're expecting the pattern * { @@ -2299,7 +2493,7 @@ open class KotlinFileExtractor( return false } - fun extractExpressionStmt(e: IrExpression, callable: Label, parent: Label, idx: Int) { + private fun extractExpressionStmt(e: IrExpression, callable: Label, parent: Label, idx: Int) { extractExpression(e, callable, StmtParent(parent, idx)) } @@ -2307,7 +2501,7 @@ open class KotlinFileExtractor( extractExpression(e, callable, ExprParent(parent, idx, enclosingStmt)) } - fun extractExpression(e: IrExpression, callable: Label, parent: StmtExprParent) { + private fun extractExpression(e: IrExpression, callable: Label, parent: StmtExprParent) { with("expression", e) { when(e) { is IrDelegatingConstructorCall -> { @@ -2402,41 +2596,35 @@ open class KotlinFileExtractor( } } is IrWhileLoop -> { - val stmtParent = parent.stmt(e, callable) - val id = tw.getFreshIdLabel() - loopIdMap[e] = id - val locId = tw.getLocation(e) - tw.writeStmts_whilestmt(id, stmtParent.parent, stmtParent.idx, callable) - tw.writeHasLocation(id, locId) - extractExpressionExpr(e.condition, callable, id, 0, id) - val body = e.body - if(body != null) { - extractExpressionStmt(body, callable, id, 1) - } - loopIdMap.remove(e) + extractLoop(e, parent, callable) } is IrDoWhileLoop -> { - val stmtParent = parent.stmt(e, callable) - val id = tw.getFreshIdLabel() - loopIdMap[e] = id - val locId = tw.getLocation(e) - tw.writeStmts_dostmt(id, stmtParent.parent, stmtParent.idx, callable) - tw.writeHasLocation(id, locId) - extractExpressionExpr(e.condition, callable, id, 0, id) - val body = e.body - if(body != null) { - extractExpressionStmt(body, callable, id, 1) - } - loopIdMap.remove(e) + extractLoop(e, parent, callable) } is IrInstanceInitializerCall -> { - val stmtParent = parent.stmt(e, callable) val irConstructor = declarationStack.peek() as? IrConstructor if (irConstructor == null) { logger.errorElement("IrInstanceInitializerCall outside constructor", e) return } - extractInstanceInitializerBlock(stmtParent, irConstructor) + if (needsObinitFunction(irConstructor.parentAsClass)) { + val exprParent = parent.expr(e, callable) + val id = tw.getFreshIdLabel() + val type = useType(pluginContext.irBuiltIns.unitType) + val locId = tw.getLocation(e) + val methodLabel = getObinitLabel(irConstructor.parentAsClass) + val methodId = tw.getLabelFor(methodLabel) + tw.writeExprs_methodaccess(id, type.javaResult.id, exprParent.parent, exprParent.idx) + tw.writeExprsKotlinType(id, type.kotlinResult.id) + tw.writeHasLocation(id, locId) + tw.writeCallableEnclosingExpr(id, callable) + tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt) + tw.writeCallableBinding(id, methodId) + } + else { + val stmtParent = parent.stmt(e, callable) + extractInstanceInitializerBlock(stmtParent, irConstructor) + } } is IrConstructorCall -> { val exprParent = parent.expr(e, callable) @@ -2556,78 +2744,22 @@ open class KotlinFileExtractor( val exprParent = parent.expr(e, callable) val owner = e.symbol.owner if (owner is IrValueParameter && owner.index == -1 && !owner.isExtensionReceiver()) { - val id = tw.getFreshIdLabel() - val type = useType(e.type) - val locId = tw.getLocation(e) - tw.writeExprs_thisaccess(id, type.javaResult.id, exprParent.parent, exprParent.idx) - tw.writeExprsKotlinType(id, type.kotlinResult.id) - tw.writeHasLocation(id, locId) - tw.writeCallableEnclosingExpr(id, callable) - tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt) - - - fun extractTypeAccess(parent: IrClass){ - extractTypeAccessRecursive(parent.typeWith(listOf()), locId, id, 0, callable, exprParent.enclosingStmt) - } - - when(val ownerParent = owner.parent) { - is IrFunction -> { - if (ownerParent.dispatchReceiverParameter == owner && - ownerParent.extensionReceiverParameter != null) { - - val ownerParent2 = ownerParent.parent - if (ownerParent2 is IrClass){ - extractTypeAccess(ownerParent2) - } else { - logger.errorElement("Unhandled qualifier for this", e) - } - } - } - is IrClass -> { - if (ownerParent.thisReceiver == owner) { - extractTypeAccess(ownerParent) - } - } - else -> { - logger.errorElement("Unexpected owner parent for this access: " + ownerParent.javaClass, e) - } - } + extractThisAccess(e, exprParent, callable) } else { - val id = tw.getFreshIdLabel() - val type = useType(e.type) - val locId = tw.getLocation(e) - tw.writeExprs_varaccess(id, type.javaResult.id, exprParent.parent, exprParent.idx) - tw.writeExprsKotlinType(id, type.kotlinResult.id) - tw.writeHasLocation(id, locId) - tw.writeCallableEnclosingExpr(id, callable) - tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt) - - val vId = useValueDeclaration(owner) - if (vId != null) { - tw.writeVariableBinding(id, vId) - } + extractVariableAccess(useValueDeclaration(owner), e.type, tw.getLocation(e), exprParent.parent, exprParent.idx, callable, exprParent.enclosingStmt) } } is IrGetField -> { val exprParent = parent.expr(e, callable) - val id = tw.getFreshIdLabel() - val type = useType(e.type) - val locId = tw.getLocation(e) - tw.writeExprs_varaccess(id, type.javaResult.id, exprParent.parent, exprParent.idx) - tw.writeExprsKotlinType(id, type.kotlinResult.id) - tw.writeHasLocation(id, locId) - tw.writeCallableEnclosingExpr(id, callable) - tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt) val owner = tryReplaceAndroidSyntheticField(e.symbol.owner) - val vId = useField(owner) - tw.writeVariableBinding(id, vId) - tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt) - - val receiver = e.receiver - if (receiver != null) { - extractExpressionExpr(receiver, callable, id, -1, exprParent.enclosingStmt) - } else if (owner.isStatic) { - extractStaticTypeAccessQualifier(owner, id, locId, callable, exprParent.enclosingStmt) + val locId = tw.getLocation(e) + extractVariableAccess(useField(owner), e.type, locId, exprParent.parent, exprParent.idx, callable, exprParent.enclosingStmt).also { id -> + val receiver = e.receiver + if (receiver != null) { + extractExpressionExpr(receiver, callable, id, -1, exprParent.enclosingStmt) + } else if (owner.isStatic) { + extractStaticTypeAccessQualifier(owner, id, locId, callable, exprParent.enclosingStmt) + } } } is IrGetEnumValue -> { @@ -2928,6 +3060,114 @@ open class KotlinFileExtractor( } } + private fun extractThisAccess(e: IrGetValue, exprParent: ExprParent, callable: Label) { + val containingDeclaration = declarationStack.peek() + val locId = tw.getLocation(e) + val type = useType(e.type) + + if (containingDeclaration.shouldExtractAsStatic && containingDeclaration.parentClassOrNull?.isNonCompanionObject == true) { + // Use of `this` in a non-companion object member that will be lowered to a static function -- replace with a reference + // to the corresponding static object instance. + val instanceField = useObjectClassInstance(containingDeclaration.parentAsClass) + extractVariableAccess(instanceField.id, e.type, locId, exprParent.parent, exprParent.idx, callable, exprParent.enclosingStmt).also { varAccessId -> + extractStaticTypeAccessQualifier(containingDeclaration, varAccessId, locId, callable, exprParent.enclosingStmt) + } + } else { + val id = tw.getFreshIdLabel() + + tw.writeExprs_thisaccess(id, type.javaResult.id, exprParent.parent, exprParent.idx) + tw.writeExprsKotlinType(id, type.kotlinResult.id) + tw.writeHasLocation(id, locId) + tw.writeCallableEnclosingExpr(id, callable) + tw.writeStatementEnclosingExpr(id, exprParent.enclosingStmt) + + fun extractTypeAccess(parent: IrClass) { + extractTypeAccessRecursive(parent.typeWith(listOf()), locId, id, 0, callable, exprParent.enclosingStmt) + } + + val owner = e.symbol.owner + when(val ownerParent = owner.parent) { + is IrFunction -> { + if (ownerParent.dispatchReceiverParameter == owner && + ownerParent.extensionReceiverParameter != null) { + + val ownerParent2 = ownerParent.parent + if (ownerParent2 is IrClass){ + extractTypeAccess(ownerParent2) + } else { + logger.errorElement("Unhandled qualifier for this", e) + } + } + } + is IrClass -> { + if (ownerParent.thisReceiver == owner) { + extractTypeAccess(ownerParent) + } + } + else -> { + logger.errorElement("Unexpected owner parent for this access: " + ownerParent.javaClass, e) + } + } + } + } + + private fun extractVariableAccess(variable: Label?, irType: IrType, locId: Label, parent: Label, idx: Int, callable: Label, enclosingStmt: Label) = + tw.getFreshIdLabel().also { + val type = useType(irType) + tw.writeExprs_varaccess(it, type.javaResult.id, parent, idx) + tw.writeExprsKotlinType(it, type.kotlinResult.id) + tw.writeHasLocation(it, locId) + tw.writeCallableEnclosingExpr(it, callable) + tw.writeStatementEnclosingExpr(it, enclosingStmt) + + if (variable != null) { + tw.writeVariableBinding(it, variable) + } + } + + private fun extractLoop( + loop: IrLoop, + stmtExprParent: StmtExprParent, + callable: Label + ) { + val stmtParent = stmtExprParent.stmt(loop, callable) + val locId = tw.getLocation(loop) + + val idx: Int + val parent: Label + + val label = loop.label + if (label != null) { + val labeledStmt = tw.getFreshIdLabel() + tw.writeStmts_labeledstmt(labeledStmt, stmtParent.parent, stmtParent.idx, callable) + tw.writeHasLocation(labeledStmt, locId) + + tw.writeNamestrings(label, "", labeledStmt) + idx = 0 + parent = labeledStmt + } else { + idx = stmtParent.idx + parent = stmtParent.parent + } + + val id = if (loop is IrWhileLoop) { + val id = tw.getFreshIdLabel() + tw.writeStmts_whilestmt(id, parent, idx, callable) + id + } else { + val id = tw.getFreshIdLabel() + tw.writeStmts_dostmt(id, parent, idx, callable) + id + } + + tw.writeHasLocation(id, locId) + extractExpressionExpr(loop.condition, callable, id, 0, id) + val body = loop.body + if (body != null) { + extractExpressionStmt(body, callable, id, 1) + } + } + private fun IrValueParameter.isExtensionReceiver(): Boolean { val parentFun = parent as? IrFunction ?: return false return parentFun.extensionReceiverParameter == this @@ -3733,7 +3973,7 @@ open class KotlinFileExtractor( } } - fun extractVarargElement(e: IrVarargElement, callable: Label, parent: Label, idx: Int, enclosingStmt: Label) { + private fun extractVarargElement(e: IrVarargElement, callable: Label, parent: Label, idx: Int, enclosingStmt: Label) { with("vararg element", e) { val argExpr = when(e) { is IrExpression -> e @@ -3925,7 +4165,7 @@ open class KotlinFileExtractor( return initId } - fun extractTypeOperatorCall(e: IrTypeOperatorCall, callable: Label, parent: Label, idx: Int, enclosingStmt: Label) { + private fun extractTypeOperatorCall(e: IrTypeOperatorCall, callable: Label, parent: Label, idx: Int, enclosingStmt: Label) { with("type operator call", e) { when(e.operator) { IrTypeOperator.CAST -> { @@ -4201,7 +4441,7 @@ open class KotlinFileExtractor( private fun extractBreakContinue( e: IrBreakContinue, - id: Label + id: Label ) { with("break/continue", e) { val locId = tw.getLocation(e) @@ -4210,14 +4450,6 @@ open class KotlinFileExtractor( if (label != null) { tw.writeNamestrings(label, "", id) } - - val loopId = loopIdMap[e.loop] - if (loopId == null) { - logger.errorElement("Missing break/continue target", e) - return - } - - tw.writeKtBreakContinueTargets(id, loopId) } } @@ -4299,4 +4531,15 @@ open class KotlinFileExtractor( declarationStack.pop() } } + + private enum class CompilerGeneratedKinds(val kind: Int) { + DECLARING_CLASSES_OF_ADAPTER_FUNCTIONS(1), + GENERATED_DATA_CLASS_MEMBER(2), + DEFAULT_PROPERTY_ACCESSOR(3), + CLASS_INITIALISATION_METHOD(4), + ENUM_CLASS_SPECIAL_MEMBER(5), + DELEGATED_PROPERTY_GETTER(6), + DELEGATED_PROPERTY_SETTER(7), + JVMSTATIC_PROXY_METHOD(8), + } } diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt index b5fcad1372d..982a11c5f68 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinUsesExtractor.kt @@ -49,7 +49,7 @@ open class KotlinUsesExtractor( javaLangObject?.typeWith() } - fun usePackage(pkg: String): Label { + private fun usePackage(pkg: String): Label { return extractPackage(pkg) } @@ -154,12 +154,12 @@ open class KotlinUsesExtractor( } ?: argsIncludingOuterClasses } - fun isStaticClass(c: IrClass) = c.visibility != DescriptorVisibilities.LOCAL && !c.isInner + private fun isStaticClass(c: IrClass) = c.visibility != DescriptorVisibilities.LOCAL && !c.isInner // Gets nested inner classes starting at `c` and proceeding outwards to the innermost enclosing static class. // For example, for (java syntax) `class A { static class B { class C { class D { } } } }`, // `nonStaticParentsWithSelf(D)` = `[D, C, B]`. - fun parentsWithTypeParametersInScope(c: IrClass): List { + private fun parentsWithTypeParametersInScope(c: IrClass): List { val parentsList = c.parentsWithSelf.toList() val firstOuterClassIdx = parentsList.indexOfFirst { it is IrClass && isStaticClass(it) } return if (firstOuterClassIdx == -1) parentsList else parentsList.subList(0, firstOuterClassIdx + 1) @@ -168,14 +168,14 @@ open class KotlinUsesExtractor( // Gets the type parameter symbols that are in scope for class `c` in Kotlin order (i.e. for // `class NotInScope { static class OutermostInScope { class QueryClass { } } }`, // `getTypeParametersInScope(QueryClass)` = `[C, D, A, B]`. - fun getTypeParametersInScope(c: IrClass) = + private fun getTypeParametersInScope(c: IrClass) = parentsWithTypeParametersInScope(c).mapNotNull({ getTypeParameters(it) }).flatten() // Returns a map from `c`'s type variables in scope to type arguments `argsIncludingOuterClasses`. // Hack for the time being: the substituted types are always nullable, to prevent downstream code // from replacing a generic parameter by a primitive. As and when we extract Kotlin types we will // need to track this information in more detail. - fun makeTypeGenericSubstitutionMap(c: IrClass, argsIncludingOuterClasses: List) = + private fun makeTypeGenericSubstitutionMap(c: IrClass, argsIncludingOuterClasses: List) = getTypeParametersInScope(c).map({ it.symbol }).zip(argsIncludingOuterClasses.map { it.withQuestionMark(true) }).toMap() fun makeGenericSubstitutionFunction(c: IrClass, argsIncludingOuterClasses: List) = @@ -190,7 +190,7 @@ open class KotlinUsesExtractor( } // The Kotlin compiler internal representation of Outer.Inner.InnerInner.someFunction.LocalClass is LocalClass. This function returns [A, B, C, D, E, F, G, H, I, J]. - fun orderTypeArgsLeftToRight(c: IrClass, argsIncludingOuterClasses: List?): List? { + private fun orderTypeArgsLeftToRight(c: IrClass, argsIncludingOuterClasses: List?): List? { if(argsIncludingOuterClasses.isNullOrEmpty()) return argsIncludingOuterClasses val ret = ArrayList() @@ -237,15 +237,15 @@ open class KotlinUsesExtractor( return UseClassInstanceResult(classTypeResult, extractClass) } - fun isArray(t: IrSimpleType) = t.isBoxedArray || t.isPrimitiveArray() + private fun isArray(t: IrSimpleType) = t.isBoxedArray || t.isPrimitiveArray() - fun extractClassLaterIfExternal(c: IrClass) { + private fun extractClassLaterIfExternal(c: IrClass) { if (isExternalDeclaration(c)) { extractExternalClassLater(c) } } - fun extractExternalEnclosingClassLater(d: IrDeclaration) { + private fun extractExternalEnclosingClassLater(d: IrDeclaration) { when (val parent = d.parent) { is IrClass -> extractExternalClassLater(parent) is IrFunction -> extractExternalEnclosingClassLater(parent) @@ -254,7 +254,7 @@ open class KotlinUsesExtractor( } } - fun extractPropertyLaterIfExternalFileMember(p: IrProperty) { + private fun extractPropertyLaterIfExternalFileMember(p: IrProperty) { if (isExternalFileClassMember(p)) { extractExternalClassLater(p.parentAsClass) dependencyCollector?.addDependency(p, externalClassExtractor.propertySignature) @@ -262,7 +262,7 @@ open class KotlinUsesExtractor( } } - fun extractFieldLaterIfExternalFileMember(f: IrField) { + private fun extractFieldLaterIfExternalFileMember(f: IrField) { if (isExternalFileClassMember(f)) { extractExternalClassLater(f.parentAsClass) dependencyCollector?.addDependency(f, externalClassExtractor.fieldSignature) @@ -270,7 +270,7 @@ open class KotlinUsesExtractor( } } - fun extractFunctionLaterIfExternalFileMember(f: IrFunction) { + private fun extractFunctionLaterIfExternalFileMember(f: IrFunction) { if (isExternalFileClassMember(f)) { extractExternalClassLater(f.parentAsClass) (f as? IrSimpleFunction)?.correspondingPropertySymbol?.let { @@ -301,7 +301,7 @@ open class KotlinUsesExtractor( externalClassExtractor.extractLater(c) } - fun tryReplaceAndroidSyntheticClass(c: IrClass): IrClass { + private fun tryReplaceAndroidSyntheticClass(c: IrClass): IrClass { // The Android Kotlin Extensions Gradle plugin introduces synthetic functions, fields and classes. The most // obvious signature is that they lack any supertype information even though they are not root classes. // If possible, replace them by a real version of the same class. @@ -503,7 +503,7 @@ open class KotlinUsesExtractor( // but returns boxed arrays with a nullable, invariant component type, with any nested arrays // similarly transformed. For example, Array> would become Array?> // Array<*> will become Array. - fun getInvariantNullableArrayType(arrayType: IrSimpleType): IrSimpleType = + private fun getInvariantNullableArrayType(arrayType: IrSimpleType): IrSimpleType = if (arrayType.isPrimitiveArray()) arrayType else { @@ -528,7 +528,7 @@ open class KotlinUsesExtractor( ) } - fun useArrayType(arrayType: IrSimpleType, componentType: IrType, elementType: IrType, dimensions: Int, isPrimitiveArray: Boolean): TypeResults { + private fun useArrayType(arrayType: IrSimpleType, componentType: IrType, elementType: IrType, dimensions: Int, isPrimitiveArray: Boolean): TypeResults { // Ensure we extract Array as Integer[], not int[], for example: fun nullableIfNotPrimitive(type: IrType) = if (type.isPrimitiveType() && !isPrimitiveArray) type.makeNullable() else type @@ -579,7 +579,7 @@ open class KotlinUsesExtractor( RETURN, GENERIC_ARGUMENT, OTHER } - fun useSimpleType(s: IrSimpleType, context: TypeContext): TypeResults { + private fun useSimpleType(s: IrSimpleType, context: TypeContext): TypeResults { if (s.abbreviation != null) { // TODO: Extract this information } @@ -810,14 +810,14 @@ open class KotlinUsesExtractor( return if (f is IrConstructor) f.typeParameters else f.typeParameters.filter { it.parent == f } } - fun getTypeParameters(dp: IrDeclarationParent): List = + private fun getTypeParameters(dp: IrDeclarationParent): List = when(dp) { is IrClass -> dp.typeParameters is IrFunction -> getFunctionTypeParameters(dp) else -> listOf() } - fun getEnclosingClass(it: IrDeclarationParent): IrClass? = + private fun getEnclosingClass(it: IrDeclarationParent): IrClass? = when(it) { is IrClass -> it is IrFunction -> getEnclosingClass(it.parent) @@ -924,7 +924,7 @@ open class KotlinUsesExtractor( null } ?: t - fun getJavaTypeArgument(jt: JavaType, idx: Int) = + private fun getJavaTypeArgument(jt: JavaType, idx: Int) = when(jt) { is JavaClassifierType -> jt.typeArguments.getOrNull(idx) is JavaArrayType -> if (idx == 0) jt.componentType else null @@ -1146,15 +1146,6 @@ open class KotlinUsesExtractor( return res } - fun useFunctionCommon(f: IrFunction, label: String): Label { - val id: Label = tw.getLabelFor(label) - if (isExternalDeclaration(f)) { - extractFunctionLaterIfExternalFileMember(f) - extractExternalEnclosingClassLater(f) - } - return id - } - // These are classes with Java equivalents, but whose methods don't all exist on those Java equivalents-- // for example, the numeric classes define arithmetic functions (Int.plus, Long.or and so on) that lower to // primitive arithmetic on the JVM, but which we extract as calls to reflect the source syntax more closely. @@ -1162,7 +1153,7 @@ open class KotlinUsesExtractor( "kotlin.Boolean", "kotlin.Byte", "kotlin.Char", "kotlin.Double", "kotlin.Float", "kotlin.Int", "kotlin.Long", "kotlin.Number", "kotlin.Short" ) - fun kotlinFunctionToJavaEquivalent(f: IrFunction, noReplace: Boolean) = + private fun kotlinFunctionToJavaEquivalent(f: IrFunction, noReplace: Boolean) = if (noReplace) f else @@ -1210,20 +1201,24 @@ open class KotlinUsesExtractor( } as IrFunction? ?: f fun useFunction(f: IrFunction, classTypeArgsIncludingOuterClasses: List? = null, noReplace: Boolean = false): Label { + return useFunction(f, null, classTypeArgsIncludingOuterClasses, noReplace) + } + + fun useFunction(f: IrFunction, parentId: Label?, classTypeArgsIncludingOuterClasses: List?, noReplace: Boolean = false): Label { if (f.isLocalFunction()) { val ids = getLocallyVisibleFunctionLabels(f) return ids.function.cast() - } else { - val realFunction = kotlinFunctionToJavaEquivalent(f, noReplace) - return useFunctionCommon(realFunction, getFunctionLabel(realFunction, classTypeArgsIncludingOuterClasses)) } + val javaFun = kotlinFunctionToJavaEquivalent(f, noReplace) + val label = getFunctionLabel(javaFun, parentId, classTypeArgsIncludingOuterClasses) + val id: Label = tw.getLabelFor(label) + if (isExternalDeclaration(javaFun)) { + extractFunctionLaterIfExternalFileMember(javaFun) + extractExternalEnclosingClassLater(javaFun) + } + return id } - fun useFunction(f: IrFunction, parentId: Label, classTypeArgsIncludingOuterClasses: List?, noReplace: Boolean = false) = - kotlinFunctionToJavaEquivalent(f, noReplace).let { - useFunctionCommon(it, getFunctionLabel(it, parentId, classTypeArgsIncludingOuterClasses)) - } - fun getTypeArgumentLabel( arg: IrTypeArgument ): TypeResult { @@ -1351,14 +1346,14 @@ open class KotlinUsesExtractor( return "@\"typevar;{$parentLabel};${param.name}\"" } - fun useTypeParameter(param: IrTypeParameter) = + private fun useTypeParameter(param: IrTypeParameter) = TypeResult( tw.getLabelFor(getTypeParameterLabel(param)), useType(eraseTypeParameter(param)).javaResult.signature, param.name.asString() ) - fun extractModifier(m: String): Label { + private fun extractModifier(m: String): Label { val modifierLabel = "@\"modifier;$m\"" val id: Label = tw.getLabelFor(modifierLabel, { tw.writeModifiers(it, m) @@ -1440,7 +1435,7 @@ open class KotlinUsesExtractor( * Note that `Array` is retained (with `T` itself erased) because these are expected to be lowered to Java * arrays, which are not generic. */ - fun erase (t: IrType): IrType { + private fun erase (t: IrType): IrType { if (t is IrSimpleType) { val classifier = t.classifier val owner = classifier.owner @@ -1464,7 +1459,7 @@ open class KotlinUsesExtractor( return t } - fun eraseTypeParameter(t: IrTypeParameter) = + private fun eraseTypeParameter(t: IrTypeParameter) = erase(t.superTypes[0]) /** @@ -1493,7 +1488,7 @@ open class KotlinUsesExtractor( fun useValueParameter(vp: IrValueParameter, parent: Label?): Label = tw.getLabelFor(getValueParameterLabel(vp, parent)) - fun isDirectlyExposedCompanionObjectField(f: IrField) = + private fun isDirectlyExposedCompanionObjectField(f: IrField) = f.hasAnnotation(FqName("kotlin.jvm.JvmField")) || f.correspondingPropertySymbol?.owner?.let { it.isConst || it.isLateinit @@ -1519,7 +1514,7 @@ open class KotlinUsesExtractor( // otherwise two extension properties declared in the same enclosing context will get // clashing trap labels. These are always private, so we can just make up a label without // worrying about their names as seen from Java. - val extensionPropertyDiscriminator = getExtensionReceiverType(f)?.let { "extension;${useType(it)}" } ?: "" + val extensionPropertyDiscriminator = getExtensionReceiverType(f)?.let { "extension;${useType(it).javaResult.id}" } ?: "" return "@\"field;{$parentId};${extensionPropertyDiscriminator}${f.name.asString()}\"" } diff --git a/java/kotlin-extractor/src/main/kotlin/PrimitiveTypeInfo.kt b/java/kotlin-extractor/src/main/kotlin/PrimitiveTypeInfo.kt index 6eaa27b0ca4..8d844a65ec8 100644 --- a/java/kotlin-extractor/src/main/kotlin/PrimitiveTypeInfo.kt +++ b/java/kotlin-extractor/src/main/kotlin/PrimitiveTypeInfo.kt @@ -1,14 +1,21 @@ package com.github.codeql import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext +import org.jetbrains.kotlin.builtins.StandardNames import org.jetbrains.kotlin.ir.declarations.IrClass +import org.jetbrains.kotlin.ir.declarations.IrPackageFragment import org.jetbrains.kotlin.ir.types.IrSimpleType -import org.jetbrains.kotlin.ir.types.IdSignatureValues -import org.jetbrains.kotlin.ir.util.IdSignature +import org.jetbrains.kotlin.ir.types.classOrNull import org.jetbrains.kotlin.name.FqName class PrimitiveTypeMapping(val logger: Logger, val pluginContext: IrPluginContext) { - fun getPrimitiveInfo(s: IrSimpleType) = mapping[s.classifier.signature] + fun getPrimitiveInfo(s: IrSimpleType) = + s.classOrNull?.let { + if ((it.owner.parent as? IrPackageFragment)?.fqName == StandardNames.BUILT_INS_PACKAGE_FQ_NAME) + mapping[it.owner.name] + else + null + } data class PrimitiveTypeInfo( val primitiveName: String?, @@ -60,25 +67,25 @@ class PrimitiveTypeMapping(val logger: Logger, val pluginContext: IrPluginContex val javaLangVoid = findClass("java.lang.Void", kotlinNothing) mapOf( - IdSignatureValues._byte to PrimitiveTypeInfo("byte", true, javaLangByte, "kotlin", "Byte"), - IdSignatureValues._short to PrimitiveTypeInfo("short", true, javaLangShort, "kotlin", "Short"), - IdSignatureValues._int to PrimitiveTypeInfo("int", true, javaLangInteger, "kotlin", "Int"), - IdSignatureValues._long to PrimitiveTypeInfo("long", true, javaLangLong, "kotlin", "Long"), + StandardNames.FqNames._byte.shortName() to PrimitiveTypeInfo("byte", true, javaLangByte, "kotlin", "Byte"), + StandardNames.FqNames._short.shortName() to PrimitiveTypeInfo("short", true, javaLangShort, "kotlin", "Short"), + StandardNames.FqNames._int.shortName() to PrimitiveTypeInfo("int", true, javaLangInteger, "kotlin", "Int"), + StandardNames.FqNames._long.shortName() to PrimitiveTypeInfo("long", true, javaLangLong, "kotlin", "Long"), - IdSignatureValues.uByte to PrimitiveTypeInfo("byte", true, kotlinUByte, "kotlin", "UByte"), - IdSignatureValues.uShort to PrimitiveTypeInfo("short", true, kotlinUShort, "kotlin", "UShort"), - IdSignatureValues.uInt to PrimitiveTypeInfo("int", true, kotlinUInt, "kotlin", "UInt"), - IdSignatureValues.uLong to PrimitiveTypeInfo("long", true, kotlinULong, "kotlin", "ULong"), + StandardNames.FqNames.uByteFqName.shortName() to PrimitiveTypeInfo("byte", true, kotlinUByte, "kotlin", "UByte"), + StandardNames.FqNames.uShortFqName.shortName() to PrimitiveTypeInfo("short", true, kotlinUShort, "kotlin", "UShort"), + StandardNames.FqNames.uIntFqName.shortName() to PrimitiveTypeInfo("int", true, kotlinUInt, "kotlin", "UInt"), + StandardNames.FqNames.uLongFqName.shortName() to PrimitiveTypeInfo("long", true, kotlinULong, "kotlin", "ULong"), - IdSignatureValues._double to PrimitiveTypeInfo("double", true, javaLangDouble, "kotlin", "Double"), - IdSignatureValues._float to PrimitiveTypeInfo("float", true, javaLangFloat, "kotlin", "Float"), + StandardNames.FqNames._double.shortName() to PrimitiveTypeInfo("double", true, javaLangDouble, "kotlin", "Double"), + StandardNames.FqNames._float.shortName() to PrimitiveTypeInfo("float", true, javaLangFloat, "kotlin", "Float"), - IdSignatureValues._boolean to PrimitiveTypeInfo("boolean", true, javaLangBoolean, "kotlin", "Boolean"), + StandardNames.FqNames._boolean.shortName() to PrimitiveTypeInfo("boolean", true, javaLangBoolean, "kotlin", "Boolean"), - IdSignatureValues._char to PrimitiveTypeInfo("char", true, javaLangCharacter, "kotlin", "Char"), + StandardNames.FqNames._char.shortName() to PrimitiveTypeInfo("char", true, javaLangCharacter, "kotlin", "Char"), - IdSignatureValues.unit to PrimitiveTypeInfo("void", false, kotlinUnit, "kotlin", "Unit"), - IdSignatureValues.nothing to PrimitiveTypeInfo(null, true, javaLangVoid, "kotlin", "Nothing"), + StandardNames.FqNames.unit.shortName() to PrimitiveTypeInfo("void", false, kotlinUnit, "kotlin", "Unit"), + StandardNames.FqNames.nothing.shortName() to PrimitiveTypeInfo(null, true, javaLangVoid, "kotlin", "Nothing"), ) }() } diff --git a/java/kotlin-extractor/src/main/kotlin/utils/AutoCloseableUse.kt b/java/kotlin-extractor/src/main/kotlin/utils/AutoCloseableUse.kt index fe68f308893..dad820ab6ee 100644 --- a/java/kotlin-extractor/src/main/kotlin/utils/AutoCloseableUse.kt +++ b/java/kotlin-extractor/src/main/kotlin/utils/AutoCloseableUse.kt @@ -40,4 +40,4 @@ fun AutoCloseable?.closeFinallyAC(cause: Throwable?) = when { } catch (closeException: Throwable) { cause.addSuppressed(closeException) } -} \ No newline at end of file +} diff --git a/java/kotlin-extractor/src/main/kotlin/utils/ClassNames.kt b/java/kotlin-extractor/src/main/kotlin/utils/ClassNames.kt index 6f3954cfc34..15ca35a1438 100644 --- a/java/kotlin-extractor/src/main/kotlin/utils/ClassNames.kt +++ b/java/kotlin-extractor/src/main/kotlin/utils/ClassNames.kt @@ -68,7 +68,7 @@ fun getIrClassVirtualFile(irClass: IrClass): VirtualFile? { return null } -fun getRawIrClassBinaryPath(irClass: IrClass) = +private fun getRawIrClassBinaryPath(irClass: IrClass) = getIrClassVirtualFile(irClass)?.let { val path = it.path if(it.fileSystem.protocol == StandardFileSystems.JRT_PROTOCOL) @@ -92,4 +92,4 @@ fun getContainingClassOrSelf(decl: IrDeclaration): IrClass? { } fun getJavaEquivalentClassId(c: IrClass) = - c.fqNameWhenAvailable?.toUnsafe()?.let { JavaToKotlinClassMap.mapKotlinToJava(it) } \ No newline at end of file + c.fqNameWhenAvailable?.toUnsafe()?.let { JavaToKotlinClassMap.mapKotlinToJava(it) } diff --git a/java/kotlin-extractor/src/main/kotlin/utils/JvmNames.kt b/java/kotlin-extractor/src/main/kotlin/utils/JvmNames.kt index dce49790e0e..57a3e92e6b2 100644 --- a/java/kotlin-extractor/src/main/kotlin/utils/JvmNames.kt +++ b/java/kotlin-extractor/src/main/kotlin/utils/JvmNames.kt @@ -55,7 +55,7 @@ private val specialFunctions = mapOf( private val specialFunctionShortNames = specialFunctions.keys.map { it.functionName }.toSet() -fun getSpecialJvmName(f: IrFunction): String? { +private fun getSpecialJvmName(f: IrFunction): String? { if (specialFunctionShortNames.contains(f.name) && f is IrSimpleFunction) { f.allOverridden(true).forEach { overriddenFunc -> overriddenFunc.parentClassOrNull?.fqNameWhenAvailable?.let { parentFqName -> @@ -87,4 +87,4 @@ fun getJvmName(container: IrAnnotationContainer): String? { } } return (container as? IrFunction)?.let { getSpecialJvmName(container) } -} \ No newline at end of file +} diff --git a/java/kotlin-extractor/src/main/kotlin/utils/Logger.kt b/java/kotlin-extractor/src/main/kotlin/utils/Logger.kt index 1349380cbc4..ca27217ac6c 100644 --- a/java/kotlin-extractor/src/main/kotlin/utils/Logger.kt +++ b/java/kotlin-extractor/src/main/kotlin/utils/Logger.kt @@ -207,20 +207,6 @@ open class LoggerBase(val logCounter: LogCounter) { } open class Logger(val loggerBase: LoggerBase, open val tw: TrapWriter) { - private fun getDiagnosticLocation(): String? { - val st = Exception().stackTrace - for(x in st) { - when(x.className) { - "com.github.codeql.Logger", - "com.github.codeql.FileLogger" -> {} - else -> { - return x.toString() - } - } - } - return null - } - fun flush() { tw.flush() loggerBase.flush() @@ -240,7 +226,7 @@ open class Logger(val loggerBase: LoggerBase, open val tw: TrapWriter) { loggerBase.info(tw, msg) } - fun warn(msg: String, extraInfo: String?) { + private fun warn(msg: String, extraInfo: String?) { loggerBase.warn(tw, msg, extraInfo) } fun warn(msg: String, exn: Throwable) { @@ -250,7 +236,7 @@ open class Logger(val loggerBase: LoggerBase, open val tw: TrapWriter) { warn(msg, null) } - fun error(msg: String, extraInfo: String?) { + private fun error(msg: String, extraInfo: String?) { loggerBase.error(tw, msg, extraInfo) } fun error(msg: String) { diff --git a/java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt b/java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt index b249bb0091a..694b3dff289 100644 --- a/java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt +++ b/java/kotlin-extractor/src/main/kotlin/utils/TypeSubstitution.kt @@ -37,7 +37,7 @@ fun IrType.substituteTypeArguments(params: List, arguments: Lis else -> this } -fun IrSimpleType.substituteTypeArguments(substitutionMap: Map): IrSimpleType { +private fun IrSimpleType.substituteTypeArguments(substitutionMap: Map): IrSimpleType { if (substitutionMap.isEmpty()) return this val newArguments = arguments.map { @@ -100,7 +100,7 @@ private fun subProjectedType(substitutionMap: Map context.irBuiltIns.anyNType is IrTypeProjection -> when(this.variance) { @@ -111,7 +111,7 @@ fun IrTypeArgument.upperBound(context: IrPluginContext) = else -> context.irBuiltIns.anyNType } -fun IrTypeArgument.lowerBound(context: IrPluginContext) = +private fun IrTypeArgument.lowerBound(context: IrPluginContext) = when(this) { is IrStarProjection -> context.irBuiltIns.nothingType is IrTypeProjection -> when(this.variance) { @@ -200,7 +200,7 @@ fun IrTypeArgument.withQuestionMark(b: Boolean): IrTypeArgument = typealias TypeSubstitution = (IrType, KotlinUsesExtractor.TypeContext, IrPluginContext) -> IrType -fun matchingTypeParameters(l: IrTypeParameter?, r: IrTypeParameter): Boolean { +private fun matchingTypeParameters(l: IrTypeParameter?, r: IrTypeParameter): Boolean { if (l === r) return true if (l == null) diff --git a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/Descriptors.kt b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/Descriptors.kt deleted file mode 100644 index 77cd96d541d..00000000000 --- a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/Descriptors.kt +++ /dev/null @@ -1,9 +0,0 @@ -package com.github.codeql.utils.versions - -import com.github.codeql.KotlinUsesExtractor -import org.jetbrains.kotlin.ir.util.DeclarationStubGenerator - -fun KotlinUsesExtractor.getIrStubFromDescriptor(generateStub: (DeclarationStubGenerator) -> TIrStub) : TIrStub? { - logger.error("Descriptors not yet supported for Kotlin 1.7") - return null -} diff --git a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/Descriptors.kt b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/Descriptors.kt new file mode 100644 index 00000000000..45b2afcc858 --- /dev/null +++ b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/Descriptors.kt @@ -0,0 +1,27 @@ +package com.github.codeql.utils.versions + +import com.github.codeql.KotlinUsesExtractor +import org.jetbrains.kotlin.backend.common.serialization.DescriptorByIdSignatureFinderImpl +import org.jetbrains.kotlin.idea.MainFunctionDetector +import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI +import org.jetbrains.kotlin.ir.backend.jvm.serialization.JvmDescriptorMangler +import org.jetbrains.kotlin.ir.util.DeclarationStubGenerator +import org.jetbrains.kotlin.ir.util.SymbolTable +import org.jetbrains.kotlin.psi2ir.generators.DeclarationStubGeneratorImpl + +@OptIn(ObsoleteDescriptorBasedAPI::class) +fun KotlinUsesExtractor.getIrStubFromDescriptor(generateStub: (DeclarationStubGenerator) -> TIrStub) : TIrStub? = + (pluginContext.symbolTable as? SymbolTable) ?.let { + // Copying the construction seen in JvmIrLinker.kt + val mangler = JvmDescriptorMangler(MainFunctionDetector(pluginContext.bindingContext, pluginContext.languageVersionSettings)) + val descriptorFinder = DescriptorByIdSignatureFinderImpl( + pluginContext.moduleDescriptor, + mangler, + DescriptorByIdSignatureFinderImpl.LookupMode.MODULE_ONLY + ) + val stubGenerator = DeclarationStubGeneratorImpl(pluginContext.moduleDescriptor, it, pluginContext.irBuiltIns, descriptorFinder) + generateStub(stubGenerator) + } ?: run { + logger.error("Plugin context has no symbol table, couldn't get IR stub") + null + } diff --git a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/FileEntry.kt b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/FileEntry.kt similarity index 100% rename from java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/FileEntry.kt rename to java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/FileEntry.kt diff --git a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/Functions.kt b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/Functions.kt similarity index 100% rename from java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/Functions.kt rename to java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/Functions.kt diff --git a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/Psi2Ir.kt b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/Psi2Ir.kt similarity index 100% rename from java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/Psi2Ir.kt rename to java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/Psi2Ir.kt diff --git a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/Types.kt b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/Types.kt similarity index 100% rename from java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/Types.kt rename to java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/Types.kt diff --git a/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/withHasQuestionMark.kt b/java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/withHasQuestionMark.kt similarity index 100% rename from java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC/withHasQuestionMark.kt rename to java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0/withHasQuestionMark.kt diff --git a/java/ql/consistency-queries/calls.ql b/java/ql/consistency-queries/calls.ql index 207d7bd45b3..78ebc3fa9a6 100644 --- a/java/ql/consistency-queries/calls.ql +++ b/java/ql/consistency-queries/calls.ql @@ -1,5 +1,10 @@ import java from MethodAccess ma -where not exists(ma.getQualifier()) and ma.getFile().isKotlinSourceFile() +// Generally Kotlin calls will always use an explicit qualifier, except for calls +// to the synthetic instance initializer , which use an implicit `this`. +where + not exists(ma.getQualifier()) and + ma.getFile().isKotlinSourceFile() and + not ma.getCallee() instanceof InstanceInitializer select ma diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/PrintAst.expected b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/PrintAst.expected new file mode 100644 index 00000000000..51186ef7b15 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/PrintAst.expected @@ -0,0 +1,83 @@ +a.kt: +# 0| [CompilationUnit] a +# 1| 1: [Class] A +# 0| 1: [Method] +# 0| 3: [TypeAccess] int +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [IntegerLiteral] 42 +# 1| 2: [Constructor] A +# 1| 5: [BlockStmt] { ... } +# 1| 0: [SuperConstructorInvocationStmt] super(...) +# 1| 1: [BlockStmt] { ... } +# 2| 3: [Method] f1 +# 2| 3: [TypeAccess] int +# 2| 5: [BlockStmt] { ... } +# 2| 0: [ReturnStmt] return ... +# 2| 0: [IntegerLiteral] 1 +b.kt: +# 0| [CompilationUnit] b +# 1| 1: [Class] B +# 0| 1: [Method] +# 0| 3: [TypeAccess] int +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [UnsafeCoerceExpr] +# 0| 0: [TypeAccess] int +# 0| 1: [IntegerLiteral] 1 +# 1| 2: [Constructor] B +# 1| 5: [BlockStmt] { ... } +# 1| 0: [SuperConstructorInvocationStmt] super(...) +# 1| 1: [BlockStmt] { ... } +c.kt: +# 0| [CompilationUnit] c +# 1| 1: [Class] C +# 0| 1: [Method] +# 0| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 0| 0: [Parameter] param +# 0| 0: [TypeAccess] ProcessBuilder +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [MethodAccess] start(...) +# 0| -1: [VarAccess] param +# 1| 2: [Constructor] C +# 1| 5: [BlockStmt] { ... } +# 1| 0: [SuperConstructorInvocationStmt] super(...) +# 1| 1: [BlockStmt] { ... } +d.kt: +# 0| [CompilationUnit] d +# 1| 1: [Class] D +# 0| 2: [FieldDeclaration] String bar; +# 0| -1: [TypeAccess] String +# 0| 0: [StringLiteral] Foobar +# 1| 3: [Constructor] D +# 1| 5: [BlockStmt] { ... } +# 1| 0: [SuperConstructorInvocationStmt] super(...) +# 1| 1: [BlockStmt] { ... } +e.kt: +# 0| [CompilationUnit] e +# 1| 1: [Class] E +# 0| 1: [Method] +# 0| 3: [TypeAccess] boolean +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [MethodAccess] add(...) +# 0| -1: [ClassInstanceExpr] new ArrayList(...) +# 0| -3: [TypeAccess] ArrayList +# 0| 0: [IntegerLiteral] 1 +# 0| 0: [NullLiteral] null +# 0| 2: [Method] +# 0| 3: [TypeAccess] Object +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [MethodAccess] put(...) +# 0| -1: [ClassInstanceExpr] new LinkedHashMap(...) +# 0| -3: [TypeAccess] LinkedHashMap +# 0| 0: [IntegerLiteral] 1 +# 0| 0: [NullLiteral] null +# 0| 1: [NullLiteral] null +# 1| 3: [Constructor] E +# 1| 5: [BlockStmt] { ... } +# 1| 0: [SuperConstructorInvocationStmt] super(...) +# 1| 1: [BlockStmt] { ... } diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/PrintAst.qlref b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/PrintAst.qlref new file mode 100644 index 00000000000..c7fd5faf239 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/PrintAst.qlref @@ -0,0 +1 @@ +semmle/code/java/PrintAst.ql \ No newline at end of file diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/a.kt b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/a.kt new file mode 100644 index 00000000000..922e7e86703 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/a.kt @@ -0,0 +1,3 @@ +class A { + fun f1() = 1 +} diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/b.kt b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/b.kt new file mode 100644 index 00000000000..7d95eb64996 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/b.kt @@ -0,0 +1,2 @@ +class B { +} diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/build_plugin b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/build_plugin new file mode 100755 index 00000000000..c38ab33eb75 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/build_plugin @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +import subprocess +import shutil +import os +import os.path +import sys +import shlex + + +def run_process(cmd): + try: + print("Running command: " + shlex.join(cmd)) + return subprocess.run(cmd, check=True, capture_output=True) + except subprocess.CalledProcessError as e: + print("In: " + os.getcwd(), file=sys.stderr) + print("Command failed: " + shlex.join(cmd), file=sys.stderr) + print("stdout output:\n" + e.stdout.decode(encoding='UTF-8', + errors='strict'), file=sys.stderr) + print("stderr output:\n" + e.stderr.decode(encoding='UTF-8', + errors='strict'), file=sys.stderr) + raise e + +root = '../../../../../../../../..' + +sys.path.append(root + '/ql/java/kotlin-extractor') +import kotlin_plugin_versions +defaultKotlinDependencyVersion = kotlin_plugin_versions.get_single_version() + +builddir = 'build' +dependency_dir = root + '/resources/kotlin-dependencies/' +dependencies = ['kotlin-stdlib-' + defaultKotlinDependencyVersion + + '.jar', 'kotlin-compiler-' + defaultKotlinDependencyVersion + '.jar'] +classpath = ':'.join([dependency_dir + dep for dep in dependencies]) +srcs = ['plugin/Plugin.kt'] +output = 'plugin.jar' + +if os.path.exists(builddir): + shutil.rmtree(builddir) +os.makedirs(builddir) + +run_process(['kotlinc', + '-J-Xmx2G', + '-d', builddir, + '-module-name', 'test', + '-no-reflect', '-no-stdlib', + '-jvm-target', '1.8', + '-classpath', classpath] + srcs) + +run_process(['jar', '-c', '-f', output, + '-C', builddir, '.', + '-C', 'plugin/resources', 'META-INF']) +shutil.rmtree(builddir) diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/c.kt b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/c.kt new file mode 100644 index 00000000000..b0a84db03d1 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/c.kt @@ -0,0 +1 @@ +class C { } diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/d.kt b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/d.kt new file mode 100644 index 00000000000..8472937f6bc --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/d.kt @@ -0,0 +1 @@ +class D { } diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/diagnostics.expected b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/diagnostics.expected new file mode 100644 index 00000000000..183abf9a986 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/diagnostics.expected @@ -0,0 +1,2 @@ +| CodeQL Kotlin extractor | 2 | | IrProperty without a getter | d.kt:0:0:0:0 | d.kt:0:0:0:0 | +| CodeQL Kotlin extractor | 2 | | Not rewriting trap file for: Boolean -1.0-0- -1.0-0-null test-db/trap/java/classes/kotlin/Boolean.members.trap.gz | file://:0:0:0:0 | file://:0:0:0:0 | diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/diagnostics.ql b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/diagnostics.ql new file mode 100755 index 00000000000..57ec32bb048 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/diagnostics.ql @@ -0,0 +1,13 @@ +import java + +from string genBy, int severity, string tag, string msg, Location l +where + diagnostics(_, genBy, severity, tag, msg, _, l) and + ( + // Different installations get different sets of these messages, + // so we filter out all but one that happens everywhere. + msg.matches("Not rewriting trap file for: %") + implies + msg.matches("Not rewriting trap file for: Boolean %") + ) +select genBy, severity, tag, msg, l diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/e.kt b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/e.kt new file mode 100644 index 00000000000..f4b8aa5df61 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/e.kt @@ -0,0 +1 @@ +class E { } diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/methods.expected b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/methods.expected new file mode 100644 index 00000000000..c485610e7b3 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/methods.expected @@ -0,0 +1,7 @@ +| a.kt:0:0:0:0 | | has body | +| a.kt:2:5:2:16 | f1 | has body | +| b.kt:0:0:0:0 | | has body | +| c.kt:0:0:0:0 | | has body | +| d.kt:0:0:0:0 | | has body | +| e.kt:0:0:0:0 | | has body | +| e.kt:0:0:0:0 | | has body | diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/methods.ql b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/methods.ql new file mode 100755 index 00000000000..adb7c8784e5 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/methods.ql @@ -0,0 +1,7 @@ +import java + +from Method m, string body +where + m.fromSource() and + if exists(m.getBody()) then body = "has body" else body = "has no body" +select m, body diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/plugin/Plugin.kt b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/plugin/Plugin.kt new file mode 100644 index 00000000000..c88410ca9db --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/plugin/Plugin.kt @@ -0,0 +1,280 @@ +package com.github.codeql + +import com.intellij.mock.MockProject +import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext +import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension +import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext +import org.jetbrains.kotlin.backend.common.ir.createImplicitParameterDeclarationWithWrappedDescriptor +import org.jetbrains.kotlin.backend.common.lower.DeclarationIrBuilder +import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.descriptors.DescriptorVisibilities +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI +import org.jetbrains.kotlin.ir.builders.declarations.* +import org.jetbrains.kotlin.ir.builders.irCall +import org.jetbrains.kotlin.ir.builders.irExprBody +import org.jetbrains.kotlin.ir.builders.irGet +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.declarations.impl.IrExternalPackageFragmentImpl +import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl +import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl +import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl +import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl +import org.jetbrains.kotlin.ir.symbols.IrClassSymbol +import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol +import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol +import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.defaultType +import org.jetbrains.kotlin.ir.types.typeWith +import org.jetbrains.kotlin.ir.util.defaultType +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name + +class TestComponentRegistrar : ComponentRegistrar { + override fun registerProjectComponents( + project: MockProject, + configuration: CompilerConfiguration + ) { + IrGenerationExtension.registerExtension(project, IrAdder()) + } +} + +@OptIn(ObsoleteDescriptorBasedAPI::class) +class IrAdder : IrGenerationExtension { + override fun generate(moduleFragment: IrModuleFragment, pluginContext: IrPluginContext) { + + class AndroidSymbols { + private val irFactory: IrFactory = IrFactoryImpl + private val kotlinJvmInternalPackage: IrPackageFragment = createPackage("kotlin.jvm.internal") + private val javaUtil: IrPackageFragment = createPackage("java.util") + + private fun createPackage(packageName: String): IrPackageFragment = + IrExternalPackageFragmentImpl.createEmptyExternalPackageFragment( + moduleFragment.descriptor, + FqName(packageName) + ) + + private fun createClass( + irPackage: IrPackageFragment, + shortName: String, + classKind: ClassKind, + classModality: Modality + ): IrClassSymbol = irFactory.buildClass { + name = Name.identifier(shortName) + kind = classKind + modality = classModality + }.apply { + parent = irPackage + createImplicitParameterDeclarationWithWrappedDescriptor() + }.symbol + + val unsafeCoerceIntrinsic: IrSimpleFunctionSymbol = + irFactory.buildFun { + name = Name.special("") + origin = IrDeclarationOrigin.IR_BUILTINS_STUB + }.apply { + parent = kotlinJvmInternalPackage + val src = addTypeParameter("T", pluginContext.irBuiltIns.anyNType) + val dst = addTypeParameter("R", pluginContext.irBuiltIns.anyNType) + addValueParameter("v", src.defaultType) + returnType = dst.defaultType + }.symbol + + val javaUtilArrayList: IrClassSymbol = + createClass(javaUtil, "ArrayList", ClassKind.CLASS, Modality.OPEN) + + val javaUtilLinkedHashMap: IrClassSymbol = + createClass(javaUtil, "LinkedHashMap", ClassKind.CLASS, Modality.OPEN) + + val arrayListConstructor: IrConstructorSymbol = javaUtilArrayList.owner.addConstructor().apply { + addValueParameter("p_0", pluginContext.irBuiltIns.intType) + }.symbol + + val arrayListAdd: IrSimpleFunctionSymbol = + javaUtilArrayList.owner.addFunction("add", pluginContext.irBuiltIns.booleanType).apply { + addValueParameter("p_0", pluginContext.irBuiltIns.anyNType) + }.symbol + + val linkedHashMapConstructor: IrConstructorSymbol = + javaUtilLinkedHashMap.owner.addConstructor().apply { + addValueParameter("p_0", pluginContext.irBuiltIns.intType) + }.symbol + + val linkedHashMapPut: IrSimpleFunctionSymbol = + javaUtilLinkedHashMap.owner.addFunction("put", pluginContext.irBuiltIns.anyNType).apply { + addValueParameter("p_0", pluginContext.irBuiltIns.anyNType) + addValueParameter("p_1", pluginContext.irBuiltIns.anyNType) + }.symbol + } + + moduleFragment.transform(object: IrElementTransformerVoidWithContext() { + override fun visitClassNew(declaration: IrClass): IrStatement { + if (declaration.name.asString() == "A") { + addFunWithExprBody(declaration) + } else if (declaration.name.asString() == "B") { + addFunWithUnsafeCoerce(declaration) + } else if (declaration.name.asString() == "C") { + addFunWithStubClass(declaration) + } else if (declaration.name.asString() == "D") { + addStaticFieldWithExprInit(declaration) + } else if (declaration.name.asString() == "E") { + addFunWithArrayListAdd(declaration) + addFunWithLinkedHashMapPut(declaration) + } + + return super.visitClassNew(declaration) + } + + fun unsafeCoerce(value: IrExpression, fromType: IrType, toType: IrType): IrExpression { + return IrCallImpl.fromSymbolOwner(-1, -1, toType, AndroidSymbols().unsafeCoerceIntrinsic).apply { + putTypeArgument(0, fromType) + putTypeArgument(1, toType) + putValueArgument(0, value) + } + } + + private fun arrayListAdd(): IrExpression { + // ArrayList(1).add(null) + var androidSymbols = AndroidSymbols() + return IrCallImpl.fromSymbolOwner(-1, -1, pluginContext.irBuiltIns.booleanType, androidSymbols.arrayListAdd).apply { + dispatchReceiver = IrConstructorCallImpl.fromSymbolOwner(-1,-1, androidSymbols.javaUtilArrayList.typeWith(), androidSymbols.arrayListConstructor).apply { + putValueArgument(0, IrConstImpl.int(-1, -1, pluginContext.irBuiltIns.intType, 1)) + } + putValueArgument(0, IrConstImpl.constNull(-1,-1, pluginContext.irBuiltIns.anyNType)) + } + } + + private fun linkedHashMapPut(): IrExpression { + // LinkedHashMap(1).put(null, null) + var androidSymbols = AndroidSymbols() + return IrCallImpl.fromSymbolOwner(-1, -1, pluginContext.irBuiltIns.anyNType, androidSymbols.linkedHashMapPut).apply { + dispatchReceiver = IrConstructorCallImpl.fromSymbolOwner(-1,-1, androidSymbols.javaUtilLinkedHashMap.typeWith(), androidSymbols.linkedHashMapConstructor).apply { + putValueArgument(0, IrConstImpl.int(-1, -1, pluginContext.irBuiltIns.intType, 1)) + } + putValueArgument(0, IrConstImpl.constNull(-1,-1, pluginContext.irBuiltIns.anyNType)) + putValueArgument(1, IrConstImpl.constNull(-1,-1, pluginContext.irBuiltIns.anyNType)) + } + } + + private fun addFunWithArrayListAdd(declaration: IrClass) { + declaration.declarations.add(pluginContext.irFactory.buildFun { + name = Name.identifier("") + returnType = pluginContext.irBuiltIns.booleanType + }. also { + it.body = DeclarationIrBuilder(pluginContext, it.symbol) + .irExprBody( + arrayListAdd() + ) + it.parent = declaration + }) + } + + private fun addFunWithLinkedHashMapPut(declaration: IrClass) { + declaration.declarations.add(pluginContext.irFactory.buildFun { + name = Name.identifier("") + returnType = pluginContext.irBuiltIns.anyNType + }. also { + it.body = DeclarationIrBuilder(pluginContext, it.symbol) + .irExprBody( + linkedHashMapPut() + ) + it.parent = declaration + }) + } + + private fun addFunWithUnsafeCoerce(declaration: IrClass) { + val uintType = pluginContext.referenceClass(FqName("kotlin.UInt"))!!.owner.typeWith() + declaration.declarations.add(pluginContext.irFactory.buildFun { + name = Name.identifier("") + returnType = uintType + }. also { + it.body = DeclarationIrBuilder(pluginContext, it.symbol) + .irExprBody( + unsafeCoerce(IrConstImpl.int(-1, -1, pluginContext.irBuiltIns.intType, 1), pluginContext.irBuiltIns.intType, uintType) + ) + it.parent = declaration + }) + } + + private fun addFunWithExprBody(declaration: IrClass) { + declaration.declarations.add(pluginContext.irFactory.buildFun { + name = Name.identifier("") + returnType = pluginContext.irBuiltIns.intType + }. also { + it.body = DeclarationIrBuilder(pluginContext, it.symbol) + .irExprBody( + IrConstImpl.int(-1, -1, pluginContext.irBuiltIns.intType, 42) + ) + it.parent = declaration + }) + } + + private fun addStaticFieldWithExprInit(declaration: IrClass) { + declaration.declarations.add(pluginContext.irFactory.buildProperty { + name = Name.identifier("bar") + isConst = true + visibility = DescriptorVisibilities.PRIVATE + }.also { irProperty -> + irProperty.backingField = pluginContext.irFactory.buildField { + name = Name.identifier("bar") + type = pluginContext.irBuiltIns.stringType + isStatic = true + visibility = DescriptorVisibilities.PRIVATE + }.also { irField -> + irField.initializer = DeclarationIrBuilder(pluginContext, irField.symbol) + .irExprBody( + IrConstImpl.string(-1, -1, pluginContext.irBuiltIns.stringType, "Foobar") + ) + irField.parent = declaration + } + irProperty.parent = declaration + }) + } + + val javaLangPackage = IrExternalPackageFragmentImpl.createEmptyExternalPackageFragment(pluginContext.moduleDescriptor, FqName("java.lang")) + + private fun makeJavaLangClass(fnName: String) = pluginContext.irFactory.buildClass { + name = Name.identifier(fnName) + kind = ClassKind.CLASS + origin = IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB + }.apply { + parent = javaLangPackage + createImplicitParameterDeclarationWithWrappedDescriptor() + } + + // This adds a function with a parameter whose type is a real class without its supertypes specified, + // mimicking the behaviour of the Kotlin android extensions gradle plugin, which refers to some real + // Android classes through these sorts of synthetic, incomplete references. The extractor should + // respond by replacing them with the real version available on the classpath. + // I pick the particular java.lang class "ProcessBuilder" since it is (a) always available and + // (b) not normally extracted by this project. + private fun addFunWithStubClass(declaration: IrClass) { + declaration.declarations.add(pluginContext.irFactory.buildFun { + name = Name.identifier("") + returnType = pluginContext.irBuiltIns.unitType + }. also { addedFn -> + val processBuilderStub = makeJavaLangClass("ProcessBuilder") + val processBuilderStubType = processBuilderStub.defaultType + val startProcessMethod = processBuilderStub.addFunction { + name = Name.identifier("start") + origin = IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB + modality = Modality.FINAL + returnType = pluginContext.referenceClass(FqName("java.lang.Process"))!!.owner.defaultType + }.apply { + addDispatchReceiver { type = processBuilderStubType } + } + + val paramSymbol = addedFn.addValueParameter("param", processBuilderStubType) + DeclarationIrBuilder(pluginContext, addedFn.symbol).apply { + addedFn.body = irExprBody(irCall(startProcessMethod).apply { dispatchReceiver = irGet(paramSymbol) }) + addedFn.parent = declaration + } + }) + } + }, null) + } +} diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/plugin/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/plugin/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar new file mode 100644 index 00000000000..5d546a3b00a --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/plugin/resources/META-INF/services/org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar @@ -0,0 +1 @@ +com.github.codeql.TestComponentRegistrar diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/rootClasses.expected b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/rootClasses.expected new file mode 100644 index 00000000000..1f41ac1e6bb --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/rootClasses.expected @@ -0,0 +1,4 @@ +| file://:0:0:0:0 | fake.kotlin | FakeKotlinClass | +| file://:0:0:0:0 | java.lang | Object | +| file://:0:0:0:0 | kotlin | Any | +| file://:0:0:0:0 | kotlin | TypeParam | diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/rootClasses.ql b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/rootClasses.ql new file mode 100644 index 00000000000..640ae984d14 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/rootClasses.ql @@ -0,0 +1,5 @@ +import java + +from ClassOrInterface ci +where not exists(ci.getASupertype()) +select ci.getPackage(), ci.toString() diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/staticinit.expected b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/staticinit.expected new file mode 100644 index 00000000000..606bbd3f338 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/staticinit.expected @@ -0,0 +1 @@ +| d.kt:0:0:0:0 | bar | d.kt:0:0:0:0 | Foobar | diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/staticinit.ql b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/staticinit.ql new file mode 100644 index 00000000000..de6bd1ca92e --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/staticinit.ql @@ -0,0 +1,5 @@ +import java + +from Field f, Expr init +where init = f.getInitializer() +select f, init diff --git a/java/ql/integration-tests/linux-only/kotlin/custom_plugin/test.py b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/test.py new file mode 100644 index 00000000000..98610959b58 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/custom_plugin/test.py @@ -0,0 +1,6 @@ +from create_database_utils import * +import subprocess + +subprocess.call("./build_plugin", shell=True) +run_codeql_database_create( + ["kotlinc -J-Xmx2G -Xplugin=plugin.jar a.kt b.kt c.kt d.kt e.kt"], lang="java") diff --git a/java/ql/integration-tests/linux-only/kotlin/qlpack.yml b/java/ql/integration-tests/linux-only/kotlin/qlpack.yml new file mode 100644 index 00000000000..11adb1f538b --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/qlpack.yml @@ -0,0 +1,2 @@ +libraryPathDependencies: + - codeql-java diff --git a/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/BoundedGenericTest.java b/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/BoundedGenericTest.java new file mode 100644 index 00000000000..1bc13098a62 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/BoundedGenericTest.java @@ -0,0 +1,8 @@ +package extlib; + +public class BoundedGenericTest { + + public void method(T t) { } + +} + diff --git a/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/ComplexBoundedGenericTest.java b/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/ComplexBoundedGenericTest.java new file mode 100644 index 00000000000..16d0d950e0c --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/ComplexBoundedGenericTest.java @@ -0,0 +1,8 @@ +package extlib; + +public class ComplexBoundedGenericTest { + + public void method(A a, B b) { } + +} + diff --git a/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/GenericTest.java b/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/GenericTest.java new file mode 100644 index 00000000000..d953cf90b98 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/GenericTest.java @@ -0,0 +1,10 @@ +package extlib; + +public class GenericTest { + + public void method(T t) { } + + public void takesSelfMethod(GenericTest selfLike) { } + +} + diff --git a/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/Lib.java b/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/Lib.java new file mode 100644 index 00000000000..f533e43c527 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/use_java_library/javasrc/extlib/Lib.java @@ -0,0 +1,35 @@ +package extlib; + +import java.util.*; + +public class Lib { + + public void testParameterTypes( + char p1, + byte p2, + short p3, + int p4, + long p5, + float p6, + double p7, + boolean p8, + Lib simpleClass, + GenericTest simpleGeneric, + BoundedGenericTest boundedGeneric, + ComplexBoundedGenericTest complexBoundedGeneric, + int[] primitiveArray, + Integer[] boxedTypeArray, + int [][] multiDimensionalPrimitiveArray, + Integer[][] multiDimensionalBoxedTypeArray, + List[] genericTypeArray, + List producerWildcard, + List consumerWildcard, + List> nestedWildcard, + List unboundedWildcard) { } + + public List returnErasureTest() { return null; } + + public void paramErasureTest(List param) { } + +} + diff --git a/java/ql/integration-tests/linux-only/kotlin/use_java_library/parameterTypes.expected b/java/ql/integration-tests/linux-only/kotlin/use_java_library/parameterTypes.expected new file mode 100644 index 00000000000..605c9628bff --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/use_java_library/parameterTypes.expected @@ -0,0 +1,52 @@ +parameterTypes +| extlib.jar/extlib/GenericTest.class:0:0:0:0 | p0 | GenericTest | +| javasrc/extlib/GenericTest.java:7:31:7:53 | selfLike | GenericTest | +| javasrc/extlib/Lib.java:8:5:8:11 | p1 | char | +| javasrc/extlib/Lib.java:9:5:9:11 | p2 | byte | +| javasrc/extlib/Lib.java:10:5:10:12 | p3 | short | +| javasrc/extlib/Lib.java:11:5:11:10 | p4 | int | +| javasrc/extlib/Lib.java:12:5:12:11 | p5 | long | +| javasrc/extlib/Lib.java:13:5:13:12 | p6 | float | +| javasrc/extlib/Lib.java:14:5:14:13 | p7 | double | +| javasrc/extlib/Lib.java:15:5:15:14 | p8 | boolean | +| javasrc/extlib/Lib.java:16:5:16:19 | simpleClass | Lib | +| javasrc/extlib/Lib.java:17:5:17:37 | simpleGeneric | GenericTest | +| javasrc/extlib/Lib.java:18:5:18:45 | boundedGeneric | BoundedGenericTest | +| javasrc/extlib/Lib.java:19:5:19:73 | complexBoundedGeneric | ComplexBoundedGenericTest | +| javasrc/extlib/Lib.java:20:5:20:24 | primitiveArray | int[] | +| javasrc/extlib/Lib.java:21:5:21:28 | boxedTypeArray | Integer[] | +| javasrc/extlib/Lib.java:22:5:22:43 | multiDimensionalPrimitiveArray | int[][] | +| javasrc/extlib/Lib.java:23:5:23:46 | multiDimensionalBoxedTypeArray | Integer[][] | +| javasrc/extlib/Lib.java:24:5:24:35 | genericTypeArray | List[] | +| javasrc/extlib/Lib.java:25:5:25:49 | producerWildcard | List | +| javasrc/extlib/Lib.java:26:5:26:47 | consumerWildcard | List | +| javasrc/extlib/Lib.java:27:5:27:63 | nestedWildcard | List> | +| javasrc/extlib/Lib.java:28:5:28:29 | unboundedWildcard | List | +arrayTypes +| javasrc/extlib/Lib.java:20:5:20:24 | primitiveArray | file://:0:0:0:0 | int[] | int | 1 | int | +| javasrc/extlib/Lib.java:21:5:21:28 | boxedTypeArray | file://:0:0:0:0 | Integer[] | Integer | 1 | Integer | +| javasrc/extlib/Lib.java:22:5:22:43 | multiDimensionalPrimitiveArray | file://:0:0:0:0 | int[][] | int | 2 | int[] | +| javasrc/extlib/Lib.java:23:5:23:46 | multiDimensionalBoxedTypeArray | file://:0:0:0:0 | Integer[][] | Integer | 2 | Integer[] | +| javasrc/extlib/Lib.java:24:5:24:35 | genericTypeArray | file://:0:0:0:0 | List[] | List | 1 | List | +wildcardTypes +| javasrc/extlib/Lib.java:25:5:25:49 | producerWildcard | file://:0:0:0:0 | ? extends CharSequence | upper | CharSequence | +| javasrc/extlib/Lib.java:26:5:26:47 | consumerWildcard | file://:0:0:0:0 | ? super CharSequence | lower | CharSequence | +| javasrc/extlib/Lib.java:26:5:26:47 | consumerWildcard | file://:0:0:0:0 | ? super CharSequence | upper | Object | +| javasrc/extlib/Lib.java:27:5:27:63 | nestedWildcard | file://:0:0:0:0 | ? extends List | upper | List | +| javasrc/extlib/Lib.java:28:5:28:29 | unboundedWildcard | file://:0:0:0:0 | ? | upper | Object | +parameterizedTypes +| extlib.jar/extlib/GenericTest.class:0:0:0:0 | p0 | GenericTest | String | +| javasrc/extlib/GenericTest.java:7:31:7:53 | selfLike | GenericTest | T | +| javasrc/extlib/Lib.java:17:5:17:37 | simpleGeneric | GenericTest | String | +| javasrc/extlib/Lib.java:18:5:18:45 | boundedGeneric | BoundedGenericTest | String | +| javasrc/extlib/Lib.java:19:5:19:73 | complexBoundedGeneric | ComplexBoundedGenericTest | CharSequence | +| javasrc/extlib/Lib.java:19:5:19:73 | complexBoundedGeneric | ComplexBoundedGenericTest | String | +| javasrc/extlib/Lib.java:25:5:25:49 | producerWildcard | List | ? extends CharSequence | +| javasrc/extlib/Lib.java:26:5:26:47 | consumerWildcard | List | ? super CharSequence | +| javasrc/extlib/Lib.java:27:5:27:63 | nestedWildcard | List> | ? extends List | +| javasrc/extlib/Lib.java:28:5:28:29 | unboundedWildcard | List | ? | +libCallables +| javasrc/extlib/Lib.java:5:14:5:16 | Lib | +| javasrc/extlib/Lib.java:7:15:7:32 | testParameterTypes | +| javasrc/extlib/Lib.java:30:24:30:40 | returnErasureTest | +| javasrc/extlib/Lib.java:32:19:32:34 | paramErasureTest | diff --git a/java/ql/integration-tests/linux-only/kotlin/use_java_library/parameterTypes.ql b/java/ql/integration-tests/linux-only/kotlin/use_java_library/parameterTypes.ql new file mode 100644 index 00000000000..31397f18ac8 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/use_java_library/parameterTypes.ql @@ -0,0 +1,40 @@ +import java + +class ExtLibParameter extends Parameter { + ExtLibParameter() { this.getCallable().getName() = ["testParameterTypes", "takesSelfMethod"] } +} + +query predicate parameterTypes(ExtLibParameter p, string t) { p.getType().toString() = t } + +query predicate arrayTypes( + ExtLibParameter p, Array at, string elementType, int dimension, string componentType +) { + p.getType() = at and + at.getElementType().toString() = elementType and + at.getDimension() = dimension and + at.getComponentType().toString() = componentType +} + +query predicate wildcardTypes(ExtLibParameter p, Wildcard wc, string boundKind, string bound) { + // Expose details of wildcard types: + wc = + [ + p.getType().(ParameterizedType).getATypeArgument(), + p.getType().(ParameterizedType).getATypeArgument().(ParameterizedType).getATypeArgument() + ] and + ( + boundKind = "upper" and bound = wc.getUpperBoundType().toString() + or + boundKind = "lower" and bound = wc.getLowerBoundType().toString() + ) +} + +query predicate parameterizedTypes(ExtLibParameter p, string ptstr, string typeArg) { + exists(ParameterizedType pt | + p.getType() = pt and + pt.getATypeArgument().toString() = typeArg and + ptstr = pt.toString() + ) +} + +query predicate libCallables(Callable c) { c.getFile().getBaseName().matches("%Lib.java") } diff --git a/java/ql/integration-tests/linux-only/kotlin/use_java_library/test.py b/java/ql/integration-tests/linux-only/kotlin/use_java_library/test.py new file mode 100644 index 00000000000..13230ceeb43 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/use_java_library/test.py @@ -0,0 +1,8 @@ +from create_database_utils import * +import glob + +os.mkdir('build') +javaccmd = " ".join(["javac"] + glob.glob("javasrc/extlib/*.java") + ["-d", "build"]) +jarcmd = " ".join(["jar", "-c", "-f", "extlib.jar", "-C", "build", "extlib"]) +run_codeql_database_create([javaccmd, jarcmd, "kotlinc user.kt -cp extlib.jar"], lang="java") + diff --git a/java/ql/integration-tests/linux-only/kotlin/use_java_library/user.kt b/java/ql/integration-tests/linux-only/kotlin/use_java_library/user.kt new file mode 100644 index 00000000000..d2c0a5bf341 --- /dev/null +++ b/java/ql/integration-tests/linux-only/kotlin/use_java_library/user.kt @@ -0,0 +1,45 @@ +import extlib.* +import java.util.* + +fun test() { + + // Pending better varargs support, avoiding listOf and mutableListOf + val stringList = ArrayList() + val objectList = ArrayList() + val stringStringList = ArrayList>() + + val lib = Lib() + lib.testParameterTypes( + 'a', + 1, + 2, + 3, + 4, + 5.0f, + 6.0, + true, + Lib(), + GenericTest(), + BoundedGenericTest(), + ComplexBoundedGenericTest(), + intArrayOf(1), + arrayOf(1), + arrayOf(intArrayOf(1)), + arrayOf(arrayOf(1)), + arrayOf(stringList), + stringList, + objectList, + stringStringList, + objectList) + + val returnedList = lib.returnErasureTest() + lib.paramErasureTest(listOf("Hello")) + + // Check trap labelling consistency for methods that instantiate a generic type + // with its own generic parameters -- for example, class MyList { void addAll(MyList l) { } }, + // which has the trap labelling oddity of looking like plain MyList, not MyList, even though + // this is a generic instantiation. + val takesSelfTest = GenericTest() + takesSelfTest.takesSelfMethod(takesSelfTest) + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/enabling/KotlinDefault.kt b/java/ql/integration-tests/posix-only/kotlin/enabling/KotlinDefault.kt new file mode 100644 index 00000000000..3defce70dac --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/enabling/KotlinDefault.kt @@ -0,0 +1 @@ +class KotlinDefault {} diff --git a/java/ql/integration-tests/posix-only/kotlin/enabling/KotlinDisabled.kt b/java/ql/integration-tests/posix-only/kotlin/enabling/KotlinDisabled.kt new file mode 100644 index 00000000000..7e1bd360129 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/enabling/KotlinDisabled.kt @@ -0,0 +1 @@ +class KotlinDisabled {} diff --git a/java/ql/integration-tests/posix-only/kotlin/enabling/KotlinEnabled.kt b/java/ql/integration-tests/posix-only/kotlin/enabling/KotlinEnabled.kt new file mode 100644 index 00000000000..7d7dcff7040 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/enabling/KotlinEnabled.kt @@ -0,0 +1 @@ +class KotlinEnabled {} diff --git a/java/ql/integration-tests/posix-only/kotlin/enabling/build.py b/java/ql/integration-tests/posix-only/kotlin/enabling/build.py new file mode 100644 index 00000000000..63f29878915 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/enabling/build.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 + +from create_database_utils import * + +runSuccessfully(["kotlinc", "KotlinDefault.kt"]) +os.environ['CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN'] = 'true' +runSuccessfully(["kotlinc", "KotlinDisabled.kt"]) +del(os.environ['CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN']) +os.environ['CODEQL_EXTRACTOR_JAVA_AGENT_ENABLE_KOTLIN'] = 'true' +runSuccessfully(["kotlinc", "KotlinEnabled.kt"]) diff --git a/java/ql/integration-tests/posix-only/kotlin/enabling/class.expected b/java/ql/integration-tests/posix-only/kotlin/enabling/class.expected new file mode 100644 index 00000000000..8c8a04f83ce --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/enabling/class.expected @@ -0,0 +1 @@ +| KotlinEnabled.kt:1:1:1:22 | KotlinEnabled | diff --git a/java/ql/integration-tests/posix-only/kotlin/enabling/class.ql b/java/ql/integration-tests/posix-only/kotlin/enabling/class.ql new file mode 100644 index 00000000000..35cdaef9da7 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/enabling/class.ql @@ -0,0 +1,5 @@ +import java + +from Class c +where c.fromSource() +select c diff --git a/java/ql/integration-tests/posix-only/kotlin/enabling/test.py b/java/ql/integration-tests/posix-only/kotlin/enabling/test.py new file mode 100644 index 00000000000..4bcf7ada880 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/enabling/test.py @@ -0,0 +1,9 @@ +from create_database_utils import * + +for var in ['CODEQL_EXTRACTOR_JAVA_AGENT_ENABLE_KOTLIN', + 'CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN']: + if var in os.environ: + del(os.environ[var]) + +run_codeql_database_create(['"%s" build.py' % sys.executable], lang="java") + diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/classes.expected b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/classes.expected new file mode 100644 index 00000000000..e84dc8f218d --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/classes.expected @@ -0,0 +1,2 @@ +| code/A.kt:2:1:2:10 | A | +| code/C.kt:2:1:2:10 | C | diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/classes.ql b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/classes.ql new file mode 100644 index 00000000000..35cdaef9da7 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/classes.ql @@ -0,0 +1,5 @@ +import java + +from Class c +where c.fromSource() +select c diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/A.kt b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/A.kt new file mode 100644 index 00000000000..d11e54e922f --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/A.kt @@ -0,0 +1,3 @@ + +class A {} + diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/B.kt b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/B.kt new file mode 100644 index 00000000000..a4d3b9876ee --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/B.kt @@ -0,0 +1,3 @@ + +class B {} + diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/C.kt b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/C.kt new file mode 100644 index 00000000000..ddd7c69e28c --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/C.kt @@ -0,0 +1,3 @@ + +class C {} + diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/build.py b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/build.py new file mode 100644 index 00000000000..db077b5e41e --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/code/build.py @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 + +import os +import subprocess + +os.environ['CODEQL_KOTLIN_INTERNAL_EXCEPTION_WHILE_EXTRACTING_FILE'] = 'B.kt' + +subprocess.check_call(['kotlinc', 'A.kt', 'B.kt', 'C.kt', ]) diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilationFiles.expected b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilationFiles.expected new file mode 100644 index 00000000000..48a0d4ec87b --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilationFiles.expected @@ -0,0 +1,3 @@ +| | 0 | code/A.kt:0:0:0:0 | A | Extraction successful | Not recoverable errors | Not non-recoverable errors | +| | 1 | code/B.kt:0:0:0:0 | code/B.kt | Not extraction successful | Not recoverable errors | Non-recoverable errors | +| | 2 | code/C.kt:0:0:0:0 | C | Extraction successful | Not recoverable errors | Not non-recoverable errors | diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilationFiles.ql b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilationFiles.ql new file mode 100644 index 00000000000..b3c9437c3d4 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilationFiles.ql @@ -0,0 +1,24 @@ +import java + +class AnonymousCompilation extends Compilation { + override string toString() { result = "" } +} + +from Compilation c, int i, File f +where f = c.getFileCompiled(i) +select c, i, f, + any(string s | + if c.fileCompiledSuccessful(i) + then s = "Extraction successful" + else s = "Not extraction successful" + ), + any(string s | + if c.fileCompiledRecoverableErrors(i) + then s = "Recoverable errors" + else s = "Not recoverable errors" + ), + any(string s | + if c.fileCompiledNonRecoverableErrors(i) + then s = "Non-recoverable errors" + else s = "Not non-recoverable errors" + ) diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilations.expected b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilations.expected new file mode 100644 index 00000000000..c87bb373166 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilations.expected @@ -0,0 +1 @@ +| | Normal termination | Not extraction successful | Not recoverable errors | Non-recoverable errors | diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilations.ql b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilations.ql new file mode 100644 index 00000000000..13d4ce46f51 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/compilations.ql @@ -0,0 +1,24 @@ +import java + +class AnonymousCompilation extends Compilation { + override string toString() { result = "" } +} + +from Compilation c +select c, + any(string s | + if c.normalTermination() then s = "Normal termination" else s = "Not normal termination" + ), + any(string s | + if c.extractionSuccessful() + then s = "Extraction successful" + else s = "Not extraction successful" + ), + any(string s | + if c.recoverableErrors() then s = "Recoverable errors" else s = "Not recoverable errors" + ), + any(string s | + if c.nonRecoverableErrors() + then s = "Non-recoverable errors" + else s = "Not non-recoverable errors" + ) diff --git a/java/ql/integration-tests/posix-only/kotlin/extractor_crash/test.py b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/test.py new file mode 100644 index 00000000000..9abcb43e304 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/extractor_crash/test.py @@ -0,0 +1,7 @@ +import sys + +from create_database_utils import * + +run_codeql_database_create( + ['"%s" build.py' % sys.executable], + source="code", lang="java") diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/app/build.gradle b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/app/build.gradle new file mode 100644 index 00000000000..16aad9297b0 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/app/build.gradle @@ -0,0 +1,25 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * This generated file contains a sample Kotlin application project to get you started. + * For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle + * User Manual available at https://docs.gradle.org/7.0.2/userguide/building_java_projects.html + */ + +plugins { + // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. + id 'org.jetbrains.kotlin.jvm' version '1.5.31' + + // Apply the application plugin to add support for building a CLI application in Java. + id 'application' +} + +repositories { + // Use Maven Central for resolving dependencies. + mavenCentral() +} + +application { + // Define the main class for the application. + mainClass = 'testProject.AppKt' +} diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/app/src/main/kotlin/testProject/App.kt b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/app/src/main/kotlin/testProject/App.kt new file mode 100644 index 00000000000..0ed9df24a57 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/app/src/main/kotlin/testProject/App.kt @@ -0,0 +1,15 @@ +/* + * This Kotlin source file was generated by the Gradle 'init' task. + */ +package testProject + +class App { + val greeting: String + get() { + return "Hello World!" + } +} + +fun main() { + // TODO: println(App().greeting) +} diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/compilations.expected b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/compilations.expected new file mode 100644 index 00000000000..2a4f078a25f --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/compilations.expected @@ -0,0 +1 @@ +| 1 | diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/compilations.ql b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/compilations.ql new file mode 100644 index 00000000000..7ddd497d555 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/compilations.ql @@ -0,0 +1,3 @@ +import java + +select count(Compilation c) diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/methods.expected b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/methods.expected new file mode 100644 index 00000000000..9f5adb7d6e5 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/methods.expected @@ -0,0 +1,2 @@ +| app/src/main/kotlin/testProject/App.kt:8:9:10:9 | getGreeting | +| app/src/main/kotlin/testProject/App.kt:13:1:15:1 | main | diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/methods.ql b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/methods.ql new file mode 100644 index 00000000000..9d32c93e69c --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/methods.ql @@ -0,0 +1,5 @@ +import java + +from Method m +where exists(m.getFile().getRelativePath()) +select m diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/settings.gradle b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/settings.gradle new file mode 100644 index 00000000000..a56fb7dd11c --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/settings.gradle @@ -0,0 +1,11 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * The settings file is used to specify which projects to include in your build. + * + * Detailed information about configuring a multi-project build in Gradle can be found + * in the user manual at https://docs.gradle.org/7.0.2/userguide/multi_project_builds.html + */ + +rootProject.name = 'testProject' +include('app') diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/test.py b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/test.py new file mode 100644 index 00000000000..7f44398cd12 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_groovy_app/test.py @@ -0,0 +1,4 @@ +from create_database_utils import * + +run_codeql_database_create(["gradle build --no-daemon --no-build-cache"], lang="java") +runSuccessfully(["gradle", "clean"]) diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/PrintAst.expected b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/PrintAst.expected new file mode 100644 index 00000000000..e37e65dc3c8 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/PrintAst.expected @@ -0,0 +1,432 @@ +app/src/main/kotlin/testProject/App.kt: +# 0| [CompilationUnit] App +# 7| 1: [Class] Project +# 0| 1: [Constructor] Project +#-----| 4: (Parameters) +# 0| 0: [Parameter] seen1 +# 0| 0: [TypeAccess] int +# 0| 1: [Parameter] name +# 0| 0: [TypeAccess] String +# 0| 2: [Parameter] language +# 0| 0: [TypeAccess] int +# 0| 3: [Parameter] serializationConstructorMarker +# 0| 0: [TypeAccess] SerializationConstructorMarker +# 7| 5: [BlockStmt] { ... } +# 7| 0: [ExprStmt] ; +# 7| 0: [WhenExpr] when ... +# 7| 0: [WhenBranch] ... -> ... +# 7| 0: [ValueNEExpr] ... (value not-equals) ... +# 7| 0: [IntegerLiteral] 3 +# 7| 1: [MethodAccess] and(...) +# 7| -1: [IntegerLiteral] 3 +# 7| 0: [VarAccess] seen1 +# 7| 1: [ExprStmt] ; +# 7| 0: [MethodAccess] throwMissingFieldException(...) +# 7| -1: [TypeAccess] PluginExceptionsKt +# 7| 0: [VarAccess] seen1 +# 7| 1: [IntegerLiteral] 3 +# 7| 2: [MethodAccess] getDescriptor(...) +# 7| -1: [VarAccess] INSTANCE +# 7| 1: [SuperConstructorInvocationStmt] super(...) +# 7| 2: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] Project.this.name +# 7| -1: [ThisAccess] Project.this +# 7| 0: [TypeAccess] Project +# 7| 1: [VarAccess] name +# 7| 3: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] Project.this.language +# 7| -1: [ThisAccess] Project.this +# 7| 0: [TypeAccess] Project +# 7| 1: [VarAccess] language +# 0| 2: [Method] component1 +# 0| 3: [TypeAccess] String +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [VarAccess] this.name +# 0| -1: [ThisAccess] this +# 0| 3: [Method] component2 +# 0| 3: [TypeAccess] int +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [VarAccess] this.language +# 0| -1: [ThisAccess] this +# 0| 4: [Method] copy +# 0| 3: [TypeAccess] Project +#-----| 4: (Parameters) +# 8| 0: [Parameter] name +# 8| 0: [TypeAccess] String +# 8| 1: [Parameter] language +# 8| 0: [TypeAccess] int +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [ClassInstanceExpr] new Project(...) +# 0| -3: [TypeAccess] Project +# 0| 0: [VarAccess] name +# 0| 1: [VarAccess] language +# 0| 5: [Method] equals +# 0| 3: [TypeAccess] boolean +#-----| 4: (Parameters) +# 0| 0: [Parameter] other +# 0| 0: [TypeAccess] Object +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ExprStmt] ; +# 0| 0: [WhenExpr] when ... +# 0| 0: [WhenBranch] ... -> ... +# 0| 0: [EQExpr] ... == ... +# 0| 0: [ThisAccess] this +# 0| 1: [VarAccess] other +# 0| 1: [ReturnStmt] return ... +# 0| 0: [BooleanLiteral] true +# 0| 1: [ExprStmt] ; +# 0| 0: [WhenExpr] when ... +# 0| 0: [WhenBranch] ... -> ... +# 0| 0: [NotInstanceOfExpr] ... !is ... +# 0| 0: [VarAccess] other +# 0| 1: [TypeAccess] Project +# 0| 1: [ReturnStmt] return ... +# 0| 0: [BooleanLiteral] false +# 0| 2: [LocalVariableDeclStmt] var ...; +# 0| 1: [LocalVariableDeclExpr] tmp0_other_with_cast +# 0| 0: [CastExpr] (...)... +# 0| 0: [TypeAccess] Project +# 0| 1: [VarAccess] other +# 0| 3: [ExprStmt] ; +# 0| 0: [WhenExpr] when ... +# 0| 0: [WhenBranch] ... -> ... +# 0| 0: [ValueNEExpr] ... (value not-equals) ... +# 0| 0: [VarAccess] this.name +# 0| -1: [ThisAccess] this +# 0| 1: [VarAccess] tmp0_other_with_cast.name +# 0| -1: [VarAccess] tmp0_other_with_cast +# 0| 1: [ReturnStmt] return ... +# 0| 0: [BooleanLiteral] false +# 0| 4: [ExprStmt] ; +# 0| 0: [WhenExpr] when ... +# 0| 0: [WhenBranch] ... -> ... +# 0| 0: [ValueNEExpr] ... (value not-equals) ... +# 0| 0: [VarAccess] this.language +# 0| -1: [ThisAccess] this +# 0| 1: [VarAccess] tmp0_other_with_cast.language +# 0| -1: [VarAccess] tmp0_other_with_cast +# 0| 1: [ReturnStmt] return ... +# 0| 0: [BooleanLiteral] false +# 0| 5: [ReturnStmt] return ... +# 0| 0: [BooleanLiteral] true +# 0| 6: [Method] hashCode +# 0| 3: [TypeAccess] int +# 0| 5: [BlockStmt] { ... } +# 0| 0: [LocalVariableDeclStmt] var ...; +# 0| 1: [LocalVariableDeclExpr] result +# 0| 0: [MethodAccess] hashCode(...) +# 0| -1: [VarAccess] this.name +# 0| -1: [ThisAccess] this +# 0| 1: [ExprStmt] ; +# 0| 0: [AssignExpr] ...=... +# 0| 0: [VarAccess] result +# 0| 1: [MethodAccess] plus(...) +# 0| -1: [MethodAccess] times(...) +# 0| -1: [VarAccess] result +# 0| 0: [IntegerLiteral] 31 +# 0| 0: [MethodAccess] hashCode(...) +# 0| -1: [VarAccess] this.language +# 0| -1: [ThisAccess] this +# 0| 2: [ReturnStmt] return ... +# 0| 0: [VarAccess] result +# 0| 7: [Method] toString +# 0| 3: [TypeAccess] String +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [StringTemplateExpr] "..." +# 0| 0: [StringLiteral] Project( +# 0| 1: [StringLiteral] name= +# 0| 2: [VarAccess] this.name +# 0| -1: [ThisAccess] this +# 0| 3: [StringLiteral] , +# 0| 4: [StringLiteral] language= +# 0| 5: [VarAccess] this.language +# 0| -1: [ThisAccess] this +# 0| 6: [StringLiteral] ) +# 0| 8: [Method] write$Self +# 0| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 0| 0: [Parameter] self +# 0| 0: [TypeAccess] Project +# 0| 1: [Parameter] output +# 0| 0: [TypeAccess] CompositeEncoder +# 0| 2: [Parameter] serialDesc +# 0| 0: [TypeAccess] SerialDescriptor +# 7| 5: [BlockStmt] { ... } +# 7| 0: [ExprStmt] ; +# 7| 0: [MethodAccess] encodeStringElement(...) +# 7| -1: [VarAccess] output +# 7| 0: [VarAccess] serialDesc +# 7| 1: [IntegerLiteral] 0 +# 7| 2: [MethodAccess] getName(...) +# 7| -1: [VarAccess] self +# 7| 1: [ExprStmt] ; +# 7| 0: [MethodAccess] encodeIntElement(...) +# 7| -1: [VarAccess] output +# 7| 0: [VarAccess] serialDesc +# 7| 1: [IntegerLiteral] 1 +# 7| 2: [MethodAccess] getLanguage(...) +# 7| -1: [VarAccess] self +# 7| 9: [Class] $serializer +# 0| 1: [FieldDeclaration] SerialDescriptor descriptor; +# 0| -1: [TypeAccess] SerialDescriptor +# 0| 2: [Method] childSerializers +# 0| 3: [TypeAccess] KSerializer[] +# 0| 0: [TypeAccess] KSerializer +# 0| 0: [WildcardTypeAccess] ? ... +# 7| 5: [BlockStmt] { ... } +# 7| 0: [ReturnStmt] return ... +# 7| 0: [ArrayCreationExpr] new KSerializer[] +# 7| -2: [ArrayInit] {...} +# 7| 0: [VarAccess] INSTANCE +# 7| 1: [VarAccess] INSTANCE +# 7| -1: [TypeAccess] KSerializer +# 7| 0: [IntegerLiteral] 2 +# 0| 3: [Method] deserialize +# 0| 3: [TypeAccess] Project +#-----| 4: (Parameters) +# 0| 0: [Parameter] decoder +# 0| 0: [TypeAccess] Decoder +# 7| 5: [BlockStmt] { ... } +# 7| 0: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp0_desc +# 7| 0: [MethodAccess] getDescriptor(...) +# 7| -1: [ThisAccess] this +# 7| 1: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp1_flag +# 7| 0: [BooleanLiteral] true +# 7| 2: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp2_index +# 7| 0: [IntegerLiteral] 0 +# 7| 3: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp3_bitMask0 +# 7| 0: [IntegerLiteral] 0 +# 7| 4: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp4_local0 +# 7| 0: [NullLiteral] null +# 7| 5: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp5_local1 +# 7| 0: [IntegerLiteral] 0 +# 7| 6: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp6_input +# 7| 0: [MethodAccess] beginStructure(...) +# 7| -1: [VarAccess] decoder +# 7| 0: [VarAccess] tmp0_desc +# 7| 7: [ExprStmt] ; +# 7| 0: [WhenExpr] when ... +# 7| 0: [WhenBranch] ... -> ... +# 7| 0: [MethodAccess] decodeSequentially(...) +# 7| -1: [VarAccess] tmp6_input +# 7| 1: [BlockStmt] { ... } +# 7| 0: [BlockStmt] { ... } +# 7| 0: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp4_local0 +# 7| 1: [MethodAccess] decodeStringElement(...) +# 7| -1: [VarAccess] tmp6_input +# 7| 0: [VarAccess] tmp0_desc +# 7| 1: [IntegerLiteral] 0 +# 7| 1: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp3_bitMask0 +# 7| 1: [MethodAccess] or(...) +# 7| -1: [VarAccess] tmp3_bitMask0 +# 7| 0: [IntegerLiteral] 1 +# 7| 1: [BlockStmt] { ... } +# 7| 0: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp5_local1 +# 7| 1: [MethodAccess] decodeIntElement(...) +# 7| -1: [VarAccess] tmp6_input +# 7| 0: [VarAccess] tmp0_desc +# 7| 1: [IntegerLiteral] 1 +# 7| 1: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp3_bitMask0 +# 7| 1: [MethodAccess] or(...) +# 7| -1: [VarAccess] tmp3_bitMask0 +# 7| 0: [IntegerLiteral] 2 +# 7| 1: [WhenBranch] ... -> ... +# 7| 0: [BooleanLiteral] true +# 7| 1: [WhileStmt] while (...) +# 7| 0: [VarAccess] tmp1_flag +# 7| 1: [BlockStmt] { ... } +# 7| 0: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp2_index +# 7| 1: [MethodAccess] decodeElementIndex(...) +# 7| -1: [VarAccess] tmp6_input +# 7| 0: [VarAccess] tmp0_desc +# 7| 1: [ExprStmt] ; +# 7| 0: [WhenExpr] when ... +# 7| 0: [WhenBranch] ... -> ... +# 7| 0: [ValueEQExpr] ... (value equals) ... +# 7| 0: [VarAccess] tmp2_index +# 7| 1: [IntegerLiteral] -1 +# 7| 1: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp1_flag +# 7| 1: [BooleanLiteral] false +# 7| 1: [WhenBranch] ... -> ... +# 7| 0: [ValueEQExpr] ... (value equals) ... +# 7| 0: [VarAccess] tmp2_index +# 7| 1: [IntegerLiteral] 0 +# 7| 1: [BlockStmt] { ... } +# 7| 0: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp4_local0 +# 7| 1: [MethodAccess] decodeStringElement(...) +# 7| -1: [VarAccess] tmp6_input +# 7| 0: [VarAccess] tmp0_desc +# 7| 1: [IntegerLiteral] 0 +# 7| 1: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp3_bitMask0 +# 7| 1: [MethodAccess] or(...) +# 7| -1: [VarAccess] tmp3_bitMask0 +# 7| 0: [IntegerLiteral] 1 +# 7| 2: [WhenBranch] ... -> ... +# 7| 0: [ValueEQExpr] ... (value equals) ... +# 7| 0: [VarAccess] tmp2_index +# 7| 1: [IntegerLiteral] 1 +# 7| 1: [BlockStmt] { ... } +# 7| 0: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp5_local1 +# 7| 1: [MethodAccess] decodeIntElement(...) +# 7| -1: [VarAccess] tmp6_input +# 7| 0: [VarAccess] tmp0_desc +# 7| 1: [IntegerLiteral] 1 +# 7| 1: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] tmp3_bitMask0 +# 7| 1: [MethodAccess] or(...) +# 7| -1: [VarAccess] tmp3_bitMask0 +# 7| 0: [IntegerLiteral] 2 +# 7| 3: [WhenBranch] ... -> ... +# 7| 0: [BooleanLiteral] true +# 7| 1: [ThrowStmt] throw ... +# 7| 0: [ClassInstanceExpr] new UnknownFieldException(...) +# 7| -3: [TypeAccess] UnknownFieldException +# 7| 0: [VarAccess] tmp2_index +# 7| 8: [ExprStmt] ; +# 7| 0: [MethodAccess] endStructure(...) +# 7| -1: [VarAccess] tmp6_input +# 7| 0: [VarAccess] tmp0_desc +# 7| 9: [ReturnStmt] return ... +# 7| 0: [ClassInstanceExpr] new Project(...) +# 7| -3: [TypeAccess] Project +# 7| 0: [VarAccess] tmp3_bitMask0 +# 7| 1: [VarAccess] tmp4_local0 +# 7| 2: [VarAccess] tmp5_local1 +# 7| 3: [NullLiteral] null +# 0| 4: [Method] getDescriptor +# 0| 3: [TypeAccess] SerialDescriptor +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [VarAccess] this.descriptor +# 0| -1: [ThisAccess] this +# 0| 5: [Method] serialize +# 0| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 0| 0: [Parameter] encoder +# 0| 0: [TypeAccess] Encoder +# 0| 1: [Parameter] value +# 0| 0: [TypeAccess] Project +# 7| 5: [BlockStmt] { ... } +# 7| 0: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp0_desc +# 7| 0: [MethodAccess] getDescriptor(...) +# 7| -1: [ThisAccess] this +# 7| 1: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp1_output +# 7| 0: [MethodAccess] beginStructure(...) +# 7| -1: [VarAccess] encoder +# 7| 0: [VarAccess] tmp0_desc +# 7| 2: [ExprStmt] ; +# 7| 0: [MethodAccess] write$Self(...) +# 7| -1: [TypeAccess] Project +# 7| 0: [VarAccess] value +# 7| 1: [VarAccess] tmp1_output +# 7| 2: [VarAccess] tmp0_desc +# 7| 3: [ExprStmt] ; +# 7| 0: [MethodAccess] endStructure(...) +# 7| -1: [VarAccess] tmp1_output +# 7| 0: [VarAccess] tmp0_desc +# 7| 6: [Constructor] $serializer +# 7| 5: [BlockStmt] { ... } +# 7| 0: [SuperConstructorInvocationStmt] super(...) +# 7| 1: [BlockStmt] { ... } +# 7| 0: [LocalVariableDeclStmt] var ...; +# 7| 1: [LocalVariableDeclExpr] tmp0_serialDesc +# 7| 0: [ClassInstanceExpr] new PluginGeneratedSerialDescriptor(...) +# 7| -3: [TypeAccess] PluginGeneratedSerialDescriptor +# 7| 0: [StringLiteral] testProject.Project +# 7| 1: [ThisAccess] $serializer.this +# 7| 0: [TypeAccess] $serializer +# 7| 2: [IntegerLiteral] 2 +# 7| 1: [ExprStmt] ; +# 7| 0: [MethodAccess] addElement(...) +# 7| -1: [VarAccess] tmp0_serialDesc +# 7| 0: [StringLiteral] name +# 7| 1: [BooleanLiteral] false +# 7| 2: [ExprStmt] ; +# 7| 0: [MethodAccess] addElement(...) +# 7| -1: [VarAccess] tmp0_serialDesc +# 7| 0: [StringLiteral] language +# 7| 1: [BooleanLiteral] false +# 7| 3: [ExprStmt] ; +# 7| 0: [AssignExpr] ...=... +# 7| 0: [VarAccess] $serializer.this.descriptor +# 7| -1: [ThisAccess] $serializer.this +# 7| 0: [TypeAccess] $serializer +# 7| 1: [VarAccess] tmp0_serialDesc +# 7| 10: [Class] Companion +# 0| 1: [Method] serializer +# 0| 3: [TypeAccess] KSerializer +# 0| 0: [TypeAccess] Project +# 7| 5: [BlockStmt] { ... } +# 7| 0: [ReturnStmt] return ... +# 7| 0: [VarAccess] INSTANCE +# 7| 2: [Constructor] Companion +# 7| 5: [BlockStmt] { ... } +# 7| 0: [SuperConstructorInvocationStmt] super(...) +# 7| 1: [BlockStmt] { ... } +# 8| 11: [Constructor] Project +#-----| 4: (Parameters) +# 8| 0: [Parameter] name +# 8| 0: [TypeAccess] String +# 8| 1: [Parameter] language +# 8| 0: [TypeAccess] int +# 7| 5: [BlockStmt] { ... } +# 7| 0: [SuperConstructorInvocationStmt] super(...) +# 8| 1: [BlockStmt] { ... } +# 8| 0: [ExprStmt] ; +# 8| 0: [KtInitializerAssignExpr] ...=... +# 8| 0: [VarAccess] name +# 8| 1: [ExprStmt] ; +# 8| 0: [KtInitializerAssignExpr] ...=... +# 8| 0: [VarAccess] language +# 8| 12: [FieldDeclaration] String name; +# 8| -1: [TypeAccess] String +# 8| 0: [VarAccess] name +# 8| 13: [Method] getName +# 8| 3: [TypeAccess] String +# 8| 5: [BlockStmt] { ... } +# 8| 0: [ReturnStmt] return ... +# 8| 0: [VarAccess] this.name +# 8| -1: [ThisAccess] this +# 8| 14: [Method] getLanguage +# 8| 3: [TypeAccess] int +# 8| 5: [BlockStmt] { ... } +# 8| 0: [ReturnStmt] return ... +# 8| 0: [VarAccess] this.language +# 8| -1: [ThisAccess] this +# 8| 15: [FieldDeclaration] int language; +# 8| -1: [TypeAccess] int +# 8| 0: [VarAccess] language diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/PrintAst.qlref b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/PrintAst.qlref new file mode 100644 index 00000000000..c7fd5faf239 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/PrintAst.qlref @@ -0,0 +1 @@ +semmle/code/java/PrintAst.ql \ No newline at end of file diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/app/build.gradle b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/app/build.gradle new file mode 100644 index 00000000000..528b73cabc5 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/app/build.gradle @@ -0,0 +1,13 @@ +plugins { + id 'org.jetbrains.kotlin.jvm' version '1.6.10' + id 'org.jetbrains.kotlin.plugin.serialization' version '1.6.10' +} + +repositories { + mavenCentral() +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-serialization:1.6.10" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2" +} diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/app/src/main/kotlin/testProject/App.kt b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/app/src/main/kotlin/testProject/App.kt new file mode 100644 index 00000000000..373fc924c15 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/app/src/main/kotlin/testProject/App.kt @@ -0,0 +1,8 @@ +package testProject + +import kotlinx.serialization.* +import kotlinx.serialization.json.* +import kotlinx.serialization.Serializable + +@Serializable +data class Project(val name: String, val language: Int) \ No newline at end of file diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/diagnostics.expected b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/diagnostics.expected new file mode 100644 index 00000000000..751839721f7 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/diagnostics.expected @@ -0,0 +1 @@ +| CodeQL Kotlin extractor | 2 | | Unbound object value, trying to use class stub from descriptor | app/src/main/kotlin/testProject/App.kt:7:1:8:55 | app/src/main/kotlin/testProject/App.kt:7:1:8:55 | diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/diagnostics.ql b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/diagnostics.ql new file mode 100644 index 00000000000..031278ff260 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/diagnostics.ql @@ -0,0 +1,5 @@ +import java + +from string genBy, int severity, string tag, string msg, Location l +where diagnostics(_, genBy, severity, tag, msg, _, l) +select genBy, severity, tag, msg, l diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/settings.gradle b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/settings.gradle new file mode 100644 index 00000000000..a56fb7dd11c --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/settings.gradle @@ -0,0 +1,11 @@ +/* + * This file was generated by the Gradle 'init' task. + * + * The settings file is used to specify which projects to include in your build. + * + * Detailed information about configuring a multi-project build in Gradle can be found + * in the user manual at https://docs.gradle.org/7.0.2/userguide/multi_project_builds.html + */ + +rootProject.name = 'testProject' +include('app') diff --git a/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/test.py b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/test.py new file mode 100644 index 00000000000..7f44398cd12 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/gradle_kotlinx_serialization/test.py @@ -0,0 +1,4 @@ +from create_database_utils import * + +run_codeql_database_create(["gradle build --no-daemon --no-build-cache"], lang="java") +runSuccessfully(["gradle", "clean"]) diff --git a/java/ql/integration-tests/posix-only/kotlin/java_kotlin_extraction_orders/test.expected b/java/ql/integration-tests/posix-only/kotlin/java_kotlin_extraction_orders/test.expected new file mode 100644 index 00000000000..fcee4129121 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/java_kotlin_extraction_orders/test.expected @@ -0,0 +1,24 @@ +| JavaSeesFirst/JarMtimesEqual/ClassFileMtimesEqual/seen_by_kotlin/dep.jar/Dep___JavaSeesFirst___JarMtimesEqual___ClassFileMtimesEqual.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___JarMtimesEqual___ClassFileMtimesEqual | +| JavaSeesFirst/JarMtimesEqual/JavaClassFileNewer/seen_by_kotlin/dep.jar/Dep___JavaSeesFirst___JarMtimesEqual___JavaClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___JarMtimesEqual___JavaClassFileNewer | +| JavaSeesFirst/JarMtimesEqual/KotlinClassFileNewer/seen_by_kotlin/dep.jar/Dep___JavaSeesFirst___JarMtimesEqual___KotlinClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___JarMtimesEqual___KotlinClassFileNewer | +| JavaSeesFirst/JavaJarNewer/ClassFileMtimesEqual/seen_by_kotlin/dep.jar/Dep___JavaSeesFirst___JavaJarNewer___ClassFileMtimesEqual.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___JavaJarNewer___ClassFileMtimesEqual | +| JavaSeesFirst/JavaJarNewer/JavaClassFileNewer/seen_by_kotlin/dep.jar/Dep___JavaSeesFirst___JavaJarNewer___JavaClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___JavaJarNewer___JavaClassFileNewer | +| JavaSeesFirst/JavaJarNewer/KotlinClassFileNewer/seen_by_kotlin/dep.jar/Dep___JavaSeesFirst___JavaJarNewer___KotlinClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___JavaJarNewer___KotlinClassFileNewer | +| JavaSeesFirst/KotlinJarNewer/ClassFileMtimesEqual/seen_by_kotlin/dep.jar/Dep___JavaSeesFirst___KotlinJarNewer___ClassFileMtimesEqual.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___KotlinJarNewer___ClassFileMtimesEqual | +| JavaSeesFirst/KotlinJarNewer/JavaClassFileNewer/seen_by_kotlin/dep.jar/Dep___JavaSeesFirst___KotlinJarNewer___JavaClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___KotlinJarNewer___JavaClassFileNewer | +| JavaSeesFirst/KotlinJarNewer/KotlinClassFileNewer/seen_by_kotlin/dep.jar/Dep___JavaSeesFirst___KotlinJarNewer___KotlinClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___KotlinJarNewer___KotlinClassFileNewer | +| JavaSeesFirst/NoJar/ClassFileMtimesEqual/seen_by_kotlin/Dep___JavaSeesFirst___NoJar___ClassFileMtimesEqual.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___NoJar___ClassFileMtimesEqual | +| JavaSeesFirst/NoJar/JavaClassFileNewer/seen_by_kotlin/Dep___JavaSeesFirst___NoJar___JavaClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___NoJar___JavaClassFileNewer | +| JavaSeesFirst/NoJar/KotlinClassFileNewer/seen_by_kotlin/Dep___JavaSeesFirst___NoJar___KotlinClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___JavaSeesFirst___NoJar___KotlinClassFileNewer | +| KotlinSeesFirst/JarMtimesEqual/ClassFileMtimesEqual/seen_by_kotlin/dep.jar/Dep___KotlinSeesFirst___JarMtimesEqual___ClassFileMtimesEqual.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___JarMtimesEqual___ClassFileMtimesEqual | +| KotlinSeesFirst/JarMtimesEqual/JavaClassFileNewer/seen_by_kotlin/dep.jar/Dep___KotlinSeesFirst___JarMtimesEqual___JavaClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___JarMtimesEqual___JavaClassFileNewer | +| KotlinSeesFirst/JarMtimesEqual/KotlinClassFileNewer/seen_by_kotlin/dep.jar/Dep___KotlinSeesFirst___JarMtimesEqual___KotlinClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___JarMtimesEqual___KotlinClassFileNewer | +| KotlinSeesFirst/JavaJarNewer/ClassFileMtimesEqual/seen_by_kotlin/dep.jar/Dep___KotlinSeesFirst___JavaJarNewer___ClassFileMtimesEqual.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___JavaJarNewer___ClassFileMtimesEqual | +| KotlinSeesFirst/JavaJarNewer/JavaClassFileNewer/seen_by_kotlin/dep.jar/Dep___KotlinSeesFirst___JavaJarNewer___JavaClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___JavaJarNewer___JavaClassFileNewer | +| KotlinSeesFirst/JavaJarNewer/KotlinClassFileNewer/seen_by_kotlin/dep.jar/Dep___KotlinSeesFirst___JavaJarNewer___KotlinClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___JavaJarNewer___KotlinClassFileNewer | +| KotlinSeesFirst/KotlinJarNewer/ClassFileMtimesEqual/seen_by_kotlin/dep.jar/Dep___KotlinSeesFirst___KotlinJarNewer___ClassFileMtimesEqual.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___KotlinJarNewer___ClassFileMtimesEqual | +| KotlinSeesFirst/KotlinJarNewer/JavaClassFileNewer/seen_by_kotlin/dep.jar/Dep___KotlinSeesFirst___KotlinJarNewer___JavaClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___KotlinJarNewer___JavaClassFileNewer | +| KotlinSeesFirst/KotlinJarNewer/KotlinClassFileNewer/seen_by_kotlin/dep.jar/Dep___KotlinSeesFirst___KotlinJarNewer___KotlinClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___KotlinJarNewer___KotlinClassFileNewer | +| KotlinSeesFirst/NoJar/ClassFileMtimesEqual/seen_by_kotlin/Dep___KotlinSeesFirst___NoJar___ClassFileMtimesEqual.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___NoJar___ClassFileMtimesEqual | +| KotlinSeesFirst/NoJar/JavaClassFileNewer/seen_by_kotlin/Dep___KotlinSeesFirst___NoJar___JavaClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___NoJar___JavaClassFileNewer | +| KotlinSeesFirst/NoJar/KotlinClassFileNewer/seen_by_kotlin/Dep___KotlinSeesFirst___NoJar___KotlinClassFileNewer.class:0:0:0:0 | memberOnlySeenByKotlin | Dep___KotlinSeesFirst___NoJar___KotlinClassFileNewer | diff --git a/java/ql/integration-tests/posix-only/kotlin/java_kotlin_extraction_orders/test.py b/java/ql/integration-tests/posix-only/kotlin/java_kotlin_extraction_orders/test.py new file mode 100644 index 00000000000..476db9203d5 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/java_kotlin_extraction_orders/test.py @@ -0,0 +1,128 @@ +from create_database_utils import * +import os +import os.path +import subprocess + +# Build a family of dependencies outside tracing, then refer to them from a traced build: + +older_datetime = "202201010101" +newer_datetime = "202202020202" + +classpath_entries = dict() + +extraction_orders = ["JavaSeesFirst", "KotlinSeesFirst"] +jar_states = ["NoJar", "JarMtimesEqual", "JavaJarNewer", "KotlinJarNewer"] +class_file_states = ["ClassFileMtimesEqual", "JavaClassFileNewer", "KotlinClassFileNewer"] + +# Create test classes for each combination of which extractor will see the file first, the relative timestamps of the jar files seen by each, and the relative timestamps of the class file inside: + +jobs = [] + +for first_extraction in extraction_orders: + for jar_state in jar_states: + for class_file_state in class_file_states: + dep_dir = os.path.join(first_extraction, jar_state, class_file_state) + dep_classname = "Dep___%s___%s___%s" % (first_extraction, jar_state, class_file_state) + dep_seen_by_java_dir = os.path.join(dep_dir, "seen_by_java") + dep_seen_by_kotlin_dir = os.path.join(dep_dir, "seen_by_kotlin") + os.makedirs(dep_seen_by_java_dir) + os.makedirs(dep_seen_by_kotlin_dir) + dep_seen_by_java_sourcefile = os.path.join(dep_seen_by_java_dir, dep_classname + ".java") + dep_seen_by_kotlin_sourcefile = os.path.join(dep_seen_by_kotlin_dir, dep_classname + ".java") + with open(dep_seen_by_java_sourcefile, "w") as f: + f.write("public class %s { }" % dep_classname) + with open(dep_seen_by_kotlin_sourcefile, "w") as f: + f.write("public class %s { void memberOnlySeenByKotlin() { } }" % dep_classname) + jobs.append({ + "first_extraction": first_extraction, + "jar_state": jar_state, + "class_file_state": class_file_state, + "dep_dir": dep_dir, + "dep_classname": dep_classname, + "dep_seen_by_java_dir": dep_seen_by_java_dir, + "dep_seen_by_kotlin_dir": dep_seen_by_kotlin_dir, + "dep_seen_by_java_sourcefile": dep_seen_by_java_sourcefile, + "dep_seen_by_kotlin_sourcefile": dep_seen_by_kotlin_sourcefile + }) + +# Compile all the test classes we just generated, in two commands (since javac objects to seeing the same class file twice in one run) + +subprocess.check_call(["javac"] + [j["dep_seen_by_java_sourcefile"] for j in jobs]) +subprocess.check_call(["javac"] + [j["dep_seen_by_kotlin_sourcefile"] for j in jobs]) + +# Create jar files and set class and jar files' relative timestamps for each dependency the two extractors will see: + +for j in jobs: + os.remove(j["dep_seen_by_java_sourcefile"]) + os.remove(j["dep_seen_by_kotlin_sourcefile"]) + dep_seen_by_java_classfile = j["dep_seen_by_java_sourcefile"].replace(".java", ".class") + dep_seen_by_kotlin_classfile = j["dep_seen_by_kotlin_sourcefile"].replace(".java", ".class") + + subprocess.check_call(["touch", "-t", newer_datetime if j["class_file_state"] == "JavaClassFileNewer" else older_datetime, dep_seen_by_java_classfile]) + subprocess.check_call(["touch", "-t", newer_datetime if j["class_file_state"] == "KotlinClassFileNewer" else older_datetime, dep_seen_by_kotlin_classfile]) + + if j["jar_state"] != "NoJar": + classfile_name = os.path.basename(dep_seen_by_java_classfile) + jar_command = ["jar", "cf", "dep.jar", classfile_name] + subprocess.check_call(jar_command, cwd = j["dep_seen_by_java_dir"]) + subprocess.check_call(jar_command, cwd = j["dep_seen_by_kotlin_dir"]) + jar_seen_by_java = os.path.join(j["dep_seen_by_java_dir"], "dep.jar") + jar_seen_by_kotlin = os.path.join(j["dep_seen_by_kotlin_dir"], "dep.jar") + subprocess.check_call(["touch", "-t", newer_datetime if j["jar_state"] == "JavaJarNewer" else older_datetime, jar_seen_by_java]) + subprocess.check_call(["touch", "-t", newer_datetime if j["jar_state"] == "KotlinJarNewer" else older_datetime, jar_seen_by_kotlin]) + j["javac_classpath_entry"] = jar_seen_by_java + j["kotlinc_classpath_entry"] = jar_seen_by_kotlin + else: + # No jar file involved, just add the dependency build directory to the classpath: + j["javac_classpath_entry"] = j["dep_seen_by_java_dir"] + j["kotlinc_classpath_entry"] = j["dep_seen_by_kotlin_dir"] + +# Create source files that instantiate each dependency type: + +kotlin_first_jobs = [j for j in jobs if j["first_extraction"] == "KotlinSeesFirst"] +java_first_jobs = [j for j in jobs if j["first_extraction"] == "JavaSeesFirst"] +kotlin_first_classes = [j["dep_classname"] for j in kotlin_first_jobs] +java_first_classes = [j["dep_classname"] for j in java_first_jobs] + +kotlin_first_user = "kotlinFirstUser.kt" +kotlin_second_user = "kotlinSecondUser.kt" +java_first_user = "JavaFirstUser.java" +java_second_user = "JavaSecondUser.java" + +def kotlin_instantiate_classes(classes): + return "; ".join(["noop(%s())" % c for c in classes]) + +def make_kotlin_user(user_filename, classes): + with open(user_filename, "w") as f: + f.write("fun noop(x: Any) { } fun user() { %s }" % kotlin_instantiate_classes(classes)) + +make_kotlin_user(kotlin_first_user, kotlin_first_classes) +make_kotlin_user(kotlin_second_user, java_first_classes) + +def java_instantiate_classes(classes): + return " ".join(["noop(new %s());" % c for c in classes]) + +def make_java_user(user_filename, classes): + with open(user_filename, "w") as f: + f.write("public class %s { private static void noop(Object x) { } public static void user() { %s } }" % (user_filename.replace(".java", ""), java_instantiate_classes(classes))) + +make_java_user(java_first_user, java_first_classes) +make_java_user(java_second_user, kotlin_first_classes) + +# Now finally make a database, including classes where Java sees them first followed by Kotlin and vice versa. +# In all cases the Kotlin extraction should take precedence. + +def make_classpath(jobs, entry_name): + return ":".join([j[entry_name] for j in jobs]) + +kotlin_first_classpath = make_classpath(kotlin_first_jobs, "kotlinc_classpath_entry") +java_first_classpath = make_classpath(java_first_jobs, "javac_classpath_entry") +kotlin_second_classpath = make_classpath(java_first_jobs, "kotlinc_classpath_entry") +java_second_classpath = make_classpath(kotlin_first_jobs, "javac_classpath_entry") + +run_codeql_database_create([ + "kotlinc -cp %s %s" % (kotlin_first_classpath, kotlin_first_user), + "javac -cp %s %s" % (java_first_classpath, java_first_user), + "kotlinc -cp %s %s" % (kotlin_second_classpath, kotlin_second_user), + "javac -cp %s %s" % (java_second_classpath, java_second_user) +], lang="java") diff --git a/java/ql/integration-tests/posix-only/kotlin/java_kotlin_extraction_orders/test.ql b/java/ql/integration-tests/posix-only/kotlin/java_kotlin_extraction_orders/test.ql new file mode 100644 index 00000000000..637735f68ea --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/java_kotlin_extraction_orders/test.ql @@ -0,0 +1,5 @@ +import java + +from Method m +where m.getName() = "memberOnlySeenByKotlin" +select m, m.getDeclaringType().getName() diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/J.java b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/J.java new file mode 100644 index 00000000000..d1cc30d651d --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/J.java @@ -0,0 +1 @@ +public class J { } diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/K.kt b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/K.kt new file mode 100644 index 00000000000..d07b8bd8d03 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/K.kt @@ -0,0 +1 @@ +fun user1(j: J) { } diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/K2.kt b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/K2.kt new file mode 100644 index 00000000000..f01cd4d1304 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/K2.kt @@ -0,0 +1 @@ +fun user2(j: J) { } diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/jlocs.expected b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/jlocs.expected new file mode 100644 index 00000000000..5be9218762e --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/jlocs.expected @@ -0,0 +1,3 @@ +| J.java:1:14:1:14 | J | +| build/J.class:0:0:0:0 | J | +| file:///!unknown-binary-location/J.class:0:0:0:0 | J | diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/jlocs.ql b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/jlocs.ql new file mode 100644 index 00000000000..d0d4beee9f9 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/jlocs.ql @@ -0,0 +1,5 @@ +import java + +from Class c +where c.getSourceDeclaration().getName() = "J" +select c diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/test.py b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/test.py new file mode 100644 index 00000000000..2b44384c1dc --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_compiler_java_source/test.py @@ -0,0 +1,8 @@ +from create_database_utils import * + +os.mkdir('build') +# Steps: +# 1. Compile Kotlin passing Java source code. J.class is extracted with an unknown binary location +# 2. Compile Java producing a class file. J.class should be re-extracted this time with a known binary location +# 3. Compile a Kotlin user passing a Java class file on the classpath. Should reference the class file location that step 1 didn't know, but step 2 did. +run_codeql_database_create(["kotlinc J.java K.kt -d build", "javac J.java -d build", "kotlinc K2.kt -cp build -d build"], lang="java") diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/libsrc/longsig.kt b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/libsrc/longsig.kt new file mode 100644 index 00000000000..25dda426865 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/libsrc/longsig.kt @@ -0,0 +1,7 @@ +package abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij; + +class Param { + +} + +fun f(p1: Param, p2: Param, p3: Param, p4: Param, p5: Param) { } diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/test.expected b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/test.expected new file mode 100644 index 00000000000..d99bf44e5fb --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/test.expected @@ -0,0 +1 @@ +| /abcdefghij/abcdefghij/abcdefghij/abcdefghij/abcdefghij/abcdefghij/abcdefghij/abcdefghij/abcdefghij/abcdefghij/LongsigKt.class:0:0:0:0 | f | diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/test.py b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/test.py new file mode 100644 index 00000000000..a5987b0c08f --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/test.py @@ -0,0 +1,11 @@ +from create_database_utils import * +import glob + +# Compile library Kotlin file untraced. Note the library is hidden under `libsrc` so the Kotlin compiler +# will certainly reference the jar, not the source or class file. + +os.mkdir('build') +runSuccessfully(["kotlinc"] + glob.glob("libsrc/*.kt") + ["-d", "build"]) +runSuccessfully(["jar", "cf", "extlib.jar", "-C", "build", "abcdefghij", "-C", "build", "META-INF"]) +run_codeql_database_create(["kotlinc user.kt -cp extlib.jar"], lang="java") + diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/test.ql b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/test.ql new file mode 100644 index 00000000000..f514be114a7 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/test.ql @@ -0,0 +1,7 @@ +import java + +from Method m +where m.getDeclaringType().getName() = "LongsigKt" +select m.getLocation() + .toString() + .regexpReplaceAll(".*(extlib.jar|!unknown-binary-location)/", "/"), m.toString() diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/user.kt b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/user.kt new file mode 100644 index 00000000000..8c60c53fc03 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_file_import/user.kt @@ -0,0 +1,7 @@ +import abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.abcdefghij.* + +fun user() { + + f(Param(), Param(), Param(), Param(), Param()) + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/JavaDefns.java b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/JavaDefns.java new file mode 100644 index 00000000000..c8e4daaa5f0 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/JavaDefns.java @@ -0,0 +1,18 @@ +public class JavaDefns { + + // Currently known not to work: the Comparable case, which Kotlin sees as Comparable<*> because the + // wildcard goes the opposite direction to the variance declared on Comparable's type parameter. + + public static void takesComparable(Comparable invar, Comparable contravar) { } + + public static void takesNestedComparable(Comparable> innerContravar, Comparable> outerContravar) { } + + public static void takesArrayOfComparable(Comparable[] invar, Comparable[] contravar) { } + + public static Comparable returnsWildcard() { return null; } + + public static Comparable returnsInvariant() { return null; } + + public JavaDefns(Comparable invar, Comparable contravar) { } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/JavaUser.java b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/JavaUser.java new file mode 100644 index 00000000000..cbc0544e9fe --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/JavaUser.java @@ -0,0 +1,54 @@ +import java.util.List; + +public class JavaUser { + + public static void test() { + + KotlinDefns kd = new KotlinDefns(); + + kd.takesInvariantType((List)null, (List)null, (List)null); + + kd.takesCovariantType((List)null, (List)null); + + kd.takesContravariantType((Comparable)null, (Comparable)null); + + kd.takesNestedType((List>) null, (List>)null, (Comparable>)null, (List>)null, (Comparable>)null); + + kd.takesFinalParameter((List)null, (List)null, (Comparable)null); + + kd.takesFinalParameterForceWildcard((List)null, (List)null, (Comparable)null); + + kd.takesAnyParameter((List)null, (List)null, (Comparable)null); + + kd.takesAnyQParameter((List)null, (List)null, (Comparable)null); + + kd.takesAnyParameterForceWildcard((List)null, (List)null, (Comparable)null); + + kd.takesVariantTypesSuppressedWildcards((List)null, (Comparable)null); + + List r1 = kd.returnsInvar(); + + List r2 = kd.returnsCovar(); + + Comparable r3 = kd.returnsContravar(); + + List r4 = kd.returnsCovarForced(); + + Comparable r5 = kd.returnsContravarForced(); + + KotlinDefnsSuppressedOuter kdso = new KotlinDefnsSuppressedOuter(); + kdso.outerFn((List)null, (Comparable)null); + KotlinDefnsSuppressedOuter.Inner kdsoi = new KotlinDefnsSuppressedOuter.Inner(); + kdsoi.innerFn((List)null, (Comparable)null); + + KotlinDefnsSuppressedInner kdsi = new KotlinDefnsSuppressedInner(); + kdsi.outerFn((List)null, (Comparable)null); + KotlinDefnsSuppressedInner.Inner kdsii = new KotlinDefnsSuppressedInner.Inner(); + kdsii.innerFn((List)null, (Comparable)null); + + KotlinDefnsSuppressedFn kdsf = new KotlinDefnsSuppressedFn(); + kdsf.outerFn((List)null, (Comparable)null); + + } + +} \ No newline at end of file diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/kotlindefns.kt b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/kotlindefns.kt new file mode 100644 index 00000000000..671c1ae0ecc --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/kotlindefns.kt @@ -0,0 +1,78 @@ +// Note throughout, using: +// MutableList as a type whose parameter is invariant +// List as a type whose parameter is covariant (List) +// Comparable as a type whose parameter is contravariant (Comparable) +// CharSequence as a non-final type +// String as a final type + +class ComparableCs : Comparable { + override fun compareTo(other: CharSequence): Int = 1 +} + +class KotlinDefns { + + fun takesInvariantType(noUseSiteVariance: MutableList, useSiteCovariant: MutableList, useSiteContravariant: MutableList) { } + + // Note List is a static error (contradictory variance) + fun takesCovariantType(noUseSiteVariance: List, useSiteCovariant: List) { } + + // Note Comparable is a static error (contradictory variance) + fun takesContravariantType(noUseSiteVariance: Comparable, useSiteContravariant: Comparable) { } + + fun takesNestedType(invar: MutableList>, covar: List>, contravar: Comparable>, mixed1: List>, mixed2: Comparable>) { } + + fun takesFinalParameter(invar: MutableList, covar: List, contravar: Comparable) { } + + fun takesFinalParameterForceWildcard(invar: MutableList<@JvmWildcard String>, covar: List<@JvmWildcard String>, contravar: Comparable<@JvmWildcard String>) { } + + fun takesAnyParameter(invar: MutableList, covar: List, contravar: Comparable) { } + + fun takesAnyQParameter(invar: MutableList, covar: List, contravar: Comparable) { } + + fun takesAnyParameterForceWildcard(invar: MutableList<@JvmWildcard Any>, covar: List<@JvmWildcard Any>, contravar: Comparable<@JvmWildcard Any>) { } + + fun takesVariantTypesSuppressedWildcards(covar: List<@JvmSuppressWildcards CharSequence>, contravar: Comparable<@JvmSuppressWildcards CharSequence>) { } + + fun returnsInvar() : MutableList = mutableListOf() + + fun returnsCovar(): List = listOf() + + fun returnsContravar(): Comparable = ComparableCs() + + fun returnsCovarForced(): List<@JvmWildcard CharSequence> = listOf() + + fun returnsContravarForced(): Comparable<@JvmWildcard CharSequence> = ComparableCs() + +} + +@JvmSuppressWildcards +class KotlinDefnsSuppressedOuter { + + fun outerFn(covar: List, contravar: Comparable) { } + + class Inner { + + fun innerFn(covar: List, contravar: Comparable) { } + + } + +} + +class KotlinDefnsSuppressedInner { + + fun outerFn(covar: List, contravar: Comparable) { } + + @JvmSuppressWildcards + class Inner { + + fun innerFn(covar: List, contravar: Comparable) { } + + } + +} + +class KotlinDefnsSuppressedFn { + + @JvmSuppressWildcards fun outerFn(covar: List, contravar: Comparable) { } + +} \ No newline at end of file diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/kotlinuser.kt b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/kotlinuser.kt new file mode 100644 index 00000000000..535b03b902f --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/kotlinuser.kt @@ -0,0 +1,10 @@ + +fun user() { + val cs = ComparableCs() + val acs = arrayOf(cs) + + JavaDefns.takesComparable(cs, cs) + JavaDefns.takesArrayOfComparable(acs, acs) + + val constructed = JavaDefns(cs, cs) +} diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/test.expected b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/test.expected new file mode 100644 index 00000000000..a0c58e6b492 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/test.expected @@ -0,0 +1,54 @@ +| JavaDefns | JavaDefns | contravar | Comparable | +| JavaDefns | JavaDefns | invar | Comparable | +| JavaDefns | returnsInvariant | return | Comparable | +| JavaDefns | returnsWildcard | return | Comparable | +| JavaDefns | takesArrayOfComparable | contravar | Comparable[] | +| JavaDefns | takesArrayOfComparable | invar | Comparable[] | +| JavaDefns | takesComparable | contravar | Comparable | +| JavaDefns | takesComparable | invar | Comparable | +| JavaDefns | takesNestedComparable | innerContravar | Comparable> | +| JavaDefns | takesNestedComparable | outerContravar | Comparable> | +| KotlinDefns | returnsContravar | return | Comparable | +| KotlinDefns | returnsContravarForced | return | Comparable | +| KotlinDefns | returnsCovar | return | List | +| KotlinDefns | returnsCovarForced | return | List | +| KotlinDefns | returnsInvar | return | List | +| KotlinDefns | takesAnyParameter | contravar | Comparable | +| KotlinDefns | takesAnyParameter | covar | List | +| KotlinDefns | takesAnyParameter | invar | List | +| KotlinDefns | takesAnyParameterForceWildcard | contravar | Comparable | +| KotlinDefns | takesAnyParameterForceWildcard | covar | List | +| KotlinDefns | takesAnyParameterForceWildcard | invar | List | +| KotlinDefns | takesAnyQParameter | contravar | Comparable | +| KotlinDefns | takesAnyQParameter | covar | List | +| KotlinDefns | takesAnyQParameter | invar | List | +| KotlinDefns | takesContravariantType | noUseSiteVariance | Comparable | +| KotlinDefns | takesContravariantType | useSiteContravariant | Comparable | +| KotlinDefns | takesCovariantType | noUseSiteVariance | List | +| KotlinDefns | takesCovariantType | useSiteCovariant | List | +| KotlinDefns | takesFinalParameter | contravar | Comparable | +| KotlinDefns | takesFinalParameter | covar | List | +| KotlinDefns | takesFinalParameter | invar | List | +| KotlinDefns | takesFinalParameterForceWildcard | contravar | Comparable | +| KotlinDefns | takesFinalParameterForceWildcard | covar | List | +| KotlinDefns | takesFinalParameterForceWildcard | invar | List | +| KotlinDefns | takesInvariantType | noUseSiteVariance | List | +| KotlinDefns | takesInvariantType | useSiteContravariant | List | +| KotlinDefns | takesInvariantType | useSiteCovariant | List | +| KotlinDefns | takesNestedType | contravar | Comparable> | +| KotlinDefns | takesNestedType | covar | List> | +| KotlinDefns | takesNestedType | invar | List> | +| KotlinDefns | takesNestedType | mixed1 | List> | +| KotlinDefns | takesNestedType | mixed2 | Comparable> | +| KotlinDefns | takesVariantTypesSuppressedWildcards | contravar | Comparable | +| KotlinDefns | takesVariantTypesSuppressedWildcards | covar | List | +| KotlinDefnsSuppressedFn | outerFn | contravar | Comparable | +| KotlinDefnsSuppressedFn | outerFn | covar | List | +| KotlinDefnsSuppressedInner | outerFn | contravar | Comparable | +| KotlinDefnsSuppressedInner | outerFn | covar | List | +| KotlinDefnsSuppressedInner$Inner | innerFn | contravar | Comparable | +| KotlinDefnsSuppressedInner$Inner | innerFn | covar | List | +| KotlinDefnsSuppressedOuter | outerFn | contravar | Comparable | +| KotlinDefnsSuppressedOuter | outerFn | covar | List | +| KotlinDefnsSuppressedOuter$Inner | innerFn | contravar | Comparable | +| KotlinDefnsSuppressedOuter$Inner | innerFn | covar | List | diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/test.py b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/test.py new file mode 100644 index 00000000000..76e58dc728b --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/test.py @@ -0,0 +1,3 @@ +from create_database_utils import * + +run_codeql_database_create(["kotlinc kotlindefns.kt", "javac JavaUser.java JavaDefns.java -cp .", "kotlinc -cp . kotlinuser.kt"], lang="java") diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/test.ql b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/test.ql new file mode 100644 index 00000000000..36dd57871b7 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_lowering_wildcards/test.ql @@ -0,0 +1,22 @@ +import java + +predicate isInterestingClass(Class c) { + [c, c.(NestedType).getEnclosingType()].getName().matches(["KotlinDefns%", "JavaDefns"]) +} + +from Callable c, string paramOrReturnName, Type paramOrReturnType +where + isInterestingClass(c.getDeclaringType()) and + ( + exists(Parameter p | + p = c.getAParameter() and + paramOrReturnName = p.getName() and + paramOrReturnType = p.getType() + ) + or + paramOrReturnName = "return" and + paramOrReturnType = c.getReturnType() and + not paramOrReturnType instanceof VoidType + ) +select c.getDeclaringType().getQualifiedName(), c.getName(), paramOrReturnName, + paramOrReturnType.toString() diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/ReadsFields.java b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/ReadsFields.java new file mode 100644 index 00000000000..02bf6ff5255 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/ReadsFields.java @@ -0,0 +1,13 @@ +public class ReadsFields { + + public static void read() { + + sink(HasFields.constField); + sink(HasFields.lateinitField); + sink(HasFields.jvmFieldAnnotatedField); + + } + + public static void sink(String x) { } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/hasFields.kt b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/hasFields.kt new file mode 100644 index 00000000000..a7fde8fa33b --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/hasFields.kt @@ -0,0 +1,17 @@ +public class HasFields { + + companion object { + + const val constField = "taint" + + lateinit var lateinitField: String + + @JvmField val jvmFieldAnnotatedField = "taint" + + } + + fun doLateInit() { + lateinitField = "taint" + } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/test.expected b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/test.expected new file mode 100644 index 00000000000..3581a178422 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/test.expected @@ -0,0 +1,26 @@ +edges +| hasFields.kt:5:5:5:34 | constField : String | ReadsFields.java:5:10:5:29 | HasFields.constField | +| hasFields.kt:5:28:5:34 | taint : String | hasFields.kt:5:5:5:34 | constField : String | +| hasFields.kt:7:5:7:38 | lateinitField : String | ReadsFields.java:6:10:6:32 | HasFields.lateinitField | +| hasFields.kt:7:14:7:38 | : String | hasFields.kt:7:5:7:38 | lateinitField : String | +| hasFields.kt:7:14:7:38 | : String | hasFields.kt:7:14:7:38 | : String | +| hasFields.kt:9:5:9:50 | jvmFieldAnnotatedField : String | ReadsFields.java:7:10:7:41 | HasFields.jvmFieldAnnotatedField | +| hasFields.kt:9:44:9:50 | taint : String | hasFields.kt:9:5:9:50 | jvmFieldAnnotatedField : String | +| hasFields.kt:14:22:14:26 | taint : String | hasFields.kt:7:14:7:38 | : String | +nodes +| ReadsFields.java:5:10:5:29 | HasFields.constField | semmle.label | HasFields.constField | +| ReadsFields.java:6:10:6:32 | HasFields.lateinitField | semmle.label | HasFields.lateinitField | +| ReadsFields.java:7:10:7:41 | HasFields.jvmFieldAnnotatedField | semmle.label | HasFields.jvmFieldAnnotatedField | +| hasFields.kt:5:5:5:34 | constField : String | semmle.label | constField : String | +| hasFields.kt:5:28:5:34 | taint : String | semmle.label | taint : String | +| hasFields.kt:7:5:7:38 | lateinitField : String | semmle.label | lateinitField : String | +| hasFields.kt:7:14:7:38 | : String | semmle.label | : String | +| hasFields.kt:7:14:7:38 | : String | semmle.label | : String | +| hasFields.kt:9:5:9:50 | jvmFieldAnnotatedField : String | semmle.label | jvmFieldAnnotatedField : String | +| hasFields.kt:9:44:9:50 | taint : String | semmle.label | taint : String | +| hasFields.kt:14:22:14:26 | taint : String | semmle.label | taint : String | +subpaths +#select +| hasFields.kt:5:28:5:34 | taint : String | hasFields.kt:5:28:5:34 | taint : String | ReadsFields.java:5:10:5:29 | HasFields.constField | flow path | +| hasFields.kt:9:44:9:50 | taint : String | hasFields.kt:9:44:9:50 | taint : String | ReadsFields.java:7:10:7:41 | HasFields.jvmFieldAnnotatedField | flow path | +| hasFields.kt:14:22:14:26 | taint : String | hasFields.kt:14:22:14:26 | taint : String | ReadsFields.java:6:10:6:32 | HasFields.lateinitField | flow path | diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/test.py b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/test.py new file mode 100644 index 00000000000..07bf397a81e --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/test.py @@ -0,0 +1,4 @@ +from create_database_utils import * + +os.mkdir('build') +run_codeql_database_create(["kotlinc ReadsFields.java hasFields.kt -d kbuild", "javac ReadsFields.java -cp kbuild"], lang="java") diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/test.ql b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/test.ql new file mode 100644 index 00000000000..f7702b2ac38 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlin_java_static_fields/test.ql @@ -0,0 +1,17 @@ +import java +import semmle.code.java.dataflow.DataFlow +import DataFlow::PathGraph + +class Config extends DataFlow::Configuration { + Config() { this = "Config" } + + override predicate isSource(DataFlow::Node n) { n.asExpr().(StringLiteral).getValue() = "taint" } + + override predicate isSink(DataFlow::Node n) { + n.asExpr().(Argument).getCall().getCallee().getName() = "sink" + } +} + +from DataFlow::PathNode source, DataFlow::PathNode sink, Config c +where c.hasFlowPath(source, sink) +select source, source, sink, "flow path" diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/FileA.kt b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/FileA.kt new file mode 100644 index 00000000000..1b471fcea51 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/FileA.kt @@ -0,0 +1,9 @@ +package foo.bar; + +// import foo.bar.ClassB; + +class ClassA { + fun f(b: ClassB) { + b.called(); + } +} diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/FileB.kt b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/FileB.kt new file mode 100644 index 00000000000..43f5f870d52 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/FileB.kt @@ -0,0 +1,8 @@ +package foo.bar; + +class ClassB { + fun called() { + } + fun notCalled() { + } +} diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/build.py b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/build.py new file mode 100644 index 00000000000..09d42100362 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/build.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +from create_database_utils import * + +runSuccessfully(["kotlinc", "FileA.kt", "FileB.kt"]) + diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/compilations.expected b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/compilations.expected new file mode 100644 index 00000000000..2a4f078a25f --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/compilations.expected @@ -0,0 +1 @@ +| 1 | diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/compilations.ql b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/compilations.ql new file mode 100644 index 00000000000..7ddd497d555 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/compilations.ql @@ -0,0 +1,3 @@ +import java + +select count(Compilation c) diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/methods.expected b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/methods.expected new file mode 100644 index 00000000000..873b5d7debc --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/methods.expected @@ -0,0 +1,3 @@ +| FileA.kt:6:2:8:2 | f | +| FileB.kt:4:2:5:2 | called | +| FileB.kt:6:2:7:2 | notCalled | diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/methods.ql b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/methods.ql new file mode 100644 index 00000000000..9d32c93e69c --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/methods.ql @@ -0,0 +1,5 @@ +import java + +from Method m +where exists(m.getFile().getRelativePath()) +select m diff --git a/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/test.py b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/test.py new file mode 100644 index 00000000000..074931bbe89 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/kotlinc_multi/test.py @@ -0,0 +1,3 @@ +from create_database_utils import * + +run_codeql_database_create(['"%s" ./build.py' % sys.executable], lang="java") diff --git a/java/ql/integration-tests/posix-only/kotlin/logs/build.py b/java/ql/integration-tests/posix-only/kotlin/logs/build.py new file mode 100644 index 00000000000..eedddd8ba5c --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/logs/build.py @@ -0,0 +1,18 @@ +#!/usr/bin/python + +from create_database_utils import * + +# Make a source file to keep codeql happy +srcDir = os.environ['CODEQL_EXTRACTOR_JAVA_SOURCE_ARCHIVE_DIR'] +srcFile = srcDir + '/Source.java' +os.makedirs(srcDir) +with open(srcFile, 'w') as f: + pass + +for t in ['Test1', 'sun.something.Test2']: + print('Test ' + t + ' started.') + sys.stdout.flush() + runSuccessfully(['java', t]) + print('Test ' + t + ' ended.') + sys.stdout.flush() + diff --git a/java/ql/integration-tests/posix-only/kotlin/logs/index_logs.py b/java/ql/integration-tests/posix-only/kotlin/logs/index_logs.py new file mode 100644 index 00000000000..c7b94ad024d --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/logs/index_logs.py @@ -0,0 +1,41 @@ +#!/usr/bin/python + +import csv +import json +import re +import sys +from create_database_utils import * + +# Make a source file to keep codeql happy +src_dir = os.environ['CODEQL_EXTRACTOR_JAVA_SOURCE_ARCHIVE_DIR'] +src_file = src_dir + '/Source.java' +os.makedirs(src_dir) +with open(src_file, 'w') as f: + pass + +line_index = 0 +file_index = 0 +with open('logs.csv', 'w', newline='') as f_out: + csv_writer = csv.writer(f_out) + def write_line(origin, kind, msg): + global file_index, line_index + csv_writer.writerow([str(file_index), str(line_index), origin, kind, msg]) + line_index += 1 + log_dir = 'kt-db/log' + for file_name in os.listdir(log_dir): + if file_name.startswith('kotlin-extractor'): + file_index += 1 + line_index = 1 + write_line('Test script', 'Log file', str(file_index)) + with open(log_dir + '/' + file_name) as f_in: + for line in f_in: + j = json.loads(line) + msg = j['message'] + msg = re.sub('(?<=Extraction for invocation TRAP file ).*/kt-db/trap/java/invocations/kotlin\..*\.trap', '', msg) + if msg.startswith('Peak memory: '): + # Peak memory information varies from run to run, so just ignore it + continue + write_line(j['origin'], j['kind'], msg) + +runSuccessfully(["codeql", "database", "index-files", "--language=csv", "--include=logs.csv", "test-db"]) + diff --git a/java/ql/integration-tests/posix-only/kotlin/logs/logs.expected b/java/ql/integration-tests/posix-only/kotlin/logs/logs.expected new file mode 100644 index 00000000000..9c5116e850f --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/logs/logs.expected @@ -0,0 +1,5 @@ +| 1 | 1 | Test script | Log file | 1 | +| 1 | 2 | CodeQL Kotlin extractor | INFO | Extraction started | +| 1 | 3 | CodeQL Kotlin extractor | INFO | Extraction for invocation TRAP file | +| 1 | 4 | CodeQL Kotlin extractor | INFO | Extracting file test.kt | +| 1 | 5 | CodeQL Kotlin extractor | INFO | Extraction completed | diff --git a/java/ql/integration-tests/posix-only/kotlin/logs/logs.ql b/java/ql/integration-tests/posix-only/kotlin/logs/logs.ql new file mode 100644 index 00000000000..5a3d30fc5b2 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/logs/logs.ql @@ -0,0 +1,5 @@ +import external.ExternalArtifact + +from ExternalData ed +where ed.getDataPath().matches("%logs.csv") +select ed.getFieldAsInt(0), ed.getFieldAsInt(1), ed.getField(2), ed.getField(3), ed.getField(4) diff --git a/java/ql/integration-tests/posix-only/kotlin/logs/test.kt b/java/ql/integration-tests/posix-only/kotlin/logs/test.kt new file mode 100644 index 00000000000..2fc18b1217a --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/logs/test.kt @@ -0,0 +1,2 @@ +class Test { +} diff --git a/java/ql/integration-tests/posix-only/kotlin/logs/test.py b/java/ql/integration-tests/posix-only/kotlin/logs/test.py new file mode 100644 index 00000000000..6203650ac3f --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/logs/test.py @@ -0,0 +1,4 @@ +from create_database_utils import * + +run_codeql_database_create(['kotlinc test.kt'], test_db="kt-db", db=None, lang="java") +run_codeql_database_create(['"%s" ./index_logs.py' % sys.executable], lang="java") diff --git a/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/JavaUser.java b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/JavaUser.java new file mode 100644 index 00000000000..f54b65bde92 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/JavaUser.java @@ -0,0 +1,35 @@ +import extlib.*; + +public class JavaUser { + + public static void test() { + + OuterGeneric.InnerGeneric a = (new OuterGeneric()).new InnerGeneric('a'); + OuterGeneric.InnerGeneric a2 = (new OuterGeneric()).new InnerGeneric('a'); + OuterGeneric.InnerGeneric a3 = (new OuterGeneric()).new InnerGeneric('a', "Hello world"); + OuterGeneric.InnerNotGeneric b = (new OuterGeneric()).new InnerNotGeneric(); + OuterGeneric.InnerNotGeneric b2 = (new OuterGeneric()).new InnerNotGeneric(); + OuterNotGeneric.InnerGeneric c = (new OuterNotGeneric()).new InnerGeneric(); + OuterGeneric.InnerStaticGeneric d = new OuterGeneric.InnerStaticGeneric('a', "Hello world"); + OuterManyParams.MiddleManyParams.InnerManyParams e = ((new OuterManyParams(1, "hello")).new MiddleManyParams(1.0f, 1.0)).new InnerManyParams(1L, (short)1); + + String result1 = a.returnsecond(0, "hello"); + String result1a = a.returnsecond(0, "hello", 'a'); + Integer result2 = b.identity(5); + String result2b = b2.identity("hello"); + String result3 = c.identity("world"); + String result4 = d.identity("goodbye"); + Short result5 = e.returnSixth(1, "hello", 1.0f, 1.0, 1L, (short)1); + + OuterGeneric.InnerNotGeneric innerGetterTest = (new OuterGeneric()).getInnerNotGeneric(); + OuterNotGeneric.InnerGeneric innerGetterTest2 = (new OuterNotGeneric()).getInnerGeneric(); + + TypeParamVisibility tpv = new TypeParamVisibility(); + TypeParamVisibility.VisibleBecauseInner visibleBecauseInner = tpv.getVisibleBecauseInner(); + TypeParamVisibility.VisibleBecauseInnerIndirectContainer.VisibleBecauseInnerIndirect visibleBecauseInnerIndirect = tpv.getVisibleBecauseInnerIndirect(); + TypeParamVisibility.NotVisibleBecauseStatic notVisibleBecauseStatic = tpv.getNotVisibleBecauseStatic(); + TypeParamVisibility.NotVisibleBecauseStaticIndirectContainer.NotVisibleBecauseStaticIndirect notVisibleBecauseStaticIndirect = tpv.getNotVisibleBecauseStaticIndirect(); + + } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/KotlinUser.kt b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/KotlinUser.kt new file mode 100644 index 00000000000..44474b84619 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/KotlinUser.kt @@ -0,0 +1,36 @@ +package testuser + +import extlib.* + +class User { + + fun test() { + + val a = OuterGeneric().InnerGeneric('a') + val a2 = OuterGeneric().InnerGeneric('a', "hello world") + val b = OuterGeneric().InnerNotGeneric() + val b2 = OuterGeneric().InnerNotGeneric() + val c = OuterNotGeneric().InnerGeneric() + val d = OuterGeneric.InnerStaticGeneric('a', "hello world") + val e = OuterManyParams(1, "hello").MiddleManyParams(1.0f, 1.0).InnerManyParams(1L, 1.toShort()) + + val result1 = a.returnsecond(0, "hello") + val result1a = a.returnsecond(0, "hello", 'a') + val result2 = b.identity(5) + val result2b = b2.identity("hello") + val result3 = c.identity("world") + val result4 = d.identity("goodbye") + val result5 = e.returnSixth(1, "hello", 1.0f, 1.0, 1L, 1.toShort()) + + val innerGetterTest = OuterGeneric().getInnerNotGeneric() + val innerGetterTest2 = OuterNotGeneric().getInnerGeneric() + + val tpv = TypeParamVisibility() + val visibleBecauseInner = tpv.getVisibleBecauseInner(); + val visibleBecauseInnerIndirect = tpv.getVisibleBecauseInnerIndirect() + val notVisibleBecauseStatic = tpv.getNotVisibleBecauseStatic() + val notVisibleBecauseStaticIndirect = tpv.getNotVisibleBecauseStaticIndirect() + + } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/OuterGeneric.java b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/OuterGeneric.java new file mode 100644 index 00000000000..b98950ad6dc --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/OuterGeneric.java @@ -0,0 +1,34 @@ +package extlib; + +public class OuterGeneric { + + public class InnerNotGeneric { + + public T identity(T t) { return t; } + + } + + public InnerNotGeneric getInnerNotGeneric() { return null; } + + public class InnerGeneric { + + public InnerGeneric(R r) { } + + public InnerGeneric(R r, S s) { } + + public S returnsecond(T t, S s) { return s; } + + public S returnsecond(T t, S s, R r) { return s; } + + } + + public static class InnerStaticGeneric { + + public InnerStaticGeneric(R r, S s) { } + + public S identity(S s) { return s; } + + } + +} + diff --git a/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/OuterManyParams.java b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/OuterManyParams.java new file mode 100644 index 00000000000..f21493ba9f9 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/OuterManyParams.java @@ -0,0 +1,22 @@ +package extlib; + +public class OuterManyParams { + + public OuterManyParams(A a, B b) { } + + public class MiddleManyParams { + + public MiddleManyParams(C c, D d) { } + + public class InnerManyParams { + + public InnerManyParams(E e, F f) { } + + public F returnSixth(A a, B b, C c, D d, E e, F f) { return f; } + + } + + } + +} + diff --git a/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/OuterNotGeneric.java b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/OuterNotGeneric.java new file mode 100644 index 00000000000..68a0f62d768 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/OuterNotGeneric.java @@ -0,0 +1,17 @@ +package extlib; + +public class OuterNotGeneric { + + public class InnerGeneric { + + public S identity(S s) { return s; } + + } + + public InnerGeneric getInnerGeneric() { + + return new InnerGeneric(); + + } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/TypeParamVisibility.java b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/TypeParamVisibility.java new file mode 100644 index 00000000000..1ac6d4892e3 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/libsrc/extlib/TypeParamVisibility.java @@ -0,0 +1,29 @@ +package extlib; + +public class TypeParamVisibility { + + public class VisibleBecauseInner { } + + public class VisibleBecauseInnerIndirectContainer { + + public class VisibleBecauseInnerIndirect { } + + } + + public static class NotVisibleBecauseStatic { } + + public static class NotVisibleBecauseStaticIndirectContainer { + + public class NotVisibleBecauseStaticIndirect { } + + } + + public VisibleBecauseInner getVisibleBecauseInner() { return new VisibleBecauseInner(); } + + public VisibleBecauseInnerIndirectContainer.VisibleBecauseInnerIndirect getVisibleBecauseInnerIndirect() { return (new VisibleBecauseInnerIndirectContainer()).new VisibleBecauseInnerIndirect(); } + + public NotVisibleBecauseStatic getNotVisibleBecauseStatic() { return new NotVisibleBecauseStatic(); } + + public NotVisibleBecauseStaticIndirectContainer.NotVisibleBecauseStaticIndirect getNotVisibleBecauseStaticIndirect() { return (new NotVisibleBecauseStaticIndirectContainer()).new NotVisibleBecauseStaticIndirect(); } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/test.expected b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/test.expected new file mode 100644 index 00000000000..1c37ebd0eff --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/test.expected @@ -0,0 +1,378 @@ +callArgs +| JavaUser.java:7:52:7:110 | new InnerGeneric(...) | JavaUser.java:7:53:7:79 | new OuterGeneric(...) | -2 | +| JavaUser.java:7:52:7:110 | new InnerGeneric(...) | JavaUser.java:7:86:7:105 | InnerGeneric | -3 | +| JavaUser.java:7:52:7:110 | new InnerGeneric(...) | JavaUser.java:7:107:7:109 | 'a' | 0 | +| JavaUser.java:7:53:7:79 | new OuterGeneric(...) | JavaUser.java:7:57:7:77 | OuterGeneric | -3 | +| JavaUser.java:8:53:8:123 | new InnerGeneric(...) | JavaUser.java:8:54:8:80 | new OuterGeneric(...) | -2 | +| JavaUser.java:8:53:8:123 | new InnerGeneric(...) | JavaUser.java:8:88:8:96 | Character | -4 | +| JavaUser.java:8:53:8:123 | new InnerGeneric(...) | JavaUser.java:8:99:8:118 | InnerGeneric | -3 | +| JavaUser.java:8:53:8:123 | new InnerGeneric(...) | JavaUser.java:8:120:8:122 | 'a' | 0 | +| JavaUser.java:8:54:8:80 | new OuterGeneric(...) | JavaUser.java:8:58:8:78 | OuterGeneric | -3 | +| JavaUser.java:9:53:9:138 | new InnerGeneric(...) | JavaUser.java:9:54:9:80 | new OuterGeneric(...) | -2 | +| JavaUser.java:9:53:9:138 | new InnerGeneric(...) | JavaUser.java:9:88:9:96 | Character | -4 | +| JavaUser.java:9:53:9:138 | new InnerGeneric(...) | JavaUser.java:9:99:9:118 | InnerGeneric | -3 | +| JavaUser.java:9:53:9:138 | new InnerGeneric(...) | JavaUser.java:9:120:9:122 | 'a' | 0 | +| JavaUser.java:9:53:9:138 | new InnerGeneric(...) | JavaUser.java:9:125:9:137 | "Hello world" | 1 | +| JavaUser.java:9:54:9:80 | new OuterGeneric(...) | JavaUser.java:9:58:9:78 | OuterGeneric | -3 | +| JavaUser.java:10:47:10:97 | new InnerNotGeneric(...) | JavaUser.java:10:48:10:74 | new OuterGeneric(...) | -2 | +| JavaUser.java:10:47:10:97 | new InnerNotGeneric(...) | JavaUser.java:10:81:10:95 | InnerNotGeneric | -3 | +| JavaUser.java:10:48:10:74 | new OuterGeneric(...) | JavaUser.java:10:52:10:72 | OuterGeneric | -3 | +| JavaUser.java:11:47:11:96 | new InnerNotGeneric(...) | JavaUser.java:11:48:11:73 | new OuterGeneric(...) | -2 | +| JavaUser.java:11:47:11:96 | new InnerNotGeneric(...) | JavaUser.java:11:80:11:94 | InnerNotGeneric | -3 | +| JavaUser.java:11:48:11:73 | new OuterGeneric(...) | JavaUser.java:11:52:11:71 | OuterGeneric | -3 | +| JavaUser.java:12:46:12:95 | new InnerGeneric(...) | JavaUser.java:12:47:12:67 | new OuterNotGeneric(...) | -2 | +| JavaUser.java:12:46:12:95 | new InnerGeneric(...) | JavaUser.java:12:74:12:93 | InnerGeneric | -3 | +| JavaUser.java:12:47:12:67 | new OuterNotGeneric(...) | JavaUser.java:12:51:12:65 | OuterNotGeneric | -3 | +| JavaUser.java:13:49:13:111 | new InnerStaticGeneric(...) | JavaUser.java:13:53:13:91 | OuterGeneric<>.InnerStaticGeneric | -3 | +| JavaUser.java:13:49:13:111 | new InnerStaticGeneric(...) | JavaUser.java:13:93:13:95 | 'a' | 0 | +| JavaUser.java:13:49:13:111 | new InnerStaticGeneric(...) | JavaUser.java:13:98:13:110 | "Hello world" | 1 | +| JavaUser.java:14:103:14:248 | new InnerManyParams(...) | JavaUser.java:14:104:14:200 | new MiddleManyParams(...) | -2 | +| JavaUser.java:14:103:14:248 | new InnerManyParams(...) | JavaUser.java:14:207:14:234 | InnerManyParams | -3 | +| JavaUser.java:14:103:14:248 | new InnerManyParams(...) | JavaUser.java:14:236:14:237 | 1L | 0 | +| JavaUser.java:14:103:14:248 | new InnerManyParams(...) | JavaUser.java:14:240:14:247 | (...)... | 1 | +| JavaUser.java:14:104:14:200 | new MiddleManyParams(...) | JavaUser.java:14:105:14:152 | new OuterManyParams(...) | -2 | +| JavaUser.java:14:104:14:200 | new MiddleManyParams(...) | JavaUser.java:14:159:14:189 | MiddleManyParams | -3 | +| JavaUser.java:14:104:14:200 | new MiddleManyParams(...) | JavaUser.java:14:191:14:194 | 1.0f | 0 | +| JavaUser.java:14:104:14:200 | new MiddleManyParams(...) | JavaUser.java:14:197:14:199 | 1.0 | 1 | +| JavaUser.java:14:105:14:152 | new OuterManyParams(...) | JavaUser.java:14:109:14:140 | OuterManyParams | -3 | +| JavaUser.java:14:105:14:152 | new OuterManyParams(...) | JavaUser.java:14:142:14:142 | 1 | 0 | +| JavaUser.java:14:105:14:152 | new OuterManyParams(...) | JavaUser.java:14:145:14:151 | "hello" | 1 | +| JavaUser.java:16:22:16:47 | returnsecond(...) | JavaUser.java:16:22:16:22 | a | -1 | +| JavaUser.java:16:22:16:47 | returnsecond(...) | JavaUser.java:16:37:16:37 | 0 | 0 | +| JavaUser.java:16:22:16:47 | returnsecond(...) | JavaUser.java:16:40:16:46 | "hello" | 1 | +| JavaUser.java:17:23:17:53 | returnsecond(...) | JavaUser.java:17:23:17:23 | a | -1 | +| JavaUser.java:17:23:17:53 | returnsecond(...) | JavaUser.java:17:38:17:38 | 0 | 0 | +| JavaUser.java:17:23:17:53 | returnsecond(...) | JavaUser.java:17:41:17:47 | "hello" | 1 | +| JavaUser.java:17:23:17:53 | returnsecond(...) | JavaUser.java:17:50:17:52 | 'a' | 2 | +| JavaUser.java:18:23:18:35 | identity(...) | JavaUser.java:18:23:18:23 | b | -1 | +| JavaUser.java:18:23:18:35 | identity(...) | JavaUser.java:18:34:18:34 | 5 | 0 | +| JavaUser.java:19:23:19:42 | identity(...) | JavaUser.java:19:23:19:24 | b2 | -1 | +| JavaUser.java:19:23:19:42 | identity(...) | JavaUser.java:19:35:19:41 | "hello" | 0 | +| JavaUser.java:20:22:20:40 | identity(...) | JavaUser.java:20:22:20:22 | c | -1 | +| JavaUser.java:20:22:20:40 | identity(...) | JavaUser.java:20:33:20:39 | "world" | 0 | +| JavaUser.java:21:22:21:42 | identity(...) | JavaUser.java:21:22:21:22 | d | -1 | +| JavaUser.java:21:22:21:42 | identity(...) | JavaUser.java:21:33:21:41 | "goodbye" | 0 | +| JavaUser.java:22:21:22:70 | returnSixth(...) | JavaUser.java:22:21:22:21 | e | -1 | +| JavaUser.java:22:21:22:70 | returnSixth(...) | JavaUser.java:22:35:22:35 | 1 | 0 | +| JavaUser.java:22:21:22:70 | returnSixth(...) | JavaUser.java:22:38:22:44 | "hello" | 1 | +| JavaUser.java:22:21:22:70 | returnSixth(...) | JavaUser.java:22:47:22:50 | 1.0f | 2 | +| JavaUser.java:22:21:22:70 | returnSixth(...) | JavaUser.java:22:53:22:55 | 1.0 | 3 | +| JavaUser.java:22:21:22:70 | returnSixth(...) | JavaUser.java:22:58:22:59 | 1L | 4 | +| JavaUser.java:22:21:22:70 | returnSixth(...) | JavaUser.java:22:62:22:69 | (...)... | 5 | +| JavaUser.java:24:60:24:108 | getInnerNotGeneric(...) | JavaUser.java:24:61:24:86 | new OuterGeneric(...) | -1 | +| JavaUser.java:24:61:24:86 | new OuterGeneric(...) | JavaUser.java:24:65:24:84 | OuterGeneric | -3 | +| JavaUser.java:25:61:25:101 | getInnerGeneric(...) | JavaUser.java:25:62:25:82 | new OuterNotGeneric(...) | -1 | +| JavaUser.java:25:62:25:82 | new OuterNotGeneric(...) | JavaUser.java:25:66:25:80 | OuterNotGeneric | -3 | +| JavaUser.java:27:39:27:71 | new TypeParamVisibility(...) | JavaUser.java:27:43:27:69 | TypeParamVisibility | -3 | +| JavaUser.java:28:83:28:110 | getVisibleBecauseInner(...) | JavaUser.java:28:83:28:85 | tpv | -1 | +| JavaUser.java:29:136:29:171 | getVisibleBecauseInnerIndirect(...) | JavaUser.java:29:136:29:138 | tpv | -1 | +| JavaUser.java:30:83:30:114 | getNotVisibleBecauseStatic(...) | JavaUser.java:30:83:30:85 | tpv | -1 | +| JavaUser.java:31:140:31:179 | getNotVisibleBecauseStaticIndirect(...) | JavaUser.java:31:140:31:142 | tpv | -1 | +| KotlinUser.kt:9:13:9:31 | new OuterGeneric(...) | KotlinUser.kt:9:13:9:31 | OuterGeneric | -3 | +| KotlinUser.kt:9:33:9:63 | new InnerGeneric(...) | KotlinUser.kt:9:13:9:31 | new OuterGeneric(...) | -2 | +| KotlinUser.kt:9:33:9:63 | new InnerGeneric(...) | KotlinUser.kt:9:33:9:63 | InnerGeneric | -3 | +| KotlinUser.kt:9:33:9:63 | new InnerGeneric(...) | KotlinUser.kt:9:60:9:62 | a | 0 | +| KotlinUser.kt:10:14:10:32 | new OuterGeneric(...) | KotlinUser.kt:10:14:10:32 | OuterGeneric | -3 | +| KotlinUser.kt:10:34:10:65 | new InnerGeneric(...) | KotlinUser.kt:10:14:10:32 | new OuterGeneric(...) | -2 | +| KotlinUser.kt:10:34:10:65 | new InnerGeneric(...) | KotlinUser.kt:10:34:10:65 | InnerGeneric | -3 | +| KotlinUser.kt:10:34:10:65 | new InnerGeneric(...) | KotlinUser.kt:10:47:10:49 | a | 0 | +| KotlinUser.kt:10:34:10:65 | new InnerGeneric(...) | KotlinUser.kt:10:53:10:63 | hello world | 1 | +| KotlinUser.kt:11:13:11:31 | new OuterGeneric(...) | KotlinUser.kt:11:13:11:31 | OuterGeneric | -3 | +| KotlinUser.kt:11:33:11:49 | new InnerNotGeneric<>(...) | KotlinUser.kt:11:13:11:31 | new OuterGeneric(...) | -2 | +| KotlinUser.kt:11:33:11:49 | new InnerNotGeneric<>(...) | KotlinUser.kt:11:33:11:49 | InnerNotGeneric<> | -3 | +| KotlinUser.kt:12:14:12:35 | new OuterGeneric(...) | KotlinUser.kt:12:14:12:35 | OuterGeneric | -3 | +| KotlinUser.kt:12:37:12:53 | new InnerNotGeneric<>(...) | KotlinUser.kt:12:14:12:35 | new OuterGeneric(...) | -2 | +| KotlinUser.kt:12:37:12:53 | new InnerNotGeneric<>(...) | KotlinUser.kt:12:37:12:53 | InnerNotGeneric<> | -3 | +| KotlinUser.kt:13:13:13:29 | new OuterNotGeneric(...) | KotlinUser.kt:13:13:13:29 | OuterNotGeneric | -3 | +| KotlinUser.kt:13:31:13:52 | new InnerGeneric(...) | KotlinUser.kt:13:13:13:29 | new OuterNotGeneric(...) | -2 | +| KotlinUser.kt:13:31:13:52 | new InnerGeneric(...) | KotlinUser.kt:13:31:13:52 | InnerGeneric | -3 | +| KotlinUser.kt:14:26:14:63 | new InnerStaticGeneric(...) | KotlinUser.kt:14:26:14:63 | InnerStaticGeneric | -3 | +| KotlinUser.kt:14:26:14:63 | new InnerStaticGeneric(...) | KotlinUser.kt:14:45:14:47 | a | 0 | +| KotlinUser.kt:14:26:14:63 | new InnerStaticGeneric(...) | KotlinUser.kt:14:51:14:61 | hello world | 1 | +| KotlinUser.kt:15:13:15:39 | new OuterManyParams(...) | KotlinUser.kt:15:13:15:39 | OuterManyParams | -3 | +| KotlinUser.kt:15:13:15:39 | new OuterManyParams(...) | KotlinUser.kt:15:29:15:29 | 1 | 0 | +| KotlinUser.kt:15:13:15:39 | new OuterManyParams(...) | KotlinUser.kt:15:33:15:37 | hello | 1 | +| KotlinUser.kt:15:41:15:67 | new MiddleManyParams(...) | KotlinUser.kt:15:13:15:39 | new OuterManyParams(...) | -2 | +| KotlinUser.kt:15:41:15:67 | new MiddleManyParams(...) | KotlinUser.kt:15:41:15:67 | MiddleManyParams | -3 | +| KotlinUser.kt:15:41:15:67 | new MiddleManyParams(...) | KotlinUser.kt:15:58:15:61 | 1.0 | 0 | +| KotlinUser.kt:15:41:15:67 | new MiddleManyParams(...) | KotlinUser.kt:15:64:15:66 | 1.0 | 1 | +| KotlinUser.kt:15:69:15:100 | new InnerManyParams(...) | KotlinUser.kt:15:41:15:67 | new MiddleManyParams(...) | -2 | +| KotlinUser.kt:15:69:15:100 | new InnerManyParams(...) | KotlinUser.kt:15:69:15:100 | InnerManyParams | -3 | +| KotlinUser.kt:15:69:15:100 | new InnerManyParams(...) | KotlinUser.kt:15:85:15:86 | 1 | 0 | +| KotlinUser.kt:15:69:15:100 | new InnerManyParams(...) | KotlinUser.kt:15:91:15:99 | shortValue(...) | 1 | +| KotlinUser.kt:15:91:15:99 | shortValue(...) | KotlinUser.kt:15:89:15:89 | 1 | -1 | +| KotlinUser.kt:17:21:17:44 | returnsecond(...) | KotlinUser.kt:17:19:17:19 | a | -1 | +| KotlinUser.kt:17:21:17:44 | returnsecond(...) | KotlinUser.kt:17:34:17:34 | 0 | 0 | +| KotlinUser.kt:17:21:17:44 | returnsecond(...) | KotlinUser.kt:17:38:17:42 | hello | 1 | +| KotlinUser.kt:18:22:18:50 | returnsecond(...) | KotlinUser.kt:18:20:18:20 | a | -1 | +| KotlinUser.kt:18:22:18:50 | returnsecond(...) | KotlinUser.kt:18:22:18:50 | Character | -2 | +| KotlinUser.kt:18:22:18:50 | returnsecond(...) | KotlinUser.kt:18:35:18:35 | 0 | 0 | +| KotlinUser.kt:18:22:18:50 | returnsecond(...) | KotlinUser.kt:18:39:18:43 | hello | 1 | +| KotlinUser.kt:18:22:18:50 | returnsecond(...) | KotlinUser.kt:18:47:18:49 | a | 2 | +| KotlinUser.kt:19:21:19:31 | identity(...) | KotlinUser.kt:19:19:19:19 | b | -1 | +| KotlinUser.kt:19:21:19:31 | identity(...) | KotlinUser.kt:19:30:19:30 | 5 | 0 | +| KotlinUser.kt:20:23:20:39 | identity(...) | KotlinUser.kt:20:20:20:21 | b2 | -1 | +| KotlinUser.kt:20:23:20:39 | identity(...) | KotlinUser.kt:20:33:20:37 | hello | 0 | +| KotlinUser.kt:21:21:21:37 | identity(...) | KotlinUser.kt:21:19:21:19 | c | -1 | +| KotlinUser.kt:21:21:21:37 | identity(...) | KotlinUser.kt:21:31:21:35 | world | 0 | +| KotlinUser.kt:22:21:22:39 | identity(...) | KotlinUser.kt:22:19:22:19 | d | -1 | +| KotlinUser.kt:22:21:22:39 | identity(...) | KotlinUser.kt:22:31:22:37 | goodbye | 0 | +| KotlinUser.kt:23:21:23:71 | returnSixth(...) | KotlinUser.kt:23:19:23:19 | e | -1 | +| KotlinUser.kt:23:21:23:71 | returnSixth(...) | KotlinUser.kt:23:33:23:33 | 1 | 0 | +| KotlinUser.kt:23:21:23:71 | returnSixth(...) | KotlinUser.kt:23:37:23:41 | hello | 1 | +| KotlinUser.kt:23:21:23:71 | returnSixth(...) | KotlinUser.kt:23:45:23:48 | 1.0 | 2 | +| KotlinUser.kt:23:21:23:71 | returnSixth(...) | KotlinUser.kt:23:51:23:53 | 1.0 | 3 | +| KotlinUser.kt:23:21:23:71 | returnSixth(...) | KotlinUser.kt:23:56:23:57 | 1 | 4 | +| KotlinUser.kt:23:21:23:71 | returnSixth(...) | KotlinUser.kt:23:62:23:70 | shortValue(...) | 5 | +| KotlinUser.kt:23:62:23:70 | shortValue(...) | KotlinUser.kt:23:60:23:60 | 1 | -1 | +| KotlinUser.kt:25:27:25:48 | new OuterGeneric(...) | KotlinUser.kt:25:27:25:48 | OuterGeneric | -3 | +| KotlinUser.kt:25:50:25:69 | getInnerNotGeneric(...) | KotlinUser.kt:25:27:25:48 | new OuterGeneric(...) | -1 | +| KotlinUser.kt:26:28:26:44 | new OuterNotGeneric(...) | KotlinUser.kt:26:28:26:44 | OuterNotGeneric | -3 | +| KotlinUser.kt:26:46:26:62 | getInnerGeneric(...) | KotlinUser.kt:26:28:26:44 | new OuterNotGeneric(...) | -1 | +| KotlinUser.kt:28:15:28:43 | new TypeParamVisibility(...) | KotlinUser.kt:28:15:28:43 | TypeParamVisibility | -3 | +| KotlinUser.kt:29:35:29:58 | getVisibleBecauseInner(...) | KotlinUser.kt:29:31:29:33 | tpv | -1 | +| KotlinUser.kt:30:43:30:74 | getVisibleBecauseInnerIndirect(...) | KotlinUser.kt:30:39:30:41 | tpv | -1 | +| KotlinUser.kt:31:39:31:66 | getNotVisibleBecauseStatic(...) | KotlinUser.kt:31:35:31:37 | tpv | -1 | +| KotlinUser.kt:32:47:32:82 | getNotVisibleBecauseStaticIndirect(...) | KotlinUser.kt:32:43:32:45 | tpv | -1 | +genericTypes +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | S | +| extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | S | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | T | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | E | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | F | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | C | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | D | +| extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | A | +| extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | B | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | S | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStatic.class:0:0:0:0 | NotVisibleBecauseStatic | extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStatic.class:0:0:0:0 | S | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer$NotVisibleBecauseStaticIndirect.class:0:0:0:0 | NotVisibleBecauseStaticIndirect | extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer$NotVisibleBecauseStaticIndirect.class:0:0:0:0 | S | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner | extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | S | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect | extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | S | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | T | +paramTypes +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | S | +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | String | +| extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | S | +| extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | String | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | T | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | Integer | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | String | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | E | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | F | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | Long | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | Short | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | C | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | D | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | Double | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | Float | +| extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | A | +| extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | B | +| extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | Integer | +| extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | String | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | S | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | String | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStatic.class:0:0:0:0 | NotVisibleBecauseStatic | S | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStatic.class:0:0:0:0 | NotVisibleBecauseStatic | String | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer$NotVisibleBecauseStaticIndirect.class:0:0:0:0 | NotVisibleBecauseStaticIndirect | S | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer$NotVisibleBecauseStaticIndirect.class:0:0:0:0 | NotVisibleBecauseStaticIndirect | String | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner | S | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner | String | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner | String | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect | S | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect | String | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect | String | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | T | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | String | +constructors +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | InnerGeneric(java.lang.Object) | +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | InnerGeneric(java.lang.Object,java.lang.Object) | +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | InnerGeneric(java.lang.Object) | +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | InnerGeneric(java.lang.Object,java.lang.String) | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric | InnerNotGeneric() | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | InnerNotGeneric<>() | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | InnerNotGeneric<>() | +| extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | InnerStaticGeneric(java.lang.Object,java.lang.Object) | +| extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | InnerStaticGeneric(java.lang.Object,java.lang.String) | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | OuterGeneric() | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | OuterGeneric() | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | OuterGeneric() | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | InnerManyParams(java.lang.Object,java.lang.Object) | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | InnerManyParams(java.lang.Long,java.lang.Short) | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | MiddleManyParams(java.lang.Object,java.lang.Object) | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | MiddleManyParams(java.lang.Float,java.lang.Double) | +| extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | OuterManyParams(java.lang.Object,java.lang.Object) | +| extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | OuterManyParams(java.lang.Integer,java.lang.String) | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | InnerGeneric() | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | InnerGeneric() | +| extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | OuterNotGeneric | OuterNotGeneric() | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStatic.class:0:0:0:0 | NotVisibleBecauseStatic | NotVisibleBecauseStatic() | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer$NotVisibleBecauseStaticIndirect.class:0:0:0:0 | NotVisibleBecauseStaticIndirect | NotVisibleBecauseStaticIndirect() | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer.class:0:0:0:0 | NotVisibleBecauseStaticIndirectContainer | NotVisibleBecauseStaticIndirectContainer() | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner | VisibleBecauseInner() | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect | VisibleBecauseInnerIndirect() | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer.class:0:0:0:0 | VisibleBecauseInnerIndirectContainer | VisibleBecauseInnerIndirectContainer() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | TypeParamVisibility() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | TypeParamVisibility() | +methods +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | returnsecond | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | returnsecond(java.lang.Object,java.lang.Object) | +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | returnsecond | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | returnsecond(java.lang.Object,java.lang.Object,java.lang.Object) | +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | returnsecond | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | returnsecond(java.lang.Integer,java.lang.String) | +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | returnsecond | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | returnsecond(java.lang.Integer,java.lang.String,java.lang.Object) | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | identity | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric | identity(java.lang.Object) | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | identity | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | identity(java.lang.Integer) | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | identity | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | identity(java.lang.String) | +| extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | identity | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | identity(java.lang.Object) | +| extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | identity | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | identity(java.lang.String) | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | getInnerNotGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | getInnerNotGeneric() | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | getInnerNotGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | getInnerNotGeneric() | +| extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | getInnerNotGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | getInnerNotGeneric() | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | returnSixth | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | returnSixth(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object) | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | returnSixth | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | returnSixth(java.lang.Integer,java.lang.String,java.lang.Float,java.lang.Double,java.lang.Long,java.lang.Short) | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | identity | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | identity(java.lang.Object) | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | identity | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | identity(java.lang.String) | +| extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | getInnerGeneric | extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | OuterNotGeneric | getInnerGeneric() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getNotVisibleBecauseStatic | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | getNotVisibleBecauseStatic() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getNotVisibleBecauseStatic | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | getNotVisibleBecauseStatic() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getNotVisibleBecauseStaticIndirect | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | getNotVisibleBecauseStaticIndirect() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getNotVisibleBecauseStaticIndirect | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | getNotVisibleBecauseStaticIndirect() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getVisibleBecauseInner | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | getVisibleBecauseInner() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getVisibleBecauseInner | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | getVisibleBecauseInner() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getVisibleBecauseInnerIndirect | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | getVisibleBecauseInnerIndirect() | +| extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getVisibleBecauseInnerIndirect | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | getVisibleBecauseInnerIndirect() | +nestedTypes +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric<> | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | +| extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | OuterNotGeneric | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric<> | extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | OuterNotGeneric | +| extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | OuterNotGeneric | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStatic.class:0:0:0:0 | NotVisibleBecauseStatic | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStatic.class:0:0:0:0 | NotVisibleBecauseStatic<> | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStatic.class:0:0:0:0 | NotVisibleBecauseStatic | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer$NotVisibleBecauseStaticIndirect.class:0:0:0:0 | NotVisibleBecauseStaticIndirect | extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer.class:0:0:0:0 | NotVisibleBecauseStaticIndirectContainer | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer$NotVisibleBecauseStaticIndirect.class:0:0:0:0 | NotVisibleBecauseStaticIndirect<> | extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer.class:0:0:0:0 | NotVisibleBecauseStaticIndirectContainer | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer$NotVisibleBecauseStaticIndirect.class:0:0:0:0 | NotVisibleBecauseStaticIndirect | extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer.class:0:0:0:0 | NotVisibleBecauseStaticIndirectContainer | +| extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer.class:0:0:0:0 | NotVisibleBecauseStaticIndirectContainer | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner<> | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility<> | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect | extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer.class:0:0:0:0 | VisibleBecauseInnerIndirectContainer | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect<> | extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer.class:0:0:0:0 | VisibleBecauseInnerIndirectContainer<> | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect | extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer.class:0:0:0:0 | VisibleBecauseInnerIndirectContainer | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect | extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer.class:0:0:0:0 | VisibleBecauseInnerIndirectContainer<> | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer.class:0:0:0:0 | VisibleBecauseInnerIndirectContainer | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer.class:0:0:0:0 | VisibleBecauseInnerIndirectContainer<> | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility<> | +| extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer.class:0:0:0:0 | VisibleBecauseInnerIndirectContainer<> | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +javaKotlinCalleeAgreement +| JavaUser.java:16:22:16:47 | returnsecond(...) | KotlinUser.kt:17:21:17:44 | returnsecond(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | returnsecond | +| JavaUser.java:17:23:17:53 | returnsecond(...) | KotlinUser.kt:18:22:18:50 | returnsecond(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | returnsecond | +| JavaUser.java:18:23:18:35 | identity(...) | KotlinUser.kt:19:21:19:31 | identity(...) | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | identity | +| JavaUser.java:19:23:19:42 | identity(...) | KotlinUser.kt:20:23:20:39 | identity(...) | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | identity | +| JavaUser.java:20:22:20:40 | identity(...) | KotlinUser.kt:21:21:21:37 | identity(...) | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | identity | +| JavaUser.java:21:22:21:42 | identity(...) | KotlinUser.kt:22:21:22:39 | identity(...) | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | identity | +| JavaUser.java:22:21:22:70 | returnSixth(...) | KotlinUser.kt:23:21:23:71 | returnSixth(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | returnSixth | +| JavaUser.java:24:60:24:108 | getInnerNotGeneric(...) | KotlinUser.kt:25:50:25:69 | getInnerNotGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | getInnerNotGeneric | +| JavaUser.java:25:61:25:101 | getInnerGeneric(...) | KotlinUser.kt:26:46:26:62 | getInnerGeneric(...) | extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | getInnerGeneric | +| JavaUser.java:28:83:28:110 | getVisibleBecauseInner(...) | KotlinUser.kt:29:35:29:58 | getVisibleBecauseInner(...) | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getVisibleBecauseInner | +| JavaUser.java:29:136:29:171 | getVisibleBecauseInnerIndirect(...) | KotlinUser.kt:30:43:30:74 | getVisibleBecauseInnerIndirect(...) | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getVisibleBecauseInnerIndirect | +| JavaUser.java:30:83:30:114 | getNotVisibleBecauseStatic(...) | KotlinUser.kt:31:39:31:66 | getNotVisibleBecauseStatic(...) | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getNotVisibleBecauseStatic | +| JavaUser.java:31:140:31:179 | getNotVisibleBecauseStaticIndirect(...) | KotlinUser.kt:32:47:32:82 | getNotVisibleBecauseStaticIndirect(...) | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | getNotVisibleBecauseStaticIndirect | +javaKotlinConstructorAgreement +| JavaUser.java:7:52:7:110 | new InnerGeneric(...) | KotlinUser.kt:9:33:9:63 | new InnerGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:7:53:7:79 | new OuterGeneric(...) | KotlinUser.kt:9:13:9:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:7:53:7:79 | new OuterGeneric(...) | KotlinUser.kt:10:14:10:32 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:7:53:7:79 | new OuterGeneric(...) | KotlinUser.kt:11:13:11:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:8:53:8:123 | new InnerGeneric(...) | KotlinUser.kt:9:33:9:63 | new InnerGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:8:54:8:80 | new OuterGeneric(...) | KotlinUser.kt:9:13:9:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:8:54:8:80 | new OuterGeneric(...) | KotlinUser.kt:10:14:10:32 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:8:54:8:80 | new OuterGeneric(...) | KotlinUser.kt:11:13:11:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:9:53:9:138 | new InnerGeneric(...) | KotlinUser.kt:10:34:10:65 | new InnerGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:9:54:9:80 | new OuterGeneric(...) | KotlinUser.kt:9:13:9:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:9:54:9:80 | new OuterGeneric(...) | KotlinUser.kt:10:14:10:32 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:9:54:9:80 | new OuterGeneric(...) | KotlinUser.kt:11:13:11:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:10:48:10:74 | new OuterGeneric(...) | KotlinUser.kt:9:13:9:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:10:48:10:74 | new OuterGeneric(...) | KotlinUser.kt:10:14:10:32 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:10:48:10:74 | new OuterGeneric(...) | KotlinUser.kt:11:13:11:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:11:48:11:73 | new OuterGeneric(...) | KotlinUser.kt:12:14:12:35 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:11:48:11:73 | new OuterGeneric(...) | KotlinUser.kt:25:27:25:48 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:12:46:12:95 | new InnerGeneric(...) | KotlinUser.kt:13:31:13:52 | new InnerGeneric(...) | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:12:47:12:67 | new OuterNotGeneric(...) | KotlinUser.kt:13:13:13:29 | new OuterNotGeneric(...) | extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | OuterNotGeneric | +| JavaUser.java:12:47:12:67 | new OuterNotGeneric(...) | KotlinUser.kt:26:28:26:44 | new OuterNotGeneric(...) | extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | OuterNotGeneric | +| JavaUser.java:13:49:13:111 | new InnerStaticGeneric(...) | KotlinUser.kt:14:26:14:63 | new InnerStaticGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | +| JavaUser.java:14:103:14:248 | new InnerManyParams(...) | KotlinUser.kt:15:69:15:100 | new InnerManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | +| JavaUser.java:14:104:14:200 | new MiddleManyParams(...) | KotlinUser.kt:15:41:15:67 | new MiddleManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | +| JavaUser.java:14:105:14:152 | new OuterManyParams(...) | KotlinUser.kt:15:13:15:39 | new OuterManyParams(...) | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | +| JavaUser.java:24:61:24:86 | new OuterGeneric(...) | KotlinUser.kt:12:14:12:35 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:24:61:24:86 | new OuterGeneric(...) | KotlinUser.kt:25:27:25:48 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | +| JavaUser.java:25:62:25:82 | new OuterNotGeneric(...) | KotlinUser.kt:13:13:13:29 | new OuterNotGeneric(...) | extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | OuterNotGeneric | +| JavaUser.java:25:62:25:82 | new OuterNotGeneric(...) | KotlinUser.kt:26:28:26:44 | new OuterNotGeneric(...) | extlib.jar/extlib/OuterNotGeneric.class:0:0:0:0 | OuterNotGeneric | +| JavaUser.java:27:39:27:71 | new TypeParamVisibility(...) | KotlinUser.kt:28:15:28:43 | new TypeParamVisibility(...) | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +javaKotlinLocalTypeAgreement +| JavaUser.java:7:5:7:111 | InnerGeneric a | KotlinUser.kt:9:5:9:63 | InnerGeneric a | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:7:5:7:111 | InnerGeneric a | KotlinUser.kt:10:5:10:65 | InnerGeneric a2 | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:8:5:8:124 | InnerGeneric a2 | KotlinUser.kt:9:5:9:63 | InnerGeneric a | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:8:5:8:124 | InnerGeneric a2 | KotlinUser.kt:10:5:10:65 | InnerGeneric a2 | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:9:5:9:139 | InnerGeneric a3 | KotlinUser.kt:9:5:9:63 | InnerGeneric a | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:9:5:9:139 | InnerGeneric a3 | KotlinUser.kt:10:5:10:65 | InnerGeneric a2 | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:10:5:10:98 | InnerNotGeneric<> b | KotlinUser.kt:11:5:11:49 | InnerNotGeneric<> b | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | +| JavaUser.java:11:5:11:97 | InnerNotGeneric<> b2 | KotlinUser.kt:12:5:12:53 | InnerNotGeneric<> b2 | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | +| JavaUser.java:11:5:11:97 | InnerNotGeneric<> b2 | KotlinUser.kt:25:5:25:69 | InnerNotGeneric<> innerGetterTest | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | +| JavaUser.java:12:5:12:96 | InnerGeneric c | KotlinUser.kt:13:5:13:52 | InnerGeneric c | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:12:5:12:96 | InnerGeneric c | KotlinUser.kt:26:5:26:62 | InnerGeneric innerGetterTest2 | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:13:5:13:112 | InnerStaticGeneric d | KotlinUser.kt:14:5:14:63 | InnerStaticGeneric d | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | +| JavaUser.java:14:5:14:249 | InnerManyParams e | KotlinUser.kt:15:5:15:100 | InnerManyParams e | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | +| JavaUser.java:24:5:24:109 | InnerNotGeneric<> innerGetterTest | KotlinUser.kt:12:5:12:53 | InnerNotGeneric<> b2 | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | +| JavaUser.java:24:5:24:109 | InnerNotGeneric<> innerGetterTest | KotlinUser.kt:25:5:25:69 | InnerNotGeneric<> innerGetterTest | extlib.jar/extlib/OuterGeneric$InnerNotGeneric.class:0:0:0:0 | InnerNotGeneric<> | +| JavaUser.java:25:5:25:102 | InnerGeneric innerGetterTest2 | KotlinUser.kt:13:5:13:52 | InnerGeneric c | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:25:5:25:102 | InnerGeneric innerGetterTest2 | KotlinUser.kt:26:5:26:62 | InnerGeneric innerGetterTest2 | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | +| JavaUser.java:27:5:27:72 | TypeParamVisibility tpv | KotlinUser.kt:28:5:28:43 | TypeParamVisibility tpv | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | +| JavaUser.java:28:5:28:111 | VisibleBecauseInner visibleBecauseInner | KotlinUser.kt:29:5:29:58 | VisibleBecauseInner visibleBecauseInner | extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInner.class:0:0:0:0 | VisibleBecauseInner | +| JavaUser.java:29:5:29:172 | VisibleBecauseInnerIndirect visibleBecauseInnerIndirect | KotlinUser.kt:30:5:30:74 | VisibleBecauseInnerIndirect visibleBecauseInnerIndirect | extlib.jar/extlib/TypeParamVisibility$VisibleBecauseInnerIndirectContainer$VisibleBecauseInnerIndirect.class:0:0:0:0 | VisibleBecauseInnerIndirect | +| JavaUser.java:30:5:30:115 | NotVisibleBecauseStatic notVisibleBecauseStatic | KotlinUser.kt:31:5:31:66 | NotVisibleBecauseStatic notVisibleBecauseStatic | extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStatic.class:0:0:0:0 | NotVisibleBecauseStatic | +| JavaUser.java:31:5:31:180 | NotVisibleBecauseStaticIndirect notVisibleBecauseStaticIndirect | KotlinUser.kt:32:5:32:82 | NotVisibleBecauseStaticIndirect notVisibleBecauseStaticIndirect | extlib.jar/extlib/TypeParamVisibility$NotVisibleBecauseStaticIndirectContainer$NotVisibleBecauseStaticIndirect.class:0:0:0:0 | NotVisibleBecauseStaticIndirect | +#select +| JavaUser.java:7:52:7:110 | new InnerGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | JavaUser.java:7:99:7:104 | String | +| JavaUser.java:7:53:7:79 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | JavaUser.java:7:70:7:76 | Integer | +| JavaUser.java:8:53:8:123 | new InnerGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | JavaUser.java:8:112:8:117 | String | +| JavaUser.java:8:54:8:80 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | JavaUser.java:8:71:8:77 | Integer | +| JavaUser.java:9:53:9:138 | new InnerGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | JavaUser.java:9:112:9:117 | String | +| JavaUser.java:9:54:9:80 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | JavaUser.java:9:71:9:77 | Integer | +| JavaUser.java:10:48:10:74 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | JavaUser.java:10:65:10:71 | Integer | +| JavaUser.java:11:48:11:73 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | JavaUser.java:11:65:11:70 | String | +| JavaUser.java:12:46:12:95 | new InnerGeneric(...) | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | JavaUser.java:12:87:12:92 | String | +| JavaUser.java:13:49:13:111 | new InnerStaticGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | JavaUser.java:13:85:13:90 | String | +| JavaUser.java:14:103:14:248 | new InnerManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | JavaUser.java:14:223:14:226 | Long | +| JavaUser.java:14:103:14:248 | new InnerManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | JavaUser.java:14:229:14:233 | Short | +| JavaUser.java:14:104:14:200 | new MiddleManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | JavaUser.java:14:176:14:180 | Float | +| JavaUser.java:14:104:14:200 | new MiddleManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | JavaUser.java:14:183:14:188 | Double | +| JavaUser.java:14:105:14:152 | new OuterManyParams(...) | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | JavaUser.java:14:125:14:131 | Integer | +| JavaUser.java:14:105:14:152 | new OuterManyParams(...) | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | JavaUser.java:14:134:14:139 | String | +| JavaUser.java:24:61:24:86 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | JavaUser.java:24:78:24:83 | String | +| JavaUser.java:27:39:27:71 | new TypeParamVisibility(...) | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | JavaUser.java:27:63:27:68 | String | +| KotlinUser.kt:9:13:9:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | KotlinUser.kt:9:13:9:31 | Integer | +| KotlinUser.kt:9:33:9:63 | new InnerGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | KotlinUser.kt:9:33:9:63 | String | +| KotlinUser.kt:10:14:10:32 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | KotlinUser.kt:10:14:10:32 | Integer | +| KotlinUser.kt:10:34:10:65 | new InnerGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | KotlinUser.kt:10:34:10:65 | String | +| KotlinUser.kt:11:13:11:31 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | KotlinUser.kt:11:13:11:31 | Integer | +| KotlinUser.kt:12:14:12:35 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | KotlinUser.kt:12:14:12:35 | String | +| KotlinUser.kt:13:31:13:52 | new InnerGeneric(...) | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | extlib.jar/extlib/OuterNotGeneric$InnerGeneric.class:0:0:0:0 | InnerGeneric | KotlinUser.kt:13:31:13:52 | String | +| KotlinUser.kt:14:26:14:63 | new InnerStaticGeneric(...) | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | extlib.jar/extlib/OuterGeneric$InnerStaticGeneric.class:0:0:0:0 | InnerStaticGeneric | KotlinUser.kt:14:26:14:63 | String | +| KotlinUser.kt:15:13:15:39 | new OuterManyParams(...) | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | KotlinUser.kt:15:13:15:39 | Integer | +| KotlinUser.kt:15:13:15:39 | new OuterManyParams(...) | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | extlib.jar/extlib/OuterManyParams.class:0:0:0:0 | OuterManyParams | KotlinUser.kt:15:13:15:39 | String | +| KotlinUser.kt:15:41:15:67 | new MiddleManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | KotlinUser.kt:15:41:15:67 | Double | +| KotlinUser.kt:15:41:15:67 | new MiddleManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams.class:0:0:0:0 | MiddleManyParams | KotlinUser.kt:15:41:15:67 | Float | +| KotlinUser.kt:15:69:15:100 | new InnerManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | KotlinUser.kt:15:69:15:100 | Long | +| KotlinUser.kt:15:69:15:100 | new InnerManyParams(...) | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | extlib.jar/extlib/OuterManyParams$MiddleManyParams$InnerManyParams.class:0:0:0:0 | InnerManyParams | KotlinUser.kt:15:69:15:100 | Short | +| KotlinUser.kt:25:27:25:48 | new OuterGeneric(...) | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | extlib.jar/extlib/OuterGeneric.class:0:0:0:0 | OuterGeneric | KotlinUser.kt:25:27:25:48 | String | +| KotlinUser.kt:28:15:28:43 | new TypeParamVisibility(...) | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | extlib.jar/extlib/TypeParamVisibility.class:0:0:0:0 | TypeParamVisibility | KotlinUser.kt:28:15:28:43 | String | diff --git a/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/test.py b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/test.py new file mode 100644 index 00000000000..a2eab7dc171 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/test.py @@ -0,0 +1,11 @@ +from create_database_utils import * +import glob + +# Compile Java untraced. Note the Java source is hidden under `javasrc` so the Kotlin compiler +# will certainly reference the jar, not the source or class file for extlib.Lib + +os.mkdir('build') +runSuccessfully(["javac"] + glob.glob("libsrc/extlib/*.java") + ["-d", "build"]) +runSuccessfully(["jar", "cf", "extlib.jar", "-C", "build", "extlib"]) +run_codeql_database_create(["javac JavaUser.java -cp extlib.jar", "kotlinc KotlinUser.kt -cp extlib.jar"], lang="java") + diff --git a/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/test.ql b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/test.ql new file mode 100644 index 00000000000..5e6bd22674a --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/nested_generic_types/test.ql @@ -0,0 +1,63 @@ +import java + +query predicate callArgs(Call gc, Expr arg, int idx) { + arg.getParent() = gc and idx = arg.getIndex() +} + +query predicate genericTypes(GenericType rt, TypeVariable param) { + rt.getPackage().getName() = "extlib" and + param = rt.getATypeParameter() +} + +query predicate paramTypes(ParameterizedType rt, string typeArg) { + rt.getPackage().getName() = "extlib" and + typeArg = rt.getATypeArgument().toString() +} + +query predicate constructors(Constructor c, string signature) { + c.getDeclaringType().getPackage().getName() = "extlib" and + signature = c.getSignature() +} + +query predicate methods(Method m, RefType declType, string signature) { + declType = m.getDeclaringType() and + signature = m.getSignature() and + declType.getPackage().getName() = "extlib" +} + +query predicate nestedTypes(NestedType nt, RefType parent) { + nt.getPackage().getName() = "extlib" and + parent = nt.getEnclosingType() +} + +query predicate javaKotlinCalleeAgreement( + MethodAccess javaMa, MethodAccess kotlinMa, Callable callee +) { + javaMa.getCallee() = callee and + kotlinMa.getCallee() = callee and + javaMa.getFile().getExtension() = "java" and + kotlinMa.getFile().getExtension() = "kt" +} + +query predicate javaKotlinConstructorAgreement( + ClassInstanceExpr javaCie, ClassInstanceExpr kotlinCie, Constructor constructor +) { + javaCie.getConstructor() = constructor and + kotlinCie.getConstructor() = constructor and + javaCie.getFile().getExtension() = "java" and + kotlinCie.getFile().getExtension() = "kt" +} + +query predicate javaKotlinLocalTypeAgreement( + LocalVariableDecl javaDecl, LocalVariableDecl kotlinDecl, RefType agreedType +) { + javaDecl.getType() = agreedType and + kotlinDecl.getType() = agreedType and + javaDecl.getFile().getExtension() = "java" and + kotlinDecl.getFile().getExtension() = "kt" and + agreedType.getPackage().getName() = "extlib" +} + +from ClassInstanceExpr cie +where cie.getFile().isSourceFile() +select cie, cie.getConstructedType(), cie.getConstructor(), cie.getATypeArgument() diff --git a/java/ql/integration-tests/posix-only/kotlin/qlpack.yml b/java/ql/integration-tests/posix-only/kotlin/qlpack.yml new file mode 100644 index 00000000000..11adb1f538b --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/qlpack.yml @@ -0,0 +1,2 @@ +libraryPathDependencies: + - codeql-java diff --git a/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/JavaUser.java b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/JavaUser.java new file mode 100644 index 00000000000..bcdf24297a9 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/JavaUser.java @@ -0,0 +1,14 @@ +import extlib.GenericTypeJava; +import extlib.RawTypesInSignatureJava; + +class JavaUser { + + public static void user() { + + GenericTypeJava rawGt = GenericTypeJava.getRaw(); + RawTypesInSignatureJava rtis = new RawTypesInSignatureJava(); + rtis.directParameter(null); + + } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/KotlinUser.kt b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/KotlinUser.kt new file mode 100644 index 00000000000..238a80ad815 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/KotlinUser.kt @@ -0,0 +1,11 @@ +import extlib.GenericTypeKotlin; +import extlib.RawTypesInSignatureKotlin; + +fun test() { + + val rawGt = GenericTypeKotlin.getRaw() + val rtis = RawTypesInSignatureKotlin() + rtis.directParameter(null) + +} + diff --git a/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/GenericTypeJava.java b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/GenericTypeJava.java new file mode 100644 index 00000000000..c45d751dfe2 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/GenericTypeJava.java @@ -0,0 +1,12 @@ +package extlib; + +import java.util.*; + +class BoundJava {} + +class InheritsGenericJava { } + +public class GenericTypeJava extends InheritsGenericJava { + public static GenericTypeJava getRaw() { return new GenericTypeJava(); } +} + diff --git a/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/GenericTypeKotlin.java b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/GenericTypeKotlin.java new file mode 100644 index 00000000000..829272760c9 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/GenericTypeKotlin.java @@ -0,0 +1,12 @@ +package extlib; + +import java.util.*; + +class BoundKotlin {} + +class InheritsGenericKotlin { } + +public class GenericTypeKotlin extends InheritsGenericKotlin { + public static GenericTypeKotlin getRaw() { return new GenericTypeKotlin(); } +} + diff --git a/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/RawTypesInSignatureJava.java b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/RawTypesInSignatureJava.java new file mode 100644 index 00000000000..afa78d3e32d --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/RawTypesInSignatureJava.java @@ -0,0 +1,23 @@ +package extlib; + +class ContainerJava { } + +public class RawTypesInSignatureJava { + + public GenericTypeJava directReturn() { return null; } + + public void directParameter(GenericTypeJava param) { } + + public ContainerJava genericParamReturn() { return null; } + + public void genericParamParameter(ContainerJava param) { } + + public ContainerJava genericParamExtendsReturn() { return null; } + + public void genericParamExtendsParameter(ContainerJava param) { } + + public ContainerJava genericParamSuperReturn() { return null; } + + public void genericParamSuperParameter(ContainerJava param) { } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/RawTypesInSignatureKotlin.java b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/RawTypesInSignatureKotlin.java new file mode 100644 index 00000000000..55e5dd68543 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/libsrc/extlib/RawTypesInSignatureKotlin.java @@ -0,0 +1,23 @@ +package extlib; + +class ContainerKotlin { } + +public class RawTypesInSignatureKotlin { + + public GenericTypeKotlin directReturn() { return null; } + + public void directParameter(GenericTypeKotlin param) { } + + public ContainerKotlin genericParamReturn() { return null; } + + public void genericParamParameter(ContainerKotlin param) { } + + public ContainerKotlin genericParamExtendsReturn() { return null; } + + public void genericParamExtendsParameter(ContainerKotlin param) { } + + public ContainerKotlin genericParamSuperReturn() { return null; } + + public void genericParamSuperParameter(ContainerKotlin param) { } + +} diff --git a/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/test.expected b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/test.expected new file mode 100644 index 00000000000..b0ea074a062 --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/test.expected @@ -0,0 +1,24 @@ +rawTypeSupertypes +| extlib.jar/extlib/ContainerJava.class:0:0:0:0 | ContainerJava<> | file:///Object.class:0:0:0:0 | Object | +| extlib.jar/extlib/ContainerKotlin.class:0:0:0:0 | ContainerKotlin<> | file:///Object.class:0:0:0:0 | Object | +| extlib.jar/extlib/GenericTypeJava.class:0:0:0:0 | GenericTypeJava<> | extlib.jar/extlib/InheritsGenericJava.class:0:0:0:0 | InheritsGenericJava<> | +| extlib.jar/extlib/GenericTypeKotlin.class:0:0:0:0 | GenericTypeKotlin<> | extlib.jar/extlib/InheritsGenericKotlin.class:0:0:0:0 | InheritsGenericKotlin<> | +| extlib.jar/extlib/InheritsGenericJava.class:0:0:0:0 | InheritsGenericJava<> | file:///Object.class:0:0:0:0 | Object | +| extlib.jar/extlib/InheritsGenericKotlin.class:0:0:0:0 | InheritsGenericKotlin<> | file:///Object.class:0:0:0:0 | Object | +rawTypeMethod +| extlib.jar/extlib/RawTypesInSignatureJava.class:0:0:0:0 | RawTypesInSignatureJava | directParameter | directParameter(extlib.GenericTypeJava) | GenericTypeJava<> | void | +| extlib.jar/extlib/RawTypesInSignatureJava.class:0:0:0:0 | RawTypesInSignatureJava | directReturn | directReturn() | No parameter | GenericTypeJava<> | +| extlib.jar/extlib/RawTypesInSignatureJava.class:0:0:0:0 | RawTypesInSignatureJava | genericParamExtendsParameter | genericParamExtendsParameter(extlib.ContainerJava) | ContainerJava> | void | +| extlib.jar/extlib/RawTypesInSignatureJava.class:0:0:0:0 | RawTypesInSignatureJava | genericParamExtendsReturn | genericParamExtendsReturn() | No parameter | ContainerJava> | +| extlib.jar/extlib/RawTypesInSignatureJava.class:0:0:0:0 | RawTypesInSignatureJava | genericParamParameter | genericParamParameter(extlib.ContainerJava) | ContainerJava> | void | +| extlib.jar/extlib/RawTypesInSignatureJava.class:0:0:0:0 | RawTypesInSignatureJava | genericParamReturn | genericParamReturn() | No parameter | ContainerJava> | +| extlib.jar/extlib/RawTypesInSignatureJava.class:0:0:0:0 | RawTypesInSignatureJava | genericParamSuperParameter | genericParamSuperParameter(extlib.ContainerJava) | ContainerJava> | void | +| extlib.jar/extlib/RawTypesInSignatureJava.class:0:0:0:0 | RawTypesInSignatureJava | genericParamSuperReturn | genericParamSuperReturn() | No parameter | ContainerJava> | +| extlib.jar/extlib/RawTypesInSignatureKotlin.class:0:0:0:0 | RawTypesInSignatureKotlin | directParameter | directParameter(extlib.GenericTypeKotlin) | GenericTypeKotlin<> | void | +| extlib.jar/extlib/RawTypesInSignatureKotlin.class:0:0:0:0 | RawTypesInSignatureKotlin | directReturn | directReturn() | No parameter | GenericTypeKotlin<> | +| extlib.jar/extlib/RawTypesInSignatureKotlin.class:0:0:0:0 | RawTypesInSignatureKotlin | genericParamExtendsParameter | genericParamExtendsParameter(extlib.ContainerKotlin) | ContainerKotlin> | void | +| extlib.jar/extlib/RawTypesInSignatureKotlin.class:0:0:0:0 | RawTypesInSignatureKotlin | genericParamExtendsReturn | genericParamExtendsReturn() | No parameter | ContainerKotlin> | +| extlib.jar/extlib/RawTypesInSignatureKotlin.class:0:0:0:0 | RawTypesInSignatureKotlin | genericParamParameter | genericParamParameter(extlib.ContainerKotlin) | ContainerKotlin> | void | +| extlib.jar/extlib/RawTypesInSignatureKotlin.class:0:0:0:0 | RawTypesInSignatureKotlin | genericParamReturn | genericParamReturn() | No parameter | ContainerKotlin> | +| extlib.jar/extlib/RawTypesInSignatureKotlin.class:0:0:0:0 | RawTypesInSignatureKotlin | genericParamSuperParameter | genericParamSuperParameter(extlib.ContainerKotlin) | ContainerKotlin> | void | +| extlib.jar/extlib/RawTypesInSignatureKotlin.class:0:0:0:0 | RawTypesInSignatureKotlin | genericParamSuperReturn | genericParamSuperReturn() | No parameter | ContainerKotlin> | diff --git a/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/test.py b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/test.py new file mode 100644 index 00000000000..520c75a556f --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/test.py @@ -0,0 +1,10 @@ +from create_database_utils import * +import glob + +# Compile Java untraced. Note the Java source is hidden under `javasrc` so the Kotlin compiler +# will certainly reference the jar, not the source or class file for extlib.Lib + +os.mkdir('build') +runSuccessfully(["javac"] + glob.glob("libsrc/extlib/*.java") + ["-d", "build"]) +runSuccessfully(["jar", "cf", "extlib.jar", "-C", "build", "extlib"]) +run_codeql_database_create(["javac JavaUser.java -cp extlib.jar", "kotlinc KotlinUser.kt -cp extlib.jar"], lang="java") diff --git a/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/test.ql b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/test.ql new file mode 100644 index 00000000000..6416917a38b --- /dev/null +++ b/java/ql/integration-tests/posix-only/kotlin/raw_generic_types/test.ql @@ -0,0 +1,30 @@ +import java + +// Stop external filepaths from appearing in the results +class ClassOrInterfaceLocation extends ClassOrInterface { + override predicate hasLocationInfo(string path, int sl, int sc, int el, int ec) { + exists(string fullPath | super.hasLocationInfo(fullPath, sl, sc, el, ec) | + if exists(this.getFile().getRelativePath()) + then path = fullPath + else path = fullPath.regexpReplaceAll(".*/", "/") + ) + } +} + +query predicate rawTypeSupertypes(RawType rt, RefType superType) { + rt.getFile().getURL().matches("%extlib%") and + rt.getASupertype() = superType +} + +query predicate rawTypeMethod(RefType rt, string name, string sig, string paramType, string retType) { + exists(Method m | m.getDeclaringType() = rt and rt.getName().matches("RawTypesInSignature%") | + name = m.getName() and + sig = m.getSignature() and + ( + if exists(m.getAParamType()) + then paramType = m.getAParamType().toString() + else paramType = "No parameter" + ) and + retType = m.getReturnType().toString() + ) +} diff --git a/java/ql/lib/CHANGELOG.md b/java/ql/lib/CHANGELOG.md index 02f489ea9c5..41b23a74d1f 100644 --- a/java/ql/lib/CHANGELOG.md +++ b/java/ql/lib/CHANGELOG.md @@ -1,3 +1,13 @@ +## 0.3.0 + +### Deprecated APIs + +* The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module. + +### Minor Analysis Improvements + +Added a flow step for `String.valueOf` calls on tainted `android.text.Editable` objects. + ## 0.2.3 ## 0.2.2 diff --git a/java/ql/src/IDEContextual.qll b/java/ql/lib/IDEContextual.qll similarity index 100% rename from java/ql/src/IDEContextual.qll rename to java/ql/lib/IDEContextual.qll diff --git a/java/ql/lib/change-notes/2022-05-18-android-external-storage.md b/java/ql/lib/change-notes/2022-05-18-android-external-storage.md new file mode 100644 index 00000000000..b3d5fa793b3 --- /dev/null +++ b/java/ql/lib/change-notes/2022-05-18-android-external-storage.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +Added additional flow sources for uses of external storage on Android. \ No newline at end of file diff --git a/java/ql/lib/change-notes/2022-05-25-string-valueof-editable-step.md b/java/ql/lib/change-notes/2022-05-25-string-valueof-editable-step.md deleted file mode 100644 index 60b8a5a8a9d..00000000000 --- a/java/ql/lib/change-notes/2022-05-25-string-valueof-editable-step.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -category: minorAnalysis ---- -Added a flow step for `String.valueOf` calls on tainted `android.text.Editable` objects. diff --git a/java/ql/lib/change-notes/2022-06-13-kotlin-break-loops.md b/java/ql/lib/change-notes/2022-06-13-kotlin-break-loops.md new file mode 100644 index 00000000000..412cf7d5ff5 --- /dev/null +++ b/java/ql/lib/change-notes/2022-06-13-kotlin-break-loops.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Removed Kotlin-specific database and QL structures for loops and `break`/`continue` statements. The Kotlin extractor was changed to reuse the Java structures for these constructs. diff --git a/java/ql/lib/change-notes/2022-06-27-isInline.md b/java/ql/lib/change-notes/2022-06-27-isInline.md new file mode 100644 index 00000000000..ad73ed8bf82 --- /dev/null +++ b/java/ql/lib/change-notes/2022-06-27-isInline.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +Added `Modifier.isInline()`. diff --git a/java/ql/lib/change-notes/released/0.3.0.md b/java/ql/lib/change-notes/released/0.3.0.md new file mode 100644 index 00000000000..0c908384d1e --- /dev/null +++ b/java/ql/lib/change-notes/released/0.3.0.md @@ -0,0 +1,9 @@ +## 0.3.0 + +### Deprecated APIs + +* The `BarrierGuard` class has been deprecated. Such barriers and sanitizers can now instead be created using the new `BarrierGuard` parameterized module. + +### Minor Analysis Improvements + +Added a flow step for `String.valueOf` calls on tainted `android.text.Editable` objects. diff --git a/java/ql/lib/codeql-pack.release.yml b/java/ql/lib/codeql-pack.release.yml index 0b605901b42..95f6e3a0ba6 100644 --- a/java/ql/lib/codeql-pack.release.yml +++ b/java/ql/lib/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.2.3 +lastReleaseVersion: 0.3.0 diff --git a/java/ql/lib/config/semmlecode.dbscheme b/java/ql/lib/config/semmlecode.dbscheme index b9225587bc0..cf58c7d9b1f 100755 --- a/java/ql/lib/config/semmlecode.dbscheme +++ b/java/ql/lib/config/semmlecode.dbscheme @@ -1165,17 +1165,6 @@ ktCommentOwners( int owner: @top ref ) -@breakcontinuestmt = @breakstmt - | @continuestmt; - -@ktloopstmt = @whilestmt - | @dostmt; - -ktBreakContinueTargets( - unique int id: @breakcontinuestmt ref, - int target: @ktloopstmt ref -) - ktExtensionFunctions( unique int id: @method ref, int typeid: @type ref, @@ -1222,10 +1211,15 @@ ktPropertyDelegates( unique int variableId: @variable ref ) +/** + * If `id` is a compiler generated element, then the kind indicates the + * reason that the compiler generated it. + * See `Element.compilerGeneratedReason()` for an explanation of what + * each `kind` means. + */ compiler_generated( unique int id: @element ref, int kind: int ref - // 1: Declaring classes of adapter functions in Kotlin ) ktFunctionOriginalNames( diff --git a/java/ql/lib/config/semmlecode.dbscheme.stats b/java/ql/lib/config/semmlecode.dbscheme.stats index f21fb24e899..2fc1431a73f 100644 --- a/java/ql/lib/config/semmlecode.dbscheme.stats +++ b/java/ql/lib/config/semmlecode.dbscheme.stats @@ -1,20 +1,20 @@ + + @diagnostic + 634718 + + + @externalDataElement + 1 + @javacompilation 8629 @kotlincompilation - 6817 - - - @diagnostic - 628563 - - - @externalDataElement - 1 + 6824 @duplication @@ -26,39 +26,39 @@ @file - 8013164 + 8020653 @folder - 1283033 + 1280356 @package - 612201 + 612878 @primitive - 12271 + 12284 @modifier - 12271 + 12284 @class - 12008156 + 12579704 @kt_nullable_type - 1363 + 1364 @kt_notnull_type - 191200 + 193427 @kt_type_alias - 2060 + 2061 @interface @@ -66,47 +66,47 @@ @fielddecl - 399499 + 399940 @field - 27544995 + 27583622 @constructor - 5063959 + 6889080 @method - 59177700 + 93482380 @location_default - 430737907 + 431212495 + + + @param + 101137218 @exception 1228291 - - @param - 62111906 - @typevariable - 5113044 + 5118694 @wildcard - 2416084 + 3116261 @typebound - 3171451 + 3872463 @array - 1109871 + 1119287 @import @@ -114,7 +114,7 @@ @block - 845356 + 846290 @ifstmt @@ -130,7 +130,7 @@ @whilestmt - 13268 + 19743 @dostmt @@ -146,11 +146,11 @@ @synchronizedstmt - 17293 + 18562 @returnstmt - 674742 + 675212 @throwstmt @@ -182,7 +182,7 @@ @localtypedeclstmt - 4062 + 4069 @constructorinvocationstmt @@ -190,7 +190,7 @@ @superconstructorinvocationstmt - 223702 + 225902 @case @@ -202,11 +202,11 @@ @labeledstmt - 2380 + 2443 @yieldstmt - 1 + 36 @errorstmt @@ -214,11 +214,11 @@ @whenbranch - 237749 + 238370 @arrayaccess - 181399 + 409746 @arraycreationexpr @@ -262,7 +262,7 @@ @integerliteral - 799586 + 1151641 @longliteral @@ -270,7 +270,7 @@ @floatingpointliteral - 17688 + 2825445 @doubleliteral @@ -334,7 +334,7 @@ @andlogicalexpr - 40867 + 41441 @orlogicalexpr @@ -382,7 +382,7 @@ @minusexpr - 148828 + 744505 @plusexpr @@ -410,7 +410,7 @@ @instanceofexpr - 29546 + 31274 @localvariabledeclexpr @@ -418,11 +418,11 @@ @typeliteral - 137113 + 147176 @thisaccess - 951850 + 952512 @superaccess @@ -434,11 +434,11 @@ @methodaccess - 1676281 + 1551591 @unannotatedtypeaccess - 2936239 + 2874591 @arraytypeaccess @@ -446,7 +446,7 @@ @wildcardtypeaccess - 63661 + 63664 @declannotation @@ -486,11 +486,11 @@ @lambdaexpr - 183561 + 185816 @memberref - 22864 + 23860 @annotatedtypeaccess @@ -506,7 +506,7 @@ @switchexpr - 1 + 591 @errorexpr @@ -514,43 +514,43 @@ @whenexpr - 172033 + 172153 @getclassexpr - 1363 + 1364 @safecastexpr - 6474 + 6986 @implicitcastexpr - 30743 + 33111 @implicitnotnullexpr - 242928 + 241008 @implicitcoerciontounitexpr - 90274 + 93086 @notinstanceofexpr - 19572 + 19586 @stmtexpr - 54780 + 58107 @stringtemplateexpr - 55902 + 55964 @notnullexpr - 12914 + 21375 @unsafecoerceexpr @@ -558,15 +558,15 @@ @valueeqexpr - 103237 + 103390 @valueneexpr - 108164 + 108240 @propertyref - 9004 + 9721 @localvar @@ -608,29 +608,29 @@ @xmldtd 569 + + @xmlelement + 106792352 + @javadocText 2503256 - - @xmlelement - 106674479 - @xmlattribute - 129755446 + 129898822 @xmlnamespace - 8180 + 8189 @xmlcomment - 107367127 + 107485764 @xmlcharacters - 101461901 + 101574013 @config @@ -646,15 +646,15 @@ @ktcomment - 133620 + 133768 @ktcommentsection - 59545 + 59246 @kt_property - 26996877 + 30317687 @@ -876,30 +876,30 @@ compilation_started - 6817 + 6824 id - 6817 + 6824 compilation_args - 158163 + 158338 id - 6817 + 6824 num - 38177 + 38219 arg - 89989 + 90089 @@ -913,22 +913,22 @@ 20 21 - 2726 + 2729 23 24 - 1363 + 1364 25 26 - 1363 + 1364 28 29 - 1363 + 1364 @@ -944,22 +944,22 @@ 20 21 - 2726 + 2729 23 24 - 1363 + 1364 25 26 - 1363 + 1364 27 28 - 1363 + 1364 @@ -975,22 +975,22 @@ 1 2 - 4090 + 4094 2 3 - 2726 + 2729 3 4 - 4090 + 4094 5 6 - 27269 + 27299 @@ -1006,27 +1006,27 @@ 1 2 - 8180 + 8189 2 3 - 5453 + 5459 3 4 - 10907 + 10919 4 5 - 6817 + 6824 5 6 - 6817 + 6824 @@ -1042,22 +1042,22 @@ 1 2 - 69537 + 69614 2 3 - 2726 + 2729 4 5 - 6817 + 6824 5 6 - 10907 + 10919 @@ -1073,17 +1073,17 @@ 1 2 - 72264 + 72344 2 3 - 14998 + 15014 4 5 - 2726 + 2729 @@ -1093,19 +1093,19 @@ compilation_compiling_files - 56513 + 60660 id - 2161 + 2320 num - 16676 + 17899 file - 47248 + 50716 @@ -1119,22 +1119,22 @@ 1 2 - 308 + 331 2 3 - 617 + 662 35 36 - 617 + 662 54 55 - 617 + 662 @@ -1150,22 +1150,22 @@ 1 2 - 308 + 331 2 3 - 617 + 662 35 36 - 617 + 662 54 55 - 617 + 662 @@ -1181,17 +1181,17 @@ 2 3 - 5867 + 6298 4 5 - 10190 + 10938 6 8 - 617 + 662 @@ -1207,17 +1207,17 @@ 2 3 - 5867 + 6298 3 4 - 9264 + 9944 4 8 - 1544 + 1657 @@ -1233,12 +1233,12 @@ 1 2 - 37984 + 40771 2 3 - 9264 + 9944 @@ -1254,7 +1254,7 @@ 1 2 - 47248 + 50716 @@ -1264,19 +1264,19 @@ compilation_compiling_files_completed - 56513 + 60660 id - 2161 + 2320 num - 16676 + 17899 result - 308 + 331 @@ -1290,22 +1290,22 @@ 1 2 - 308 + 331 2 3 - 617 + 662 35 36 - 617 + 662 54 55 - 617 + 662 @@ -1321,7 +1321,7 @@ 1 2 - 2161 + 2320 @@ -1337,17 +1337,17 @@ 2 3 - 5867 + 6298 4 5 - 10190 + 10938 6 8 - 617 + 662 @@ -1363,7 +1363,7 @@ 1 2 - 16676 + 17899 @@ -1379,7 +1379,7 @@ 7 8 - 308 + 331 @@ -1395,7 +1395,7 @@ 54 55 - 308 + 331 @@ -1826,23 +1826,23 @@ diagnostic_for - 628563 + 634718 diagnostic - 628563 + 634718 compilation - 6817 + 6824 file_number - 8180 + 8189 file_number_diagnostic_number - 59993 + 60059 @@ -1856,7 +1856,7 @@ 1 2 - 628563 + 634718 @@ -1872,7 +1872,7 @@ 1 2 - 628563 + 634718 @@ -1888,7 +1888,7 @@ 1 2 - 628563 + 634718 @@ -1904,22 +1904,22 @@ 73 74 - 1363 + 1364 - 85 - 86 - 1363 + 86 + 87 + 1364 100 101 - 2726 + 2729 - 103 - 104 - 1363 + 106 + 107 + 1364 @@ -1935,22 +1935,22 @@ 3 4 - 2726 + 2729 4 5 - 1363 + 1364 5 6 - 1363 + 1364 6 7 - 1363 + 1364 @@ -1966,27 +1966,27 @@ 29 30 - 1363 + 1364 36 37 - 1363 + 1364 40 41 - 1363 + 1364 - 41 - 42 - 1363 + 43 + 44 + 1364 44 45 - 1363 + 1364 @@ -2002,32 +2002,32 @@ 5 6 - 1363 + 1364 - 29 - 30 - 1363 + 32 + 33 + 1364 - 46 - 47 - 1363 + 49 + 50 + 1364 - 108 - 109 - 1363 + 106 + 107 + 1364 130 131 - 1363 + 1364 143 144 - 1363 + 1364 @@ -2043,22 +2043,22 @@ 1 2 - 1363 + 1364 2 3 - 1363 + 1364 3 4 - 1363 + 1364 5 6 - 4090 + 4094 @@ -2074,32 +2074,32 @@ 5 6 - 1363 + 1364 15 16 - 1363 + 1364 36 37 - 1363 - - - 40 - 41 - 1363 + 1364 41 42 - 1363 + 1364 + + + 43 + 44 + 1364 44 45 - 1363 + 1364 @@ -2114,63 +2114,63 @@ 1 - 3 - 5453 + 4 + 5459 4 5 - 5453 + 5459 - 6 + 5 7 - 4090 + 2729 7 8 - 5453 + 6824 8 9 - 4090 + 4094 9 10 - 4090 + 6824 10 - 11 - 4090 + 12 + 4094 - 11 - 13 - 5453 + 12 + 14 + 4094 - 13 + 15 16 - 4090 + 2729 16 17 - 9544 + 9554 17 - 19 - 4090 + 20 + 4094 - 19 + 20 22 - 4090 + 4094 @@ -2186,22 +2186,22 @@ 1 3 - 5453 + 5459 3 4 - 5453 + 5459 4 5 - 9544 + 9554 5 6 - 39540 + 39584 @@ -2217,27 +2217,27 @@ 1 3 - 5453 + 4094 3 4 - 5453 + 6824 4 5 - 28633 + 28664 5 6 - 13634 + 13649 6 7 - 6817 + 6824 @@ -2247,19 +2247,19 @@ compilation_compiler_times - 6817 + 6824 id - 6817 + 6824 cpu_seconds - 1363 + 1364 elapsed_seconds - 6817 + 6824 @@ -2273,7 +2273,7 @@ 1 2 - 6817 + 6824 @@ -2289,7 +2289,7 @@ 1 2 - 6817 + 6824 @@ -2305,7 +2305,7 @@ 5 6 - 1363 + 1364 @@ -2321,7 +2321,7 @@ 5 6 - 1363 + 1364 @@ -2337,7 +2337,7 @@ 1 2 - 6817 + 6824 @@ -2353,7 +2353,7 @@ 1 2 - 6817 + 6824 @@ -2579,35 +2579,35 @@ diagnostics - 628563 + 634718 id - 628563 + 634718 generated_by - 1363 + 1364 severity - 1363 + 1364 error_tag - 1363 + 1364 error_message - 92716 + 96913 full_error_message - 496306 + 499584 location - 1363 + 1364 @@ -2621,7 +2621,7 @@ 1 2 - 628563 + 634718 @@ -2637,7 +2637,7 @@ 1 2 - 628563 + 634718 @@ -2653,7 +2653,7 @@ 1 2 - 628563 + 634718 @@ -2669,7 +2669,7 @@ 1 2 - 628563 + 634718 @@ -2685,7 +2685,7 @@ 1 2 - 628563 + 634718 @@ -2701,7 +2701,7 @@ 1 2 - 628563 + 634718 @@ -2715,9 +2715,9 @@ 12 - 461 - 462 - 1363 + 465 + 466 + 1364 @@ -2733,7 +2733,7 @@ 1 2 - 1363 + 1364 @@ -2749,7 +2749,7 @@ 1 2 - 1363 + 1364 @@ -2763,9 +2763,9 @@ 12 - 68 - 69 - 1363 + 71 + 72 + 1364 @@ -2779,9 +2779,9 @@ 12 - 364 - 365 - 1363 + 366 + 367 + 1364 @@ -2797,7 +2797,7 @@ 1 2 - 1363 + 1364 @@ -2811,9 +2811,9 @@ 12 - 461 - 462 - 1363 + 465 + 466 + 1364 @@ -2829,7 +2829,7 @@ 1 2 - 1363 + 1364 @@ -2845,7 +2845,7 @@ 1 2 - 1363 + 1364 @@ -2859,9 +2859,9 @@ 12 - 68 - 69 - 1363 + 71 + 72 + 1364 @@ -2875,9 +2875,9 @@ 12 - 364 - 365 - 1363 + 366 + 367 + 1364 @@ -2893,7 +2893,7 @@ 1 2 - 1363 + 1364 @@ -2907,9 +2907,9 @@ 12 - 461 - 462 - 1363 + 465 + 466 + 1364 @@ -2925,7 +2925,7 @@ 1 2 - 1363 + 1364 @@ -2941,7 +2941,7 @@ 1 2 - 1363 + 1364 @@ -2955,9 +2955,9 @@ 12 - 68 - 69 - 1363 + 71 + 72 + 1364 @@ -2971,9 +2971,9 @@ 12 - 364 - 365 - 1363 + 366 + 367 + 1364 @@ -2989,7 +2989,7 @@ 1 2 - 1363 + 1364 @@ -3005,181 +3005,176 @@ 1 2 - 14998 + 19109 2 3 - 6817 + 6824 3 4 - 12271 + 13649 4 5 - 4090 + 4094 5 6 - 6817 + 5459 6 7 - 5453 + 6824 7 8 - 4090 + 2729 8 9 - 9544 + 9554 9 10 - 6817 - - - 10 - 14 - 8180 - - - 14 - 16 - 4090 - - - 16 - 20 - 8180 - - - 20 - 21 - 1363 - - - - - - - error_message - generated_by - - - 12 - - - 1 - 2 - 92716 - - - - - - - error_message - severity - - - 12 - - - 1 - 2 - 92716 - - - - - - - error_message - error_tag - - - 12 - - - 1 - 2 - 92716 - - - - - - - error_message - full_error_message - - - 12 - - - 1 - 2 - 19088 - - - 2 - 3 - 5453 - - - 3 - 4 - 12271 - - - 4 - 5 - 5453 - - - 5 - 6 - 4090 - - - 6 - 7 - 5453 - - - 7 - 8 - 9544 - - - 8 - 9 - 14998 - - - 9 - 10 - 2726 + 5459 10 11 - 8180 + 6824 + + + 13 + 15 + 5459 + + + 16 + 19 + 8189 + + + 20 + 21 + 2729 + + + + + + + error_message + generated_by + + + 12 + + + 1 + 2 + 96913 + + + + + + + error_message + severity + + + 12 + + + 1 + 2 + 96913 + + + + + + + error_message + error_tag + + + 12 + + + 1 + 2 + 96913 + + + + + + + error_message + full_error_message + + + 12 + + + 1 + 2 + 23204 + + + 2 + 3 + 5459 + + + 3 + 4 + 13649 + + + 4 + 6 + 8189 + + + 6 + 7 + 6824 + + + 7 + 8 + 6824 + + + 8 + 9 + 16379 + + + 9 + 10 + 2729 + + + 10 + 11 + 6824 11 - 13 - 5453 + 12 + 6824 @@ -3195,7 +3190,7 @@ 1 2 - 92716 + 96913 @@ -3211,17 +3206,17 @@ 1 2 - 409043 + 409495 2 3 - 46358 + 49139 3 5 - 40904 + 40949 @@ -3237,7 +3232,7 @@ 1 2 - 496306 + 499584 @@ -3253,7 +3248,7 @@ 1 2 - 496306 + 499584 @@ -3269,7 +3264,7 @@ 1 2 - 496306 + 499584 @@ -3285,7 +3280,7 @@ 1 2 - 496306 + 499584 @@ -3301,7 +3296,7 @@ 1 2 - 496306 + 499584 @@ -3315,9 +3310,9 @@ 12 - 461 - 462 - 1363 + 465 + 466 + 1364 @@ -3333,7 +3328,7 @@ 1 2 - 1363 + 1364 @@ -3349,7 +3344,7 @@ 1 2 - 1363 + 1364 @@ -3365,7 +3360,7 @@ 1 2 - 1363 + 1364 @@ -3379,9 +3374,9 @@ 12 - 68 - 69 - 1363 + 71 + 72 + 1364 @@ -3395,9 +3390,9 @@ 12 - 364 - 365 - 1363 + 366 + 367 + 1364 @@ -3562,11 +3557,11 @@ sourceLocationPrefix - 1363 + 1364 prefix - 1363 + 1364 @@ -4853,31 +4848,31 @@ locations_default - 430737907 + 431212495 id - 430737907 + 431212495 file - 8013164 + 8020653 beginLine - 2799221 + 2802314 beginColumn - 175888 + 176083 endLine - 2800585 + 2803679 endColumn - 620382 + 621068 @@ -4891,7 +4886,7 @@ 1 2 - 430737907 + 431212495 @@ -4907,7 +4902,7 @@ 1 2 - 430737907 + 431212495 @@ -4923,7 +4918,7 @@ 1 2 - 430737907 + 431212495 @@ -4939,7 +4934,7 @@ 1 2 - 430737907 + 431212495 @@ -4955,7 +4950,7 @@ 1 2 - 430737907 + 431212495 @@ -4971,17 +4966,17 @@ 1 2 - 7173261 + 7179822 2 20 - 604021 + 604688 20 3605 - 235881 + 236142 @@ -4997,17 +4992,17 @@ 1 2 - 7173261 + 7179822 2 15 - 601294 + 601958 15 1830 - 238608 + 238872 @@ -5023,17 +5018,17 @@ 1 2 - 7173261 + 7179822 2 7 - 628563 + 629258 7 105 - 211339 + 211572 @@ -5049,17 +5044,17 @@ 1 2 - 7173261 + 7179822 2 18 - 601294 + 601958 18 1834 - 238608 + 238872 @@ -5075,17 +5070,17 @@ 1 2 - 7173261 + 7179822 2 15 - 604021 + 604688 15 205 - 235881 + 236142 @@ -5101,67 +5096,67 @@ 1 14 - 222247 + 222492 14 125 - 215429 + 215667 125 142 - 215429 + 215667 142 152 - 223610 + 223857 152 159 - 249516 + 249792 159 165 - 257697 + 257982 165 170 - 226337 + 226587 170 174 - 216793 + 217032 174 179 - 229064 + 229317 179 185 - 214066 + 214302 185 194 - 222247 + 222492 194 215 - 215429 + 215667 215 - 5878 - 91353 + 5877 + 91454 @@ -5177,67 +5172,67 @@ 1 7 - 229064 + 229317 7 65 - 212702 + 212937 65 73 - 216793 + 217032 73 78 - 207248 + 207477 78 81 - 190887 + 191097 81 84 - 249516 + 249792 84 86 - 215429 + 215667 86 88 - 257697 + 257982 88 90 - 222247 + 222492 90 93 - 248153 + 248427 93 97 - 218156 + 218397 97 106 - 214066 + 214302 106 - 5878 - 117259 + 5877 + 117388 @@ -5253,62 +5248,62 @@ 1 5 - 222247 + 222492 5 17 - 196340 + 196557 17 19 - 167707 + 167893 19 20 - 214066 + 214302 20 21 - 268605 + 268902 21 22 - 283603 + 283916 22 23 - 329961 + 330326 23 24 - 304055 + 304391 24 25 - 235881 + 236142 25 26 - 170434 + 170623 26 28 - 212702 + 212937 28 45 - 193613 + 193827 @@ -5324,32 +5319,32 @@ 1 2 - 903986 + 904985 2 3 - 895805 + 896795 3 4 - 482671 + 483204 4 5 - 211339 + 211572 5 11 - 220883 + 221127 11 97 - 84535 + 84629 @@ -5365,72 +5360,72 @@ 1 13 - 219520 + 219762 13 60 - 209975 + 210207 60 64 - 223610 + 223857 64 66 - 209975 + 210207 66 68 - 259060 + 259347 68 69 - 130893 + 131038 69 70 - 155436 + 155608 70 71 - 134984 + 135133 71 73 - 235881 + 236142 73 75 - 212702 + 212937 75 78 - 234518 + 234777 78 82 - 252243 + 252522 82 89 - 214066 + 214302 89 104 - 106351 + 106468 @@ -5446,67 +5441,67 @@ 1 11 - 14998 + 15014 15 34 - 14998 + 15014 36 58 - 13634 + 13649 63 88 - 13634 + 13649 89 132 - 13634 + 13649 141 196 - 14998 + 15014 210 285 - 13634 + 13649 316 468 - 13634 + 13649 496 853 - 13634 + 13649 899 1420 - 13634 + 13649 1472 2256 - 13634 + 13649 2300 2526 - 13634 + 13649 2589 226687 - 8180 + 8189 @@ -5522,72 +5517,72 @@ 1 9 - 9544 + 9554 9 11 - 13634 + 13649 12 16 - 8180 + 8189 16 19 - 13634 + 13649 19 31 - 13634 + 13649 35 73 - 13634 + 13649 73 83 - 13634 + 13649 85 104 - 14998 + 15014 104 110 - 10907 + 10919 110 114 - 14998 + 15014 115 119 - 13634 + 13649 119 121 - 12271 + 12284 121 126 - 13634 + 13649 126 - 5878 - 9544 + 5877 + 9554 @@ -5603,67 +5598,67 @@ 1 10 - 14998 + 15014 10 29 - 13634 + 13649 29 43 - 13634 + 13649 45 58 - 13634 + 13649 58 85 - 13634 + 13649 86 106 - 13634 + 13649 108 167 - 13634 + 13649 171 227 - 13634 + 13649 231 379 - 13634 + 13649 383 650 - 13634 + 13649 651 891 - 13634 + 13649 940 1086 - 13634 + 13649 1093 2051 - 10907 + 10919 @@ -5679,67 +5674,67 @@ 1 10 - 14998 + 15014 10 30 - 13634 + 13649 30 43 - 13634 + 13649 46 59 - 13634 + 13649 60 87 - 13634 + 13649 87 109 - 13634 + 13649 115 173 - 13634 + 13649 174 226 - 13634 + 13649 230 380 - 13634 + 13649 383 650 - 13634 + 13649 653 892 - 13634 + 13649 940 1084 - 13634 + 13649 1092 2051 - 10907 + 10919 @@ -5755,72 +5750,72 @@ 1 8 - 14998 + 15014 8 17 - 13634 + 13649 18 25 - 10907 + 10919 25 30 - 13634 + 13649 30 36 - 13634 + 13649 36 44 - 13634 + 13649 45 56 - 12271 + 12284 57 64 - 13634 + 13649 64 73 - 13634 + 13649 73 86 - 13634 + 13649 86 106 - 13634 + 13649 107 129 - 13634 + 13649 129 197 - 13634 + 13649 392 393 - 1363 + 1364 @@ -5836,67 +5831,67 @@ 1 14 - 220883 + 221127 14 124 - 215429 + 215667 124 143 - 218156 + 218397 143 152 - 235881 + 236142 152 159 - 223610 + 223857 159 165 - 257697 + 257982 165 170 - 239972 + 240237 170 174 - 222247 + 222492 174 179 - 222247 + 222492 179 185 - 211339 + 211572 185 194 - 216793 + 217032 194 217 - 212702 + 212937 217 - 5878 - 103624 + 5877 + 103738 @@ -5912,67 +5907,67 @@ 1 7 - 231791 + 232047 7 66 - 224973 + 225222 66 74 - 227700 + 227952 74 80 - 250880 + 251157 80 83 - 241335 + 241602 83 85 - 185433 + 185637 85 87 - 246789 + 247062 87 89 - 246789 + 247062 89 91 - 188160 + 188367 91 94 - 248153 + 248427 94 99 - 226337 + 226587 99 127 - 212702 + 212937 127 - 5878 - 69537 + 5877 + 69614 @@ -5988,32 +5983,32 @@ 1 2 - 710372 + 711157 2 3 - 988522 + 989614 3 4 - 643561 + 644273 4 6 - 237245 + 237507 6 18 - 212702 + 212937 18 22 - 8180 + 8189 @@ -6029,62 +6024,62 @@ 1 5 - 219520 + 219762 5 17 - 199067 + 199287 17 19 - 163617 + 163798 19 20 - 192250 + 192462 20 21 - 280876 + 281186 21 22 - 272695 + 272997 22 23 - 329961 + 330326 23 24 - 306782 + 307121 24 25 - 224973 + 225222 25 26 - 184069 + 184273 26 28 - 223610 + 223857 28 44 - 203158 + 203382 @@ -6100,72 +6095,72 @@ 1 13 - 222247 + 222492 13 61 - 250880 + 251157 61 64 - 173161 + 173353 64 66 - 218156 + 218397 66 68 - 250880 + 251157 68 69 - 137711 + 137863 69 70 - 137711 + 137863 70 71 - 158163 + 158338 71 73 - 231791 + 232047 73 75 - 192250 + 192462 75 77 - 184069 + 184273 77 80 - 211339 + 211572 80 85 - 227700 + 227952 85 119 - 204521 + 204747 @@ -6181,57 +6176,57 @@ 1 2 - 145892 + 146053 2 3 - 64083 + 64154 3 5 - 50448 + 50504 5 13 - 50448 + 50504 13 53 - 47721 + 47774 53 146 - 47721 + 47774 146 351 - 47721 + 47774 357 997 - 47721 + 47774 1053 2396 - 47721 + 47774 2407 4957 - 47721 + 47774 5022 5934 - 23179 + 23204 @@ -6247,57 +6242,57 @@ 1 2 - 151346 + 151513 2 3 - 61356 + 61424 3 5 - 53175 + 53234 5 13 - 50448 + 50504 13 42 - 47721 + 47774 42 77 - 47721 + 47774 77 103 - 51812 + 51869 103 116 - 47721 + 47774 116 144 - 49085 + 49139 144 181 - 47721 + 47774 181 - 5878 - 12271 + 5877 + 12284 @@ -6313,57 +6308,57 @@ 1 2 - 154073 + 154243 2 3 - 62720 + 62789 3 5 - 49085 + 49139 5 13 - 49085 + 49139 13 52 - 49085 + 49139 52 115 - 47721 + 47774 123 271 - 47721 + 47774 277 658 - 47721 + 47774 669 1200 - 47721 + 47774 1219 1635 - 47721 + 47774 1639 1722 - 17725 + 17744 @@ -6379,47 +6374,47 @@ 1 2 - 194977 + 195192 2 3 - 74991 + 75074 3 6 - 54539 + 54599 6 14 - 54539 + 54599 14 26 - 47721 + 47774 26 36 - 49085 + 49139 36 47 - 49085 + 49139 47 55 - 47721 + 47774 55 68 - 47721 + 47774 @@ -6435,57 +6430,57 @@ 1 2 - 154073 + 154243 2 3 - 61356 + 61424 3 5 - 49085 + 49139 5 13 - 49085 + 49139 13 53 - 50448 + 50504 53 115 - 47721 + 47774 123 271 - 47721 + 47774 280 656 - 47721 + 47774 669 1200 - 47721 + 47774 1217 1638 - 47721 + 47774 1640 1722 - 17725 + 17744 @@ -6495,15 +6490,15 @@ hasLocation - 233017139 + 316110113 locatableid - 232872610 + 315965424 id - 11547300 + 11558695 @@ -6517,12 +6512,12 @@ 1 2 - 232728082 + 315820736 2 3 - 144528 + 144688 @@ -6538,62 +6533,62 @@ 1 2 - 2095666 + 2097982 2 3 - 1008974 + 1008724 3 4 - 718553 + 719347 4 6 - 978977 + 977329 6 7 - 773092 + 773946 7 9 - 1047151 + 1019643 9 12 - 858991 + 850385 12 16 - 942163 + 925460 16 23 - 932619 + 883145 23 - 38 - 867172 + 39 + 888605 - 38 - 90 - 869899 + 39 + 89 + 874955 - 90 - 3226 - 454038 + 89 + 9987 + 539169 @@ -6603,23 +6598,23 @@ numlines - 214843332 + 215080728 element_id - 214843332 + 215080728 num_lines - 432222 + 432700 num_code - 433586 + 434065 num_comment - 1344389 + 1345875 @@ -6633,7 +6628,7 @@ 1 2 - 214843332 + 215080728 @@ -6649,7 +6644,7 @@ 1 2 - 214843332 + 215080728 @@ -6665,7 +6660,7 @@ 1 2 - 214843332 + 215080728 @@ -6681,37 +6676,37 @@ 1 2 - 231791 + 232047 2 3 - 53175 + 53234 3 4 - 44994 + 45044 4 7 - 34086 + 34124 7 14 - 32723 + 32759 15 839 - 32723 + 32759 3519 149603 - 2726 + 2729 @@ -6727,12 +6722,12 @@ 1 2 - 422678 + 423145 2 3 - 9544 + 9554 @@ -6748,27 +6743,27 @@ 1 2 - 274059 + 274362 2 3 - 69537 + 69614 3 4 - 36813 + 36854 4 6 - 34086 + 34124 6 987 - 17725 + 17744 @@ -6784,37 +6779,37 @@ 1 2 - 231791 + 232047 2 3 - 53175 + 53234 3 4 - 44994 + 45044 4 7 - 34086 + 34124 7 14 - 32723 + 32759 15 468 - 32723 + 32759 495 78746 - 4090 + 4094 @@ -6830,12 +6825,12 @@ 1 2 - 432222 + 432700 7 8 - 1363 + 1364 @@ -6851,27 +6846,27 @@ 1 2 - 274059 + 274362 2 3 - 69537 + 69614 3 4 - 36813 + 36854 4 6 - 34086 + 34124 6 987 - 19088 + 19109 @@ -6887,77 +6882,77 @@ 1 7 - 109078 + 109198 7 49 - 100897 + 101008 49 71 - 104987 + 105103 71 78 - 107714 + 107833 78 83 - 103624 + 103738 83 87 - 115895 + 116023 87 89 - 99533 + 99643 89 91 - 95443 + 95548 91 92 - 57266 + 57329 92 93 - 68173 + 68249 93 94 - 74991 + 75074 94 95 - 69537 + 69614 95 97 - 109078 + 109198 97 119 - 100897 + 101008 119 75115 - 27269 + 27299 @@ -6973,22 +6968,22 @@ 1 2 - 1103054 + 1104273 2 3 - 114532 + 114658 3 6 - 102260 + 102373 6 120 - 24542 + 24569 @@ -7004,22 +6999,22 @@ 1 2 - 1103054 + 1104273 2 3 - 114532 + 114658 3 6 - 100897 + 101008 6 121 - 25906 + 25934 @@ -7029,15 +7024,15 @@ files - 8013164 + 8020653 id - 8013164 + 8020653 name - 8013164 + 8020653 @@ -7051,7 +7046,7 @@ 1 2 - 8013164 + 8020653 @@ -7067,7 +7062,7 @@ 1 2 - 8013164 + 8020653 @@ -7077,15 +7072,15 @@ folders - 1283033 + 1280356 id - 1283033 + 1280356 name - 1283033 + 1280356 @@ -7099,7 +7094,7 @@ 1 2 - 1283033 + 1280356 @@ -7115,7 +7110,7 @@ 1 2 - 1283033 + 1280356 @@ -7125,15 +7120,15 @@ containerparent - 9293470 + 9298279 parent - 1323937 + 1321305 child - 9293470 + 9298279 @@ -7147,37 +7142,37 @@ 1 2 - 714462 + 713887 2 3 - 139074 + 140593 3 4 - 81808 + 79169 4 7 - 115895 + 113293 7 14 - 110441 + 111928 14 29 - 102260 + 102373 29 194 - 59993 + 60059 @@ -7193,7 +7188,7 @@ 1 2 - 9293470 + 9298279 @@ -7203,15 +7198,15 @@ cupackage - 7152809 + 7160712 id - 7152809 + 7160712 packageid - 610838 + 611513 @@ -7225,7 +7220,7 @@ 1 2 - 7152809 + 7160712 @@ -7241,52 +7236,52 @@ 1 2 - 148619 + 148783 2 3 - 80445 + 80534 3 4 - 55902 + 55964 4 5 - 42267 + 42314 5 7 - 46358 + 46409 7 10 - 50448 + 50504 10 15 - 50448 + 50504 15 21 - 49085 + 49139 21 36 - 47721 + 47774 39 187 - 39540 + 39584 @@ -8048,15 +8043,15 @@ packages - 612201 + 612878 id - 612201 + 612878 nodeName - 612201 + 612878 @@ -8070,7 +8065,7 @@ 1 2 - 612201 + 612878 @@ -8086,7 +8081,7 @@ 1 2 - 612201 + 612878 @@ -8096,15 +8091,15 @@ primitives - 12271 + 12284 id - 12271 + 12284 nodeName - 12271 + 12284 @@ -8118,7 +8113,7 @@ 1 2 - 12271 + 12284 @@ -8134,7 +8129,7 @@ 1 2 - 12271 + 12284 @@ -8144,15 +8139,15 @@ modifiers - 12271 + 12284 id - 12271 + 12284 nodeName - 12271 + 12284 @@ -8166,7 +8161,7 @@ 1 2 - 12271 + 12284 @@ -8182,7 +8177,7 @@ 1 2 - 12271 + 12284 @@ -8192,23 +8187,23 @@ classes - 12008156 + 12579704 id - 12008156 + 12579704 nodeName - 6521518 + 6868605 parentid - 443130 + 443620 sourceid - 4514477 + 4519466 @@ -8222,7 +8217,7 @@ 1 2 - 12008156 + 12579704 @@ -8238,7 +8233,7 @@ 1 2 - 12008156 + 12579704 @@ -8254,7 +8249,7 @@ 1 2 - 12008156 + 12579704 @@ -8270,17 +8265,17 @@ 1 2 - 5441643 + 5735668 2 3 - 711735 + 746646 3 - 235 - 368139 + 236 + 386290 @@ -8296,17 +8291,17 @@ 1 2 - 5910679 + 6252997 2 3 - 542664 + 547359 3 52 - 68173 + 68249 @@ -8322,17 +8317,17 @@ 1 2 - 5888864 + 6229792 2 3 - 530393 + 536439 3 160 - 102260 + 102373 @@ -8348,57 +8343,57 @@ 1 2 - 107714 + 107833 2 3 - 54539 + 54599 3 4 - 32723 + 32759 4 5 - 31360 + 30029 5 7 - 32723 + 34124 7 - 10 - 28633 + 11 + 40949 - 10 - 14 - 34086 + 11 + 17 + 34124 - 14 - 20 - 35450 + 17 + 23 + 34124 - 20 - 33 - 34086 + 23 + 40 + 36854 - 33 - 60 - 34086 + 40 + 707 + 34124 - 62 - 1398 - 17725 + 1013 + 1412 + 4094 @@ -8414,52 +8409,52 @@ 1 2 - 107714 + 107833 2 3 - 54539 + 54599 3 4 - 35450 + 35489 4 5 - 34086 + 34124 5 7 - 38177 + 38219 7 - 10 - 31360 + 11 + 40949 - 10 - 15 - 35450 + 11 + 17 + 36854 - 15 - 20 - 36813 + 17 + 23 + 34124 - 20 - 36 - 35450 + 23 + 40 + 35489 - 37 - 826 - 34086 + 40 + 828 + 25934 @@ -8475,52 +8470,52 @@ 1 2 - 118622 + 118753 2 3 - 64083 + 64154 3 4 - 36813 + 36854 4 5 - 34086 + 34124 5 7 - 35450 + 35489 7 11 - 40904 + 40949 11 17 - 34086 + 34124 17 26 - 34086 + 34124 26 56 - 34086 + 34124 64 138 - 10907 + 10919 @@ -8536,17 +8531,17 @@ 1 2 - 4048168 + 4052641 2 11 - 346323 + 342611 11 - 1344 - 119986 + 1358 + 124213 @@ -8562,17 +8557,17 @@ 1 2 - 4048168 + 4052641 2 6 - 362685 + 360356 6 - 781 - 103624 + 783 + 106468 @@ -8588,7 +8583,7 @@ 1 2 - 4514477 + 4519466 @@ -8598,26 +8593,26 @@ file_class - 14998 + 15014 id - 14998 + 15014 class_object - 122713 + 122848 id - 122713 + 122848 instance - 122713 + 122848 @@ -8631,7 +8626,7 @@ 1 2 - 122713 + 122848 @@ -8647,7 +8642,7 @@ 1 2 - 122713 + 122848 @@ -8657,19 +8652,19 @@ type_companion_object - 218156 + 218397 id - 218156 + 218397 instance - 218156 + 218397 companion_object - 218156 + 218397 @@ -8683,7 +8678,7 @@ 1 2 - 218156 + 218397 @@ -8699,7 +8694,7 @@ 1 2 - 218156 + 218397 @@ -8715,7 +8710,7 @@ 1 2 - 218156 + 218397 @@ -8731,7 +8726,7 @@ 1 2 - 218156 + 218397 @@ -8747,7 +8742,7 @@ 1 2 - 218156 + 218397 @@ -8763,7 +8758,7 @@ 1 2 - 218156 + 218397 @@ -8773,15 +8768,15 @@ kt_nullable_types - 1363 + 1364 id - 1363 + 1364 classid - 1363 + 1364 @@ -8795,7 +8790,7 @@ 1 2 - 1363 + 1364 @@ -8811,7 +8806,7 @@ 1 2 - 1363 + 1364 @@ -8821,15 +8816,15 @@ kt_notnull_types - 191200 + 193427 id - 191200 + 193427 classid - 191200 + 193427 @@ -8843,7 +8838,7 @@ 1 2 - 191200 + 193427 @@ -8859,7 +8854,7 @@ 1 2 - 191200 + 193427 @@ -8869,15 +8864,15 @@ kt_type_alias - 2060 + 2061 id - 2060 + 2061 name - 2060 + 2061 kttypeid @@ -8895,7 +8890,7 @@ 1 2 - 2060 + 2061 @@ -8911,7 +8906,7 @@ 1 2 - 2060 + 2061 @@ -8927,7 +8922,7 @@ 1 2 - 2060 + 2061 @@ -8943,7 +8938,7 @@ 1 2 - 2060 + 2061 @@ -8985,11 +8980,11 @@ isRecord - 1 + 417 id - 1 + 417 @@ -9442,15 +9437,15 @@ fielddecls - 399499 + 399940 id - 399499 + 399940 parentid - 53175 + 60059 @@ -9464,7 +9459,7 @@ 1 2 - 399499 + 399940 @@ -9480,32 +9475,32 @@ 1 2 - 21815 + 30029 2 3 - 13634 + 13649 3 4 - 6817 + 5459 4 - 7 - 4090 + 5 + 2729 - 7 + 6 16 - 4090 + 5459 40 159 - 2726 + 2729 @@ -9515,19 +9510,19 @@ fieldDeclaredIn - 399499 + 399940 fieldId - 399499 + 399940 fieldDeclId - 399499 + 399940 pos - 1363 + 1364 @@ -9541,7 +9536,7 @@ 1 2 - 399499 + 399940 @@ -9557,7 +9552,7 @@ 1 2 - 399499 + 399940 @@ -9573,7 +9568,7 @@ 1 2 - 399499 + 399940 @@ -9589,7 +9584,7 @@ 1 2 - 399499 + 399940 @@ -9605,7 +9600,7 @@ 293 294 - 1363 + 1364 @@ -9621,7 +9616,7 @@ 293 294 - 1363 + 1364 @@ -9631,27 +9626,27 @@ fields - 27544995 + 27583622 id - 27544995 + 27583622 nodeName - 10922827 + 10929437 typeid - 2732411 + 2735430 parentid - 3866825 + 3861543 sourceid - 27544995 + 27583622 @@ -9665,7 +9660,7 @@ 1 2 - 27544995 + 27583622 @@ -9681,7 +9676,7 @@ 1 2 - 27544995 + 27583622 @@ -9697,7 +9692,7 @@ 1 2 - 27544995 + 27583622 @@ -9713,7 +9708,7 @@ 1 2 - 27544995 + 27583622 @@ -9729,22 +9724,22 @@ 1 2 - 8082701 + 8083442 2 3 - 1435743 + 1437329 3 11 - 759457 + 763026 11 - 822 - 644925 + 828 + 645638 @@ -9760,17 +9755,17 @@ 1 2 - 9896128 + 9901603 2 4 - 852174 + 853115 4 160 - 174525 + 174718 @@ -9786,22 +9781,22 @@ 1 2 - 8082701 + 8083442 2 3 - 1435743 + 1437329 3 11 - 759457 + 763026 11 - 822 - 644925 + 828 + 645638 @@ -9817,22 +9812,22 @@ 1 2 - 8082701 + 8083442 2 3 - 1435743 + 1437329 3 11 - 759457 + 763026 11 - 822 - 644925 + 828 + 645638 @@ -9848,32 +9843,32 @@ 1 2 - 1735708 + 1737626 2 3 - 339506 + 339881 3 4 - 175888 + 176083 4 7 - 208612 + 208842 7 24 - 205885 + 206112 24 - 7473 - 66810 + 7479 + 66884 @@ -9889,27 +9884,27 @@ 1 2 - 1897962 + 1900059 2 3 - 302692 + 303026 3 4 - 184069 + 184273 4 9 - 212702 + 212937 9 2335 - 134984 + 135133 @@ -9925,17 +9920,17 @@ 1 2 - 2328821 + 2332759 2 4 - 230427 + 229317 4 - 1386 - 173161 + 1392 + 173353 @@ -9951,32 +9946,32 @@ 1 2 - 1735708 + 1737626 2 3 - 339506 + 339881 3 4 - 175888 + 176083 4 7 - 208612 + 208842 7 24 - 205885 + 206112 24 - 7473 - 66810 + 7479 + 66884 @@ -9992,37 +9987,37 @@ 1 2 - 1941593 + 1942374 2 3 - 488125 + 485934 3 4 - 308146 + 304391 4 6 - 350414 + 342611 6 10 - 298601 + 301661 10 - 28 - 297238 + 27 + 292106 - 28 + 27 1610 - 182706 + 192462 @@ -10038,37 +10033,37 @@ 1 2 - 1941593 + 1942374 2 3 - 488125 + 485934 3 4 - 308146 + 304391 4 6 - 350414 + 342611 6 10 - 298601 + 301661 10 - 28 - 297238 + 27 + 292106 - 28 + 27 1610 - 182706 + 192462 @@ -10084,27 +10079,27 @@ 1 2 - 2523799 + 2506112 2 3 - 612201 + 625163 3 4 - 252243 + 244332 4 7 - 332688 + 339881 7 76 - 145892 + 146053 @@ -10120,37 +10115,37 @@ 1 2 - 1941593 + 1942374 2 3 - 488125 + 485934 3 4 - 308146 + 304391 4 6 - 350414 + 342611 6 10 - 298601 + 301661 10 - 28 - 297238 + 27 + 292106 - 28 + 27 1610 - 182706 + 192462 @@ -10166,7 +10161,7 @@ 1 2 - 27544995 + 27583622 @@ -10182,7 +10177,7 @@ 1 2 - 27544995 + 27583622 @@ -10198,7 +10193,7 @@ 1 2 - 27544995 + 27583622 @@ -10214,7 +10209,7 @@ 1 2 - 27544995 + 27583622 @@ -10224,15 +10219,15 @@ fieldsKotlinType - 27544995 + 27583622 id - 27544995 + 27583622 kttypeid - 1363 + 1364 @@ -10246,7 +10241,7 @@ 1 2 - 27544995 + 27583622 @@ -10260,9 +10255,9 @@ 12 - 20202 - 20203 - 1363 + 20208 + 20209 + 1364 @@ -10272,31 +10267,31 @@ constrs - 5063959 + 6889080 id - 5063959 + 6889080 nodeName - 2950567 + 3756439 signature - 4712182 + 5887181 typeid - 2726 + 2729 parentid - 3444147 + 4849792 sourceid - 5063959 + 5069555 @@ -10310,7 +10305,7 @@ 1 2 - 5063959 + 6889080 @@ -10326,7 +10321,7 @@ 1 2 - 5063959 + 6889080 @@ -10342,7 +10337,7 @@ 1 2 - 5063959 + 6889080 @@ -10358,7 +10353,7 @@ 1 2 - 5063959 + 6889080 @@ -10374,7 +10369,7 @@ 1 2 - 5063959 + 6889080 @@ -10390,22 +10385,22 @@ 1 2 - 1979771 + 2366884 2 3 - 595840 + 839465 3 5 - 230427 + 346706 5 - 38 - 144528 + 42 + 203382 @@ -10421,95 +10416,95 @@ 1 2 - 2097030 + 2635786 2 3 - 507214 - - - 3 - 6 - 268605 - - - 6 - 19 - 77718 - - - - - - - nodeName - typeid - - - 12 - - - 1 - 2 - 2950567 - - - - - - - nodeName - parentid - - - 12 - - - 1 - 2 - 2661510 - - - 2 - 3 - 234518 - - - 3 - 32 - 54539 - - - - - - - nodeName - sourceid - - - 12 - - - 1 - 2 - 1979771 - - - 2 - 3 - 595840 + 685222 3 5 - 230427 + 303026 + + + 5 + 19 + 132403 + + + + + + + nodeName + typeid + + + 12 + + + 1 + 2 + 3756439 + + + + + + + nodeName + parentid + + + 12 + + + 1 + 2 + 3295074 + + + 2 + 3 + 316676 + + + 3 + 42 + 144688 + + + + + + + nodeName + sourceid + + + 12 + + + 1 + 2 + 2458338 + + + 2 + 3 + 831276 + + + 3 + 5 + 319406 5 38 - 144528 + 147418 @@ -10525,12 +10520,12 @@ 1 2 - 4492662 + 5474955 2 - 32 - 219520 + 42 + 412225 @@ -10546,7 +10541,7 @@ 1 2 - 4712182 + 5887181 @@ -10562,7 +10557,7 @@ 1 2 - 4712182 + 5887181 @@ -10578,12 +10573,12 @@ 1 2 - 4492662 + 5474955 2 - 32 - 219520 + 42 + 412225 @@ -10599,12 +10594,12 @@ 1 2 - 4492662 + 5604629 2 32 - 219520 + 282551 @@ -10620,96 +10615,96 @@ 31 32 - 1363 + 1364 + + + 5016 + 5017 + 1364 + + + + + + + typeid + nodeName + + + 12 + + + 1 + 2 + 1364 + + + 2751 + 2752 + 1364 + + + + + + + typeid + signature + + + 12 + + + 1 + 2 + 1364 + + + 4312 + 4313 + 1364 + + + + + + + typeid + parentid + + + 12 + + + 31 + 32 + 1364 + + + 3522 + 3523 + 1364 + + + + + + + typeid + sourceid + + + 12 + + + 31 + 32 + 1364 3683 3684 - 1363 - - - - - - - typeid - nodeName - - - 12 - - - 1 - 2 - 1363 - - - 2163 - 2164 - 1363 - - - - - - - typeid - signature - - - 12 - - - 1 - 2 - 1363 - - - 3455 - 3456 - 1363 - - - - - - - typeid - parentid - - - 12 - - - 31 - 32 - 1363 - - - 2495 - 2496 - 1363 - - - - - - - typeid - sourceid - - - 12 - - - 31 - 32 - 1363 - - - 3683 - 3684 - 1363 + 1364 @@ -10725,22 +10720,22 @@ 1 2 - 2590609 + 3688190 2 3 - 533120 + 739822 3 6 - 265878 + 367181 6 19 - 54539 + 54599 @@ -10756,7 +10751,7 @@ 1 2 - 3444147 + 4849792 @@ -10772,22 +10767,22 @@ 1 2 - 2590609 + 3688190 2 3 - 533120 + 739822 3 6 - 265878 + 367181 6 19 - 54539 + 54599 @@ -10803,7 +10798,7 @@ 1 2 - 3444147 + 4849792 @@ -10819,22 +10814,22 @@ 1 2 - 2590609 + 3688190 2 3 - 533120 + 739822 3 6 - 265878 + 367181 6 19 - 54539 + 54599 @@ -10850,7 +10845,12 @@ 1 2 - 5063959 + 4756973 + + + 2 + 259 + 312581 @@ -10866,7 +10866,12 @@ 1 2 - 5063959 + 4756973 + + + 2 + 212 + 312581 @@ -10882,7 +10887,12 @@ 1 2 - 5063959 + 4756973 + + + 2 + 212 + 312581 @@ -10898,7 +10908,7 @@ 1 2 - 5063959 + 5069555 @@ -10914,7 +10924,12 @@ 1 2 - 5063959 + 4756973 + + + 2 + 259 + 312581 @@ -10924,15 +10939,15 @@ constrsKotlinType - 5063959 + 6889080 id - 5063959 + 6889080 kttypeid - 1363 + 1364 @@ -10946,7 +10961,7 @@ 1 2 - 5063959 + 6889080 @@ -10960,9 +10975,9 @@ 12 - 3714 - 3715 - 1363 + 5047 + 5048 + 1364 @@ -10972,31 +10987,31 @@ methods - 59177700 + 93482380 id - 59177700 + 93482380 nodeName - 20363553 + 20395609 signature - 29276613 + 29871337 typeid - 9259383 + 11611929 parentid - 7800461 + 11303442 sourceid - 58550500 + 58623387 @@ -11010,7 +11025,7 @@ 1 2 - 59177700 + 93482380 @@ -11026,7 +11041,7 @@ 1 2 - 59177700 + 93482380 @@ -11042,7 +11057,7 @@ 1 2 - 59177700 + 93482380 @@ -11058,7 +11073,7 @@ 1 2 - 59177700 + 93482380 @@ -11074,7 +11089,7 @@ 1 2 - 59177700 + 93482380 @@ -11090,27 +11105,32 @@ 1 2 - 12246765 + 11927241 2 3 - 3894095 + 3791929 3 4 - 1328028 + 1317210 4 7 - 1668897 + 1789495 7 - 922 - 1225767 + 259 + 1530148 + + + 270 + 2134 + 39584 @@ -11126,17 +11146,17 @@ 1 2 - 16896227 + 16912167 2 3 - 2116118 + 2122552 3 - 109 - 1351207 + 361 + 1360890 @@ -11152,17 +11172,22 @@ 1 2 - 17234370 + 17141484 2 3 - 1696167 + 1683026 3 - 839 - 1433016 + 52 + 1530148 + + + 52 + 845 + 40949 @@ -11178,27 +11203,27 @@ 1 2 - 13008949 + 12654778 2 3 - 3718206 + 3558516 3 4 - 1199861 + 1250326 4 - 8 - 1593906 + 7 + 1575192 - 8 - 920 - 842629 + 7 + 1278 + 1356795 @@ -11214,27 +11239,27 @@ 1 2 - 12287669 + 12309437 2 3 - 3914547 + 3921602 3 4 - 1296668 + 1298100 4 7 - 1652536 + 1654362 7 - 922 - 1212132 + 928 + 1212106 @@ -11250,22 +11275,22 @@ 1 2 - 21199366 + 20522553 2 3 - 4359041 + 4879822 3 - 6 - 2518345 + 5 + 2368249 - 6 - 917 - 1199861 + 5 + 1275 + 2100712 @@ -11281,7 +11306,7 @@ 1 2 - 29276613 + 29871337 @@ -11297,17 +11322,17 @@ 1 2 - 26429670 + 26823325 2 5 - 2341092 + 2390089 5 - 837 - 505850 + 843 + 657922 @@ -11323,22 +11348,22 @@ 1 2 - 21203456 + 20526648 2 3 - 4357677 + 4878457 3 - 6 - 2516981 + 5 + 2366884 - 6 - 917 - 1198497 + 5 + 1275 + 2099347 @@ -11354,22 +11379,22 @@ 1 2 - 21264813 + 21147716 2 3 - 4369949 + 4997211 3 6 - 2459715 + 2537507 6 - 917 - 1182135 + 923 + 1188902 @@ -11385,410 +11410,415 @@ 1 2 - 5468912 + 5705638 2 3 - 1708438 + 2455608 3 4 - 601294 + 1087893 4 - 7 - 704918 - - - 7 - 40 - 696737 - - - 40 - 8885 - 79081 - - - - - - - typeid - nodeName - - - 12 - - - 1 - 2 - 6055208 - - - 2 - 3 - 1722073 - - - 3 - 5 - 752640 - - - 5 - 49 - 696737 - - - 49 - 3955 - 32723 - - - - - - - typeid - signature - - - 12 - - - 1 - 2 - 5907953 - - - 2 - 3 - 1712529 - - - 3 - 5 - 770365 - - - 5 - 18 - 702191 - - - 18 - 5683 - 166344 - - - - - - - typeid - parentid - - - 12 - - - 1 - 2 - 6419257 - - - 2 - 3 - 1569363 - - - 3 - 5 - 739005 - - - 5 - 2008 - 531756 - - - - - - - typeid - sourceid - - - 12 - - - 1 - 2 - 5532996 - - - 2 - 3 - 1704348 - - - 3 - 4 - 560389 - - - 4 - 7 - 695374 - - - 7 - 46 - 698101 - - - 46 - 8862 - 68173 - - - - - - - parentid - id - - - 12 - - - 1 - 2 - 2480167 - - - 2 - 3 - 1077148 - - - 3 - 4 - 621746 - - - 4 - 5 - 538574 - - - 5 6 - 413134 + 924095 6 - 8 - 624473 - - - 8 - 11 - 628563 - - - 11 - 18 - 621746 - - - 18 - 42 - 591749 - - - 42 - 319 - 203158 - - - - - - - parentid - nodeName - - - 12 - - - 1 - 2 - 2530616 - - - 2 - 3 - 1096236 - - - 3 - 4 - 672194 - - - 4 - 5 - 548118 - - - 5 - 6 - 403589 - - - 6 - 8 - 632654 - - - 8 - 11 - 628563 - - - 11 - 19 - 644925 - - - 19 - 62 - 586295 - - - 62 - 290 - 57266 - - - - - - - parentid - signature - - - 12 - - - 1 - 2 - 2480167 - - - 2 - 3 - 1077148 - - - 3 - 4 - 621746 - - - 4 - 5 - 538574 - - - 5 - 6 - 413134 - - - 6 - 8 - 624473 - - - 8 - 11 - 628563 - - - 11 - 18 - 623109 - - - 18 - 42 - 590386 - - - 42 - 319 - 203158 - - - - - - - parentid - typeid - - - 12 - - - 1 - 2 - 3063736 - - - 2 - 3 - 1313029 - - - 3 - 4 - 823541 - - - 4 - 5 - 619019 - - - 5 - 6 - 549481 - - - 6 - 8 - 583568 - - - 8 14 - 614928 + 877685 14 + 11682 + 561008 + + + + + + + typeid + nodeName + + + 12 + + + 1 + 2 + 7632997 + + + 2 + 3 + 2222196 + + + 3 + 6 + 1063323 + + + 6 + 3956 + 693412 + + + + + + + typeid + signature + + + 12 + + + 1 + 2 + 7390030 + + + 2 + 3 + 2276795 + + + 3 + 5 + 879050 + + + 5 + 17 + 884510 + + + 17 + 5707 + 181543 + + + + + + + typeid + parentid + + + 12 + + + 1 + 2 + 6811276 + + + 2 + 3 + 2467893 + + + 3 + 4 + 1004629 + + + 4 + 9 + 917270 + + + 9 + 3421 + 410860 + + + + + + + typeid + sourceid + + + 12 + + + 1 + 2 + 6202493 + + + 2 + 3 + 2268605 + + + 3 + 4 + 984154 + + + 4 + 6 + 909080 + + + 6 + 16 + 892700 + + + 16 + 8870 + 354896 + + + + + + + parentid + id + + + 12 + + + 1 + 2 + 3200890 + + + 2 + 3 + 1298100 + + + 3 + 4 + 1027833 + + + 4 + 5 + 748011 + + + 5 + 7 + 925460 + + + 7 + 10 + 959584 + + + 10 + 13 + 997804 + + + 13 + 19 + 909080 + + + 19 + 38 + 910445 + + + 38 + 319 + 326231 + + + + + + + parentid + nodeName + + + 12 + + + 1 + 2 + 3254124 + + + 2 + 3 + 1318575 + + + 3 + 4 + 1108368 + + + 4 + 5 + 788961 + + + 5 + 7 + 888605 + + + 7 + 10 + 1021008 + + + 10 + 13 + 941839 + + + 13 + 17 + 876320 + + + 17 + 35 + 850385 + + + 35 + 290 + 255252 + + + + + + + parentid + signature + + + 12 + + + 1 + 2 + 3200890 + + + 2 + 3 + 1298100 + + + 3 + 4 + 1027833 + + + 4 + 5 + 748011 + + + 5 + 7 + 925460 + + + 7 + 10 + 959584 + + + 10 + 13 + 997804 + + + 13 + 19 + 909080 + + + 19 + 38 + 910445 + + + 38 + 319 + 326231 + + + + + + + parentid + typeid + + + 12 + + + 1 + 2 + 3901127 + + + 2 + 3 + 1624332 + + + 3 + 4 + 1329495 + + + 4 + 5 + 790326 + + + 5 + 6 + 636083 + + + 6 + 7 + 502314 + + + 7 + 9 + 1034658 + + + 9 + 13 + 881780 + + + 13 78 - 233154 + 603323 @@ -11804,52 +11834,52 @@ 1 2 - 2480167 + 3200890 2 3 - 1077148 + 1298100 3 4 - 621746 + 1027833 4 5 - 538574 + 748011 5 - 6 - 413134 + 7 + 925460 - 6 - 8 - 624473 + 7 + 10 + 959584 - 8 - 11 - 628563 + 10 + 13 + 997804 - 11 - 18 - 621746 + 13 + 19 + 909080 - 18 - 42 - 591749 + 19 + 38 + 910445 - 42 + 38 319 - 203158 + 326231 @@ -11865,12 +11895,12 @@ 1 2 - 58210994 + 54259529 2 - 15 - 339506 + 349 + 4363857 @@ -11886,7 +11916,7 @@ 1 2 - 58550500 + 58623387 @@ -11902,12 +11932,12 @@ 1 2 - 58520504 + 58339470 2 - 9 - 29996 + 347 + 283916 @@ -11923,12 +11953,12 @@ 1 2 - 58483690 + 56923980 2 - 10 - 66810 + 259 + 1699406 @@ -11944,12 +11974,12 @@ 1 2 - 58210994 + 54259529 2 - 15 - 339506 + 349 + 4363857 @@ -11959,15 +11989,15 @@ methodsKotlinType - 59177700 + 93482380 id - 59177700 + 93482380 kttypeid - 1363 + 1364 @@ -11981,7 +12011,7 @@ 1 2 - 59177700 + 93482380 @@ -11995,9 +12025,9 @@ 12 - 43402 - 43403 - 1363 + 68486 + 68487 + 1364 @@ -12007,27 +12037,27 @@ params - 62111906 + 101137218 id - 62111906 + 101137218 typeid - 9391641 + 11278873 pos - 29996 + 30029 parentid - 36234445 + 56339766 sourceid - 61258369 + 61326058 @@ -12041,7 +12071,7 @@ 1 2 - 62111906 + 101137218 @@ -12057,7 +12087,7 @@ 1 2 - 62111906 + 101137218 @@ -12073,7 +12103,7 @@ 1 2 - 62111906 + 101137218 @@ -12089,7 +12119,7 @@ 1 2 - 62111906 + 101137218 @@ -12105,32 +12135,32 @@ 1 2 - 5944766 + 6038694 2 3 - 1075784 + 1756736 3 4 - 595840 + 853115 4 - 7 - 804452 + 6 + 966409 - 7 - 24 - 704918 + 6 + 12 + 854480 - 24 - 6303 - 265878 + 12 + 7464 + 809436 @@ -12146,22 +12176,17 @@ 1 2 - 7680475 + 9331039 2 3 - 944890 + 1156142 3 - 9 - 719916 - - - 9 17 - 46358 + 791691 @@ -12177,32 +12202,32 @@ 1 2 - 6221553 + 6227062 2 3 - 977614 + 1726706 3 4 - 598567 + 873590 4 - 7 - 718553 + 6 + 909080 - 7 - 31 - 709008 + 6 + 13 + 854480 - 31 - 4373 - 166344 + 13 + 5239 + 687952 @@ -12218,32 +12243,32 @@ 1 2 - 5974763 + 6433175 2 3 - 1077148 + 1613412 3 4 - 578114 + 884510 4 - 7 - 812633 + 6 + 943204 - 7 - 25 - 714462 + 6 + 14 + 889970 - 25 + 14 6287 - 234518 + 514599 @@ -12259,57 +12284,57 @@ 1 2 - 2726 + 2729 - 4 - 7 - 2726 + 53 + 56 + 2729 - 10 - 12 - 2726 + 110 + 112 + 2729 - 16 - 19 - 2726 + 165 + 172 + 2729 - 22 - 36 - 2726 + 224 + 242 + 2729 - 47 - 72 - 2726 + 304 + 329 + 2729 - 112 - 155 - 2726 + 523 + 665 + 2729 - 215 - 368 - 2726 + 879 + 1140 + 2729 - 584 - 997 - 2726 + 1514 + 2087 + 2729 - 1989 - 4203 - 2726 + 3295 + 5932 + 2729 - 10118 - 26576 - 2726 + 15024 + 41276 + 2729 @@ -12325,57 +12350,57 @@ 1 2 - 2726 + 2729 2 5 - 2726 + 2729 6 7 - 2726 + 2729 10 12 - 2726 + 2729 13 19 - 2726 + 2729 26 - 36 - 2726 + 38 + 2729 57 - 74 - 2726 + 76 + 2729 - 97 + 99 159 - 2726 + 2729 - 210 + 212 305 - 2726 + 2729 - 444 - 791 - 2726 + 451 + 888 + 2729 - 2124 - 5120 - 2726 + 2378 + 6326 + 2729 @@ -12391,57 +12416,57 @@ 1 2 - 2726 + 2729 - 4 - 7 - 2726 + 53 + 56 + 2729 - 10 - 12 - 2726 + 110 + 112 + 2729 - 16 - 19 - 2726 + 165 + 172 + 2729 - 22 - 36 - 2726 + 224 + 242 + 2729 - 47 - 72 - 2726 + 304 + 329 + 2729 - 112 - 155 - 2726 + 523 + 665 + 2729 - 215 - 368 - 2726 + 879 + 1140 + 2729 - 584 - 997 - 2726 + 1514 + 2087 + 2729 - 1989 - 4203 - 2726 + 3295 + 5932 + 2729 - 10118 - 26576 - 2726 + 15024 + 41276 + 2729 @@ -12457,57 +12482,57 @@ 1 2 - 2726 + 2729 2 5 - 2726 + 2729 6 8 - 2726 + 2729 10 13 - 2726 + 2729 14 28 - 2726 + 2729 37 62 - 2726 + 2729 97 137 - 2726 + 2729 192 342 - 2726 + 2729 553 963 - 2726 + 2729 1950 4155 - 2726 + 2729 10027 26335 - 2726 + 2729 @@ -12523,22 +12548,27 @@ 1 2 - 22438768 + 35832228 2 3 - 8066339 + 12411811 3 4 - 3017378 + 3598101 4 + 15 + 4264213 + + + 15 23 - 2711959 + 233412 @@ -12554,22 +12584,17 @@ 1 2 - 24706233 + 39830270 2 3 - 8092245 + 12671158 3 - 5 - 2934206 - - - 5 23 - 501760 + 3838338 @@ -12585,22 +12610,27 @@ 1 2 - 22438768 + 35832228 2 3 - 8066339 + 12411811 3 4 - 3017378 + 3598101 4 + 15 + 4264213 + + + 15 23 - 2711959 + 233412 @@ -12616,22 +12646,27 @@ 1 2 - 22438768 + 35832228 2 3 - 8066339 + 12411811 3 4 - 3017378 + 3598101 4 + 15 + 4264213 + + + 15 23 - 2711959 + 233412 @@ -12647,12 +12682,12 @@ 1 2 - 60793423 + 56895315 2 - 15 - 464946 + 349 + 4430742 @@ -12668,12 +12703,12 @@ 1 2 - 61190195 + 59783624 2 - 9 - 68173 + 349 + 1542433 @@ -12689,7 +12724,7 @@ 1 2 - 61258369 + 61326058 @@ -12705,12 +12740,12 @@ 1 2 - 60793423 + 56895315 2 - 15 - 464946 + 349 + 4430742 @@ -12720,15 +12755,15 @@ paramsKotlinType - 62111906 + 101137218 id - 62111906 + 101137218 kttypeid - 1363 + 1364 @@ -12742,7 +12777,7 @@ 1 2 - 62111906 + 101137218 @@ -12756,9 +12791,9 @@ 12 - 45554 - 45555 - 1363 + 74094 + 74095 + 1364 @@ -12768,15 +12803,15 @@ paramName - 62111906 + 101137218 id - 62111906 + 101137218 nodeName - 1686623 + 1688486 @@ -12790,7 +12825,7 @@ 1 2 - 62111906 + 101137218 @@ -12806,37 +12841,37 @@ 1 2 - 736278 + 719347 2 3 - 336779 + 331691 3 4 - 156800 + 173353 4 5 - 118622 + 114658 5 9 - 139074 + 144688 9 - 23 - 129530 + 25 + 126943 - 23 - 21136 - 69537 + 25 + 32680 + 77804 @@ -12846,11 +12881,11 @@ isVarargsParam - 813823 + 1005994 param - 813823 + 1005994 @@ -13073,11 +13108,11 @@ isAnnotType - 29041 + 29833 interfaceid - 29041 + 29833 @@ -13361,11 +13396,11 @@ isEnumType - 350414 + 350801 classid - 350414 + 350801 @@ -13383,27 +13418,27 @@ typeVars - 5113044 + 5118694 id - 5113044 + 5118694 nodeName - 70900 + 70979 pos - 5453 + 5459 kind - 1363 + 1364 parentid - 3720933 + 3725044 @@ -13417,7 +13452,7 @@ 1 2 - 5113044 + 5118694 @@ -13433,7 +13468,7 @@ 1 2 - 5113044 + 5118694 @@ -13449,7 +13484,7 @@ 1 2 - 5113044 + 5118694 @@ -13465,7 +13500,7 @@ 1 2 - 5113044 + 5118694 @@ -13481,47 +13516,47 @@ 1 2 - 20452 + 20474 2 3 - 10907 + 10919 3 4 - 6817 + 6824 4 7 - 5453 + 5459 7 10 - 5453 + 5459 10 28 - 5453 + 5459 37 71 - 5453 + 5459 71 253 - 5453 + 5459 459 951 - 5453 + 5459 @@ -13537,22 +13572,22 @@ 1 2 - 44994 + 45044 2 3 - 16361 + 16379 3 4 - 8180 + 8189 4 5 - 1363 + 1364 @@ -13568,7 +13603,7 @@ 1 2 - 70900 + 70979 @@ -13584,47 +13619,47 @@ 1 2 - 20452 + 20474 2 3 - 10907 + 10919 3 4 - 6817 + 6824 4 7 - 5453 + 5459 7 10 - 5453 + 5459 10 28 - 5453 + 5459 37 71 - 5453 + 5459 71 253 - 5453 + 5459 459 951 - 5453 + 5459 @@ -13640,22 +13675,22 @@ 6 7 - 1363 + 1364 94 95 - 1363 + 1364 921 922 - 1363 + 1364 2729 2730 - 1363 + 1364 @@ -13671,22 +13706,22 @@ 2 3 - 1363 + 1364 13 14 - 1363 + 1364 23 24 - 1363 + 1364 41 42 - 1363 + 1364 @@ -13702,7 +13737,7 @@ 1 2 - 5453 + 5459 @@ -13718,22 +13753,22 @@ 6 7 - 1363 + 1364 94 95 - 1363 + 1364 921 922 - 1363 + 1364 2729 2730 - 1363 + 1364 @@ -13749,7 +13784,7 @@ 3750 3751 - 1363 + 1364 @@ -13765,7 +13800,7 @@ 52 53 - 1363 + 1364 @@ -13781,7 +13816,7 @@ 4 5 - 1363 + 1364 @@ -13797,7 +13832,7 @@ 2729 2730 - 1363 + 1364 @@ -13813,17 +13848,17 @@ 1 2 - 2465169 + 2467893 2 3 - 1127596 + 1128842 3 5 - 128166 + 128308 @@ -13839,17 +13874,17 @@ 1 2 - 2465169 + 2467893 2 3 - 1127596 + 1128842 3 5 - 128166 + 128308 @@ -13865,17 +13900,17 @@ 1 2 - 2465169 + 2467893 2 3 - 1127596 + 1128842 3 5 - 128166 + 128308 @@ -13891,7 +13926,7 @@ 1 2 - 3720933 + 3725044 @@ -13901,19 +13936,19 @@ wildcards - 2416084 + 3116261 id - 2416084 + 3116261 nodeName - 751276 + 859940 kind - 2726 + 2729 @@ -13927,7 +13962,7 @@ 1 2 - 2416084 + 3116261 @@ -13943,7 +13978,7 @@ 1 2 - 2416084 + 3116261 @@ -13959,17 +13994,17 @@ 1 2 - 591749 + 683857 2 3 - 109078 + 110563 3 - 140 - 50448 + 170 + 65519 @@ -13985,7 +14020,7 @@ 1 2 - 751276 + 859940 @@ -13999,14 +14034,14 @@ 12 - 648 - 649 - 1363 + 898 + 899 + 1364 - 1124 - 1125 - 1363 + 1385 + 1386 + 1364 @@ -14020,14 +14055,14 @@ 12 - 152 - 153 - 1363 + 196 + 197 + 1364 - 399 - 400 - 1363 + 434 + 435 + 1364 @@ -14037,23 +14072,23 @@ typeBounds - 3171451 + 3872463 id - 3171451 + 3872463 typeid - 2387451 + 2723145 pos - 1363 + 1364 parentid - 3171451 + 3872463 @@ -14067,7 +14102,7 @@ 1 2 - 3171451 + 3872463 @@ -14083,7 +14118,7 @@ 1 2 - 3171451 + 3872463 @@ -14099,7 +14134,7 @@ 1 2 - 3171451 + 3872463 @@ -14115,17 +14150,17 @@ 1 2 - 2101120 + 2093887 2 3 - 218156 + 552819 3 51 - 68173 + 76439 @@ -14141,7 +14176,7 @@ 1 2 - 2387451 + 2723145 @@ -14157,17 +14192,17 @@ 1 2 - 2101120 + 2093887 2 3 - 218156 + 552819 3 51 - 68173 + 76439 @@ -14181,9 +14216,9 @@ 12 - 2326 - 2327 - 1363 + 2837 + 2838 + 1364 @@ -14197,9 +14232,9 @@ 12 - 1751 - 1752 - 1363 + 1995 + 1996 + 1364 @@ -14213,9 +14248,9 @@ 12 - 2326 - 2327 - 1363 + 2837 + 2838 + 1364 @@ -14231,7 +14266,7 @@ 1 2 - 3171451 + 3872463 @@ -14247,7 +14282,7 @@ 1 2 - 3171451 + 3872463 @@ -14263,7 +14298,7 @@ 1 2 - 3171451 + 3872463 @@ -14569,37 +14604,37 @@ isParameterized - 22414889 + 24792227 memberid - 22414889 + 24792227 isRaw - 635381 + 642908 memberid - 635381 + 642908 erasure - 22417402 + 25435135 memberid - 22417402 + 25435135 erasureid - 2850 + 868130 @@ -14613,7 +14648,7 @@ 1 2 - 22417402 + 25435135 @@ -14629,52 +14664,57 @@ 1 2 - 177 + 144688 2 3 - 437 + 133768 3 + 4 + 88724 + + + 4 5 - 249 + 55964 5 6 - 703 + 51869 6 - 9 - 226 + 8 + 62789 - 9 - 23 - 243 + 8 + 11 + 77804 - 23 - 98 - 215 + 11 + 19 + 70979 - 101 - 288 - 215 + 19 + 33 + 70979 - 345 - 2541 - 215 + 33 + 93 + 65519 - 2940 - 468247 - 166 + 97 + 1723 + 45044 @@ -14684,15 +14724,15 @@ isAnonymClass - 192470 + 194713 classid - 192470 + 194713 parent - 192470 + 194713 @@ -14706,7 +14746,7 @@ 1 2 - 192470 + 194713 @@ -14722,7 +14762,7 @@ 1 2 - 192470 + 194713 @@ -14732,15 +14772,15 @@ isLocalClassOrInterface - 4062 + 4069 typeid - 4062 + 4069 parent - 4062 + 4069 @@ -14754,7 +14794,7 @@ 1 2 - 4062 + 4069 @@ -14770,7 +14810,7 @@ 1 2 - 4062 + 4069 @@ -14780,22 +14820,22 @@ isDefConstr - 138448 + 138456 constructorid - 138448 + 138456 lambdaKind - 183561 + 185816 exprId - 183561 + 185816 bodyKind @@ -14813,7 +14853,7 @@ 1 2 - 183561 + 185816 @@ -14827,8 +14867,8 @@ 12 - 11702 - 11703 + 11987 + 11988 15 @@ -14839,27 +14879,27 @@ arrays - 1109871 + 1119287 id - 1109871 + 1119287 nodeName - 688556 + 689317 elementtypeid - 1103054 + 1112462 dimension - 2726 + 2729 componenttypeid - 1109871 + 1119287 @@ -14873,7 +14913,7 @@ 1 2 - 1109871 + 1119287 @@ -14889,7 +14929,7 @@ 1 2 - 1109871 + 1119287 @@ -14905,7 +14945,7 @@ 1 2 - 1109871 + 1119287 @@ -14921,7 +14961,7 @@ 1 2 - 1109871 + 1119287 @@ -14937,17 +14977,17 @@ 1 2 - 563116 + 563738 2 3 - 99533 + 99643 3 - 89 - 25906 + 95 + 25934 @@ -14963,17 +15003,17 @@ 1 2 - 563116 + 563738 2 3 - 99533 + 99643 3 - 89 - 25906 + 95 + 25934 @@ -14989,7 +15029,7 @@ 1 2 - 688556 + 689317 @@ -15005,17 +15045,17 @@ 1 2 - 563116 + 563738 2 3 - 99533 + 99643 3 - 89 - 25906 + 95 + 25934 @@ -15031,12 +15071,12 @@ 1 2 - 1096236 + 1105638 2 3 - 6817 + 6824 @@ -15052,12 +15092,12 @@ 1 2 - 1096236 + 1105638 2 3 - 6817 + 6824 @@ -15073,12 +15113,12 @@ 1 2 - 1096236 + 1105638 2 3 - 6817 + 6824 @@ -15094,12 +15134,12 @@ 1 2 - 1096236 + 1105638 2 3 - 6817 + 6824 @@ -15115,12 +15155,12 @@ 5 6 - 1363 + 1364 - 809 - 810 - 1363 + 815 + 816 + 1364 @@ -15136,12 +15176,12 @@ 5 6 - 1363 + 1364 500 501 - 1363 + 1364 @@ -15157,12 +15197,12 @@ 5 6 - 1363 + 1364 - 809 - 810 - 1363 + 815 + 816 + 1364 @@ -15178,12 +15218,12 @@ 5 6 - 1363 + 1364 - 809 - 810 - 1363 + 815 + 816 + 1364 @@ -15199,7 +15239,7 @@ 1 2 - 1109871 + 1119287 @@ -15215,7 +15255,7 @@ 1 2 - 1109871 + 1119287 @@ -15231,7 +15271,7 @@ 1 2 - 1109871 + 1119287 @@ -15247,7 +15287,7 @@ 1 2 - 1109871 + 1119287 @@ -15257,15 +15297,15 @@ enclInReftype - 3363701 + 3417923 child - 3363701 + 3417923 parent - 927165 + 928189 @@ -15279,7 +15319,7 @@ 1 2 - 3363701 + 3417923 @@ -15295,32 +15335,32 @@ 1 2 - 545391 + 545994 2 3 - 149982 + 150148 3 4 - 72264 + 70979 4 7 - 83172 + 83264 7 - 51 - 69537 + 48 + 69614 - 54 - 261 - 6817 + 50 + 277 + 8189 @@ -15330,15 +15370,15 @@ extendsReftype - 42364645 + 47612051 id1 - 29841093 + 33730150 id2 - 12951683 + 13910564 @@ -15352,22 +15392,22 @@ 1 2 - 22519213 + 25830981 2 3 - 2991472 + 3150385 3 4 - 3587312 + 3643145 4 10 - 743095 + 1105638 @@ -15383,17 +15423,17 @@ 1 2 - 10991001 + 11822137 2 3 - 1330755 + 1423679 3 - 10473 - 629927 + 12114 + 664747 @@ -15403,15 +15443,15 @@ implInterface - 3035340 + 3035438 id1 - 753178 + 753152 id2 - 2261946 + 2262035 @@ -15425,37 +15465,37 @@ 1 2 - 208701 + 208645 2 3 - 50090 + 50093 3 4 - 67184 + 67188 4 5 - 61692 + 61695 5 6 - 19204 + 19205 6 7 - 304112 + 304129 7 10 - 42193 + 42195 @@ -15471,12 +15511,12 @@ 1 2 - 2186998 + 2187117 2 63837 - 74948 + 74918 @@ -15486,51 +15526,15 @@ permits - 1 + 125 id1 - 1 + 32 id2 - 1 - - - - - id1 - id2 - - - 12 - - - - - - id2 - id1 - - - 12 - - - - - - - - hasModifier - 172920454 - - - id1 - 125651375 - - - id2 - 12271 + 125 @@ -15544,17 +15548,100 @@ 1 2 - 78728621 + 2 2 3 - 46576431 + 9 3 4 - 346323 + 8 + + + 4 + 5 + 1 + + + 5 + 6 + 4 + + + 6 + 8 + 2 + + + 8 + 9 + 2 + + + 10 + 11 + 1 + + + + + + + id2 + id1 + + + 12 + + + 1 + 2 + 125 + + + + + + + + + hasModifier + 248786309 + + + id1 + 166367134 + + + id2 + 12284 + + + + + id1 + id2 + + + 12 + + + 1 + 2 + 84399769 + + + 2 + 3 + 81515555 + + + 3 + 4 + 451810 @@ -15570,47 +15657,47 @@ 34 35 - 1363 + 1364 - 108 - 109 - 1363 + 109 + 110 + 1364 - 284 - 285 - 1363 + 285 + 286 + 1364 - 391 - 392 - 1363 + 500 + 501 + 1364 - 4671 - 4672 - 1363 + 8057 + 8058 + 1364 - 5009 - 5010 - 1363 + 17754 + 17755 + 1364 - 12072 - 12073 - 1363 + 18275 + 18276 + 1364 - 15259 - 15260 - 1363 + 20697 + 20698 + 1364 - 88995 - 88996 - 1363 + 116552 + 116553 + 1364 @@ -15951,27 +16038,27 @@ stmts - 2531979 + 2534777 id - 2531979 + 2534777 kind - 13634 + 13649 parent - 1783430 + 1785400 idx - 216793 + 217032 bodydecl - 703554 + 704332 @@ -15985,7 +16072,7 @@ 1 2 - 2531979 + 2534777 @@ -16001,7 +16088,7 @@ 1 2 - 2531979 + 2534777 @@ -16017,7 +16104,7 @@ 1 2 - 2531979 + 2534777 @@ -16033,7 +16120,7 @@ 1 2 - 2531979 + 2534777 @@ -16049,42 +16136,42 @@ 2 3 - 4090 + 4094 4 5 - 1363 + 1364 72 73 - 1363 + 1364 96 97 - 1363 + 1364 162 163 - 1363 + 1364 372 373 - 1363 + 1364 525 526 - 1363 + 1364 620 621 - 1363 + 1364 @@ -16100,47 +16187,47 @@ 1 2 - 1363 + 1364 2 3 - 2726 + 2729 4 5 - 1363 + 1364 53 54 - 1363 + 1364 72 73 - 1363 + 1364 98 99 - 1363 + 1364 233 234 - 1363 + 1364 372 373 - 1363 + 1364 620 621 - 1363 + 1364 @@ -16156,32 +16243,32 @@ 1 2 - 5453 + 5459 2 3 - 1363 + 1364 5 6 - 1363 + 1364 6 7 - 1363 + 1364 7 8 - 2726 + 2729 158 159 - 1363 + 1364 @@ -16197,42 +16284,42 @@ 1 2 - 1363 + 1364 2 3 - 4090 + 4094 25 26 - 1363 + 1364 71 72 - 1363 + 1364 72 73 - 1363 + 1364 119 120 - 1363 + 1364 370 371 - 1363 + 1364 516 517 - 1363 + 1364 @@ -16248,17 +16335,17 @@ 1 2 - 1501190 + 1502848 2 3 - 199067 + 199287 3 159 - 83172 + 83264 @@ -16274,17 +16361,17 @@ 1 2 - 1587089 + 1588842 2 3 - 189523 + 189732 3 4 - 6817 + 6824 @@ -16300,17 +16387,17 @@ 1 2 - 1501190 + 1502848 2 3 - 199067 + 199287 3 159 - 83172 + 83264 @@ -16326,7 +16413,7 @@ 1 2 - 1783430 + 1785400 @@ -16342,22 +16429,22 @@ 1 2 - 160890 + 161068 2 3 - 34086 + 34124 3 24 - 16361 + 16379 34 1211 - 5453 + 5459 @@ -16373,12 +16460,12 @@ 1 2 - 204521 + 204747 2 9 - 12271 + 12284 @@ -16394,22 +16481,22 @@ 1 2 - 160890 + 161068 2 3 - 34086 + 34124 3 24 - 16361 + 16379 34 1211 - 5453 + 5459 @@ -16425,22 +16512,22 @@ 1 2 - 160890 + 161068 2 3 - 34086 + 34124 3 19 - 16361 + 16379 29 517 - 5453 + 5459 @@ -16456,22 +16543,22 @@ 2 3 - 544027 + 544629 3 4 - 58629 + 58694 4 7 - 53175 + 53234 7 162 - 47721 + 47774 @@ -16487,17 +16574,17 @@ 2 3 - 575387 + 576023 3 4 - 81808 + 81899 4 7 - 46358 + 46409 @@ -16513,17 +16600,17 @@ 2 3 - 629927 + 630623 3 8 - 57266 + 57329 9 47 - 16361 + 16379 @@ -16539,22 +16626,22 @@ 1 2 - 544027 + 544629 2 3 - 92716 + 92818 3 7 - 54539 + 54599 7 159 - 12271 + 12284 @@ -17435,7 +17522,7 @@ kttypeid - 12361 + 12370 @@ -17465,16 +17552,16 @@ 1 2 - 9271 + 9277 2 3 - 2060 + 2061 - 7182 - 7183 + 7177 + 7178 1030 @@ -17485,15 +17572,15 @@ callableEnclosingExpr - 7217924 + 7300230 id - 7217924 + 7300230 callable_id - 240274 + 19880 @@ -17507,7 +17594,7 @@ 1 2 - 7217924 + 7300230 @@ -17522,68 +17609,73 @@ 1 + 2 + 711 + + + 2 3 - 21096 + 1691 3 - 4 - 16487 - - - 4 5 - 19087 + 1604 5 6 - 31319 + 806 6 7 - 13591 + 1955 7 - 8 - 11582 + 9 + 1374 - 8 - 10 - 19619 - - - 10 + 9 13 - 20328 + 1825 13 18 - 18023 + 1574 18 26 - 19028 + 1530 26 42 - 18673 + 1530 42 - 90 - 18141 + 73 + 1504 - 90 - 2632 - 13296 + 73 + 177 + 1496 + + + 179 + 1146 + 1491 + + + 1148 + 37742 + 780 @@ -17593,15 +17685,15 @@ statementEnclosingExpr - 6747230 + 7259867 id - 6747230 + 7259867 statement_id - 1036488 + 525862 @@ -17615,7 +17707,7 @@ 1 2 - 6747230 + 7259867 @@ -17630,58 +17722,63 @@ 1 - 2 - 91145 - - - 2 3 - 105186 + 29130 3 - 4 - 160261 - - - 4 5 - 132927 + 47085 5 - 6 - 117577 - - - 6 7 - 81534 + 48481 7 8 - 70956 + 36048 8 9 - 74134 + 38151 9 + 10 + 50455 + + + 10 11 - 89864 + 29217 11 - 17 - 80045 + 12 + 127070 - 17 - 5127 - 32854 + 12 + 35 + 35328 + + + 35 + 40 + 44630 + + + 40 + 81 + 40228 + + + 82 + 210 + 34 @@ -17744,37 +17841,37 @@ when_if - 82305 + 83447 id - 82305 + 83447 when_branch_else - 80340 + 80753 id - 80340 + 80753 callableBinding - 1981634 + 1832536 callerid - 1981634 + 1832536 callee - 243322 + 263412 @@ -17788,7 +17885,7 @@ 1 2 - 1981634 + 1832536 @@ -17804,32 +17901,32 @@ 1 2 - 144987 + 162246 2 3 - 30712 + 33026 3 4 - 16063 + 16214 4 7 - 21383 + 22259 7 - 18 - 18691 + 20 + 19913 - 18 - 53688 - 11484 + 20 + 46115 + 9752 @@ -17839,15 +17936,15 @@ memberRefBinding - 22459 + 23208 id - 22459 + 23208 callable - 11307 + 11197 @@ -17861,7 +17958,7 @@ 1 2 - 22459 + 23208 @@ -17877,22 +17974,22 @@ 1 2 - 7789 + 7862 2 3 - 2295 + 2075 3 7 - 917 + 940 7 - 658 - 303 + 912 + 319 @@ -17902,15 +17999,15 @@ propertyRefGetBinding - 9002 + 9718 id - 9002 + 9718 getter - 5441 + 5873 @@ -17924,7 +18021,7 @@ 1 2 - 9002 + 9718 @@ -17940,17 +18037,17 @@ 1 2 - 1977 + 2132 2 3 - 3376 + 3646 3 6 - 87 + 94 @@ -18008,15 +18105,15 @@ propertyRefSetBinding - 2470 + 2651 id - 2470 + 2651 setter - 1235 + 1325 @@ -18030,7 +18127,7 @@ 1 2 - 2470 + 2651 @@ -18046,7 +18143,7 @@ 2 3 - 1235 + 1325 @@ -18505,15 +18602,15 @@ localvarsKotlinType - 223610 + 227623 id - 223610 + 227623 kttypeid - 1363 + 163 @@ -18527,7 +18624,7 @@ 1 2 - 223610 + 227623 @@ -18541,9 +18638,9 @@ 12 - 164 - 165 - 1363 + 1395 + 1396 + 163 @@ -18553,19 +18650,19 @@ namestrings - 1890347 + 4023074 name - 333893 + 23388 value - 328748 + 22170 parent - 1890347 + 4023074 @@ -18579,7 +18676,7 @@ 1 2 - 333893 + 23388 @@ -18595,27 +18692,42 @@ 1 2 - 189516 + 9606 2 3 - 80984 + 3812 3 5 - 30700 + 2151 5 - 15 - 25390 + 9 + 1769 - 15 - 2528 - 7301 + 9 + 21 + 1795 + + + 21 + 69 + 1760 + + + 69 + 385 + 1756 + + + 390 + 412517 + 737 @@ -18631,12 +18743,12 @@ 1 2 - 324102 + 21562 2 - 4 - 4646 + 12 + 607 @@ -18652,27 +18764,42 @@ 1 2 - 185699 + 9120 2 3 - 80984 + 3595 3 5 - 30037 + 1912 5 - 16 - 24726 + 9 + 1665 - 17 - 2537 - 7301 + 9 + 21 + 1691 + + + 21 + 67 + 1678 + + + 67 + 318 + 1665 + + + 320 + 413340 + 841 @@ -18688,7 +18815,7 @@ 1 2 - 1890347 + 4023074 @@ -18704,7 +18831,7 @@ 1 2 - 1890347 + 4023074 @@ -20413,15 +20540,15 @@ xmlEncoding - 801725 + 802611 id - 801725 + 802611 encoding - 1363 + 1364 @@ -20435,7 +20562,7 @@ 1 2 - 801725 + 802611 @@ -20451,7 +20578,7 @@ 588 589 - 1363 + 1364 @@ -20809,27 +20936,27 @@ xmlElements - 106674479 + 106792352 id - 106674479 + 106792352 name - 338142 + 338516 parentid - 2751499 + 2754540 idx - 1209405 + 1210741 fileid - 801725 + 802611 @@ -20843,7 +20970,7 @@ 1 2 - 106674479 + 106792352 @@ -20859,7 +20986,7 @@ 1 2 - 106674479 + 106792352 @@ -20875,7 +21002,7 @@ 1 2 - 106674479 + 106792352 @@ -20891,7 +21018,7 @@ 1 2 - 106674479 + 106792352 @@ -20907,57 +21034,57 @@ 1 2 - 106351 + 106468 2 3 - 40904 + 40949 3 4 - 16361 + 16379 4 6 - 29996 + 30029 6 8 - 24542 + 24569 8 9 - 12271 + 12284 9 10 - 23179 + 23204 10 18 - 28633 + 28664 18 48 - 25906 + 25934 52 250 - 25906 + 25934 342 73380 - 4090 + 4094 @@ -20973,52 +21100,52 @@ 1 2 - 124076 + 124213 2 3 - 46358 + 46409 3 4 - 17725 + 17744 4 5 - 14998 + 15014 5 6 - 19088 + 19109 6 8 - 28633 + 28664 8 10 - 28633 + 28664 10 21 - 27269 + 27299 22 128 - 25906 + 25934 130 229 - 5453 + 5459 @@ -21034,37 +21161,37 @@ 1 2 - 186796 + 187002 2 3 - 49085 + 49139 3 4 - 24542 + 24569 4 6 - 20452 + 20474 6 9 - 20452 + 20474 9 38 - 25906 + 25934 45 888 - 10907 + 10919 @@ -21080,42 +21207,42 @@ 1 2 - 184069 + 184273 2 3 - 36813 + 36854 3 4 - 17725 + 17744 4 5 - 13634 + 13649 5 7 - 29996 + 30029 7 16 - 25906 + 25934 17 114 - 27269 + 27299 118 131 - 2726 + 2729 @@ -21131,32 +21258,32 @@ 1 2 - 1674351 + 1676201 2 3 - 429495 + 429970 3 4 - 178615 + 178813 4 8 - 214066 + 214302 8 777 - 224973 + 225222 777 888 - 29996 + 30029 @@ -21172,17 +21299,17 @@ 1 2 - 2271555 + 2274065 2 3 - 291784 + 292106 3 17 - 188160 + 188367 @@ -21198,32 +21325,32 @@ 1 2 - 1674351 + 1676201 2 3 - 429495 + 429970 3 4 - 178615 + 178813 4 8 - 214066 + 214302 8 777 - 224973 + 225222 777 888 - 29996 + 30029 @@ -21239,7 +21366,7 @@ 1 2 - 2751499 + 2754540 @@ -21255,67 +21382,67 @@ 2 8 - 102260 + 102373 9 76 - 96806 + 96913 76 82 - 91353 + 91454 82 89 - 87262 + 87359 89 92 - 79081 + 79169 92 95 - 95443 + 95548 95 97 - 106351 + 106468 97 98 - 149982 + 150148 98 99 - 92716 + 92818 99 104 - 110441 + 110563 104 106 - 92716 + 92818 106 159 - 91353 + 91454 162 2019 - 13634 + 13649 @@ -21331,22 +21458,22 @@ 1 2 - 980341 + 981424 2 5 - 89989 + 90089 5 9 - 103624 + 103738 9 150 - 35450 + 35489 @@ -21362,67 +21489,67 @@ 2 8 - 102260 + 102373 9 76 - 96806 + 96913 76 82 - 91353 + 91454 82 89 - 87262 + 87359 89 92 - 79081 + 79169 92 95 - 95443 + 95548 95 97 - 106351 + 106468 97 98 - 149982 + 150148 98 99 - 92716 + 92818 99 104 - 110441 + 110563 104 106 - 92716 + 92818 106 159 - 91353 + 91454 162 2019 - 13634 + 13649 @@ -21438,67 +21565,67 @@ 2 8 - 102260 + 102373 9 76 - 96806 + 96913 76 82 - 91353 + 91454 82 89 - 87262 + 87359 89 92 - 79081 + 79169 92 95 - 95443 + 95548 95 97 - 106351 + 106468 97 98 - 149982 + 150148 98 99 - 92716 + 92818 99 104 - 110441 + 110563 104 106 - 92716 + 92818 106 139 - 91353 + 91454 141 589 - 13634 + 13649 @@ -21514,57 +21641,57 @@ 1 2 - 58629 + 58694 2 3 - 134984 + 135133 3 4 - 177252 + 177448 4 5 - 74991 + 75074 5 7 - 59993 + 60059 7 10 - 66810 + 66884 10 31 - 62720 + 62789 35 694 - 61356 + 61424 738 776 - 20452 + 20474 777 779 - 65446 + 65519 788 889 - 19088 + 19109 @@ -21580,37 +21707,37 @@ 1 2 - 58629 + 58694 2 3 - 399499 + 399940 3 4 - 139074 + 139228 4 5 - 65446 + 65519 5 6 - 61356 + 61424 6 9 - 65446 + 65519 9 69 - 12271 + 12284 @@ -21626,27 +21753,27 @@ 1 2 - 58629 + 58694 2 3 - 568570 + 569198 3 4 - 57266 + 57329 4 6 - 58629 + 58694 6 165 - 58629 + 58694 @@ -21662,42 +21789,42 @@ 1 2 - 203158 + 203382 2 3 - 219520 + 219762 3 4 - 88626 + 88724 4 7 - 66810 + 66884 7 17 - 66810 + 66884 18 763 - 61356 + 61424 764 777 - 65446 + 65519 777 888 - 29996 + 30029 @@ -21707,31 +21834,31 @@ xmlAttrs - 129755446 + 129898822 id - 129755446 + 129898822 elementid - 105766403 + 105883272 name - 512667 + 513234 value - 8197233 + 8206291 idx - 31360 + 31394 fileid - 800361 + 801246 @@ -21745,7 +21872,7 @@ 1 2 - 129755446 + 129898822 @@ -21761,7 +21888,7 @@ 1 2 - 129755446 + 129898822 @@ -21777,7 +21904,7 @@ 1 2 - 129755446 + 129898822 @@ -21793,7 +21920,7 @@ 1 2 - 129755446 + 129898822 @@ -21809,7 +21936,7 @@ 1 2 - 129755446 + 129898822 @@ -21825,17 +21952,17 @@ 1 2 - 96786532 + 96893479 2 6 - 7953171 + 7961959 6 24 - 1026699 + 1027833 @@ -21851,17 +21978,17 @@ 1 2 - 96786532 + 96893479 2 6 - 7966805 + 7975608 6 23 - 1013064 + 1014184 @@ -21877,17 +22004,17 @@ 1 2 - 96839708 + 96946713 2 6 - 8006346 + 8015193 6 21 - 920348 + 921365 @@ -21903,17 +22030,17 @@ 1 2 - 96786532 + 96893479 2 6 - 7953171 + 7961959 6 24 - 1026699 + 1027833 @@ -21929,7 +22056,7 @@ 1 2 - 105766403 + 105883272 @@ -21945,62 +22072,62 @@ 1 2 - 106351 + 106468 2 3 - 55902 + 55964 3 4 - 31360 + 31394 4 5 - 17725 + 17744 5 6 - 29996 + 30029 6 8 - 36813 + 36854 8 11 - 42267 + 42314 11 22 - 39540 + 39584 23 38 - 40904 + 40949 38 79 - 40904 + 40949 81 168 - 39540 + 39584 168 74700 - 31360 + 31394 @@ -22016,62 +22143,62 @@ 1 2 - 106351 + 106468 2 3 - 55902 + 55964 3 4 - 31360 + 31394 4 5 - 17725 + 17744 5 6 - 29996 + 30029 6 8 - 36813 + 36854 8 11 - 46358 + 46409 11 25 - 43631 + 43679 25 39 - 42267 + 42314 43 91 - 40904 + 40949 91 227 - 39540 + 39584 227 74700 - 21815 + 21839 @@ -22087,42 +22214,42 @@ 1 2 - 215429 + 215667 2 3 - 80445 + 80534 3 4 - 34086 + 34124 4 5 - 36813 + 36854 5 9 - 42267 + 42314 9 21 - 39540 + 39584 22 64 - 42267 + 42314 68 2100 - 21815 + 21839 @@ -22138,37 +22265,37 @@ 1 2 - 201794 + 202017 2 3 - 95443 + 95548 3 4 - 49085 + 49139 4 5 - 54539 + 54599 5 7 - 32723 + 32759 7 10 - 40904 + 40949 10 21 - 38177 + 38219 @@ -22184,52 +22311,52 @@ 1 2 - 178615 + 178813 2 3 - 53175 + 53234 3 4 - 27269 + 27299 4 5 - 24542 + 24569 5 6 - 38177 + 38219 6 9 - 42267 + 42314 9 17 - 44994 + 45044 17 34 - 39540 + 39584 36 91 - 39540 + 39584 91 223 - 24542 + 24569 @@ -22245,37 +22372,37 @@ 1 2 - 4477663 + 4482611 2 3 - 1212132 + 1213471 3 5 - 628563 + 629258 5 31 - 617655 + 618338 31 91 - 644925 + 645638 91 1111 - 614928 + 615608 3397 3398 - 1363 + 1364 @@ -22291,32 +22418,32 @@ 1 2 - 4567653 + 4572700 2 3 - 1154866 + 1156142 3 5 - 636744 + 637448 5 33 - 646288 + 647003 33 93 - 632654 + 633353 93 3398 - 559026 + 559643 @@ -22332,17 +22459,17 @@ 1 2 - 7439139 + 7447359 2 4 - 659923 + 660652 4 53 - 98170 + 98278 @@ -22358,17 +22485,17 @@ 1 2 - 6788760 + 6796261 2 3 - 991248 + 992344 3 20 - 417224 + 417685 @@ -22384,32 +22511,32 @@ 1 2 - 5276662 + 5282492 2 3 - 888988 + 889970 3 10 - 636744 + 637448 10 83 - 623109 + 623798 83 99 - 625836 + 626528 99 182 - 145892 + 146053 @@ -22425,62 +22552,62 @@ 1 6 - 2726 + 2729 12 14 - 2726 + 2729 17 26 - 2726 + 2729 39 56 - 2726 + 2729 83 110 - 2726 + 2729 153 232 - 2726 + 2729 316 400 - 2726 + 2729 468 545 - 2726 + 2729 626 754 - 2726 + 2729 951 1491 - 2726 + 2729 4718 6587 - 2726 + 2729 77571 77572 - 1363 + 1364 @@ -22496,62 +22623,62 @@ 1 6 - 2726 + 2729 12 14 - 2726 + 2729 17 26 - 2726 + 2729 39 56 - 2726 + 2729 83 110 - 2726 + 2729 153 232 - 2726 + 2729 316 400 - 2726 + 2729 468 545 - 2726 + 2729 626 754 - 2726 + 2729 951 1491 - 2726 + 2729 4718 6587 - 2726 + 2729 77571 77572 - 1363 + 1364 @@ -22567,62 +22694,62 @@ 1 4 - 2726 + 2729 7 10 - 2726 + 2729 11 17 - 2726 + 2729 18 23 - 2726 + 2729 26 38 - 2726 + 2729 39 49 - 2726 + 2729 57 67 - 2726 + 2729 72 79 - 2726 + 2729 95 101 - 2726 + 2729 105 106 - 2726 + 2729 106 132 - 2726 + 2729 140 141 - 1363 + 1364 @@ -22638,62 +22765,62 @@ 1 5 - 2726 + 2729 7 10 - 2726 + 2729 11 18 - 2726 + 2729 22 32 - 2726 + 2729 46 63 - 2726 + 2729 85 119 - 2726 + 2729 142 185 - 2726 + 2729 212 228 - 2726 + 2729 253 275 - 2726 + 2729 307 423 - 2726 + 2729 580 1324 - 2726 + 2729 3579 3580 - 1363 + 1364 @@ -22709,62 +22836,62 @@ 1 6 - 2726 + 2729 7 8 - 2726 + 2729 10 19 - 2726 + 2729 23 36 - 2726 + 2729 45 59 - 2726 + 2729 73 97 - 2726 + 2729 115 131 - 2726 + 2729 140 148 - 2726 + 2729 168 181 - 2726 + 2729 248 363 - 2726 + 2729 473 530 - 2726 + 2729 587 588 - 1363 + 1364 @@ -22780,72 +22907,72 @@ 1 3 - 59993 + 60059 3 5 - 61356 + 61424 5 6 - 36813 + 36854 6 7 - 61356 + 61424 7 8 - 51812 + 51869 8 10 - 58629 + 58694 10 15 - 65446 + 65519 15 27 - 61356 + 61424 27 41 - 61356 + 61424 41 65 - 61356 + 61424 65 157 - 65446 + 65519 162 817 - 61356 + 61424 818 832 - 66810 + 66884 832 1187 - 27269 + 27299 @@ -22861,52 +22988,52 @@ 1 2 - 91353 + 91454 2 3 - 188160 + 188367 3 4 - 113168 + 113293 4 5 - 77718 + 77804 5 8 - 72264 + 72344 8 14 - 61356 + 61424 14 295 - 61356 + 61424 330 775 - 50448 + 50504 776 778 - 65446 + 65519 787 888 - 19088 + 19109 @@ -22922,62 +23049,62 @@ 1 2 - 50448 + 50504 2 3 - 65446 + 65519 3 4 - 50448 + 50504 4 5 - 66810 + 66884 5 6 - 121349 + 121483 6 7 - 114532 + 114658 7 8 - 50448 + 50504 8 12 - 61356 + 61424 12 18 - 69537 + 69614 18 24 - 68173 + 68249 24 37 - 62720 + 62789 37 55 - 19088 + 19109 @@ -22993,67 +23120,67 @@ 1 3 - 69537 + 69614 3 4 - 39540 + 39584 4 5 - 73627 + 73709 5 6 - 88626 + 88724 6 8 - 62720 + 62789 8 12 - 70900 + 70979 12 19 - 61356 + 61424 19 27 - 69537 + 69614 27 41 - 61356 + 61424 42 170 - 61356 + 61424 205 780 - 57266 + 57329 781 783 - 65446 + 65519 791 893 - 19088 + 19109 @@ -23069,47 +23196,47 @@ 1 2 - 79081 + 79169 2 3 - 76354 + 76439 3 4 - 151346 + 151513 4 5 - 155436 + 155608 5 6 - 92716 + 92818 6 10 - 68173 + 68249 10 12 - 46358 + 46409 12 15 - 69537 + 69614 15 24 - 61356 + 61424 @@ -23119,23 +23246,23 @@ xmlNs - 1285760 + 1287181 id - 8180 + 8189 prefixName - 9544 + 9554 URI - 8180 + 8189 fileid - 748549 + 749376 @@ -23149,12 +23276,12 @@ 1 2 - 6817 + 6824 2 3 - 1363 + 1364 @@ -23170,7 +23297,7 @@ 1 2 - 8180 + 8189 @@ -23186,32 +23313,32 @@ 2 3 - 1363 + 1364 20 21 - 1363 + 1364 88 89 - 1363 + 1364 167 168 - 1363 + 1364 213 214 - 1363 + 1364 453 454 - 1363 + 1364 @@ -23227,7 +23354,7 @@ 1 2 - 9544 + 9554 @@ -23243,7 +23370,7 @@ 1 2 - 9544 + 9554 @@ -23259,37 +23386,37 @@ 1 2 - 1363 + 1364 2 3 - 1363 + 1364 20 21 - 1363 + 1364 88 89 - 1363 + 1364 166 167 - 1363 + 1364 213 214 - 1363 + 1364 453 454 - 1363 + 1364 @@ -23305,7 +23432,7 @@ 1 2 - 8180 + 8189 @@ -23321,12 +23448,12 @@ 1 2 - 6817 + 6824 2 3 - 1363 + 1364 @@ -23342,32 +23469,32 @@ 2 3 - 1363 + 1364 20 21 - 1363 + 1364 88 89 - 1363 + 1364 167 168 - 1363 + 1364 213 214 - 1363 + 1364 453 454 - 1363 + 1364 @@ -23383,17 +23510,17 @@ 1 2 - 334052 + 334421 2 3 - 291784 + 292106 3 4 - 122713 + 122848 @@ -23409,17 +23536,17 @@ 1 2 - 334052 + 334421 2 3 - 291784 + 292106 3 4 - 122713 + 122848 @@ -23435,17 +23562,17 @@ 1 2 - 334052 + 334421 2 3 - 291784 + 292106 3 4 - 122713 + 122848 @@ -23455,19 +23582,19 @@ xmlHasNs - 25937454 + 25966114 elementId - 25937454 + 25966114 nsId - 8180 + 8189 fileid - 744459 + 745281 @@ -23481,7 +23608,7 @@ 1 2 - 25937454 + 25966114 @@ -23497,7 +23624,7 @@ 1 2 - 25937454 + 25966114 @@ -23513,32 +23640,32 @@ 13 14 - 1363 + 1364 84 85 - 1363 + 1364 2426 2427 - 1363 + 1364 2733 2734 - 1363 + 1364 3704 3705 - 1363 + 1364 10063 10064 - 1363 + 1364 @@ -23554,32 +23681,32 @@ 2 3 - 1363 + 1364 20 21 - 1363 + 1364 86 87 - 1363 + 1364 164 165 - 1363 + 1364 209 210 - 1363 + 1364 453 454 - 1363 + 1364 @@ -23595,77 +23722,77 @@ 1 3 - 44994 + 45044 3 5 - 62720 + 62789 5 6 - 34086 + 34124 6 7 - 65446 + 65519 7 8 - 49085 + 49139 8 10 - 61356 + 61424 10 15 - 65446 + 65519 15 25 - 55902 + 55964 25 36 - 57266 + 57329 36 49 - 58629 + 58694 49 54 - 14998 + 15014 54 55 - 58629 + 58694 55 81 - 57266 + 57329 81 298 - 55902 + 55964 298 833 - 2726 + 2729 @@ -23681,17 +23808,17 @@ 1 2 - 335415 + 335786 2 3 - 289057 + 289376 3 4 - 119986 + 120118 @@ -23701,23 +23828,23 @@ xmlComments - 107367127 + 107485764 id - 107367127 + 107485764 text - 1694803 + 1696676 parentid - 841266 + 842195 fileid - 786727 + 787596 @@ -23731,7 +23858,7 @@ 1 2 - 107367127 + 107485764 @@ -23747,7 +23874,7 @@ 1 2 - 107367127 + 107485764 @@ -23763,7 +23890,7 @@ 1 2 - 107367127 + 107485764 @@ -23779,67 +23906,67 @@ 1 2 - 233154 + 233412 2 7 - 139074 + 139228 7 32 - 140438 + 140593 32 61 - 128166 + 128308 61 76 - 128166 + 128308 76 84 - 136347 + 136498 84 90 - 125440 + 125578 90 94 - 111805 + 111928 94 95 - 59993 + 60059 95 96 - 100897 + 101008 96 98 - 140438 + 140593 98 100 - 126803 + 126943 100 460 - 124076 + 124213 @@ -23855,67 +23982,67 @@ 1 2 - 235881 + 236142 2 6 - 134984 + 135133 6 32 - 143165 + 143323 32 61 - 129530 + 129673 61 75 - 132257 + 132403 75 84 - 148619 + 148783 84 90 - 122713 + 122848 90 94 - 119986 + 120118 94 95 - 66810 + 66884 95 96 - 103624 + 103738 96 98 - 143165 + 143323 98 100 - 134984 + 135133 100 460 - 79081 + 79169 @@ -23931,67 +24058,67 @@ 1 2 - 246789 + 247062 2 7 - 133620 + 133768 7 32 - 133620 + 133768 32 61 - 129530 + 129673 61 75 - 132257 + 132403 75 84 - 148619 + 148783 84 90 - 122713 + 122848 90 94 - 119986 + 120118 94 95 - 66810 + 66884 95 96 - 103624 + 103738 96 98 - 143165 + 143323 98 100 - 134984 + 135133 100 460 - 79081 + 79169 @@ -24007,22 +24134,22 @@ 1 2 - 669468 + 670207 2 724 - 64083 + 64154 726 830 - 77718 + 77804 831 941 - 29996 + 30029 @@ -24038,27 +24165,27 @@ 1 2 - 669468 + 670207 2 697 - 64083 + 64154 697 795 - 34086 + 34124 795 827 - 64083 + 64154 838 899 - 9544 + 9554 @@ -24074,7 +24201,7 @@ 1 2 - 841266 + 842195 @@ -24090,27 +24217,27 @@ 1 2 - 601294 + 601958 2 549 - 59993 + 60059 579 829 - 40904 + 40949 829 832 - 65446 + 65519 834 941 - 19088 + 19109 @@ -24126,27 +24253,27 @@ 1 2 - 601294 + 601958 2 536 - 59993 + 60059 560 795 - 51812 + 51869 795 812 - 59993 + 60059 819 899 - 13634 + 13649 @@ -24162,12 +24289,12 @@ 1 2 - 747186 + 748011 2 6 - 39540 + 39584 @@ -24177,31 +24304,31 @@ xmlChars - 101461901 + 101574013 id - 101461901 + 101574013 text - 77920078 + 78006178 parentid - 101461901 + 101574013 idx - 1363 + 1364 isCDATA - 2726 + 2729 fileid - 177252 + 177448 @@ -24215,7 +24342,7 @@ 1 2 - 101461901 + 101574013 @@ -24231,7 +24358,7 @@ 1 2 - 101461901 + 101574013 @@ -24247,7 +24374,7 @@ 1 2 - 101461901 + 101574013 @@ -24263,7 +24390,7 @@ 1 2 - 101461901 + 101574013 @@ -24279,7 +24406,7 @@ 1 2 - 101461901 + 101574013 @@ -24295,17 +24422,17 @@ 1 2 - 66672743 + 66746414 2 3 - 7002826 + 7010564 3 128 - 4244509 + 4249199 @@ -24321,17 +24448,17 @@ 1 2 - 66672743 + 66746414 2 3 - 7002826 + 7010564 3 128 - 4244509 + 4249199 @@ -24347,7 +24474,7 @@ 1 2 - 77920078 + 78006178 @@ -24363,7 +24490,7 @@ 1 2 - 77920078 + 78006178 @@ -24379,12 +24506,12 @@ 1 2 - 74553649 + 74636029 2 76 - 3366428 + 3370148 @@ -24400,7 +24527,7 @@ 1 2 - 101461901 + 101574013 @@ -24416,7 +24543,7 @@ 1 2 - 101461901 + 101574013 @@ -24432,7 +24559,7 @@ 1 2 - 101461901 + 101574013 @@ -24448,7 +24575,7 @@ 1 2 - 101461901 + 101574013 @@ -24464,7 +24591,7 @@ 1 2 - 101461901 + 101574013 @@ -24480,7 +24607,7 @@ 74414 74415 - 1363 + 1364 @@ -24496,7 +24623,7 @@ 57148 57149 - 1363 + 1364 @@ -24512,7 +24639,7 @@ 74414 74415 - 1363 + 1364 @@ -24528,7 +24655,7 @@ 2 3 - 1363 + 1364 @@ -24544,7 +24671,7 @@ 130 131 - 1363 + 1364 @@ -24560,12 +24687,12 @@ 518 519 - 1363 + 1364 73896 73897 - 1363 + 1364 @@ -24581,12 +24708,12 @@ 492 493 - 1363 + 1364 56656 56657 - 1363 + 1364 @@ -24602,12 +24729,12 @@ 518 519 - 1363 + 1364 73896 73897 - 1363 + 1364 @@ -24623,7 +24750,7 @@ 1 2 - 2726 + 2729 @@ -24639,12 +24766,12 @@ 98 99 - 1363 + 1364 130 131 - 1363 + 1364 @@ -24660,57 +24787,57 @@ 1 2 - 14998 + 15014 2 23 - 13634 + 13649 24 243 - 13634 + 13649 294 566 - 13634 + 13649 610 686 - 13634 + 13649 691 764 - 13634 + 13649 765 775 - 13634 + 13649 775 776 - 4090 + 4094 776 777 - 49085 + 49139 777 803 - 13634 + 13649 807 888 - 13634 + 13649 @@ -24726,67 +24853,67 @@ 1 2 - 14998 + 15014 2 21 - 13634 + 13649 22 188 - 13634 + 13649 208 492 - 13634 + 13649 525 589 - 13634 + 13649 590 638 - 13634 + 13649 639 651 - 13634 + 13649 652 656 - 12271 + 12284 656 659 - 16361 + 16379 659 663 - 14998 + 15014 663 667 - 13634 + 13649 667 701 - 13634 + 13649 702 744 - 9544 + 9554 @@ -24802,57 +24929,57 @@ 1 2 - 14998 + 15014 2 23 - 13634 + 13649 24 243 - 13634 + 13649 294 566 - 13634 + 13649 610 686 - 13634 + 13649 691 764 - 13634 + 13649 765 775 - 13634 + 13649 775 776 - 4090 + 4094 776 777 - 49085 + 49139 777 803 - 13634 + 13649 807 888 - 13634 + 13649 @@ -24868,7 +24995,7 @@ 1 2 - 177252 + 177448 @@ -24884,12 +25011,12 @@ 1 2 - 43631 + 43679 2 3 - 133620 + 133768 @@ -24899,15 +25026,15 @@ xmllocations - 447346440 + 447840746 xmlElement - 446068861 + 446561755 location - 419190606 + 419653800 @@ -24921,12 +25048,12 @@ 1 2 - 446060680 + 446553565 2 454 - 8180 + 8189 @@ -24942,12 +25069,12 @@ 1 2 - 409688523 + 410141218 2 25 - 9502082 + 9512582 @@ -25188,19 +25315,19 @@ ktComments - 133620 + 133768 id - 133620 + 133768 kind - 4090 + 4094 text - 96806 + 96913 @@ -25214,7 +25341,7 @@ 1 2 - 133620 + 133768 @@ -25230,7 +25357,7 @@ 1 2 - 133620 + 133768 @@ -25246,17 +25373,17 @@ 16 17 - 1363 + 1364 22 23 - 1363 + 1364 60 61 - 1363 + 1364 @@ -25272,17 +25399,17 @@ 1 2 - 1363 + 1364 16 17 - 1363 + 1364 54 55 - 1363 + 1364 @@ -25298,12 +25425,12 @@ 1 2 - 92716 + 92818 4 23 - 4090 + 4094 @@ -25319,7 +25446,7 @@ 1 2 - 96806 + 96913 @@ -25329,19 +25456,19 @@ ktCommentSections - 59545 + 59246 id - 59545 + 59246 comment - 54462 + 54224 content - 50556 + 50410 @@ -25355,7 +25482,7 @@ 1 2 - 59545 + 59246 @@ -25371,7 +25498,7 @@ 1 2 - 59545 + 59246 @@ -25387,12 +25514,12 @@ 1 2 - 52423 + 52208 2 18 - 2039 + 2015 @@ -25408,12 +25535,12 @@ 1 2 - 52423 + 52208 2 18 - 2039 + 2015 @@ -25429,17 +25556,17 @@ 1 2 - 44658 + 44628 2 3 - 4941 + 4836 3 63 - 956 + 945 @@ -25455,17 +25582,17 @@ 1 2 - 44768 + 44737 2 3 - 4847 + 4743 3 56 - 941 + 930 @@ -25475,11 +25602,11 @@ ktCommentSectionNames - 5082 + 5022 id - 5082 + 5022 name @@ -25497,7 +25624,7 @@ 1 2 - 5082 + 5022 @@ -25523,15 +25650,15 @@ ktCommentSectionSubjectNames - 5082 + 5022 id - 5082 + 5022 subjectname - 3325 + 3301 @@ -25545,7 +25672,7 @@ 1 2 - 5082 + 5022 @@ -25561,22 +25688,22 @@ 1 2 - 2525 + 2511 2 3 - 501 + 496 3 9 - 250 + 248 10 - 16 - 47 + 15 + 46 @@ -25586,15 +25713,15 @@ ktCommentOwners - 84753 + 84203 id - 53694 + 53480 owner - 82651 + 82173 @@ -25608,22 +25735,22 @@ 1 2 - 34400 + 34335 2 3 - 12235 + 12184 3 4 - 4580 + 4526 4 6 - 2478 + 2433 @@ -25639,70 +25766,12 @@ 1 2 - 80564 - - - 2 - 4 - 2086 - - - - - - - - - ktBreakContinueTargets - 5129 - - - id - 5129 - - - target - 3764 - - - - - id - target - - - 12 - - - 1 - 2 - 5129 - - - - - - - target - id - - - 12 - - - 1 - 2 - 2807 + 80142 2 3 - 690 - - - 3 - 7 - 266 + 2030 @@ -25712,19 +25781,19 @@ ktExtensionFunctions - 702191 + 702967 id - 702191 + 702967 typeid - 84535 + 84629 kttypeid - 1363 + 1364 @@ -25738,7 +25807,7 @@ 1 2 - 702191 + 702967 @@ -25754,7 +25823,7 @@ 1 2 - 702191 + 702967 @@ -25770,37 +25839,37 @@ 1 2 - 53175 + 53234 2 3 - 6817 + 6824 3 4 - 1363 + 1364 4 5 - 6817 + 6824 5 12 - 6817 + 6824 12 69 - 6817 + 6824 84 174 - 2726 + 2729 @@ -25816,7 +25885,7 @@ 1 2 - 84535 + 84629 @@ -25832,7 +25901,7 @@ 515 516 - 1363 + 1364 @@ -25848,7 +25917,7 @@ 62 63 - 1363 + 1364 @@ -25858,15 +25927,15 @@ ktProperties - 26996877 + 30317687 id - 26996877 + 30317687 nodeName - 10684218 + 10696024 @@ -25880,7 +25949,7 @@ 1 2 - 26996877 + 30317687 @@ -25896,22 +25965,22 @@ 1 2 - 7928628 + 7889614 2 3 - 1254400 + 1216201 3 - 10 - 804452 + 8 + 809436 - 10 - 172 - 696737 + 8 + 554 + 780771 @@ -25921,15 +25990,15 @@ ktPropertyGetters - 3722296 + 4569970 id - 3722296 + 4569970 getter - 3722296 + 4569970 @@ -25943,7 +26012,7 @@ 1 2 - 3722296 + 4569970 @@ -25959,7 +26028,7 @@ 1 2 - 3722296 + 4569970 @@ -25969,15 +26038,15 @@ ktPropertySetters - 284967 + 290741 id - 284967 + 290741 setter - 284967 + 290741 @@ -25991,7 +26060,7 @@ 1 2 - 284967 + 290741 @@ -26007,7 +26076,7 @@ 1 2 - 284967 + 290741 @@ -26017,15 +26086,15 @@ ktPropertyBackingFields - 23584090 + 23615610 id - 23584090 + 23615610 backingField - 23584090 + 23615610 @@ -26039,7 +26108,7 @@ 1 2 - 23584090 + 23615610 @@ -26055,7 +26124,7 @@ 1 2 - 23584090 + 23615610 @@ -26065,15 +26134,15 @@ ktSyntheticBody - 10301 + 10308 id - 10301 + 10308 kind - 2060 + 2061 @@ -26087,7 +26156,7 @@ 1 2 - 10301 + 10308 @@ -26103,7 +26172,7 @@ 5 6 - 2060 + 2061 @@ -26113,37 +26182,37 @@ ktLocalFunction - 2726 + 2729 id - 2726 + 2729 ktInitializerAssignment - 392681 + 393115 id - 392681 + 393115 ktPropertyDelegates - 5247 + 5698 id - 5247 + 5698 variableId - 5247 + 5698 @@ -26157,7 +26226,7 @@ 1 2 - 5247 + 5698 @@ -26173,7 +26242,7 @@ 1 2 - 5247 + 5698 @@ -26183,11 +26252,11 @@ compiler_generated - 111 + 120 id - 111 + 120 kind @@ -26205,7 +26274,7 @@ 1 2 - 111 + 120 @@ -26231,15 +26300,15 @@ ktFunctionOriginalNames - 88629 + 981424 id - 88629 + 981424 name - 70718 + 66884 @@ -26253,7 +26322,7 @@ 1 2 - 88629 + 981424 @@ -26269,17 +26338,22 @@ 1 2 - 57439 + 53234 2 3 - 10190 + 5459 3 - 8 - 3088 + 96 + 5459 + + + 96 + 380 + 2729 diff --git a/java/ql/src/definitions.qll b/java/ql/lib/definitions.qll similarity index 100% rename from java/ql/src/definitions.qll rename to java/ql/lib/definitions.qll diff --git a/java/ql/src/localDefinitions.ql b/java/ql/lib/localDefinitions.ql similarity index 100% rename from java/ql/src/localDefinitions.ql rename to java/ql/lib/localDefinitions.ql diff --git a/java/ql/src/localReferences.ql b/java/ql/lib/localReferences.ql similarity index 100% rename from java/ql/src/localReferences.ql rename to java/ql/lib/localReferences.ql diff --git a/java/ql/src/printAst.ql b/java/ql/lib/printAst.ql similarity index 100% rename from java/ql/src/printAst.ql rename to java/ql/lib/printAst.ql diff --git a/java/ql/lib/qlpack.yml b/java/ql/lib/qlpack.yml index 0eb686d7f94..541fad197e0 100644 --- a/java/ql/lib/qlpack.yml +++ b/java/ql/lib/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-all -version: 0.3.0-dev +version: 0.3.1-dev groups: java dbscheme: config/semmlecode.dbscheme extractor: java diff --git a/java/ql/lib/semmle/code/java/Element.qll b/java/ql/lib/semmle/code/java/Element.qll index 553e447fa38..96c8a8c5c21 100755 --- a/java/ql/lib/semmle/code/java/Element.qll +++ b/java/ql/lib/semmle/code/java/Element.qll @@ -44,6 +44,27 @@ class Element extends @element, Top { /** Holds if this is an auxiliary program element generated by the compiler. */ predicate isCompilerGenerated() { compiler_generated(this, _) } + + /** Gets the reason this element was generated by the compiler, if any. */ + string compilerGeneratedReason() { + exists(int i | compiler_generated(this, i) | + i = 1 and result = "Declaring classes of adapter functions in Kotlin" + or + i = 2 and result = "Generated data class member" + or + i = 3 and result = "Default property accessor" + or + i = 4 and result = "Class initialisation method " + or + i = 5 and result = "Enum class special member" + or + i = 6 and result = "Getter for a Kotlin delegated property" + or + i = 7 and result = "Setter for a Kotlin delegated property" + or + i = 8 and result = "Proxy static method for a @JvmStatic-annotated function or property" + ) + } } /** diff --git a/java/ql/lib/semmle/code/java/Modifier.qll b/java/ql/lib/semmle/code/java/Modifier.qll index d3971e42e59..8f947383d1e 100755 --- a/java/ql/lib/semmle/code/java/Modifier.qll +++ b/java/ql/lib/semmle/code/java/Modifier.qll @@ -58,6 +58,9 @@ abstract class Modifiable extends Element { /** Holds if this element has an `internal` modifier. */ predicate isInternal() { this.hasModifier("internal") } + /** Holds if this element has an `inline` modifier. */ + predicate isInline() { this.hasModifier("inline") } + /** Holds if this element has a `volatile` modifier. */ predicate isVolatile() { this.hasModifier("volatile") } diff --git a/java/ql/lib/semmle/code/java/PrintAst.qll b/java/ql/lib/semmle/code/java/PrintAst.qll index 05453baa045..9d88550faa3 100644 --- a/java/ql/lib/semmle/code/java/PrintAst.qll +++ b/java/ql/lib/semmle/code/java/PrintAst.qll @@ -534,10 +534,12 @@ final class ClassInterfaceNode extends ElementNode { or childIndex >= 0 and result.(ElementNode).getElement() = - rank[childIndex](Element e, string file, int line, int column | - e = this.getADeclaration() and locationSortKeys(e, file, line, column) + rank[childIndex](Element e, string file, int line, int column, string childStr | + e = this.getADeclaration() and + locationSortKeys(e, file, line, column) and + childStr = e.toString() | - e order by file, line, column + e order by file, line, column, childStr ) } } diff --git a/java/ql/lib/semmle/code/java/Statement.qll b/java/ql/lib/semmle/code/java/Statement.qll index 963f006aaf5..2c8cff3c217 100755 --- a/java/ql/lib/semmle/code/java/Statement.qll +++ b/java/ql/lib/semmle/code/java/Statement.qll @@ -888,27 +888,3 @@ class SuperConstructorInvocationStmt extends Stmt, ConstructorCall, @superconstr override string getAPrimaryQlClass() { result = "SuperConstructorInvocationStmt" } } - -/** A Kotlin loop statement. */ -class KtLoopStmt extends Stmt, @ktloopstmt { - KtLoopStmt() { - this instanceof WhileStmt or - this instanceof DoStmt - } -} - -/** A Kotlin `break` or `continue` statement. */ -abstract class KtBreakContinueStmt extends Stmt, @breakcontinuestmt { - KtLoopStmt loop; - - KtBreakContinueStmt() { ktBreakContinueTargets(this, loop) } - - /** Gets the target loop statement of this `break`. */ - KtLoopStmt getLoopStmt() { result = loop } -} - -/** A Kotlin `break` statement. */ -class KtBreakStmt extends BreakStmt, KtBreakContinueStmt { } - -/** A Kotlin `continue` statement. */ -class KtContinueStmt extends ContinueStmt, KtBreakContinueStmt { } diff --git a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll index db1b5a61ef6..e8c1034a83a 100644 --- a/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll +++ b/java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll @@ -84,6 +84,7 @@ private module Frameworks { private import internal.ContainerFlow private import semmle.code.java.frameworks.android.Android private import semmle.code.java.frameworks.android.ContentProviders + private import semmle.code.java.frameworks.android.ExternalStorage private import semmle.code.java.frameworks.android.Intent private import semmle.code.java.frameworks.android.Notifications private import semmle.code.java.frameworks.android.SharedPreferences @@ -646,7 +647,7 @@ module CsvValidation { or exists(string row, string kind | sourceModel(row) | kind = row.splitAt(";", 7) and - not kind = ["remote", "contentprovider", "android-widget"] and + not kind = ["remote", "contentprovider", "android-widget", "android-external-storage-dir"] and not kind.matches("qltest%") and msg = "Invalid kind \"" + kind + "\" in source model." ) diff --git a/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll b/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll index 2c44d7a15b6..fcd4fe90b6d 100644 --- a/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll +++ b/java/ql/lib/semmle/code/java/dataflow/FlowSources.qll @@ -17,6 +17,7 @@ import semmle.code.java.frameworks.android.WebView import semmle.code.java.frameworks.JaxWS import semmle.code.java.frameworks.javase.WebSocket import semmle.code.java.frameworks.android.Android +import semmle.code.java.frameworks.android.ExternalStorage import semmle.code.java.frameworks.android.OnActivityResultSource import semmle.code.java.frameworks.android.Intent import semmle.code.java.frameworks.play.Play @@ -152,6 +153,12 @@ private class ThriftIfaceParameterSource extends RemoteFlowSource { override string getSourceType() { result = "Thrift Iface parameter" } } +private class AndroidExternalStorageSource extends RemoteFlowSource { + AndroidExternalStorageSource() { androidExternalStorageSource(this) } + + override string getSourceType() { result = "Android external storage" } +} + /** Class for `tainted` user input. */ abstract class UserInput extends DataFlow::Node { } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl2.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl3.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl4.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl5.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImpl6.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForOnActivityResult.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForOnActivityResult.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForOnActivityResult.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForOnActivityResult.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForSerializability.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForSerializability.qll index 7b9e78d2c4b..a076f7a2e45 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForSerializability.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowImplForSerializability.qll @@ -428,7 +428,7 @@ private predicate localFlowStep(NodeEx node1, NodeEx node2, Configuration config exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - simpleLocalFlowStepExt(n1, n2) and + simpleLocalFlowStepExt(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) ) or @@ -447,7 +447,7 @@ private predicate additionalLocalFlowStep(NodeEx node1, NodeEx node2, Configurat exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) ) @@ -466,7 +466,7 @@ private predicate additionalLocalStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) = getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -481,7 +481,7 @@ private predicate jumpStep(NodeEx node1, NodeEx node2, Configuration config) { exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - jumpStepCached(n1, n2) and + jumpStepCached(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext ) @@ -494,7 +494,7 @@ private predicate additionalJumpStep(NodeEx node1, NodeEx node2, Configuration c exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, n2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), pragma[only_bind_into](n2)) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not config.getAFeature() instanceof FeatureEqualSourceSinkCallContext @@ -507,7 +507,7 @@ private predicate additionalJumpStateStep( exists(Node n1, Node n2 | node1.asNode() = n1 and node2.asNode() = n2 and - config.isAdditionalFlowStep(n1, s1, n2, s2) and + config.isAdditionalFlowStep(pragma[only_bind_into](n1), s1, pragma[only_bind_into](n2), s2) and getNodeEnclosingCallable(n1) != getNodeEnclosingCallable(n2) and stepFilter(node1, node2, config) and not stateBarrier(node1, s1, config) and @@ -518,7 +518,7 @@ private predicate additionalJumpStateStep( pragma[nomagic] private predicate readSet(NodeEx node1, ContentSet c, NodeEx node2, Configuration config) { - readSet(node1.asNode(), c, node2.asNode()) and + readSet(pragma[only_bind_into](node1.asNode()), c, pragma[only_bind_into](node2.asNode())) and stepFilter(node1, node2, config) or exists(Node n | @@ -562,7 +562,8 @@ pragma[nomagic] private predicate store( NodeEx node1, TypedContent tc, NodeEx node2, DataFlowType contentType, Configuration config ) { - store(node1.asNode(), tc, node2.asNode(), contentType) and + store(pragma[only_bind_into](node1.asNode()), tc, pragma[only_bind_into](node2.asNode()), + contentType) and read(_, tc.getContent(), _, config) and stepFilter(node1, node2, config) } diff --git a/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll b/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll new file mode 100644 index 00000000000..1e6919c023b --- /dev/null +++ b/java/ql/lib/semmle/code/java/frameworks/android/ExternalStorage.qll @@ -0,0 +1,50 @@ +/** Provides definitions for working with uses of Android external storage */ + +import java +private import semmle.code.java.security.FileReadWrite +private import semmle.code.java.dataflow.DataFlow +private import semmle.code.java.dataflow.ExternalFlow + +private class ExternalStorageDirSourceModel extends SourceModelCsv { + override predicate row(string row) { + row = + [ + //"package;type;overrides;name;signature;ext;spec;kind" + "android.content;Context;true;getExternalFilesDir;(String);;ReturnValue;android-external-storage-dir;manual", + "android.content;Context;true;getExternalFilesDirs;(String);;ReturnValue;android-external-storage-dir;manual", + "android.content;Context;true;getExternalCacheDir;();;ReturnValue;android-external-storage-dir;manual", + "android.content;Context;true;getExternalCacheDirs;();;ReturnValue;android-external-storage-dir;manual", + "android.os;Environment;false;getExternalStorageDirectory;();;ReturnValue;android-external-storage-dir;manual", + "android.os;Environment;false;getExternalStoragePublicDirectory;(String);;ReturnValue;android-external-storage-dir;manual", + ] + } +} + +private predicate externalStorageFlowStep(DataFlow::Node node1, DataFlow::Node node2) { + DataFlow::localFlowStep(node1, node2) + or + exists(ConstructorCall c | c.getConstructedType() instanceof TypeFile | + node1.asExpr() = c.getArgument(0) and + node2.asExpr() = c + ) + or + node2.asExpr().(ArrayAccess).getArray() = node1.asExpr() + or + node2.asExpr().(FieldRead).getField().getInitializer() = node1.asExpr() +} + +private predicate externalStorageFlow(DataFlow::Node node1, DataFlow::Node node2) { + externalStorageFlowStep*(node1, node2) +} + +/** + * Holds if `n` is a node that reads the contents of an external file in Android. + * This is controllable by third-party applications, so is treated as a remote flow source. + */ +predicate androidExternalStorageSource(DataFlow::Node n) { + exists(DataFlow::Node externalDir, DirectFileReadExpr read | + sourceNode(externalDir, "android-external-storage-dir") and + n.asExpr() = read and + externalStorageFlow(externalDir, DataFlow::exprNode(read.getFileExpr())) + ) +} diff --git a/java/ql/lib/semmle/code/java/security/FileReadWrite.qll b/java/ql/lib/semmle/code/java/security/FileReadWrite.qll index e79f98bdca4..84be71d6a04 100644 --- a/java/ql/lib/semmle/code/java/security/FileReadWrite.qll +++ b/java/ql/lib/semmle/code/java/security/FileReadWrite.qll @@ -1,9 +1,9 @@ import java /** - * Holds if `fileAccess` is used in the `fileReadingExpr` to read the represented file. + * Holds if `fileAccess` is directly used in the `fileReadingExpr` to read the represented file. */ -private predicate fileRead(VarAccess fileAccess, Expr fileReadingExpr) { +private predicate directFileRead(Expr fileAccess, Expr fileReadingExpr) { // `fileAccess` used to construct a class that reads a file. exists(ClassInstanceExpr cie | cie = fileReadingExpr and @@ -28,6 +28,13 @@ private predicate fileRead(VarAccess fileAccess, Expr fileReadingExpr) { ]) ) ) +} + +/** + * Holds if `fileAccess` is used in the `fileReadingExpr` to read the represented file. + */ +private predicate fileRead(VarAccess fileAccess, Expr fileReadingExpr) { + directFileRead(fileAccess, fileReadingExpr) or // The `fileAccess` is used in a call which directly or indirectly accesses the file. exists(Call call, int parameterPos, VarAccess nestedFileAccess, Expr nestedFileReadingExpr | @@ -49,3 +56,15 @@ class FileReadExpr extends Expr { */ VarAccess getFileVarAccess() { fileRead(result, this) } } + +/** + * An expression that directly reads from a file and returns its contents. + */ +class DirectFileReadExpr extends Expr { + DirectFileReadExpr() { directFileRead(_, this) } + + /** + * Gets the `Expr` representing the file that is read. + */ + Expr getFileExpr() { directFileRead(result, this) } +} diff --git a/java/ql/lib/semmle/code/java/security/ImproperIntentVerificationQuery.qll b/java/ql/lib/semmle/code/java/security/ImproperIntentVerificationQuery.qll new file mode 100644 index 00000000000..00a6dae69e9 --- /dev/null +++ b/java/ql/lib/semmle/code/java/security/ImproperIntentVerificationQuery.qll @@ -0,0 +1,79 @@ +/** Definitions for the improper intent verification query. */ + +import java +import semmle.code.java.dataflow.DataFlow +import semmle.code.xml.AndroidManifest +import semmle.code.java.frameworks.android.Intent + +/** An `onReceive` method of a `BroadcastReceiver` */ +private class OnReceiveMethod extends Method { + OnReceiveMethod() { this.getASourceOverriddenMethod*() instanceof AndroidReceiveIntentMethod } + + /** Gets the parameter of this method that holds the received `Intent`. */ + Parameter getIntentParameter() { result = this.getParameter(1) } +} + +/** A configuration to detect whether the `action` of an `Intent` is checked. */ +private class VerifiedIntentConfig extends DataFlow::Configuration { + VerifiedIntentConfig() { this = "VerifiedIntentConfig" } + + override predicate isSource(DataFlow::Node src) { + src.asParameter() = any(OnReceiveMethod orm).getIntentParameter() + } + + override predicate isSink(DataFlow::Node sink) { + exists(MethodAccess ma | + ma.getMethod().hasQualifiedName("android.content", "Intent", "getAction") and + sink.asExpr() = ma.getQualifier() + ) + } +} + +/** An `onReceive` method that doesn't verify the action of the intent it receives. */ +private class UnverifiedOnReceiveMethod extends OnReceiveMethod { + UnverifiedOnReceiveMethod() { + not any(VerifiedIntentConfig c).hasFlow(DataFlow::parameterNode(this.getIntentParameter()), _) + } +} + +/** Gets the name of an intent action that can only be sent by the system. */ +string getASystemActionName() { + result = + [ + "AIRPLANE_MODE", "AIRPLANE_MODE_CHANGED", "APPLICATION_LOCALE_CHANGED", + "APPLICATION_RESTRICTIONS_CHANGED", "BATTERY_CHANGED", "BATTERY_LOW", "BATTERY_OKAY", + "BOOT_COMPLETED", "CONFIGURATION_CHANGED", "DEVICE_STORAGE_LOW", "DEVICE_STORAGE_OK", + "DREAMING_STARTED", "DREAMING_STOPPED", "EXTERNAL_APPLICATIONS_AVAILABLE", + "EXTERNAL_APPLICATIONS_UNAVAILABLE", "LOCALE_CHANGED", "LOCKED_BOOT_COMPLETED", + "MY_PACKAGE_REPLACED", "MY_PACKAGE_SUSPENDED", "MY_PACKAGE_UNSUSPENDED", "NEW_OUTGOING_CALL", + "PACKAGES_SUSPENDED", "PACKAGES_UNSUSPENDED", "PACKAGE_ADDED", "PACKAGE_CHANGED", + "PACKAGE_DATA_CLEARED", "PACKAGE_FIRST_LAUNCH", "PACKAGE_FULLY_REMOVED", "PACKAGE_INSTALL", + "PACKAGE_NEEDS_VERIFICATION", "PACKAGE_REMOVED", "PACKAGE_REPLACED", "PACKAGE_RESTARTED", + "PACKAGE_VERIFIED", "POWER_CONNECTED", "POWER_DISCONNECTED", "REBOOT", "SCREEN_OFF", + "SCREEN_ON", "SHUTDOWN", "TIMEZONE_CHANGED", "TIME_TICK", "UID_REMOVED", "USER_PRESENT" + ] +} + +/** An expression or XML attribute that contains the name of a system intent action. */ +class SystemActionName extends AndroidActionXmlElement { + string name; + + SystemActionName() { + name = getASystemActionName() and + this.getActionName() = "android.intent.action." + name + } + + /** Gets the name of the system intent that this expression or attribute represents. */ + string getSystemActionName() { result = name } +} + +/** Holds if the XML element `rec` declares a receiver `orm` to receive the system action named `sa` that doesn't verify intents it receives. */ +predicate unverifiedSystemReceiver( + AndroidReceiverXmlElement rec, UnverifiedOnReceiveMethod orm, SystemActionName sa +) { + exists(Class ormty | + ormty = orm.getDeclaringType() and + rec.getComponentName() = ["." + ormty.getName(), ormty.getQualifiedName()] and + rec.getAnIntentFilterElement().getAnActionElement() = sa + ) +} diff --git a/java/ql/lib/semmle/code/java/security/SecurityFlag.qll b/java/ql/lib/semmle/code/java/security/SecurityFlag.qll index 27ac3dfc3b2..fd1c4adbdd2 100644 --- a/java/ql/lib/semmle/code/java/security/SecurityFlag.qll +++ b/java/ql/lib/semmle/code/java/security/SecurityFlag.qll @@ -20,21 +20,34 @@ abstract class FlagKind extends string { bindingset[result] abstract string getAFlagName(); + private predicate flagFlowStepTC(DataFlow::Node node1, DataFlow::Node node2) { + node2 = node1 and + isFlagWithName(node1) + or + exists(DataFlow::Node nodeMid | + flagFlowStep(nodeMid, node2) and + flagFlowStepTC(node1, nodeMid) + ) + } + + private predicate isFlagWithName(DataFlow::Node flag) { + exists(VarAccess v | v.getVariable().getName() = getAFlagName() | + flag.asExpr() = v and v.getType() instanceof FlagType + ) + or + exists(StringLiteral s | s.getValue() = getAFlagName() | flag.asExpr() = s) + or + exists(MethodAccess ma | ma.getMethod().getName() = getAFlagName() | + flag.asExpr() = ma and + ma.getType() instanceof FlagType + ) + } + /** Gets a node representing a (likely) security flag. */ DataFlow::Node getAFlag() { exists(DataFlow::Node flag | - exists(VarAccess v | v.getVariable().getName() = getAFlagName() | - flag.asExpr() = v and v.getType() instanceof FlagType - ) - or - exists(StringLiteral s | s.getValue() = getAFlagName() | flag.asExpr() = s) - or - exists(MethodAccess ma | ma.getMethod().getName() = getAFlagName() | - flag.asExpr() = ma and - ma.getType() instanceof FlagType - ) - | - flagFlowStep*(flag, result) + isFlagWithName(flag) and + flagFlowStepTC(flag, result) ) } } diff --git a/java/ql/lib/upgrades/57c55f404a5954f0e738febf590ad5d49dd67b08/old.dbscheme b/java/ql/lib/upgrades/57c55f404a5954f0e738febf590ad5d49dd67b08/old.dbscheme new file mode 100644 index 00000000000..57c55f404a5 --- /dev/null +++ b/java/ql/lib/upgrades/57c55f404a5954f0e738febf590ad5d49dd67b08/old.dbscheme @@ -0,0 +1,1223 @@ +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * javac A.java B.java C.java + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * javac A.java B.java C.java + */ + unique int id : @compilation, + int kind: int ref, + string cwd : string ref, + string name : string ref +); + +case @compilation.kind of + 1 = @javacompilation +| 2 = @kotlincompilation +; + +compilation_started( + int id : @compilation ref +) + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * javac A.java B.java C.java + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--javac-args` + * 2 | A.java + * 3 | B.java + * 4 | C.java + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * javac A.java B.java C.java + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | A.java + * 1 | B.java + * 2 | C.java + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * For each file recorded in `compilation_compiling_files`, + * there will be a corresponding row in + * `compilation_compiling_files_completed` once extraction + * of that file is complete. The `result` will indicate the + * extraction result: + * + * 0: Successfully extracted + * 1: Errors were encountered, but extraction recovered + * 2: Errors were encountered, and extraction could not recover + */ +#keyset[id, num] +compilation_compiling_files_completed( + int id : @compilation ref, + int num : int ref, + int result : int ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + unique int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * The `cpu_seconds` and `elapsed_seconds` are the CPU time and elapsed + * time (respectively) that the original compilation (not the extraction) + * took for compiler invocation `id`. + */ +compilation_compiler_times( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + * The `result` will indicate the extraction result: + * + * 0: Successfully extracted + * 1: Errors were encountered, but extraction recovered + * 2: Errors were encountered, and extraction could not recover + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref, + int result : int ref +); + +diagnostics( + unique int id: @diagnostic, + string generated_by: string ref, // TODO: Sync this with the other languages? + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/* + * External artifacts + */ + +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +snapshotDate( + unique date snapshotDate : date ref +); + +sourceLocationPrefix( + string prefix : string ref +); + +/* + * Duplicate code + */ + +duplicateCode( + unique int id : @duplication, + string relativePath : string ref, + int equivClass : int ref +); + +similarCode( + unique int id : @similarity, + string relativePath : string ref, + int equivClass : int ref +); + +@duplication_or_similarity = @duplication | @similarity + +tokens( + int id : @duplication_or_similarity ref, + int offset : int ref, + int beginLine : int ref, + int beginColumn : int ref, + int endLine : int ref, + int endColumn : int ref +); + +/* + * SMAP + */ + +smap_header( + int outputFileId: @file ref, + string outputFilename: string ref, + string defaultStratum: string ref +); + +smap_files( + int outputFileId: @file ref, + string stratum: string ref, + int inputFileNum: int ref, + string inputFileName: string ref, + int inputFileId: @file ref +); + +smap_lines( + int outputFileId: @file ref, + string stratum: string ref, + int inputFileNum: int ref, + int inputStartLine: int ref, + int inputLineCount: int ref, + int outputStartLine: int ref, + int outputLineIncrement: int ref +); + +/* + * Locations and files + */ + +@location = @location_default ; + +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +hasLocation( + int locatableid: @locatable ref, + int id: @location ref +); + +@sourceline = @locatable ; + +#keyset[element_id] +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/* + * Java + */ + +cupackage( + unique int id: @file ref, + int packageid: @package ref +); + +#keyset[fileid,keyName] +jarManifestMain( + int fileid: @file ref, + string keyName: string ref, + string value: string ref +); + +#keyset[fileid,entryName,keyName] +jarManifestEntries( + int fileid: @file ref, + string entryName: string ref, + string keyName: string ref, + string value: string ref +); + +packages( + unique int id: @package, + string nodeName: string ref +); + +primitives( + unique int id: @primitive, + string nodeName: string ref +); + +modifiers( + unique int id: @modifier, + string nodeName: string ref +); + +classes( + unique int id: @class, + string nodeName: string ref, + int parentid: @package ref, + int sourceid: @class ref +); + +file_class( + int id: @class ref +); + +class_object( + unique int id: @class ref, + unique int instance: @field ref +); + +type_companion_object( + unique int id: @classorinterface ref, + unique int instance: @field ref, + unique int companion_object: @class ref +); + +kt_nullable_types( + unique int id: @kt_nullable_type, + int classid: @reftype ref +) + +kt_notnull_types( + unique int id: @kt_notnull_type, + int classid: @reftype ref +) + +kt_type_alias( + unique int id: @kt_type_alias, + string name: string ref, + int kttypeid: @kt_type ref +) + +@kt_type = @kt_nullable_type | @kt_notnull_type + +isRecord( + unique int id: @class ref +); + +interfaces( + unique int id: @interface, + string nodeName: string ref, + int parentid: @package ref, + int sourceid: @interface ref +); + +fielddecls( + unique int id: @fielddecl, + int parentid: @reftype ref +); + +#keyset[fieldId] #keyset[fieldDeclId,pos] +fieldDeclaredIn( + int fieldId: @field ref, + int fieldDeclId: @fielddecl ref, + int pos: int ref +); + +fields( + unique int id: @field, + string nodeName: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @field ref +); + +fieldsKotlinType( + unique int id: @field ref, + int kttypeid: @kt_type ref +); + +constrs( + unique int id: @constructor, + string nodeName: string ref, + string signature: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @constructor ref +); + +constrsKotlinType( + unique int id: @constructor ref, + int kttypeid: @kt_type ref +); + +methods( + unique int id: @method, + string nodeName: string ref, + string signature: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @method ref +); + +methodsKotlinType( + unique int id: @method ref, + int kttypeid: @kt_type ref +); + +#keyset[parentid,pos] +params( + unique int id: @param, + int typeid: @type ref, + int pos: int ref, + int parentid: @callable ref, + int sourceid: @param ref +); + +paramsKotlinType( + unique int id: @param ref, + int kttypeid: @kt_type ref +); + +paramName( + unique int id: @param ref, + string nodeName: string ref +); + +isVarargsParam( + int param: @param ref +); + +exceptions( + unique int id: @exception, + int typeid: @type ref, + int parentid: @callable ref +); + +isAnnotType( + int interfaceid: @interface ref +); + +isAnnotElem( + int methodid: @method ref +); + +annotValue( + int parentid: @annotation ref, + int id2: @method ref, + unique int value: @expr ref +); + +isEnumType( + int classid: @class ref +); + +isEnumConst( + int fieldid: @field ref +); + +#keyset[parentid,pos] +typeVars( + unique int id: @typevariable, + string nodeName: string ref, + int pos: int ref, + int kind: int ref, // deprecated + int parentid: @classorinterfaceorcallable ref +); + +wildcards( + unique int id: @wildcard, + string nodeName: string ref, + int kind: int ref +); + +#keyset[parentid,pos] +typeBounds( + unique int id: @typebound, + int typeid: @reftype ref, + int pos: int ref, + int parentid: @boundedtype ref +); + +#keyset[parentid,pos] +typeArgs( + int argumentid: @reftype ref, + int pos: int ref, + int parentid: @classorinterfaceorcallable ref +); + +isParameterized( + int memberid: @member ref +); + +isRaw( + int memberid: @member ref +); + +erasure( + unique int memberid: @member ref, + int erasureid: @member ref +); + +#keyset[classid] #keyset[parent] +isAnonymClass( + int classid: @class ref, + int parent: @classinstancexpr ref +); + +#keyset[typeid] #keyset[parent] +isLocalClassOrInterface( + int typeid: @classorinterface ref, + int parent: @localtypedeclstmt ref +); + +isDefConstr( + int constructorid: @constructor ref +); + +#keyset[exprId] +lambdaKind( + int exprId: @lambdaexpr ref, + int bodyKind: int ref +); + +arrays( + unique int id: @array, + string nodeName: string ref, + int elementtypeid: @type ref, + int dimension: int ref, + int componenttypeid: @type ref +); + +enclInReftype( + unique int child: @reftype ref, + int parent: @reftype ref +); + +extendsReftype( + int id1: @reftype ref, + int id2: @classorinterface ref +); + +implInterface( + int id1: @classorarray ref, + int id2: @interface ref +); + +permits( + int id1: @classorinterface ref, + int id2: @classorinterface ref +); + +hasModifier( + int id1: @modifiable ref, + int id2: @modifier ref +); + +imports( + unique int id: @import, + int holder: @classorinterfaceorpackage ref, + string name: string ref, + int kind: int ref +); + +#keyset[parent,idx] +stmts( + unique int id: @stmt, + int kind: int ref, + int parent: @stmtparent ref, + int idx: int ref, + int bodydecl: @callable ref +); + +@stmtparent = @callable | @stmt | @switchexpr | @whenexpr| @stmtexpr; + +case @stmt.kind of + 0 = @block +| 1 = @ifstmt +| 2 = @forstmt +| 3 = @enhancedforstmt +| 4 = @whilestmt +| 5 = @dostmt +| 6 = @trystmt +| 7 = @switchstmt +| 8 = @synchronizedstmt +| 9 = @returnstmt +| 10 = @throwstmt +| 11 = @breakstmt +| 12 = @continuestmt +| 13 = @emptystmt +| 14 = @exprstmt +| 15 = @labeledstmt +| 16 = @assertstmt +| 17 = @localvariabledeclstmt +| 18 = @localtypedeclstmt +| 19 = @constructorinvocationstmt +| 20 = @superconstructorinvocationstmt +| 21 = @case +| 22 = @catchclause +| 23 = @yieldstmt +| 24 = @errorstmt +| 25 = @whenbranch +; + +#keyset[parent,idx] +exprs( + unique int id: @expr, + int kind: int ref, + int typeid: @type ref, + int parent: @exprparent ref, + int idx: int ref +); + +exprsKotlinType( + unique int id: @expr ref, + int kttypeid: @kt_type ref +); + +callableEnclosingExpr( + unique int id: @expr ref, + int callable_id: @callable ref +); + +statementEnclosingExpr( + unique int id: @expr ref, + int statement_id: @stmt ref +); + +isParenthesized( + unique int id: @expr ref, + int parentheses: int ref +); + +case @expr.kind of + 1 = @arrayaccess +| 2 = @arraycreationexpr +| 3 = @arrayinit +| 4 = @assignexpr +| 5 = @assignaddexpr +| 6 = @assignsubexpr +| 7 = @assignmulexpr +| 8 = @assigndivexpr +| 9 = @assignremexpr +| 10 = @assignandexpr +| 11 = @assignorexpr +| 12 = @assignxorexpr +| 13 = @assignlshiftexpr +| 14 = @assignrshiftexpr +| 15 = @assignurshiftexpr +| 16 = @booleanliteral +| 17 = @integerliteral +| 18 = @longliteral +| 19 = @floatingpointliteral +| 20 = @doubleliteral +| 21 = @characterliteral +| 22 = @stringliteral +| 23 = @nullliteral +| 24 = @mulexpr +| 25 = @divexpr +| 26 = @remexpr +| 27 = @addexpr +| 28 = @subexpr +| 29 = @lshiftexpr +| 30 = @rshiftexpr +| 31 = @urshiftexpr +| 32 = @andbitexpr +| 33 = @orbitexpr +| 34 = @xorbitexpr +| 35 = @andlogicalexpr +| 36 = @orlogicalexpr +| 37 = @ltexpr +| 38 = @gtexpr +| 39 = @leexpr +| 40 = @geexpr +| 41 = @eqexpr +| 42 = @neexpr +| 43 = @postincexpr +| 44 = @postdecexpr +| 45 = @preincexpr +| 46 = @predecexpr +| 47 = @minusexpr +| 48 = @plusexpr +| 49 = @bitnotexpr +| 50 = @lognotexpr +| 51 = @castexpr +| 52 = @newexpr +| 53 = @conditionalexpr +| 54 = @parexpr // deprecated +| 55 = @instanceofexpr +| 56 = @localvariabledeclexpr +| 57 = @typeliteral +| 58 = @thisaccess +| 59 = @superaccess +| 60 = @varaccess +| 61 = @methodaccess +| 62 = @unannotatedtypeaccess +| 63 = @arraytypeaccess +| 64 = @packageaccess +| 65 = @wildcardtypeaccess +| 66 = @declannotation +| 67 = @uniontypeaccess +| 68 = @lambdaexpr +| 69 = @memberref +| 70 = @annotatedtypeaccess +| 71 = @typeannotation +| 72 = @intersectiontypeaccess +| 73 = @switchexpr +| 74 = @errorexpr +| 75 = @whenexpr +| 76 = @getclassexpr +| 77 = @safecastexpr +| 78 = @implicitcastexpr +| 79 = @implicitnotnullexpr +| 80 = @implicitcoerciontounitexpr +| 81 = @notinstanceofexpr +| 82 = @stmtexpr +| 83 = @stringtemplateexpr +| 84 = @notnullexpr +| 85 = @unsafecoerceexpr +| 86 = @valueeqexpr +| 87 = @valueneexpr +| 88 = @propertyref +; + +/** Holds if this `when` expression was written as an `if` expression. */ +when_if(unique int id: @whenexpr ref); + +/** Holds if this `when` branch was written as an `else` branch. */ +when_branch_else(unique int id: @whenbranch ref); + +@classinstancexpr = @newexpr | @lambdaexpr | @memberref | @propertyref + +@annotation = @declannotation | @typeannotation +@typeaccess = @unannotatedtypeaccess | @annotatedtypeaccess + +@assignment = @assignexpr + | @assignop; + +@unaryassignment = @postincexpr + | @postdecexpr + | @preincexpr + | @predecexpr; + +@assignop = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + | @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + | @assignurshiftexpr; + +@literal = @booleanliteral + | @integerliteral + | @longliteral + | @floatingpointliteral + | @doubleliteral + | @characterliteral + | @stringliteral + | @nullliteral; + +@binaryexpr = @mulexpr + | @divexpr + | @remexpr + | @addexpr + | @subexpr + | @lshiftexpr + | @rshiftexpr + | @urshiftexpr + | @andbitexpr + | @orbitexpr + | @xorbitexpr + | @andlogicalexpr + | @orlogicalexpr + | @ltexpr + | @gtexpr + | @leexpr + | @geexpr + | @eqexpr + | @neexpr + | @valueeqexpr + | @valueneexpr; + +@unaryexpr = @postincexpr + | @postdecexpr + | @preincexpr + | @predecexpr + | @minusexpr + | @plusexpr + | @bitnotexpr + | @lognotexpr + | @notnullexpr; + +@caller = @classinstancexpr + | @methodaccess + | @constructorinvocationstmt + | @superconstructorinvocationstmt; + +callableBinding( + unique int callerid: @caller ref, + int callee: @callable ref +); + +memberRefBinding( + unique int id: @expr ref, + int callable: @callable ref +); + +propertyRefGetBinding( + unique int id: @expr ref, + int getter: @callable ref +); + +propertyRefFieldBinding( + unique int id: @expr ref, + int field: @field ref +); + +propertyRefSetBinding( + unique int id: @expr ref, + int setter: @callable ref +); + +@exprparent = @stmt | @expr | @whenbranch | @callable | @field | @fielddecl | @class | @interface | @param | @localvar | @typevariable; + +variableBinding( + unique int expr: @varaccess ref, + int variable: @variable ref +); + +@variable = @localscopevariable | @field; + +@localscopevariable = @localvar | @param; + +localvars( + unique int id: @localvar, + string nodeName: string ref, + int typeid: @type ref, + int parentid: @localvariabledeclexpr ref +); + +localvarsKotlinType( + unique int id: @localvar ref, + int kttypeid: @kt_type ref +); + +@namedexprorstmt = @breakstmt + | @continuestmt + | @labeledstmt + | @literal; + +namestrings( + string name: string ref, + string value: string ref, + unique int parent: @namedexprorstmt ref +); + +/* + * Modules + */ + +#keyset[name] +modules( + unique int id: @module, + string name: string ref +); + +isOpen( + int id: @module ref +); + +#keyset[fileId] +cumodule( + int fileId: @file ref, + int moduleId: @module ref +); + +@directive = @requires + | @exports + | @opens + | @uses + | @provides + +#keyset[directive] +directives( + int id: @module ref, + int directive: @directive ref +); + +requires( + unique int id: @requires, + int target: @module ref +); + +isTransitive( + int id: @requires ref +); + +isStatic( + int id: @requires ref +); + +exports( + unique int id: @exports, + int target: @package ref +); + +exportsTo( + int id: @exports ref, + int target: @module ref +); + +opens( + unique int id: @opens, + int target: @package ref +); + +opensTo( + int id: @opens ref, + int target: @module ref +); + +uses( + unique int id: @uses, + string serviceInterface: string ref +); + +provides( + unique int id: @provides, + string serviceInterface: string ref +); + +providesWith( + int id: @provides ref, + string serviceImpl: string ref +); + +/* + * Javadoc + */ + +javadoc( + unique int id: @javadoc +); + +isNormalComment( + int commentid : @javadoc ref +); + +isEolComment( + int commentid : @javadoc ref +); + +hasJavadoc( + int documentableid: @member ref, + int javadocid: @javadoc ref +); + +#keyset[parentid,idx] +javadocTag( + unique int id: @javadocTag, + string name: string ref, + int parentid: @javadocParent ref, + int idx: int ref +); + +#keyset[parentid,idx] +javadocText( + unique int id: @javadocText, + string text: string ref, + int parentid: @javadocParent ref, + int idx: int ref +); + +@javadocParent = @javadoc | @javadocTag; +@javadocElement = @javadocTag | @javadocText; + +@classorinterface = @interface | @class; +@classorinterfaceorpackage = @classorinterface | @package; +@classorinterfaceorcallable = @classorinterface | @callable; +@boundedtype = @typevariable | @wildcard; +@reftype = @classorinterface | @array | @boundedtype; +@classorarray = @class | @array; +@type = @primitive | @reftype; +@callable = @method | @constructor; + +/** A program element that has a name. */ +@element = @package | @modifier | @annotation | + @locatableElement; + +@locatableElement = @file | @primitive | @class | @interface | @method | @constructor | @param | @exception | @field | + @boundedtype | @array | @localvar | @expr | @stmt | @import | @fielddecl | @kt_type | @kt_type_alias | + @kt_property; + +@modifiable = @member_modifiable| @param | @localvar ; + +@member_modifiable = @class | @interface | @method | @constructor | @field | @kt_property; + +@member = @method | @constructor | @field | @reftype ; + +/** A program element that has a location. */ +@locatable = @typebound | @javadoc | @javadocTag | @javadocText | @xmllocatable | @ktcomment | + @locatableElement; + +@top = @element | @locatable | @folder; + +/* + * XML Files + */ + +xmlEncoding( + unique int id: @file ref, + string encoding: string ref +); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters | @xmlelement | @xmlcomment | @xmlattribute | @xmldtd | @file | @xmlnamespace; + +/* + * configuration files with key value pairs + */ + +configs( + unique int id: @config +); + +configNames( + unique int id: @configName, + int config: @config ref, + string name: string ref +); + +configValues( + unique int id: @configValue, + int config: @config ref, + string value: string ref +); + +configLocations( + int locatable: @configLocatable ref, + int location: @location_default ref +); + +@configLocatable = @config | @configName | @configValue; + +ktComments( + unique int id: @ktcomment, + int kind: int ref, + string text : string ref +) + +ktCommentSections( + unique int id: @ktcommentsection, + int comment: @ktcomment ref, + string content : string ref +) + +ktCommentSectionNames( + unique int id: @ktcommentsection ref, + string name : string ref +) + +ktCommentSectionSubjectNames( + unique int id: @ktcommentsection ref, + string subjectname : string ref +) + +#keyset[id, owner] +ktCommentOwners( + int id: @ktcomment ref, + int owner: @top ref +) + +ktExtensionFunctions( + unique int id: @method ref, + int typeid: @type ref, + int kttypeid: @kt_type ref +) + +ktProperties( + unique int id: @kt_property, + string nodeName: string ref +) + +ktPropertyGetters( + unique int id: @kt_property ref, + int getter: @method ref +) + +ktPropertySetters( + unique int id: @kt_property ref, + int setter: @method ref +) + +ktPropertyBackingFields( + unique int id: @kt_property ref, + int backingField: @field ref +) + +ktSyntheticBody( + unique int id: @callable ref, + int kind: int ref + // 1: ENUM_VALUES + // 2: ENUM_VALUEOF +) + +ktLocalFunction( + unique int id: @method ref +) + +ktInitializerAssignment( + unique int id: @assignexpr ref +) + +ktPropertyDelegates( + unique int id: @kt_property ref, + unique int variableId: @variable ref +) + +compiler_generated( + unique int id: @element ref, + int kind: int ref + // 1: Declaring classes of adapter functions in Kotlin +) + +ktFunctionOriginalNames( + unique int id: @method ref, + string name: string ref +) diff --git a/java/ql/lib/upgrades/57c55f404a5954f0e738febf590ad5d49dd67b08/semmlecode.dbscheme b/java/ql/lib/upgrades/57c55f404a5954f0e738febf590ad5d49dd67b08/semmlecode.dbscheme new file mode 100755 index 00000000000..cf58c7d9b1f --- /dev/null +++ b/java/ql/lib/upgrades/57c55f404a5954f0e738febf590ad5d49dd67b08/semmlecode.dbscheme @@ -0,0 +1,1228 @@ +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * javac A.java B.java C.java + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * javac A.java B.java C.java + */ + unique int id : @compilation, + int kind: int ref, + string cwd : string ref, + string name : string ref +); + +case @compilation.kind of + 1 = @javacompilation +| 2 = @kotlincompilation +; + +compilation_started( + int id : @compilation ref +) + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * javac A.java B.java C.java + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--javac-args` + * 2 | A.java + * 3 | B.java + * 4 | C.java + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * javac A.java B.java C.java + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | A.java + * 1 | B.java + * 2 | C.java + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * For each file recorded in `compilation_compiling_files`, + * there will be a corresponding row in + * `compilation_compiling_files_completed` once extraction + * of that file is complete. The `result` will indicate the + * extraction result: + * + * 0: Successfully extracted + * 1: Errors were encountered, but extraction recovered + * 2: Errors were encountered, and extraction could not recover + */ +#keyset[id, num] +compilation_compiling_files_completed( + int id : @compilation ref, + int num : int ref, + int result : int ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + unique int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * The `cpu_seconds` and `elapsed_seconds` are the CPU time and elapsed + * time (respectively) that the original compilation (not the extraction) + * took for compiler invocation `id`. + */ +compilation_compiler_times( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + * The `result` will indicate the extraction result: + * + * 0: Successfully extracted + * 1: Errors were encountered, but extraction recovered + * 2: Errors were encountered, and extraction could not recover + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref, + int result : int ref +); + +diagnostics( + unique int id: @diagnostic, + string generated_by: string ref, // TODO: Sync this with the other languages? + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/* + * External artifacts + */ + +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +snapshotDate( + unique date snapshotDate : date ref +); + +sourceLocationPrefix( + string prefix : string ref +); + +/* + * Duplicate code + */ + +duplicateCode( + unique int id : @duplication, + string relativePath : string ref, + int equivClass : int ref +); + +similarCode( + unique int id : @similarity, + string relativePath : string ref, + int equivClass : int ref +); + +@duplication_or_similarity = @duplication | @similarity + +tokens( + int id : @duplication_or_similarity ref, + int offset : int ref, + int beginLine : int ref, + int beginColumn : int ref, + int endLine : int ref, + int endColumn : int ref +); + +/* + * SMAP + */ + +smap_header( + int outputFileId: @file ref, + string outputFilename: string ref, + string defaultStratum: string ref +); + +smap_files( + int outputFileId: @file ref, + string stratum: string ref, + int inputFileNum: int ref, + string inputFileName: string ref, + int inputFileId: @file ref +); + +smap_lines( + int outputFileId: @file ref, + string stratum: string ref, + int inputFileNum: int ref, + int inputStartLine: int ref, + int inputLineCount: int ref, + int outputStartLine: int ref, + int outputLineIncrement: int ref +); + +/* + * Locations and files + */ + +@location = @location_default ; + +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +hasLocation( + int locatableid: @locatable ref, + int id: @location ref +); + +@sourceline = @locatable ; + +#keyset[element_id] +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/* + * Java + */ + +cupackage( + unique int id: @file ref, + int packageid: @package ref +); + +#keyset[fileid,keyName] +jarManifestMain( + int fileid: @file ref, + string keyName: string ref, + string value: string ref +); + +#keyset[fileid,entryName,keyName] +jarManifestEntries( + int fileid: @file ref, + string entryName: string ref, + string keyName: string ref, + string value: string ref +); + +packages( + unique int id: @package, + string nodeName: string ref +); + +primitives( + unique int id: @primitive, + string nodeName: string ref +); + +modifiers( + unique int id: @modifier, + string nodeName: string ref +); + +classes( + unique int id: @class, + string nodeName: string ref, + int parentid: @package ref, + int sourceid: @class ref +); + +file_class( + int id: @class ref +); + +class_object( + unique int id: @class ref, + unique int instance: @field ref +); + +type_companion_object( + unique int id: @classorinterface ref, + unique int instance: @field ref, + unique int companion_object: @class ref +); + +kt_nullable_types( + unique int id: @kt_nullable_type, + int classid: @reftype ref +) + +kt_notnull_types( + unique int id: @kt_notnull_type, + int classid: @reftype ref +) + +kt_type_alias( + unique int id: @kt_type_alias, + string name: string ref, + int kttypeid: @kt_type ref +) + +@kt_type = @kt_nullable_type | @kt_notnull_type + +isRecord( + unique int id: @class ref +); + +interfaces( + unique int id: @interface, + string nodeName: string ref, + int parentid: @package ref, + int sourceid: @interface ref +); + +fielddecls( + unique int id: @fielddecl, + int parentid: @reftype ref +); + +#keyset[fieldId] #keyset[fieldDeclId,pos] +fieldDeclaredIn( + int fieldId: @field ref, + int fieldDeclId: @fielddecl ref, + int pos: int ref +); + +fields( + unique int id: @field, + string nodeName: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @field ref +); + +fieldsKotlinType( + unique int id: @field ref, + int kttypeid: @kt_type ref +); + +constrs( + unique int id: @constructor, + string nodeName: string ref, + string signature: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @constructor ref +); + +constrsKotlinType( + unique int id: @constructor ref, + int kttypeid: @kt_type ref +); + +methods( + unique int id: @method, + string nodeName: string ref, + string signature: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @method ref +); + +methodsKotlinType( + unique int id: @method ref, + int kttypeid: @kt_type ref +); + +#keyset[parentid,pos] +params( + unique int id: @param, + int typeid: @type ref, + int pos: int ref, + int parentid: @callable ref, + int sourceid: @param ref +); + +paramsKotlinType( + unique int id: @param ref, + int kttypeid: @kt_type ref +); + +paramName( + unique int id: @param ref, + string nodeName: string ref +); + +isVarargsParam( + int param: @param ref +); + +exceptions( + unique int id: @exception, + int typeid: @type ref, + int parentid: @callable ref +); + +isAnnotType( + int interfaceid: @interface ref +); + +isAnnotElem( + int methodid: @method ref +); + +annotValue( + int parentid: @annotation ref, + int id2: @method ref, + unique int value: @expr ref +); + +isEnumType( + int classid: @class ref +); + +isEnumConst( + int fieldid: @field ref +); + +#keyset[parentid,pos] +typeVars( + unique int id: @typevariable, + string nodeName: string ref, + int pos: int ref, + int kind: int ref, // deprecated + int parentid: @classorinterfaceorcallable ref +); + +wildcards( + unique int id: @wildcard, + string nodeName: string ref, + int kind: int ref +); + +#keyset[parentid,pos] +typeBounds( + unique int id: @typebound, + int typeid: @reftype ref, + int pos: int ref, + int parentid: @boundedtype ref +); + +#keyset[parentid,pos] +typeArgs( + int argumentid: @reftype ref, + int pos: int ref, + int parentid: @classorinterfaceorcallable ref +); + +isParameterized( + int memberid: @member ref +); + +isRaw( + int memberid: @member ref +); + +erasure( + unique int memberid: @member ref, + int erasureid: @member ref +); + +#keyset[classid] #keyset[parent] +isAnonymClass( + int classid: @class ref, + int parent: @classinstancexpr ref +); + +#keyset[typeid] #keyset[parent] +isLocalClassOrInterface( + int typeid: @classorinterface ref, + int parent: @localtypedeclstmt ref +); + +isDefConstr( + int constructorid: @constructor ref +); + +#keyset[exprId] +lambdaKind( + int exprId: @lambdaexpr ref, + int bodyKind: int ref +); + +arrays( + unique int id: @array, + string nodeName: string ref, + int elementtypeid: @type ref, + int dimension: int ref, + int componenttypeid: @type ref +); + +enclInReftype( + unique int child: @reftype ref, + int parent: @reftype ref +); + +extendsReftype( + int id1: @reftype ref, + int id2: @classorinterface ref +); + +implInterface( + int id1: @classorarray ref, + int id2: @interface ref +); + +permits( + int id1: @classorinterface ref, + int id2: @classorinterface ref +); + +hasModifier( + int id1: @modifiable ref, + int id2: @modifier ref +); + +imports( + unique int id: @import, + int holder: @classorinterfaceorpackage ref, + string name: string ref, + int kind: int ref +); + +#keyset[parent,idx] +stmts( + unique int id: @stmt, + int kind: int ref, + int parent: @stmtparent ref, + int idx: int ref, + int bodydecl: @callable ref +); + +@stmtparent = @callable | @stmt | @switchexpr | @whenexpr| @stmtexpr; + +case @stmt.kind of + 0 = @block +| 1 = @ifstmt +| 2 = @forstmt +| 3 = @enhancedforstmt +| 4 = @whilestmt +| 5 = @dostmt +| 6 = @trystmt +| 7 = @switchstmt +| 8 = @synchronizedstmt +| 9 = @returnstmt +| 10 = @throwstmt +| 11 = @breakstmt +| 12 = @continuestmt +| 13 = @emptystmt +| 14 = @exprstmt +| 15 = @labeledstmt +| 16 = @assertstmt +| 17 = @localvariabledeclstmt +| 18 = @localtypedeclstmt +| 19 = @constructorinvocationstmt +| 20 = @superconstructorinvocationstmt +| 21 = @case +| 22 = @catchclause +| 23 = @yieldstmt +| 24 = @errorstmt +| 25 = @whenbranch +; + +#keyset[parent,idx] +exprs( + unique int id: @expr, + int kind: int ref, + int typeid: @type ref, + int parent: @exprparent ref, + int idx: int ref +); + +exprsKotlinType( + unique int id: @expr ref, + int kttypeid: @kt_type ref +); + +callableEnclosingExpr( + unique int id: @expr ref, + int callable_id: @callable ref +); + +statementEnclosingExpr( + unique int id: @expr ref, + int statement_id: @stmt ref +); + +isParenthesized( + unique int id: @expr ref, + int parentheses: int ref +); + +case @expr.kind of + 1 = @arrayaccess +| 2 = @arraycreationexpr +| 3 = @arrayinit +| 4 = @assignexpr +| 5 = @assignaddexpr +| 6 = @assignsubexpr +| 7 = @assignmulexpr +| 8 = @assigndivexpr +| 9 = @assignremexpr +| 10 = @assignandexpr +| 11 = @assignorexpr +| 12 = @assignxorexpr +| 13 = @assignlshiftexpr +| 14 = @assignrshiftexpr +| 15 = @assignurshiftexpr +| 16 = @booleanliteral +| 17 = @integerliteral +| 18 = @longliteral +| 19 = @floatingpointliteral +| 20 = @doubleliteral +| 21 = @characterliteral +| 22 = @stringliteral +| 23 = @nullliteral +| 24 = @mulexpr +| 25 = @divexpr +| 26 = @remexpr +| 27 = @addexpr +| 28 = @subexpr +| 29 = @lshiftexpr +| 30 = @rshiftexpr +| 31 = @urshiftexpr +| 32 = @andbitexpr +| 33 = @orbitexpr +| 34 = @xorbitexpr +| 35 = @andlogicalexpr +| 36 = @orlogicalexpr +| 37 = @ltexpr +| 38 = @gtexpr +| 39 = @leexpr +| 40 = @geexpr +| 41 = @eqexpr +| 42 = @neexpr +| 43 = @postincexpr +| 44 = @postdecexpr +| 45 = @preincexpr +| 46 = @predecexpr +| 47 = @minusexpr +| 48 = @plusexpr +| 49 = @bitnotexpr +| 50 = @lognotexpr +| 51 = @castexpr +| 52 = @newexpr +| 53 = @conditionalexpr +| 54 = @parexpr // deprecated +| 55 = @instanceofexpr +| 56 = @localvariabledeclexpr +| 57 = @typeliteral +| 58 = @thisaccess +| 59 = @superaccess +| 60 = @varaccess +| 61 = @methodaccess +| 62 = @unannotatedtypeaccess +| 63 = @arraytypeaccess +| 64 = @packageaccess +| 65 = @wildcardtypeaccess +| 66 = @declannotation +| 67 = @uniontypeaccess +| 68 = @lambdaexpr +| 69 = @memberref +| 70 = @annotatedtypeaccess +| 71 = @typeannotation +| 72 = @intersectiontypeaccess +| 73 = @switchexpr +| 74 = @errorexpr +| 75 = @whenexpr +| 76 = @getclassexpr +| 77 = @safecastexpr +| 78 = @implicitcastexpr +| 79 = @implicitnotnullexpr +| 80 = @implicitcoerciontounitexpr +| 81 = @notinstanceofexpr +| 82 = @stmtexpr +| 83 = @stringtemplateexpr +| 84 = @notnullexpr +| 85 = @unsafecoerceexpr +| 86 = @valueeqexpr +| 87 = @valueneexpr +| 88 = @propertyref +; + +/** Holds if this `when` expression was written as an `if` expression. */ +when_if(unique int id: @whenexpr ref); + +/** Holds if this `when` branch was written as an `else` branch. */ +when_branch_else(unique int id: @whenbranch ref); + +@classinstancexpr = @newexpr | @lambdaexpr | @memberref | @propertyref + +@annotation = @declannotation | @typeannotation +@typeaccess = @unannotatedtypeaccess | @annotatedtypeaccess + +@assignment = @assignexpr + | @assignop; + +@unaryassignment = @postincexpr + | @postdecexpr + | @preincexpr + | @predecexpr; + +@assignop = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + | @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + | @assignurshiftexpr; + +@literal = @booleanliteral + | @integerliteral + | @longliteral + | @floatingpointliteral + | @doubleliteral + | @characterliteral + | @stringliteral + | @nullliteral; + +@binaryexpr = @mulexpr + | @divexpr + | @remexpr + | @addexpr + | @subexpr + | @lshiftexpr + | @rshiftexpr + | @urshiftexpr + | @andbitexpr + | @orbitexpr + | @xorbitexpr + | @andlogicalexpr + | @orlogicalexpr + | @ltexpr + | @gtexpr + | @leexpr + | @geexpr + | @eqexpr + | @neexpr + | @valueeqexpr + | @valueneexpr; + +@unaryexpr = @postincexpr + | @postdecexpr + | @preincexpr + | @predecexpr + | @minusexpr + | @plusexpr + | @bitnotexpr + | @lognotexpr + | @notnullexpr; + +@caller = @classinstancexpr + | @methodaccess + | @constructorinvocationstmt + | @superconstructorinvocationstmt; + +callableBinding( + unique int callerid: @caller ref, + int callee: @callable ref +); + +memberRefBinding( + unique int id: @expr ref, + int callable: @callable ref +); + +propertyRefGetBinding( + unique int id: @expr ref, + int getter: @callable ref +); + +propertyRefFieldBinding( + unique int id: @expr ref, + int field: @field ref +); + +propertyRefSetBinding( + unique int id: @expr ref, + int setter: @callable ref +); + +@exprparent = @stmt | @expr | @whenbranch | @callable | @field | @fielddecl | @class | @interface | @param | @localvar | @typevariable; + +variableBinding( + unique int expr: @varaccess ref, + int variable: @variable ref +); + +@variable = @localscopevariable | @field; + +@localscopevariable = @localvar | @param; + +localvars( + unique int id: @localvar, + string nodeName: string ref, + int typeid: @type ref, + int parentid: @localvariabledeclexpr ref +); + +localvarsKotlinType( + unique int id: @localvar ref, + int kttypeid: @kt_type ref +); + +@namedexprorstmt = @breakstmt + | @continuestmt + | @labeledstmt + | @literal; + +namestrings( + string name: string ref, + string value: string ref, + unique int parent: @namedexprorstmt ref +); + +/* + * Modules + */ + +#keyset[name] +modules( + unique int id: @module, + string name: string ref +); + +isOpen( + int id: @module ref +); + +#keyset[fileId] +cumodule( + int fileId: @file ref, + int moduleId: @module ref +); + +@directive = @requires + | @exports + | @opens + | @uses + | @provides + +#keyset[directive] +directives( + int id: @module ref, + int directive: @directive ref +); + +requires( + unique int id: @requires, + int target: @module ref +); + +isTransitive( + int id: @requires ref +); + +isStatic( + int id: @requires ref +); + +exports( + unique int id: @exports, + int target: @package ref +); + +exportsTo( + int id: @exports ref, + int target: @module ref +); + +opens( + unique int id: @opens, + int target: @package ref +); + +opensTo( + int id: @opens ref, + int target: @module ref +); + +uses( + unique int id: @uses, + string serviceInterface: string ref +); + +provides( + unique int id: @provides, + string serviceInterface: string ref +); + +providesWith( + int id: @provides ref, + string serviceImpl: string ref +); + +/* + * Javadoc + */ + +javadoc( + unique int id: @javadoc +); + +isNormalComment( + int commentid : @javadoc ref +); + +isEolComment( + int commentid : @javadoc ref +); + +hasJavadoc( + int documentableid: @member ref, + int javadocid: @javadoc ref +); + +#keyset[parentid,idx] +javadocTag( + unique int id: @javadocTag, + string name: string ref, + int parentid: @javadocParent ref, + int idx: int ref +); + +#keyset[parentid,idx] +javadocText( + unique int id: @javadocText, + string text: string ref, + int parentid: @javadocParent ref, + int idx: int ref +); + +@javadocParent = @javadoc | @javadocTag; +@javadocElement = @javadocTag | @javadocText; + +@classorinterface = @interface | @class; +@classorinterfaceorpackage = @classorinterface | @package; +@classorinterfaceorcallable = @classorinterface | @callable; +@boundedtype = @typevariable | @wildcard; +@reftype = @classorinterface | @array | @boundedtype; +@classorarray = @class | @array; +@type = @primitive | @reftype; +@callable = @method | @constructor; + +/** A program element that has a name. */ +@element = @package | @modifier | @annotation | + @locatableElement; + +@locatableElement = @file | @primitive | @class | @interface | @method | @constructor | @param | @exception | @field | + @boundedtype | @array | @localvar | @expr | @stmt | @import | @fielddecl | @kt_type | @kt_type_alias | + @kt_property; + +@modifiable = @member_modifiable| @param | @localvar ; + +@member_modifiable = @class | @interface | @method | @constructor | @field | @kt_property; + +@member = @method | @constructor | @field | @reftype ; + +/** A program element that has a location. */ +@locatable = @typebound | @javadoc | @javadocTag | @javadocText | @xmllocatable | @ktcomment | + @locatableElement; + +@top = @element | @locatable | @folder; + +/* + * XML Files + */ + +xmlEncoding( + unique int id: @file ref, + string encoding: string ref +); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters | @xmlelement | @xmlcomment | @xmlattribute | @xmldtd | @file | @xmlnamespace; + +/* + * configuration files with key value pairs + */ + +configs( + unique int id: @config +); + +configNames( + unique int id: @configName, + int config: @config ref, + string name: string ref +); + +configValues( + unique int id: @configValue, + int config: @config ref, + string value: string ref +); + +configLocations( + int locatable: @configLocatable ref, + int location: @location_default ref +); + +@configLocatable = @config | @configName | @configValue; + +ktComments( + unique int id: @ktcomment, + int kind: int ref, + string text : string ref +) + +ktCommentSections( + unique int id: @ktcommentsection, + int comment: @ktcomment ref, + string content : string ref +) + +ktCommentSectionNames( + unique int id: @ktcommentsection ref, + string name : string ref +) + +ktCommentSectionSubjectNames( + unique int id: @ktcommentsection ref, + string subjectname : string ref +) + +#keyset[id, owner] +ktCommentOwners( + int id: @ktcomment ref, + int owner: @top ref +) + +ktExtensionFunctions( + unique int id: @method ref, + int typeid: @type ref, + int kttypeid: @kt_type ref +) + +ktProperties( + unique int id: @kt_property, + string nodeName: string ref +) + +ktPropertyGetters( + unique int id: @kt_property ref, + int getter: @method ref +) + +ktPropertySetters( + unique int id: @kt_property ref, + int setter: @method ref +) + +ktPropertyBackingFields( + unique int id: @kt_property ref, + int backingField: @field ref +) + +ktSyntheticBody( + unique int id: @callable ref, + int kind: int ref + // 1: ENUM_VALUES + // 2: ENUM_VALUEOF +) + +ktLocalFunction( + unique int id: @method ref +) + +ktInitializerAssignment( + unique int id: @assignexpr ref +) + +ktPropertyDelegates( + unique int id: @kt_property ref, + unique int variableId: @variable ref +) + +/** + * If `id` is a compiler generated element, then the kind indicates the + * reason that the compiler generated it. + * See `Element.compilerGeneratedReason()` for an explanation of what + * each `kind` means. + */ +compiler_generated( + unique int id: @element ref, + int kind: int ref +) + +ktFunctionOriginalNames( + unique int id: @method ref, + string name: string ref +) diff --git a/java/ql/lib/upgrades/57c55f404a5954f0e738febf590ad5d49dd67b08/upgrade.properties b/java/ql/lib/upgrades/57c55f404a5954f0e738febf590ad5d49dd67b08/upgrade.properties new file mode 100644 index 00000000000..bdee4e55a05 --- /dev/null +++ b/java/ql/lib/upgrades/57c55f404a5954f0e738febf590ad5d49dd67b08/upgrade.properties @@ -0,0 +1,2 @@ +description: Add more compiler-generated kinds +compatibility: full diff --git a/java/ql/lib/upgrades/b9225587bc0a643ae484ec215b9a6f19d17d0fc2/old.dbscheme b/java/ql/lib/upgrades/b9225587bc0a643ae484ec215b9a6f19d17d0fc2/old.dbscheme new file mode 100755 index 00000000000..b9225587bc0 --- /dev/null +++ b/java/ql/lib/upgrades/b9225587bc0a643ae484ec215b9a6f19d17d0fc2/old.dbscheme @@ -0,0 +1,1234 @@ +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * javac A.java B.java C.java + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * javac A.java B.java C.java + */ + unique int id : @compilation, + int kind: int ref, + string cwd : string ref, + string name : string ref +); + +case @compilation.kind of + 1 = @javacompilation +| 2 = @kotlincompilation +; + +compilation_started( + int id : @compilation ref +) + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * javac A.java B.java C.java + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--javac-args` + * 2 | A.java + * 3 | B.java + * 4 | C.java + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * javac A.java B.java C.java + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | A.java + * 1 | B.java + * 2 | C.java + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * For each file recorded in `compilation_compiling_files`, + * there will be a corresponding row in + * `compilation_compiling_files_completed` once extraction + * of that file is complete. The `result` will indicate the + * extraction result: + * + * 0: Successfully extracted + * 1: Errors were encountered, but extraction recovered + * 2: Errors were encountered, and extraction could not recover + */ +#keyset[id, num] +compilation_compiling_files_completed( + int id : @compilation ref, + int num : int ref, + int result : int ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + unique int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * The `cpu_seconds` and `elapsed_seconds` are the CPU time and elapsed + * time (respectively) that the original compilation (not the extraction) + * took for compiler invocation `id`. + */ +compilation_compiler_times( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + * The `result` will indicate the extraction result: + * + * 0: Successfully extracted + * 1: Errors were encountered, but extraction recovered + * 2: Errors were encountered, and extraction could not recover + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref, + int result : int ref +); + +diagnostics( + unique int id: @diagnostic, + string generated_by: string ref, // TODO: Sync this with the other languages? + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/* + * External artifacts + */ + +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +snapshotDate( + unique date snapshotDate : date ref +); + +sourceLocationPrefix( + string prefix : string ref +); + +/* + * Duplicate code + */ + +duplicateCode( + unique int id : @duplication, + string relativePath : string ref, + int equivClass : int ref +); + +similarCode( + unique int id : @similarity, + string relativePath : string ref, + int equivClass : int ref +); + +@duplication_or_similarity = @duplication | @similarity + +tokens( + int id : @duplication_or_similarity ref, + int offset : int ref, + int beginLine : int ref, + int beginColumn : int ref, + int endLine : int ref, + int endColumn : int ref +); + +/* + * SMAP + */ + +smap_header( + int outputFileId: @file ref, + string outputFilename: string ref, + string defaultStratum: string ref +); + +smap_files( + int outputFileId: @file ref, + string stratum: string ref, + int inputFileNum: int ref, + string inputFileName: string ref, + int inputFileId: @file ref +); + +smap_lines( + int outputFileId: @file ref, + string stratum: string ref, + int inputFileNum: int ref, + int inputStartLine: int ref, + int inputLineCount: int ref, + int outputStartLine: int ref, + int outputLineIncrement: int ref +); + +/* + * Locations and files + */ + +@location = @location_default ; + +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +hasLocation( + int locatableid: @locatable ref, + int id: @location ref +); + +@sourceline = @locatable ; + +#keyset[element_id] +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/* + * Java + */ + +cupackage( + unique int id: @file ref, + int packageid: @package ref +); + +#keyset[fileid,keyName] +jarManifestMain( + int fileid: @file ref, + string keyName: string ref, + string value: string ref +); + +#keyset[fileid,entryName,keyName] +jarManifestEntries( + int fileid: @file ref, + string entryName: string ref, + string keyName: string ref, + string value: string ref +); + +packages( + unique int id: @package, + string nodeName: string ref +); + +primitives( + unique int id: @primitive, + string nodeName: string ref +); + +modifiers( + unique int id: @modifier, + string nodeName: string ref +); + +classes( + unique int id: @class, + string nodeName: string ref, + int parentid: @package ref, + int sourceid: @class ref +); + +file_class( + int id: @class ref +); + +class_object( + unique int id: @class ref, + unique int instance: @field ref +); + +type_companion_object( + unique int id: @classorinterface ref, + unique int instance: @field ref, + unique int companion_object: @class ref +); + +kt_nullable_types( + unique int id: @kt_nullable_type, + int classid: @reftype ref +) + +kt_notnull_types( + unique int id: @kt_notnull_type, + int classid: @reftype ref +) + +kt_type_alias( + unique int id: @kt_type_alias, + string name: string ref, + int kttypeid: @kt_type ref +) + +@kt_type = @kt_nullable_type | @kt_notnull_type + +isRecord( + unique int id: @class ref +); + +interfaces( + unique int id: @interface, + string nodeName: string ref, + int parentid: @package ref, + int sourceid: @interface ref +); + +fielddecls( + unique int id: @fielddecl, + int parentid: @reftype ref +); + +#keyset[fieldId] #keyset[fieldDeclId,pos] +fieldDeclaredIn( + int fieldId: @field ref, + int fieldDeclId: @fielddecl ref, + int pos: int ref +); + +fields( + unique int id: @field, + string nodeName: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @field ref +); + +fieldsKotlinType( + unique int id: @field ref, + int kttypeid: @kt_type ref +); + +constrs( + unique int id: @constructor, + string nodeName: string ref, + string signature: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @constructor ref +); + +constrsKotlinType( + unique int id: @constructor ref, + int kttypeid: @kt_type ref +); + +methods( + unique int id: @method, + string nodeName: string ref, + string signature: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @method ref +); + +methodsKotlinType( + unique int id: @method ref, + int kttypeid: @kt_type ref +); + +#keyset[parentid,pos] +params( + unique int id: @param, + int typeid: @type ref, + int pos: int ref, + int parentid: @callable ref, + int sourceid: @param ref +); + +paramsKotlinType( + unique int id: @param ref, + int kttypeid: @kt_type ref +); + +paramName( + unique int id: @param ref, + string nodeName: string ref +); + +isVarargsParam( + int param: @param ref +); + +exceptions( + unique int id: @exception, + int typeid: @type ref, + int parentid: @callable ref +); + +isAnnotType( + int interfaceid: @interface ref +); + +isAnnotElem( + int methodid: @method ref +); + +annotValue( + int parentid: @annotation ref, + int id2: @method ref, + unique int value: @expr ref +); + +isEnumType( + int classid: @class ref +); + +isEnumConst( + int fieldid: @field ref +); + +#keyset[parentid,pos] +typeVars( + unique int id: @typevariable, + string nodeName: string ref, + int pos: int ref, + int kind: int ref, // deprecated + int parentid: @classorinterfaceorcallable ref +); + +wildcards( + unique int id: @wildcard, + string nodeName: string ref, + int kind: int ref +); + +#keyset[parentid,pos] +typeBounds( + unique int id: @typebound, + int typeid: @reftype ref, + int pos: int ref, + int parentid: @boundedtype ref +); + +#keyset[parentid,pos] +typeArgs( + int argumentid: @reftype ref, + int pos: int ref, + int parentid: @classorinterfaceorcallable ref +); + +isParameterized( + int memberid: @member ref +); + +isRaw( + int memberid: @member ref +); + +erasure( + unique int memberid: @member ref, + int erasureid: @member ref +); + +#keyset[classid] #keyset[parent] +isAnonymClass( + int classid: @class ref, + int parent: @classinstancexpr ref +); + +#keyset[typeid] #keyset[parent] +isLocalClassOrInterface( + int typeid: @classorinterface ref, + int parent: @localtypedeclstmt ref +); + +isDefConstr( + int constructorid: @constructor ref +); + +#keyset[exprId] +lambdaKind( + int exprId: @lambdaexpr ref, + int bodyKind: int ref +); + +arrays( + unique int id: @array, + string nodeName: string ref, + int elementtypeid: @type ref, + int dimension: int ref, + int componenttypeid: @type ref +); + +enclInReftype( + unique int child: @reftype ref, + int parent: @reftype ref +); + +extendsReftype( + int id1: @reftype ref, + int id2: @classorinterface ref +); + +implInterface( + int id1: @classorarray ref, + int id2: @interface ref +); + +permits( + int id1: @classorinterface ref, + int id2: @classorinterface ref +); + +hasModifier( + int id1: @modifiable ref, + int id2: @modifier ref +); + +imports( + unique int id: @import, + int holder: @classorinterfaceorpackage ref, + string name: string ref, + int kind: int ref +); + +#keyset[parent,idx] +stmts( + unique int id: @stmt, + int kind: int ref, + int parent: @stmtparent ref, + int idx: int ref, + int bodydecl: @callable ref +); + +@stmtparent = @callable | @stmt | @switchexpr | @whenexpr| @stmtexpr; + +case @stmt.kind of + 0 = @block +| 1 = @ifstmt +| 2 = @forstmt +| 3 = @enhancedforstmt +| 4 = @whilestmt +| 5 = @dostmt +| 6 = @trystmt +| 7 = @switchstmt +| 8 = @synchronizedstmt +| 9 = @returnstmt +| 10 = @throwstmt +| 11 = @breakstmt +| 12 = @continuestmt +| 13 = @emptystmt +| 14 = @exprstmt +| 15 = @labeledstmt +| 16 = @assertstmt +| 17 = @localvariabledeclstmt +| 18 = @localtypedeclstmt +| 19 = @constructorinvocationstmt +| 20 = @superconstructorinvocationstmt +| 21 = @case +| 22 = @catchclause +| 23 = @yieldstmt +| 24 = @errorstmt +| 25 = @whenbranch +; + +#keyset[parent,idx] +exprs( + unique int id: @expr, + int kind: int ref, + int typeid: @type ref, + int parent: @exprparent ref, + int idx: int ref +); + +exprsKotlinType( + unique int id: @expr ref, + int kttypeid: @kt_type ref +); + +callableEnclosingExpr( + unique int id: @expr ref, + int callable_id: @callable ref +); + +statementEnclosingExpr( + unique int id: @expr ref, + int statement_id: @stmt ref +); + +isParenthesized( + unique int id: @expr ref, + int parentheses: int ref +); + +case @expr.kind of + 1 = @arrayaccess +| 2 = @arraycreationexpr +| 3 = @arrayinit +| 4 = @assignexpr +| 5 = @assignaddexpr +| 6 = @assignsubexpr +| 7 = @assignmulexpr +| 8 = @assigndivexpr +| 9 = @assignremexpr +| 10 = @assignandexpr +| 11 = @assignorexpr +| 12 = @assignxorexpr +| 13 = @assignlshiftexpr +| 14 = @assignrshiftexpr +| 15 = @assignurshiftexpr +| 16 = @booleanliteral +| 17 = @integerliteral +| 18 = @longliteral +| 19 = @floatingpointliteral +| 20 = @doubleliteral +| 21 = @characterliteral +| 22 = @stringliteral +| 23 = @nullliteral +| 24 = @mulexpr +| 25 = @divexpr +| 26 = @remexpr +| 27 = @addexpr +| 28 = @subexpr +| 29 = @lshiftexpr +| 30 = @rshiftexpr +| 31 = @urshiftexpr +| 32 = @andbitexpr +| 33 = @orbitexpr +| 34 = @xorbitexpr +| 35 = @andlogicalexpr +| 36 = @orlogicalexpr +| 37 = @ltexpr +| 38 = @gtexpr +| 39 = @leexpr +| 40 = @geexpr +| 41 = @eqexpr +| 42 = @neexpr +| 43 = @postincexpr +| 44 = @postdecexpr +| 45 = @preincexpr +| 46 = @predecexpr +| 47 = @minusexpr +| 48 = @plusexpr +| 49 = @bitnotexpr +| 50 = @lognotexpr +| 51 = @castexpr +| 52 = @newexpr +| 53 = @conditionalexpr +| 54 = @parexpr // deprecated +| 55 = @instanceofexpr +| 56 = @localvariabledeclexpr +| 57 = @typeliteral +| 58 = @thisaccess +| 59 = @superaccess +| 60 = @varaccess +| 61 = @methodaccess +| 62 = @unannotatedtypeaccess +| 63 = @arraytypeaccess +| 64 = @packageaccess +| 65 = @wildcardtypeaccess +| 66 = @declannotation +| 67 = @uniontypeaccess +| 68 = @lambdaexpr +| 69 = @memberref +| 70 = @annotatedtypeaccess +| 71 = @typeannotation +| 72 = @intersectiontypeaccess +| 73 = @switchexpr +| 74 = @errorexpr +| 75 = @whenexpr +| 76 = @getclassexpr +| 77 = @safecastexpr +| 78 = @implicitcastexpr +| 79 = @implicitnotnullexpr +| 80 = @implicitcoerciontounitexpr +| 81 = @notinstanceofexpr +| 82 = @stmtexpr +| 83 = @stringtemplateexpr +| 84 = @notnullexpr +| 85 = @unsafecoerceexpr +| 86 = @valueeqexpr +| 87 = @valueneexpr +| 88 = @propertyref +; + +/** Holds if this `when` expression was written as an `if` expression. */ +when_if(unique int id: @whenexpr ref); + +/** Holds if this `when` branch was written as an `else` branch. */ +when_branch_else(unique int id: @whenbranch ref); + +@classinstancexpr = @newexpr | @lambdaexpr | @memberref | @propertyref + +@annotation = @declannotation | @typeannotation +@typeaccess = @unannotatedtypeaccess | @annotatedtypeaccess + +@assignment = @assignexpr + | @assignop; + +@unaryassignment = @postincexpr + | @postdecexpr + | @preincexpr + | @predecexpr; + +@assignop = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + | @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + | @assignurshiftexpr; + +@literal = @booleanliteral + | @integerliteral + | @longliteral + | @floatingpointliteral + | @doubleliteral + | @characterliteral + | @stringliteral + | @nullliteral; + +@binaryexpr = @mulexpr + | @divexpr + | @remexpr + | @addexpr + | @subexpr + | @lshiftexpr + | @rshiftexpr + | @urshiftexpr + | @andbitexpr + | @orbitexpr + | @xorbitexpr + | @andlogicalexpr + | @orlogicalexpr + | @ltexpr + | @gtexpr + | @leexpr + | @geexpr + | @eqexpr + | @neexpr + | @valueeqexpr + | @valueneexpr; + +@unaryexpr = @postincexpr + | @postdecexpr + | @preincexpr + | @predecexpr + | @minusexpr + | @plusexpr + | @bitnotexpr + | @lognotexpr + | @notnullexpr; + +@caller = @classinstancexpr + | @methodaccess + | @constructorinvocationstmt + | @superconstructorinvocationstmt; + +callableBinding( + unique int callerid: @caller ref, + int callee: @callable ref +); + +memberRefBinding( + unique int id: @expr ref, + int callable: @callable ref +); + +propertyRefGetBinding( + unique int id: @expr ref, + int getter: @callable ref +); + +propertyRefFieldBinding( + unique int id: @expr ref, + int field: @field ref +); + +propertyRefSetBinding( + unique int id: @expr ref, + int setter: @callable ref +); + +@exprparent = @stmt | @expr | @whenbranch | @callable | @field | @fielddecl | @class | @interface | @param | @localvar | @typevariable; + +variableBinding( + unique int expr: @varaccess ref, + int variable: @variable ref +); + +@variable = @localscopevariable | @field; + +@localscopevariable = @localvar | @param; + +localvars( + unique int id: @localvar, + string nodeName: string ref, + int typeid: @type ref, + int parentid: @localvariabledeclexpr ref +); + +localvarsKotlinType( + unique int id: @localvar ref, + int kttypeid: @kt_type ref +); + +@namedexprorstmt = @breakstmt + | @continuestmt + | @labeledstmt + | @literal; + +namestrings( + string name: string ref, + string value: string ref, + unique int parent: @namedexprorstmt ref +); + +/* + * Modules + */ + +#keyset[name] +modules( + unique int id: @module, + string name: string ref +); + +isOpen( + int id: @module ref +); + +#keyset[fileId] +cumodule( + int fileId: @file ref, + int moduleId: @module ref +); + +@directive = @requires + | @exports + | @opens + | @uses + | @provides + +#keyset[directive] +directives( + int id: @module ref, + int directive: @directive ref +); + +requires( + unique int id: @requires, + int target: @module ref +); + +isTransitive( + int id: @requires ref +); + +isStatic( + int id: @requires ref +); + +exports( + unique int id: @exports, + int target: @package ref +); + +exportsTo( + int id: @exports ref, + int target: @module ref +); + +opens( + unique int id: @opens, + int target: @package ref +); + +opensTo( + int id: @opens ref, + int target: @module ref +); + +uses( + unique int id: @uses, + string serviceInterface: string ref +); + +provides( + unique int id: @provides, + string serviceInterface: string ref +); + +providesWith( + int id: @provides ref, + string serviceImpl: string ref +); + +/* + * Javadoc + */ + +javadoc( + unique int id: @javadoc +); + +isNormalComment( + int commentid : @javadoc ref +); + +isEolComment( + int commentid : @javadoc ref +); + +hasJavadoc( + int documentableid: @member ref, + int javadocid: @javadoc ref +); + +#keyset[parentid,idx] +javadocTag( + unique int id: @javadocTag, + string name: string ref, + int parentid: @javadocParent ref, + int idx: int ref +); + +#keyset[parentid,idx] +javadocText( + unique int id: @javadocText, + string text: string ref, + int parentid: @javadocParent ref, + int idx: int ref +); + +@javadocParent = @javadoc | @javadocTag; +@javadocElement = @javadocTag | @javadocText; + +@classorinterface = @interface | @class; +@classorinterfaceorpackage = @classorinterface | @package; +@classorinterfaceorcallable = @classorinterface | @callable; +@boundedtype = @typevariable | @wildcard; +@reftype = @classorinterface | @array | @boundedtype; +@classorarray = @class | @array; +@type = @primitive | @reftype; +@callable = @method | @constructor; + +/** A program element that has a name. */ +@element = @package | @modifier | @annotation | + @locatableElement; + +@locatableElement = @file | @primitive | @class | @interface | @method | @constructor | @param | @exception | @field | + @boundedtype | @array | @localvar | @expr | @stmt | @import | @fielddecl | @kt_type | @kt_type_alias | + @kt_property; + +@modifiable = @member_modifiable| @param | @localvar ; + +@member_modifiable = @class | @interface | @method | @constructor | @field | @kt_property; + +@member = @method | @constructor | @field | @reftype ; + +/** A program element that has a location. */ +@locatable = @typebound | @javadoc | @javadocTag | @javadocText | @xmllocatable | @ktcomment | + @locatableElement; + +@top = @element | @locatable | @folder; + +/* + * XML Files + */ + +xmlEncoding( + unique int id: @file ref, + string encoding: string ref +); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters | @xmlelement | @xmlcomment | @xmlattribute | @xmldtd | @file | @xmlnamespace; + +/* + * configuration files with key value pairs + */ + +configs( + unique int id: @config +); + +configNames( + unique int id: @configName, + int config: @config ref, + string name: string ref +); + +configValues( + unique int id: @configValue, + int config: @config ref, + string value: string ref +); + +configLocations( + int locatable: @configLocatable ref, + int location: @location_default ref +); + +@configLocatable = @config | @configName | @configValue; + +ktComments( + unique int id: @ktcomment, + int kind: int ref, + string text : string ref +) + +ktCommentSections( + unique int id: @ktcommentsection, + int comment: @ktcomment ref, + string content : string ref +) + +ktCommentSectionNames( + unique int id: @ktcommentsection ref, + string name : string ref +) + +ktCommentSectionSubjectNames( + unique int id: @ktcommentsection ref, + string subjectname : string ref +) + +#keyset[id, owner] +ktCommentOwners( + int id: @ktcomment ref, + int owner: @top ref +) + +@breakcontinuestmt = @breakstmt + | @continuestmt; + +@ktloopstmt = @whilestmt + | @dostmt; + +ktBreakContinueTargets( + unique int id: @breakcontinuestmt ref, + int target: @ktloopstmt ref +) + +ktExtensionFunctions( + unique int id: @method ref, + int typeid: @type ref, + int kttypeid: @kt_type ref +) + +ktProperties( + unique int id: @kt_property, + string nodeName: string ref +) + +ktPropertyGetters( + unique int id: @kt_property ref, + int getter: @method ref +) + +ktPropertySetters( + unique int id: @kt_property ref, + int setter: @method ref +) + +ktPropertyBackingFields( + unique int id: @kt_property ref, + int backingField: @field ref +) + +ktSyntheticBody( + unique int id: @callable ref, + int kind: int ref + // 1: ENUM_VALUES + // 2: ENUM_VALUEOF +) + +ktLocalFunction( + unique int id: @method ref +) + +ktInitializerAssignment( + unique int id: @assignexpr ref +) + +ktPropertyDelegates( + unique int id: @kt_property ref, + unique int variableId: @variable ref +) + +compiler_generated( + unique int id: @element ref, + int kind: int ref + // 1: Declaring classes of adapter functions in Kotlin +) + +ktFunctionOriginalNames( + unique int id: @method ref, + string name: string ref +) diff --git a/java/ql/lib/upgrades/b9225587bc0a643ae484ec215b9a6f19d17d0fc2/semmlecode.dbscheme b/java/ql/lib/upgrades/b9225587bc0a643ae484ec215b9a6f19d17d0fc2/semmlecode.dbscheme new file mode 100755 index 00000000000..57c55f404a5 --- /dev/null +++ b/java/ql/lib/upgrades/b9225587bc0a643ae484ec215b9a6f19d17d0fc2/semmlecode.dbscheme @@ -0,0 +1,1223 @@ +/** + * An invocation of the compiler. Note that more than one file may be + * compiled per invocation. For example, this command compiles three + * source files: + * + * javac A.java B.java C.java + * + * The `id` simply identifies the invocation, while `cwd` is the working + * directory from which the compiler was invoked. + */ +compilations( + /** + * An invocation of the compiler. Note that more than one file may + * be compiled per invocation. For example, this command compiles + * three source files: + * + * javac A.java B.java C.java + */ + unique int id : @compilation, + int kind: int ref, + string cwd : string ref, + string name : string ref +); + +case @compilation.kind of + 1 = @javacompilation +| 2 = @kotlincompilation +; + +compilation_started( + int id : @compilation ref +) + +/** + * The arguments that were passed to the extractor for a compiler + * invocation. If `id` is for the compiler invocation + * + * javac A.java B.java C.java + * + * then typically there will be rows for + * + * num | arg + * --- | --- + * 0 | *path to extractor* + * 1 | `--javac-args` + * 2 | A.java + * 3 | B.java + * 4 | C.java + */ +#keyset[id, num] +compilation_args( + int id : @compilation ref, + int num : int ref, + string arg : string ref +); + +/** + * The source files that are compiled by a compiler invocation. + * If `id` is for the compiler invocation + * + * javac A.java B.java C.java + * + * then there will be rows for + * + * num | arg + * --- | --- + * 0 | A.java + * 1 | B.java + * 2 | C.java + */ +#keyset[id, num] +compilation_compiling_files( + int id : @compilation ref, + int num : int ref, + int file : @file ref +); + +/** + * For each file recorded in `compilation_compiling_files`, + * there will be a corresponding row in + * `compilation_compiling_files_completed` once extraction + * of that file is complete. The `result` will indicate the + * extraction result: + * + * 0: Successfully extracted + * 1: Errors were encountered, but extraction recovered + * 2: Errors were encountered, and extraction could not recover + */ +#keyset[id, num] +compilation_compiling_files_completed( + int id : @compilation ref, + int num : int ref, + int result : int ref +); + +/** + * The time taken by the extractor for a compiler invocation. + * + * For each file `num`, there will be rows for + * + * kind | seconds + * ---- | --- + * 1 | CPU seconds used by the extractor frontend + * 2 | Elapsed seconds during the extractor frontend + * 3 | CPU seconds used by the extractor backend + * 4 | Elapsed seconds during the extractor backend + */ +#keyset[id, num, kind] +compilation_time( + int id : @compilation ref, + int num : int ref, + /* kind: + 1 = frontend_cpu_seconds + 2 = frontend_elapsed_seconds + 3 = extractor_cpu_seconds + 4 = extractor_elapsed_seconds + */ + int kind : int ref, + float seconds : float ref +); + +/** + * An error or warning generated by the extractor. + * The diagnostic message `diagnostic` was generated during compiler + * invocation `compilation`, and is the `file_number_diagnostic_number`th + * message generated while extracting the `file_number`th file of that + * invocation. + */ +#keyset[compilation, file_number, file_number_diagnostic_number] +diagnostic_for( + unique int diagnostic : @diagnostic ref, + int compilation : @compilation ref, + int file_number : int ref, + int file_number_diagnostic_number : int ref +); + +/** + * The `cpu_seconds` and `elapsed_seconds` are the CPU time and elapsed + * time (respectively) that the original compilation (not the extraction) + * took for compiler invocation `id`. + */ +compilation_compiler_times( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref +); + +/** + * If extraction was successful, then `cpu_seconds` and + * `elapsed_seconds` are the CPU time and elapsed time (respectively) + * that extraction took for compiler invocation `id`. + * The `result` will indicate the extraction result: + * + * 0: Successfully extracted + * 1: Errors were encountered, but extraction recovered + * 2: Errors were encountered, and extraction could not recover + */ +compilation_finished( + unique int id : @compilation ref, + float cpu_seconds : float ref, + float elapsed_seconds : float ref, + int result : int ref +); + +diagnostics( + unique int id: @diagnostic, + string generated_by: string ref, // TODO: Sync this with the other languages? + int severity: int ref, + string error_tag: string ref, + string error_message: string ref, + string full_error_message: string ref, + int location: @location_default ref +); + +/* + * External artifacts + */ + +externalData( + int id : @externalDataElement, + string path : string ref, + int column: int ref, + string value : string ref +); + +snapshotDate( + unique date snapshotDate : date ref +); + +sourceLocationPrefix( + string prefix : string ref +); + +/* + * Duplicate code + */ + +duplicateCode( + unique int id : @duplication, + string relativePath : string ref, + int equivClass : int ref +); + +similarCode( + unique int id : @similarity, + string relativePath : string ref, + int equivClass : int ref +); + +@duplication_or_similarity = @duplication | @similarity + +tokens( + int id : @duplication_or_similarity ref, + int offset : int ref, + int beginLine : int ref, + int beginColumn : int ref, + int endLine : int ref, + int endColumn : int ref +); + +/* + * SMAP + */ + +smap_header( + int outputFileId: @file ref, + string outputFilename: string ref, + string defaultStratum: string ref +); + +smap_files( + int outputFileId: @file ref, + string stratum: string ref, + int inputFileNum: int ref, + string inputFileName: string ref, + int inputFileId: @file ref +); + +smap_lines( + int outputFileId: @file ref, + string stratum: string ref, + int inputFileNum: int ref, + int inputStartLine: int ref, + int inputLineCount: int ref, + int outputStartLine: int ref, + int outputLineIncrement: int ref +); + +/* + * Locations and files + */ + +@location = @location_default ; + +locations_default( + unique int id: @location_default, + int file: @file ref, + int beginLine: int ref, + int beginColumn: int ref, + int endLine: int ref, + int endColumn: int ref +); + +hasLocation( + int locatableid: @locatable ref, + int id: @location ref +); + +@sourceline = @locatable ; + +#keyset[element_id] +numlines( + int element_id: @sourceline ref, + int num_lines: int ref, + int num_code: int ref, + int num_comment: int ref +); + +files( + unique int id: @file, + string name: string ref +); + +folders( + unique int id: @folder, + string name: string ref +); + +@container = @folder | @file + +containerparent( + int parent: @container ref, + unique int child: @container ref +); + +/* + * Java + */ + +cupackage( + unique int id: @file ref, + int packageid: @package ref +); + +#keyset[fileid,keyName] +jarManifestMain( + int fileid: @file ref, + string keyName: string ref, + string value: string ref +); + +#keyset[fileid,entryName,keyName] +jarManifestEntries( + int fileid: @file ref, + string entryName: string ref, + string keyName: string ref, + string value: string ref +); + +packages( + unique int id: @package, + string nodeName: string ref +); + +primitives( + unique int id: @primitive, + string nodeName: string ref +); + +modifiers( + unique int id: @modifier, + string nodeName: string ref +); + +classes( + unique int id: @class, + string nodeName: string ref, + int parentid: @package ref, + int sourceid: @class ref +); + +file_class( + int id: @class ref +); + +class_object( + unique int id: @class ref, + unique int instance: @field ref +); + +type_companion_object( + unique int id: @classorinterface ref, + unique int instance: @field ref, + unique int companion_object: @class ref +); + +kt_nullable_types( + unique int id: @kt_nullable_type, + int classid: @reftype ref +) + +kt_notnull_types( + unique int id: @kt_notnull_type, + int classid: @reftype ref +) + +kt_type_alias( + unique int id: @kt_type_alias, + string name: string ref, + int kttypeid: @kt_type ref +) + +@kt_type = @kt_nullable_type | @kt_notnull_type + +isRecord( + unique int id: @class ref +); + +interfaces( + unique int id: @interface, + string nodeName: string ref, + int parentid: @package ref, + int sourceid: @interface ref +); + +fielddecls( + unique int id: @fielddecl, + int parentid: @reftype ref +); + +#keyset[fieldId] #keyset[fieldDeclId,pos] +fieldDeclaredIn( + int fieldId: @field ref, + int fieldDeclId: @fielddecl ref, + int pos: int ref +); + +fields( + unique int id: @field, + string nodeName: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @field ref +); + +fieldsKotlinType( + unique int id: @field ref, + int kttypeid: @kt_type ref +); + +constrs( + unique int id: @constructor, + string nodeName: string ref, + string signature: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @constructor ref +); + +constrsKotlinType( + unique int id: @constructor ref, + int kttypeid: @kt_type ref +); + +methods( + unique int id: @method, + string nodeName: string ref, + string signature: string ref, + int typeid: @type ref, + int parentid: @reftype ref, + int sourceid: @method ref +); + +methodsKotlinType( + unique int id: @method ref, + int kttypeid: @kt_type ref +); + +#keyset[parentid,pos] +params( + unique int id: @param, + int typeid: @type ref, + int pos: int ref, + int parentid: @callable ref, + int sourceid: @param ref +); + +paramsKotlinType( + unique int id: @param ref, + int kttypeid: @kt_type ref +); + +paramName( + unique int id: @param ref, + string nodeName: string ref +); + +isVarargsParam( + int param: @param ref +); + +exceptions( + unique int id: @exception, + int typeid: @type ref, + int parentid: @callable ref +); + +isAnnotType( + int interfaceid: @interface ref +); + +isAnnotElem( + int methodid: @method ref +); + +annotValue( + int parentid: @annotation ref, + int id2: @method ref, + unique int value: @expr ref +); + +isEnumType( + int classid: @class ref +); + +isEnumConst( + int fieldid: @field ref +); + +#keyset[parentid,pos] +typeVars( + unique int id: @typevariable, + string nodeName: string ref, + int pos: int ref, + int kind: int ref, // deprecated + int parentid: @classorinterfaceorcallable ref +); + +wildcards( + unique int id: @wildcard, + string nodeName: string ref, + int kind: int ref +); + +#keyset[parentid,pos] +typeBounds( + unique int id: @typebound, + int typeid: @reftype ref, + int pos: int ref, + int parentid: @boundedtype ref +); + +#keyset[parentid,pos] +typeArgs( + int argumentid: @reftype ref, + int pos: int ref, + int parentid: @classorinterfaceorcallable ref +); + +isParameterized( + int memberid: @member ref +); + +isRaw( + int memberid: @member ref +); + +erasure( + unique int memberid: @member ref, + int erasureid: @member ref +); + +#keyset[classid] #keyset[parent] +isAnonymClass( + int classid: @class ref, + int parent: @classinstancexpr ref +); + +#keyset[typeid] #keyset[parent] +isLocalClassOrInterface( + int typeid: @classorinterface ref, + int parent: @localtypedeclstmt ref +); + +isDefConstr( + int constructorid: @constructor ref +); + +#keyset[exprId] +lambdaKind( + int exprId: @lambdaexpr ref, + int bodyKind: int ref +); + +arrays( + unique int id: @array, + string nodeName: string ref, + int elementtypeid: @type ref, + int dimension: int ref, + int componenttypeid: @type ref +); + +enclInReftype( + unique int child: @reftype ref, + int parent: @reftype ref +); + +extendsReftype( + int id1: @reftype ref, + int id2: @classorinterface ref +); + +implInterface( + int id1: @classorarray ref, + int id2: @interface ref +); + +permits( + int id1: @classorinterface ref, + int id2: @classorinterface ref +); + +hasModifier( + int id1: @modifiable ref, + int id2: @modifier ref +); + +imports( + unique int id: @import, + int holder: @classorinterfaceorpackage ref, + string name: string ref, + int kind: int ref +); + +#keyset[parent,idx] +stmts( + unique int id: @stmt, + int kind: int ref, + int parent: @stmtparent ref, + int idx: int ref, + int bodydecl: @callable ref +); + +@stmtparent = @callable | @stmt | @switchexpr | @whenexpr| @stmtexpr; + +case @stmt.kind of + 0 = @block +| 1 = @ifstmt +| 2 = @forstmt +| 3 = @enhancedforstmt +| 4 = @whilestmt +| 5 = @dostmt +| 6 = @trystmt +| 7 = @switchstmt +| 8 = @synchronizedstmt +| 9 = @returnstmt +| 10 = @throwstmt +| 11 = @breakstmt +| 12 = @continuestmt +| 13 = @emptystmt +| 14 = @exprstmt +| 15 = @labeledstmt +| 16 = @assertstmt +| 17 = @localvariabledeclstmt +| 18 = @localtypedeclstmt +| 19 = @constructorinvocationstmt +| 20 = @superconstructorinvocationstmt +| 21 = @case +| 22 = @catchclause +| 23 = @yieldstmt +| 24 = @errorstmt +| 25 = @whenbranch +; + +#keyset[parent,idx] +exprs( + unique int id: @expr, + int kind: int ref, + int typeid: @type ref, + int parent: @exprparent ref, + int idx: int ref +); + +exprsKotlinType( + unique int id: @expr ref, + int kttypeid: @kt_type ref +); + +callableEnclosingExpr( + unique int id: @expr ref, + int callable_id: @callable ref +); + +statementEnclosingExpr( + unique int id: @expr ref, + int statement_id: @stmt ref +); + +isParenthesized( + unique int id: @expr ref, + int parentheses: int ref +); + +case @expr.kind of + 1 = @arrayaccess +| 2 = @arraycreationexpr +| 3 = @arrayinit +| 4 = @assignexpr +| 5 = @assignaddexpr +| 6 = @assignsubexpr +| 7 = @assignmulexpr +| 8 = @assigndivexpr +| 9 = @assignremexpr +| 10 = @assignandexpr +| 11 = @assignorexpr +| 12 = @assignxorexpr +| 13 = @assignlshiftexpr +| 14 = @assignrshiftexpr +| 15 = @assignurshiftexpr +| 16 = @booleanliteral +| 17 = @integerliteral +| 18 = @longliteral +| 19 = @floatingpointliteral +| 20 = @doubleliteral +| 21 = @characterliteral +| 22 = @stringliteral +| 23 = @nullliteral +| 24 = @mulexpr +| 25 = @divexpr +| 26 = @remexpr +| 27 = @addexpr +| 28 = @subexpr +| 29 = @lshiftexpr +| 30 = @rshiftexpr +| 31 = @urshiftexpr +| 32 = @andbitexpr +| 33 = @orbitexpr +| 34 = @xorbitexpr +| 35 = @andlogicalexpr +| 36 = @orlogicalexpr +| 37 = @ltexpr +| 38 = @gtexpr +| 39 = @leexpr +| 40 = @geexpr +| 41 = @eqexpr +| 42 = @neexpr +| 43 = @postincexpr +| 44 = @postdecexpr +| 45 = @preincexpr +| 46 = @predecexpr +| 47 = @minusexpr +| 48 = @plusexpr +| 49 = @bitnotexpr +| 50 = @lognotexpr +| 51 = @castexpr +| 52 = @newexpr +| 53 = @conditionalexpr +| 54 = @parexpr // deprecated +| 55 = @instanceofexpr +| 56 = @localvariabledeclexpr +| 57 = @typeliteral +| 58 = @thisaccess +| 59 = @superaccess +| 60 = @varaccess +| 61 = @methodaccess +| 62 = @unannotatedtypeaccess +| 63 = @arraytypeaccess +| 64 = @packageaccess +| 65 = @wildcardtypeaccess +| 66 = @declannotation +| 67 = @uniontypeaccess +| 68 = @lambdaexpr +| 69 = @memberref +| 70 = @annotatedtypeaccess +| 71 = @typeannotation +| 72 = @intersectiontypeaccess +| 73 = @switchexpr +| 74 = @errorexpr +| 75 = @whenexpr +| 76 = @getclassexpr +| 77 = @safecastexpr +| 78 = @implicitcastexpr +| 79 = @implicitnotnullexpr +| 80 = @implicitcoerciontounitexpr +| 81 = @notinstanceofexpr +| 82 = @stmtexpr +| 83 = @stringtemplateexpr +| 84 = @notnullexpr +| 85 = @unsafecoerceexpr +| 86 = @valueeqexpr +| 87 = @valueneexpr +| 88 = @propertyref +; + +/** Holds if this `when` expression was written as an `if` expression. */ +when_if(unique int id: @whenexpr ref); + +/** Holds if this `when` branch was written as an `else` branch. */ +when_branch_else(unique int id: @whenbranch ref); + +@classinstancexpr = @newexpr | @lambdaexpr | @memberref | @propertyref + +@annotation = @declannotation | @typeannotation +@typeaccess = @unannotatedtypeaccess | @annotatedtypeaccess + +@assignment = @assignexpr + | @assignop; + +@unaryassignment = @postincexpr + | @postdecexpr + | @preincexpr + | @predecexpr; + +@assignop = @assignaddexpr + | @assignsubexpr + | @assignmulexpr + | @assigndivexpr + | @assignremexpr + | @assignandexpr + | @assignorexpr + | @assignxorexpr + | @assignlshiftexpr + | @assignrshiftexpr + | @assignurshiftexpr; + +@literal = @booleanliteral + | @integerliteral + | @longliteral + | @floatingpointliteral + | @doubleliteral + | @characterliteral + | @stringliteral + | @nullliteral; + +@binaryexpr = @mulexpr + | @divexpr + | @remexpr + | @addexpr + | @subexpr + | @lshiftexpr + | @rshiftexpr + | @urshiftexpr + | @andbitexpr + | @orbitexpr + | @xorbitexpr + | @andlogicalexpr + | @orlogicalexpr + | @ltexpr + | @gtexpr + | @leexpr + | @geexpr + | @eqexpr + | @neexpr + | @valueeqexpr + | @valueneexpr; + +@unaryexpr = @postincexpr + | @postdecexpr + | @preincexpr + | @predecexpr + | @minusexpr + | @plusexpr + | @bitnotexpr + | @lognotexpr + | @notnullexpr; + +@caller = @classinstancexpr + | @methodaccess + | @constructorinvocationstmt + | @superconstructorinvocationstmt; + +callableBinding( + unique int callerid: @caller ref, + int callee: @callable ref +); + +memberRefBinding( + unique int id: @expr ref, + int callable: @callable ref +); + +propertyRefGetBinding( + unique int id: @expr ref, + int getter: @callable ref +); + +propertyRefFieldBinding( + unique int id: @expr ref, + int field: @field ref +); + +propertyRefSetBinding( + unique int id: @expr ref, + int setter: @callable ref +); + +@exprparent = @stmt | @expr | @whenbranch | @callable | @field | @fielddecl | @class | @interface | @param | @localvar | @typevariable; + +variableBinding( + unique int expr: @varaccess ref, + int variable: @variable ref +); + +@variable = @localscopevariable | @field; + +@localscopevariable = @localvar | @param; + +localvars( + unique int id: @localvar, + string nodeName: string ref, + int typeid: @type ref, + int parentid: @localvariabledeclexpr ref +); + +localvarsKotlinType( + unique int id: @localvar ref, + int kttypeid: @kt_type ref +); + +@namedexprorstmt = @breakstmt + | @continuestmt + | @labeledstmt + | @literal; + +namestrings( + string name: string ref, + string value: string ref, + unique int parent: @namedexprorstmt ref +); + +/* + * Modules + */ + +#keyset[name] +modules( + unique int id: @module, + string name: string ref +); + +isOpen( + int id: @module ref +); + +#keyset[fileId] +cumodule( + int fileId: @file ref, + int moduleId: @module ref +); + +@directive = @requires + | @exports + | @opens + | @uses + | @provides + +#keyset[directive] +directives( + int id: @module ref, + int directive: @directive ref +); + +requires( + unique int id: @requires, + int target: @module ref +); + +isTransitive( + int id: @requires ref +); + +isStatic( + int id: @requires ref +); + +exports( + unique int id: @exports, + int target: @package ref +); + +exportsTo( + int id: @exports ref, + int target: @module ref +); + +opens( + unique int id: @opens, + int target: @package ref +); + +opensTo( + int id: @opens ref, + int target: @module ref +); + +uses( + unique int id: @uses, + string serviceInterface: string ref +); + +provides( + unique int id: @provides, + string serviceInterface: string ref +); + +providesWith( + int id: @provides ref, + string serviceImpl: string ref +); + +/* + * Javadoc + */ + +javadoc( + unique int id: @javadoc +); + +isNormalComment( + int commentid : @javadoc ref +); + +isEolComment( + int commentid : @javadoc ref +); + +hasJavadoc( + int documentableid: @member ref, + int javadocid: @javadoc ref +); + +#keyset[parentid,idx] +javadocTag( + unique int id: @javadocTag, + string name: string ref, + int parentid: @javadocParent ref, + int idx: int ref +); + +#keyset[parentid,idx] +javadocText( + unique int id: @javadocText, + string text: string ref, + int parentid: @javadocParent ref, + int idx: int ref +); + +@javadocParent = @javadoc | @javadocTag; +@javadocElement = @javadocTag | @javadocText; + +@classorinterface = @interface | @class; +@classorinterfaceorpackage = @classorinterface | @package; +@classorinterfaceorcallable = @classorinterface | @callable; +@boundedtype = @typevariable | @wildcard; +@reftype = @classorinterface | @array | @boundedtype; +@classorarray = @class | @array; +@type = @primitive | @reftype; +@callable = @method | @constructor; + +/** A program element that has a name. */ +@element = @package | @modifier | @annotation | + @locatableElement; + +@locatableElement = @file | @primitive | @class | @interface | @method | @constructor | @param | @exception | @field | + @boundedtype | @array | @localvar | @expr | @stmt | @import | @fielddecl | @kt_type | @kt_type_alias | + @kt_property; + +@modifiable = @member_modifiable| @param | @localvar ; + +@member_modifiable = @class | @interface | @method | @constructor | @field | @kt_property; + +@member = @method | @constructor | @field | @reftype ; + +/** A program element that has a location. */ +@locatable = @typebound | @javadoc | @javadocTag | @javadocText | @xmllocatable | @ktcomment | + @locatableElement; + +@top = @element | @locatable | @folder; + +/* + * XML Files + */ + +xmlEncoding( + unique int id: @file ref, + string encoding: string ref +); + +xmlDTDs( + unique int id: @xmldtd, + string root: string ref, + string publicId: string ref, + string systemId: string ref, + int fileid: @file ref +); + +xmlElements( + unique int id: @xmlelement, + string name: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int fileid: @file ref +); + +xmlAttrs( + unique int id: @xmlattribute, + int elementid: @xmlelement ref, + string name: string ref, + string value: string ref, + int idx: int ref, + int fileid: @file ref +); + +xmlNs( + int id: @xmlnamespace, + string prefixName: string ref, + string URI: string ref, + int fileid: @file ref +); + +xmlHasNs( + int elementId: @xmlnamespaceable ref, + int nsId: @xmlnamespace ref, + int fileid: @file ref +); + +xmlComments( + unique int id: @xmlcomment, + string text: string ref, + int parentid: @xmlparent ref, + int fileid: @file ref +); + +xmlChars( + unique int id: @xmlcharacters, + string text: string ref, + int parentid: @xmlparent ref, + int idx: int ref, + int isCDATA: int ref, + int fileid: @file ref +); + +@xmlparent = @file | @xmlelement; +@xmlnamespaceable = @xmlelement | @xmlattribute; + +xmllocations( + int xmlElement: @xmllocatable ref, + int location: @location_default ref +); + +@xmllocatable = @xmlcharacters | @xmlelement | @xmlcomment | @xmlattribute | @xmldtd | @file | @xmlnamespace; + +/* + * configuration files with key value pairs + */ + +configs( + unique int id: @config +); + +configNames( + unique int id: @configName, + int config: @config ref, + string name: string ref +); + +configValues( + unique int id: @configValue, + int config: @config ref, + string value: string ref +); + +configLocations( + int locatable: @configLocatable ref, + int location: @location_default ref +); + +@configLocatable = @config | @configName | @configValue; + +ktComments( + unique int id: @ktcomment, + int kind: int ref, + string text : string ref +) + +ktCommentSections( + unique int id: @ktcommentsection, + int comment: @ktcomment ref, + string content : string ref +) + +ktCommentSectionNames( + unique int id: @ktcommentsection ref, + string name : string ref +) + +ktCommentSectionSubjectNames( + unique int id: @ktcommentsection ref, + string subjectname : string ref +) + +#keyset[id, owner] +ktCommentOwners( + int id: @ktcomment ref, + int owner: @top ref +) + +ktExtensionFunctions( + unique int id: @method ref, + int typeid: @type ref, + int kttypeid: @kt_type ref +) + +ktProperties( + unique int id: @kt_property, + string nodeName: string ref +) + +ktPropertyGetters( + unique int id: @kt_property ref, + int getter: @method ref +) + +ktPropertySetters( + unique int id: @kt_property ref, + int setter: @method ref +) + +ktPropertyBackingFields( + unique int id: @kt_property ref, + int backingField: @field ref +) + +ktSyntheticBody( + unique int id: @callable ref, + int kind: int ref + // 1: ENUM_VALUES + // 2: ENUM_VALUEOF +) + +ktLocalFunction( + unique int id: @method ref +) + +ktInitializerAssignment( + unique int id: @assignexpr ref +) + +ktPropertyDelegates( + unique int id: @kt_property ref, + unique int variableId: @variable ref +) + +compiler_generated( + unique int id: @element ref, + int kind: int ref + // 1: Declaring classes of adapter functions in Kotlin +) + +ktFunctionOriginalNames( + unique int id: @method ref, + string name: string ref +) diff --git a/java/ql/lib/upgrades/b9225587bc0a643ae484ec215b9a6f19d17d0fc2/upgrade.properties b/java/ql/lib/upgrades/b9225587bc0a643ae484ec215b9a6f19d17d0fc2/upgrade.properties new file mode 100644 index 00000000000..eca767b80de --- /dev/null +++ b/java/ql/lib/upgrades/b9225587bc0a643ae484ec215b9a6f19d17d0fc2/upgrade.properties @@ -0,0 +1,4 @@ +description: Remove unneeded break/continue structures for Kotlin +compatibility: backwards + +ktBreakContinueTargets.rel: delete diff --git a/java/ql/src/CHANGELOG.md b/java/ql/src/CHANGELOG.md index 4e3bacee693..1f8a00fb1ff 100644 --- a/java/ql/src/CHANGELOG.md +++ b/java/ql/src/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.2.0 + +### Minor Analysis Improvements + +* The query `java/log-injection` now reports problems at the source (user-controlled data) instead of at the ultimate logging call. This was changed because user functions that wrap the ultimate logging call could result in most alerts being reported in an uninformative location. + ## 0.1.4 ## 0.1.3 diff --git a/java/ql/src/Security/CWE/CWE-925/AndroidManifest.xml b/java/ql/src/Security/CWE/CWE-925/AndroidManifest.xml new file mode 100644 index 00000000000..f9e11a1ee81 --- /dev/null +++ b/java/ql/src/Security/CWE/CWE-925/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/java/ql/src/Security/CWE/CWE-925/Bad.java b/java/ql/src/Security/CWE/CWE-925/Bad.java new file mode 100644 index 00000000000..376805f824e --- /dev/null +++ b/java/ql/src/Security/CWE/CWE-925/Bad.java @@ -0,0 +1,7 @@ +public class ShutdownReceiver extends BroadcastReceiver { + @Override + public void onReceive(final Context context, final Intent intent) { + mainActivity.saveLocalData(); + mainActivity.stopActivity(); + } +} \ No newline at end of file diff --git a/java/ql/src/Security/CWE/CWE-925/Good.java b/java/ql/src/Security/CWE/CWE-925/Good.java new file mode 100644 index 00000000000..b6ad1c43193 --- /dev/null +++ b/java/ql/src/Security/CWE/CWE-925/Good.java @@ -0,0 +1,10 @@ +public class ShutdownReceiver extends BroadcastReceiver { + @Override + public void onReceive(final Context context, final Intent intent) { + if (!intent.getAction().equals(Intent.ACTION_SHUTDOWN)) { + return; + } + mainActivity.saveLocalData(); + mainActivity.stopActivity(); + } +} \ No newline at end of file diff --git a/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.qhelp b/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.qhelp new file mode 100644 index 00000000000..e489e411379 --- /dev/null +++ b/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.qhelp @@ -0,0 +1,40 @@ + + + + + +

+When an Android application uses a BroadcastReceiver to receive intents, +it is also able to receive explicit intents that are sent directly to it, regardless of its filter. + +Certain intent actions are only able to be sent by the operating system, not third-party applications. +However, a BroadcastReceiver that is registered to receive system intents is still able to receive +intents from a third-party application, so it should check that the intent received has the expected action. +Otherwise, a third-party application could impersonate the system this way to cause unintended behavior, such as a denial of service. +

+
+ + +

In the following code, the ShutdownReceiver initiates a shutdown procedure upon receiving an intent, + without checking that the received action is indeed ACTION_SHUTDOWN. This allows third-party applications to + send explicit intents to this receiver to cause a denial of service.

+ + +
+ + +

+In the onReceive method of a BroadcastReciever, the action of the received Intent should be checked. The following code demonstrates this. +

+ +
+ + + + + + + +
diff --git a/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql b/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql new file mode 100644 index 00000000000..51c54e288ac --- /dev/null +++ b/java/ql/src/Security/CWE/CWE-925/ImproperIntentVerification.ql @@ -0,0 +1,19 @@ +/** + * @name Improper verification of intent by broadcast receiver + * @description A broadcast receiver that does not verify intents it receives may be susceptible to unintended behavior by third party applications sending it explicit intents. + * @kind problem + * @problem.severity warning + * @security-severity 8.2 + * @precision high + * @id java/improper-intent-verification + * @tags security + * external/cwe/cwe-925 + */ + +import java +import semmle.code.java.security.ImproperIntentVerificationQuery + +from AndroidReceiverXmlElement reg, Method orm, SystemActionName sa +where unverifiedSystemReceiver(reg, orm, sa) +select orm, "This reciever doesn't verify intents it receives, and is registered $@ to receive $@.", + reg, "here", sa, "the system action " + sa.getName() diff --git a/java/ql/src/Violations of Best Practice/Naming Conventions/Shadowing.qll b/java/ql/src/Violations of Best Practice/Naming Conventions/Shadowing.qll index 1dd17a8e734..0451956977e 100644 --- a/java/ql/src/Violations of Best Practice/Naming Conventions/Shadowing.qll +++ b/java/ql/src/Violations of Best Practice/Naming Conventions/Shadowing.qll @@ -20,13 +20,21 @@ predicate setterFor(Method m, Field f) { predicate shadows(LocalVariableDecl d, Class c, Field f, Callable method) { d.getCallable() = method and method.getDeclaringType() = c and - c.getAField() = f and - f.getName() = d.getName() and - f.getType() = d.getType() and - not d.getCallable().isStatic() and + f = getField(c, d.getName(), d.getType()) and + not method.isStatic() and not f.isStatic() } +/** + * Gets the field with the given name and type from the given class, if any. + */ +pragma[nomagic] +private Field getField(Class c, string name, Type t) { + result.getDeclaringType() = c and + result.getName() = name and + result.getType() = t +} + predicate thisAccess(LocalVariableDecl d, Field f) { shadows(d, _, f, _) and exists(VarAccess va | va.getVariable().(Field).getSourceDeclaration() = f | diff --git a/java/ql/src/change-notes/2022-04-27-intent-verification.md b/java/ql/src/change-notes/2022-04-27-intent-verification.md new file mode 100644 index 00000000000..e5e0e287753 --- /dev/null +++ b/java/ql/src/change-notes/2022-04-27-intent-verification.md @@ -0,0 +1,6 @@ +--- +category: newQuery +--- +* A new query "Improper verification of intent by broadcast receiver" (`java/improper-intent-verification`) has been added. +This query finds instances of Android `BroadcastReceiver`s that don't verify the action string of received intents when registered +to receive system intents. \ No newline at end of file diff --git a/java/ql/src/change-notes/2022-06-29-move-contextual-queries.md b/java/ql/src/change-notes/2022-06-29-move-contextual-queries.md new file mode 100644 index 00000000000..02ff5b6d59c --- /dev/null +++ b/java/ql/src/change-notes/2022-06-29-move-contextual-queries.md @@ -0,0 +1,4 @@ +--- +category: breaking +--- +* Contextual queries and the query libraries they depend on have been moved to the `codeql/java-all` package. diff --git a/java/ql/src/change-notes/2022-06-22-log-injection-location.md b/java/ql/src/change-notes/released/0.2.0.md similarity index 86% rename from java/ql/src/change-notes/2022-06-22-log-injection-location.md rename to java/ql/src/change-notes/released/0.2.0.md index b74f7d5faf9..2deabd93b15 100644 --- a/java/ql/src/change-notes/2022-06-22-log-injection-location.md +++ b/java/ql/src/change-notes/released/0.2.0.md @@ -1,4 +1,5 @@ ---- -category: minorAnalysis ---- +## 0.2.0 + +### Minor Analysis Improvements + * The query `java/log-injection` now reports problems at the source (user-controlled data) instead of at the ultimate logging call. This was changed because user functions that wrap the ultimate logging call could result in most alerts being reported in an uninformative location. diff --git a/java/ql/src/codeql-pack.release.yml b/java/ql/src/codeql-pack.release.yml index e8ee3af8ef9..5274e27ed52 100644 --- a/java/ql/src/codeql-pack.release.yml +++ b/java/ql/src/codeql-pack.release.yml @@ -1,2 +1,2 @@ --- -lastReleaseVersion: 0.1.4 +lastReleaseVersion: 0.2.0 diff --git a/java/ql/src/qlpack.yml b/java/ql/src/qlpack.yml index e9a69afa178..2366eef3778 100644 --- a/java/ql/src/qlpack.yml +++ b/java/ql/src/qlpack.yml @@ -1,5 +1,5 @@ name: codeql/java-queries -version: 0.2.0-dev +version: 0.2.1-dev groups: - java - queries diff --git a/java/ql/test/kotlin/library-tests/classes/PrintAst.expected b/java/ql/test/kotlin/library-tests/classes/PrintAst.expected index 0346a4e0292..1ba8a3396bf 100644 --- a/java/ql/test/kotlin/library-tests/classes/PrintAst.expected +++ b/java/ql/test/kotlin/library-tests/classes/PrintAst.expected @@ -32,7 +32,7 @@ classes.kt: # 4| 0: [ReturnStmt] return ... # 4| 0: [VarAccess] this.arg # 4| -1: [ThisAccess] this -# 4| 2: [FieldDeclaration] int arg; +# 4| 3: [FieldDeclaration] int arg; # 4| -1: [TypeAccess] int # 4| 0: [VarAccess] arg # 5| 4: [Method] getX @@ -41,7 +41,7 @@ classes.kt: # 5| 0: [ReturnStmt] return ... # 5| 0: [VarAccess] this.x # 5| -1: [ThisAccess] this -# 5| 4: [FieldDeclaration] int x; +# 5| 5: [FieldDeclaration] int x; # 5| -1: [TypeAccess] int # 5| 0: [IntegerLiteral] 3 # 8| 4: [Class] ClassThree @@ -118,18 +118,18 @@ classes.kt: # 42| 0: [ReturnStmt] return ... # 42| 0: [VarAccess] this.x # 42| -1: [ThisAccess] this -# 42| 2: [FieldDeclaration] int x; +# 42| 3: [FieldDeclaration] int x; # 42| -1: [TypeAccess] int # 42| 0: [IntegerLiteral] 3 # 49| 11: [Class] Direction -# 0| 1: [Method] values -# 0| 3: [TypeAccess] Direction[] -# 0| 0: [TypeAccess] Direction -# 0| 1: [Method] valueOf +# 0| 2: [Method] valueOf # 0| 3: [TypeAccess] Direction #-----| 4: (Parameters) # 0| 0: [Parameter] value # 0| 0: [TypeAccess] String +# 0| 3: [Method] values +# 0| 3: [TypeAccess] Direction[] +# 0| 0: [TypeAccess] Direction # 49| 4: [Constructor] Direction # 49| 5: [BlockStmt] { ... } # 49| 0: [ExprStmt] ; @@ -154,14 +154,14 @@ classes.kt: # 50| 0: [ClassInstanceExpr] new Direction(...) # 50| -3: [TypeAccess] Direction # 53| 12: [Class] Color -# 0| 1: [Method] values -# 0| 3: [TypeAccess] Color[] -# 0| 0: [TypeAccess] Color -# 0| 1: [Method] valueOf +# 0| 2: [Method] valueOf # 0| 3: [TypeAccess] Color #-----| 4: (Parameters) # 0| 0: [Parameter] value # 0| 0: [TypeAccess] String +# 0| 3: [Method] values +# 0| 3: [TypeAccess] Color[] +# 0| 0: [TypeAccess] Color # 53| 4: [Constructor] Color #-----| 4: (Parameters) # 53| 0: [Parameter] rgb @@ -181,7 +181,7 @@ classes.kt: # 53| 0: [ReturnStmt] return ... # 53| 0: [VarAccess] this.rgb # 53| -1: [ThisAccess] this -# 53| 5: [FieldDeclaration] int rgb; +# 53| 6: [FieldDeclaration] int rgb; # 53| -1: [TypeAccess] int # 53| 0: [VarAccess] rgb # 54| 7: [FieldDeclaration] Color RED; @@ -266,7 +266,7 @@ classes.kt: # 73| 0: [ReturnStmt] return ... # 73| 0: [VarAccess] this.x # 73| -1: [ThisAccess] this -# 73| 2: [FieldDeclaration] int x; +# 73| 3: [FieldDeclaration] int x; # 73| -1: [TypeAccess] int # 73| 0: [IntegerLiteral] 1 # 74| 4: [Method] foo @@ -434,7 +434,7 @@ classes.kt: # 118| 1: [Constructor] # 118| 5: [BlockStmt] { ... } # 118| 0: [SuperConstructorInvocationStmt] super(...) -# 118| 1: [Method] localFn +# 118| 2: [Method] localFn # 118| 3: [TypeAccess] Unit # 118| 5: [BlockStmt] { ... } # 119| 0: [LocalTypeDeclStmt] class ... @@ -541,15 +541,15 @@ generic_anonymous.kt: # 3| 1: [ExprStmt] ; # 3| 0: [KtInitializerAssignExpr] ...=... # 3| 0: [VarAccess] x -# 1| 2: [Method] getT +# 1| 2: [FieldDeclaration] T t; +# 1| -1: [TypeAccess] T +# 1| 0: [VarAccess] t +# 1| 3: [Method] getT # 1| 3: [TypeAccess] T # 1| 5: [BlockStmt] { ... } # 1| 0: [ReturnStmt] return ... # 1| 0: [VarAccess] this.t # 1| -1: [ThisAccess] this -# 1| 2: [FieldDeclaration] T t; -# 1| -1: [TypeAccess] T -# 1| 0: [VarAccess] t # 3| 4: [FieldDeclaration] new Object(...) { ... } x; # 3| -1: [TypeAccess] new Object(...) { ... } # 3| 0: [TypeAccess] T @@ -564,17 +564,17 @@ generic_anonymous.kt: # 4| 0: [ExprStmt] ; # 4| 0: [KtInitializerAssignExpr] ...=... # 4| 0: [VarAccess] member -# 4| 2: [Method] getMember -# 4| 3: [TypeAccess] T -# 4| 5: [BlockStmt] { ... } -# 4| 0: [ReturnStmt] return ... -# 4| 0: [VarAccess] this.member -# 4| -1: [ThisAccess] this # 4| 2: [FieldDeclaration] T member; # 4| -1: [TypeAccess] T # 4| 0: [MethodAccess] getT(...) # 4| -1: [ThisAccess] Generic.this # 4| 0: [TypeAccess] Generic +# 4| 3: [Method] getMember +# 4| 3: [TypeAccess] T +# 4| 5: [BlockStmt] { ... } +# 4| 0: [ReturnStmt] return ... +# 4| 0: [VarAccess] this.member +# 4| -1: [ThisAccess] this # 3| 1: [ExprStmt] ; # 3| 0: [ClassInstanceExpr] new (...) # 3| -3: [TypeAccess] Object @@ -605,12 +605,6 @@ localClassField.kt: # 7| 1: [ExprStmt] ; # 7| 0: [KtInitializerAssignExpr] ...=... # 7| 0: [VarAccess] y -# 2| 2: [Method] getX -# 2| 3: [TypeAccess] Object -# 2| 5: [BlockStmt] { ... } -# 2| 0: [ReturnStmt] return ... -# 2| 0: [VarAccess] this.x -# 2| -1: [ThisAccess] this # 2| 2: [FieldDeclaration] Object x; # 2| -1: [TypeAccess] Object # 2| 0: [WhenExpr] when ... @@ -629,12 +623,12 @@ localClassField.kt: # 2| 1: [WhenBranch] ... -> ... # 2| 0: [BooleanLiteral] true # 5| 1: [BlockStmt] { ... } -# 7| 4: [Method] getY -# 7| 3: [TypeAccess] Object -# 7| 5: [BlockStmt] { ... } -# 7| 0: [ReturnStmt] return ... -# 7| 0: [VarAccess] this.y -# 7| -1: [ThisAccess] this +# 2| 3: [Method] getX +# 2| 3: [TypeAccess] Object +# 2| 5: [BlockStmt] { ... } +# 2| 0: [ReturnStmt] return ... +# 2| 0: [VarAccess] this.x +# 2| -1: [ThisAccess] this # 7| 4: [FieldDeclaration] Object y; # 7| -1: [TypeAccess] Object # 7| 0: [WhenExpr] when ... @@ -653,6 +647,12 @@ localClassField.kt: # 7| 1: [WhenBranch] ... -> ... # 7| 0: [BooleanLiteral] true # 10| 1: [BlockStmt] { ... } +# 7| 5: [Method] getY +# 7| 3: [TypeAccess] Object +# 7| 5: [BlockStmt] { ... } +# 7| 0: [ReturnStmt] return ... +# 7| 0: [VarAccess] this.y +# 7| -1: [ThisAccess] this local_anonymous.kt: # 0| [CompilationUnit] local_anonymous # 3| 1: [Class] Class1 @@ -686,7 +686,7 @@ local_anonymous.kt: # 11| 1: [Constructor] # 11| 5: [BlockStmt] { ... } # 11| 0: [SuperConstructorInvocationStmt] super(...) -# 11| 1: [Method] fnLocal +# 11| 2: [Method] fnLocal # 11| 3: [TypeAccess] Unit # 11| 5: [BlockStmt] { ... } # 12| 1: [ExprStmt] ; @@ -703,7 +703,7 @@ local_anonymous.kt: # 16| 1: [Constructor] # 16| 5: [BlockStmt] { ... } # 16| 0: [SuperConstructorInvocationStmt] super(...) -# 16| 1: [Method] invoke +# 16| 2: [Method] invoke # 16| 3: [TypeAccess] int #-----| 4: (Parameters) # 16| 0: [Parameter] a @@ -726,7 +726,7 @@ local_anonymous.kt: # 17| 1: [Constructor] # 17| 5: [BlockStmt] { ... } # 17| 0: [SuperConstructorInvocationStmt] super(...) -# 17| 1: [Method] invoke +# 17| 2: [Method] invoke # 17| 3: [TypeAccess] int #-----| 4: (Parameters) # 17| 0: [Parameter] a @@ -752,7 +752,7 @@ local_anonymous.kt: # 21| 1: [Constructor] # 21| 5: [BlockStmt] { ... } # 21| 0: [SuperConstructorInvocationStmt] super(...) -# 21| 1: [Method] invoke +# 21| 2: [Method] invoke #-----| 4: (Parameters) # 21| 0: [Parameter] a0 # 21| 5: [BlockStmt] { ... } @@ -797,7 +797,10 @@ local_anonymous.kt: # 30| 0: [ReturnStmt] return ... # 30| 0: [VarAccess] this.x # 30| -1: [ThisAccess] this -# 30| 2: [Method] setX +# 30| 3: [FieldDeclaration] int x; +# 30| -1: [TypeAccess] int +# 30| 0: [IntegerLiteral] 1 +# 30| 4: [Method] setX # 30| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 30| 0: [Parameter] @@ -808,9 +811,6 @@ local_anonymous.kt: # 30| 0: [VarAccess] this.x # 30| -1: [ThisAccess] this # 30| 1: [VarAccess] -# 30| 2: [FieldDeclaration] int x; -# 30| -1: [TypeAccess] int -# 30| 0: [IntegerLiteral] 1 # 32| 5: [Method] member # 32| 3: [TypeAccess] Unit # 32| 5: [BlockStmt] { ... } @@ -840,23 +840,6 @@ local_anonymous.kt: # 40| 0: [ExprStmt] ; # 40| 0: [KtInitializerAssignExpr] ...=... # 40| 0: [VarAccess] i -# 40| 2: [Method] getI -# 40| 3: [TypeAccess] Interface2 -# 40| 5: [BlockStmt] { ... } -# 40| 0: [ReturnStmt] return ... -# 40| 0: [VarAccess] this.i -# 40| -1: [ThisAccess] this -# 40| 2: [Method] setI -# 40| 3: [TypeAccess] Unit -#-----| 4: (Parameters) -# 40| 0: [Parameter] -# 40| 0: [TypeAccess] Interface2 -# 40| 5: [BlockStmt] { ... } -# 40| 0: [ExprStmt] ; -# 40| 0: [AssignExpr] ...=... -# 40| 0: [VarAccess] this.i -# 40| -1: [ThisAccess] this -# 40| 1: [VarAccess] # 40| 2: [FieldDeclaration] Interface2 i; # 40| -1: [TypeAccess] Interface2 # 40| 0: [StmtExpr] @@ -873,6 +856,23 @@ local_anonymous.kt: # 40| 1: [ExprStmt] ; # 40| 0: [ClassInstanceExpr] new (...) # 40| -3: [TypeAccess] Interface2 +# 40| 3: [Method] getI +# 40| 3: [TypeAccess] Interface2 +# 40| 5: [BlockStmt] { ... } +# 40| 0: [ReturnStmt] return ... +# 40| 0: [VarAccess] this.i +# 40| -1: [ThisAccess] this +# 40| 4: [Method] setI +# 40| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 40| 0: [Parameter] +# 40| 0: [TypeAccess] Interface2 +# 40| 5: [BlockStmt] { ... } +# 40| 0: [ExprStmt] ; +# 40| 0: [AssignExpr] ...=... +# 40| 0: [VarAccess] this.i +# 40| -1: [ThisAccess] this +# 40| 1: [VarAccess] superChain.kt: # 0| [CompilationUnit] superChain # 1| 1: [Class,GenericType,ParameterizedType] SuperChain1 diff --git a/java/ql/test/kotlin/library-tests/data-classes/PrintAst.expected b/java/ql/test/kotlin/library-tests/data-classes/PrintAst.expected index 06f6a78ce60..aa31626daeb 100644 --- a/java/ql/test/kotlin/library-tests/data-classes/PrintAst.expected +++ b/java/ql/test/kotlin/library-tests/data-classes/PrintAst.expected @@ -7,14 +7,14 @@ dc.kt: # 0| 0: [ReturnStmt] return ... # 0| 0: [VarAccess] this.bytes # 0| -1: [ThisAccess] this -# 0| 1: [Method] component2 +# 0| 2: [Method] component2 # 0| 3: [TypeAccess] String[] # 0| 0: [TypeAccess] String # 0| 5: [BlockStmt] { ... } # 0| 0: [ReturnStmt] return ... # 0| 0: [VarAccess] this.strs # 0| -1: [ThisAccess] this -# 0| 1: [Method] copy +# 0| 3: [Method] copy # 0| 3: [TypeAccess] ProtoMapValue #-----| 4: (Parameters) # 1| 0: [Parameter] bytes @@ -28,47 +28,7 @@ dc.kt: # 0| -3: [TypeAccess] ProtoMapValue # 0| 0: [VarAccess] bytes # 0| 1: [VarAccess] strs -# 0| 1: [Method] toString -# 0| 3: [TypeAccess] String -# 0| 5: [BlockStmt] { ... } -# 0| 0: [ReturnStmt] return ... -# 0| 0: [StringTemplateExpr] "..." -# 0| 0: [StringLiteral] ProtoMapValue( -# 0| 1: [StringLiteral] bytes= -# 0| 2: [MethodAccess] toString(...) -# 0| -1: [TypeAccess] Arrays -# 0| 0: [VarAccess] this.bytes -# 0| -1: [ThisAccess] this -# 0| 3: [StringLiteral] , -# 0| 4: [StringLiteral] strs= -# 0| 5: [MethodAccess] toString(...) -# 0| -1: [TypeAccess] Arrays -# 0| 0: [VarAccess] this.strs -# 0| -1: [ThisAccess] this -# 0| 6: [StringLiteral] ) -# 0| 1: [Method] hashCode -# 0| 3: [TypeAccess] int -# 0| 5: [BlockStmt] { ... } -# 0| 0: [LocalVariableDeclStmt] var ...; -# 0| 1: [LocalVariableDeclExpr] result -# 0| 0: [MethodAccess] hashCode(...) -# 0| -1: [TypeAccess] Arrays -# 0| 0: [VarAccess] this.bytes -# 0| -1: [ThisAccess] this -# 0| 1: [ExprStmt] ; -# 0| 0: [AssignExpr] ...=... -# 0| 0: [VarAccess] result -# 0| 1: [MethodAccess] plus(...) -# 0| -1: [MethodAccess] times(...) -# 0| -1: [VarAccess] result -# 0| 0: [IntegerLiteral] 31 -# 0| 0: [MethodAccess] hashCode(...) -# 0| -1: [TypeAccess] Arrays -# 0| 0: [VarAccess] this.strs -# 0| -1: [ThisAccess] this -# 0| 2: [ReturnStmt] return ... -# 0| 0: [VarAccess] result -# 0| 1: [Method] equals +# 0| 4: [Method] equals # 0| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 0| 0: [Parameter] other @@ -117,6 +77,46 @@ dc.kt: # 0| 0: [BooleanLiteral] false # 0| 5: [ReturnStmt] return ... # 0| 0: [BooleanLiteral] true +# 0| 5: [Method] hashCode +# 0| 3: [TypeAccess] int +# 0| 5: [BlockStmt] { ... } +# 0| 0: [LocalVariableDeclStmt] var ...; +# 0| 1: [LocalVariableDeclExpr] result +# 0| 0: [MethodAccess] hashCode(...) +# 0| -1: [TypeAccess] Arrays +# 0| 0: [VarAccess] this.bytes +# 0| -1: [ThisAccess] this +# 0| 1: [ExprStmt] ; +# 0| 0: [AssignExpr] ...=... +# 0| 0: [VarAccess] result +# 0| 1: [MethodAccess] plus(...) +# 0| -1: [MethodAccess] times(...) +# 0| -1: [VarAccess] result +# 0| 0: [IntegerLiteral] 31 +# 0| 0: [MethodAccess] hashCode(...) +# 0| -1: [TypeAccess] Arrays +# 0| 0: [VarAccess] this.strs +# 0| -1: [ThisAccess] this +# 0| 2: [ReturnStmt] return ... +# 0| 0: [VarAccess] result +# 0| 6: [Method] toString +# 0| 3: [TypeAccess] String +# 0| 5: [BlockStmt] { ... } +# 0| 0: [ReturnStmt] return ... +# 0| 0: [StringTemplateExpr] "..." +# 0| 0: [StringLiteral] ProtoMapValue( +# 0| 1: [StringLiteral] bytes= +# 0| 2: [MethodAccess] toString(...) +# 0| -1: [TypeAccess] Arrays +# 0| 0: [VarAccess] this.bytes +# 0| -1: [ThisAccess] this +# 0| 3: [StringLiteral] , +# 0| 4: [StringLiteral] strs= +# 0| 5: [MethodAccess] toString(...) +# 0| -1: [TypeAccess] Arrays +# 0| 0: [VarAccess] this.strs +# 0| -1: [ThisAccess] this +# 0| 6: [StringLiteral] ) # 1| 7: [Constructor] ProtoMapValue #-----| 4: (Parameters) # 1| 0: [Parameter] bytes @@ -133,23 +133,23 @@ dc.kt: # 1| 1: [ExprStmt] ; # 1| 0: [KtInitializerAssignExpr] ...=... # 1| 0: [VarAccess] strs -# 1| 8: [Method] getBytes +# 1| 8: [FieldDeclaration] byte[] bytes; +# 1| -1: [TypeAccess] byte[] +# 1| 0: [VarAccess] bytes +# 1| 9: [Method] getBytes # 1| 3: [TypeAccess] byte[] # 1| 5: [BlockStmt] { ... } # 1| 0: [ReturnStmt] return ... # 1| 0: [VarAccess] this.bytes # 1| -1: [ThisAccess] this -# 1| 8: [FieldDeclaration] byte[] bytes; -# 1| -1: [TypeAccess] byte[] -# 1| 0: [VarAccess] bytes -# 1| 10: [Method] getStrs +# 1| 10: [FieldDeclaration] String[] strs; +# 1| -1: [TypeAccess] String[] +# 1| 0: [TypeAccess] String +# 1| 0: [VarAccess] strs +# 1| 11: [Method] getStrs # 1| 3: [TypeAccess] String[] # 1| 0: [TypeAccess] String # 1| 5: [BlockStmt] { ... } # 1| 0: [ReturnStmt] return ... # 1| 0: [VarAccess] this.strs # 1| -1: [ThisAccess] this -# 1| 10: [FieldDeclaration] String[] strs; -# 1| -1: [TypeAccess] String[] -# 1| 0: [TypeAccess] String -# 1| 0: [VarAccess] strs diff --git a/java/ql/test/kotlin/library-tests/dataflow/whenexpr/WhenExpr.kt b/java/ql/test/kotlin/library-tests/dataflow/whenexpr/WhenExpr.kt index c7144d2a307..595299bc45b 100644 --- a/java/ql/test/kotlin/library-tests/dataflow/whenexpr/WhenExpr.kt +++ b/java/ql/test/kotlin/library-tests/dataflow/whenexpr/WhenExpr.kt @@ -1,10 +1,10 @@ class WhenExpr { fun taint() = Uri() - fun sink(s: String) { } + fun sink(s: String?) { } - fun bad() { - val s0 = taint() + fun bad(b: Boolean) { + val s0 = if (b) taint() else null sink(s0?.getQueryParameter()) } } diff --git a/java/ql/test/kotlin/library-tests/dataflow/whenexpr/test.expected b/java/ql/test/kotlin/library-tests/dataflow/whenexpr/test.expected index 3423d46014b..1ab2f8d67d8 100644 --- a/java/ql/test/kotlin/library-tests/dataflow/whenexpr/test.expected +++ b/java/ql/test/kotlin/library-tests/dataflow/whenexpr/test.expected @@ -1 +1 @@ -| WhenExpr.kt:7:14:7:20 | taint(...) | WhenExpr.kt:8:14:8:32 | | +| WhenExpr.kt:7:21:7:27 | taint(...) | WhenExpr.kt:8:14:8:32 | | diff --git a/java/ql/test/kotlin/library-tests/exprs/PrintAst.expected b/java/ql/test/kotlin/library-tests/exprs/PrintAst.expected index 8696254be8f..879eb93c94e 100644 --- a/java/ql/test/kotlin/library-tests/exprs/PrintAst.expected +++ b/java/ql/test/kotlin/library-tests/exprs/PrintAst.expected @@ -7,7 +7,10 @@ delegatedProperties.kt: # 60| 0: [ReturnStmt] return ... # 60| 0: [VarAccess] DelegatedPropertiesKt.topLevelInt # 60| -1: [TypeAccess] DelegatedPropertiesKt -# 60| 2: [Method] setTopLevelInt +# 60| 3: [FieldDeclaration] int topLevelInt; +# 60| -1: [TypeAccess] int +# 60| 0: [IntegerLiteral] 0 +# 60| 4: [Method] setTopLevelInt # 60| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 60| 0: [Parameter] @@ -18,10 +21,35 @@ delegatedProperties.kt: # 60| 0: [VarAccess] DelegatedPropertiesKt.topLevelInt # 60| -1: [TypeAccess] DelegatedPropertiesKt # 60| 1: [VarAccess] -# 60| 2: [FieldDeclaration] int topLevelInt; -# 60| -1: [TypeAccess] int -# 60| 0: [IntegerLiteral] 0 -# 87| 5: [ExtensionMethod] getExtDelegated +# 87| 5: [FieldDeclaration] KMutableProperty0 extDelegated$delegateMyClass; +# 87| -1: [TypeAccess] KMutableProperty0 +# 87| 0: [TypeAccess] Integer +# 87| 0: [PropertyRefExpr] ...::... +# 87| -4: [AnonymousClass] new KMutableProperty0(...) { ... } +# 87| 1: [Constructor] +# 87| 5: [BlockStmt] { ... } +# 87| 0: [SuperConstructorInvocationStmt] super(...) +# 87| 2: [Method] get +# 87| 5: [BlockStmt] { ... } +# 87| 0: [ReturnStmt] return ... +# 87| 0: [MethodAccess] getTopLevelInt(...) +# 87| -1: [TypeAccess] DelegatedPropertiesKt +# 87| 3: [Method] invoke +# 87| 5: [BlockStmt] { ... } +# 87| 0: [ReturnStmt] return ... +# 87| 0: [MethodAccess] get(...) +# 87| -1: [ThisAccess] this +# 87| 4: [Method] set +#-----| 4: (Parameters) +# 87| 0: [Parameter] a0 +# 87| 5: [BlockStmt] { ... } +# 87| 0: [ReturnStmt] return ... +# 87| 0: [MethodAccess] setTopLevelInt(...) +# 87| -1: [TypeAccess] DelegatedPropertiesKt +# 87| 0: [VarAccess] a0 +# 87| -3: [TypeAccess] KMutableProperty0 +# 87| 0: [TypeAccess] Integer +# 87| 6: [ExtensionMethod] getExtDelegated # 87| 3: [TypeAccess] int #-----| 4: (Parameters) # 87| 0: [Parameter] @@ -39,7 +67,7 @@ delegatedProperties.kt: # 87| 1: [Constructor] # 87| 5: [BlockStmt] { ... } # 87| 0: [SuperConstructorInvocationStmt] super(...) -# 87| 1: [Method] get +# 87| 2: [Method] get #-----| 4: (Parameters) # 87| 0: [Parameter] a0 # 87| 5: [BlockStmt] { ... } @@ -47,7 +75,7 @@ delegatedProperties.kt: # 87| 0: [MethodAccess] getExtDelegated(...) # 87| -1: [TypeAccess] DelegatedPropertiesKt # 87| 0: [VarAccess] a0 -# 87| 1: [Method] invoke +# 87| 3: [Method] invoke #-----| 4: (Parameters) # 87| 0: [Parameter] a0 # 87| 5: [BlockStmt] { ... } @@ -55,7 +83,7 @@ delegatedProperties.kt: # 87| 0: [MethodAccess] get(...) # 87| -1: [ThisAccess] this # 87| 0: [VarAccess] a0 -# 87| 1: [Method] set +# 87| 4: [Method] set #-----| 4: (Parameters) # 87| 0: [Parameter] a0 # 87| 1: [Parameter] a1 @@ -68,7 +96,7 @@ delegatedProperties.kt: # 87| -3: [TypeAccess] KMutableProperty1 # 87| 0: [TypeAccess] MyClass # 87| 1: [TypeAccess] Integer -# 87| 5: [ExtensionMethod] setExtDelegated +# 87| 7: [ExtensionMethod] setExtDelegated # 87| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 87| 0: [Parameter] @@ -88,7 +116,7 @@ delegatedProperties.kt: # 87| 1: [Constructor] # 87| 5: [BlockStmt] { ... } # 87| 0: [SuperConstructorInvocationStmt] super(...) -# 87| 1: [Method] get +# 87| 2: [Method] get #-----| 4: (Parameters) # 87| 0: [Parameter] a0 # 87| 5: [BlockStmt] { ... } @@ -96,7 +124,7 @@ delegatedProperties.kt: # 87| 0: [MethodAccess] getExtDelegated(...) # 87| -1: [TypeAccess] DelegatedPropertiesKt # 87| 0: [VarAccess] a0 -# 87| 1: [Method] invoke +# 87| 3: [Method] invoke #-----| 4: (Parameters) # 87| 0: [Parameter] a0 # 87| 5: [BlockStmt] { ... } @@ -104,7 +132,7 @@ delegatedProperties.kt: # 87| 0: [MethodAccess] get(...) # 87| -1: [ThisAccess] this # 87| 0: [VarAccess] a0 -# 87| 1: [Method] set +# 87| 4: [Method] set #-----| 4: (Parameters) # 87| 0: [Parameter] a0 # 87| 1: [Parameter] a1 @@ -118,34 +146,6 @@ delegatedProperties.kt: # 87| 0: [TypeAccess] MyClass # 87| 1: [TypeAccess] Integer # 87| 3: [VarAccess] -# 87| 5: [FieldDeclaration] KMutableProperty0 extDelegated$delegateMyClass; -# 87| -1: [TypeAccess] KMutableProperty0 -# 87| 0: [TypeAccess] Integer -# 87| 0: [PropertyRefExpr] ...::... -# 87| -4: [AnonymousClass] new KMutableProperty0(...) { ... } -# 87| 1: [Constructor] -# 87| 5: [BlockStmt] { ... } -# 87| 0: [SuperConstructorInvocationStmt] super(...) -# 87| 1: [Method] get -# 87| 5: [BlockStmt] { ... } -# 87| 0: [ReturnStmt] return ... -# 87| 0: [MethodAccess] getTopLevelInt(...) -# 87| -1: [TypeAccess] DelegatedPropertiesKt -# 87| 1: [Method] invoke -# 87| 5: [BlockStmt] { ... } -# 87| 0: [ReturnStmt] return ... -# 87| 0: [MethodAccess] get(...) -# 87| -1: [ThisAccess] this -# 87| 1: [Method] set -#-----| 4: (Parameters) -# 87| 0: [Parameter] a0 -# 87| 5: [BlockStmt] { ... } -# 87| 0: [ReturnStmt] return ... -# 87| 0: [MethodAccess] setTopLevelInt(...) -# 87| -1: [TypeAccess] DelegatedPropertiesKt -# 87| 0: [VarAccess] a0 -# 87| -3: [TypeAccess] KMutableProperty0 -# 87| 0: [TypeAccess] Integer # 4| 2: [Class] ClassProp1 # 4| 1: [Constructor] ClassProp1 # 4| 5: [BlockStmt] { ... } @@ -165,7 +165,7 @@ delegatedProperties.kt: # 6| 1: [Constructor] # 6| 5: [BlockStmt] { ... } # 6| 0: [SuperConstructorInvocationStmt] super(...) -# 6| 1: [Method] invoke +# 6| 2: [Method] invoke # 6| 3: [TypeAccess] int # 7| 5: [BlockStmt] { ... } # 7| 0: [ExprStmt] ; @@ -181,7 +181,7 @@ delegatedProperties.kt: # 6| 1: [Constructor] # 6| 5: [BlockStmt] { ... } # 6| 0: [SuperConstructorInvocationStmt] super(...) -# 6| 1: [Method] +# 6| 2: [Method] # 6| 3: [TypeAccess] int # 6| 5: [BlockStmt] { ... } # 6| 0: [ReturnStmt] return ... @@ -195,13 +195,13 @@ delegatedProperties.kt: # 6| 1: [Constructor] # 6| 5: [BlockStmt] { ... } # 6| 0: [SuperConstructorInvocationStmt] super(...) -# 6| 1: [Method] get +# 6| 2: [Method] get # 6| 5: [BlockStmt] { ... } # 6| 0: [ReturnStmt] return ... # 6| 0: [MethodAccess] (...) # 6| -1: [ClassInstanceExpr] new (...) # 6| -3: [TypeAccess] Object -# 6| 1: [Method] invoke +# 6| 3: [Method] invoke # 6| 5: [BlockStmt] { ... } # 6| 0: [ReturnStmt] return ... # 6| 0: [MethodAccess] get(...) @@ -252,7 +252,7 @@ delegatedProperties.kt: # 19| 1: [Constructor] # 19| 5: [BlockStmt] { ... } # 19| 0: [SuperConstructorInvocationStmt] super(...) -# 19| 1: [Method] +# 19| 2: [Method] # 19| 3: [TypeAccess] int # 19| 5: [BlockStmt] { ... } # 19| 0: [ReturnStmt] return ... @@ -264,18 +264,18 @@ delegatedProperties.kt: # 19| 1: [Constructor] # 19| 5: [BlockStmt] { ... } # 19| 0: [SuperConstructorInvocationStmt] super(...) -# 19| 1: [Method] get +# 19| 2: [Method] get # 19| 5: [BlockStmt] { ... } # 19| 0: [ReturnStmt] return ... # 19| 0: [MethodAccess] (...) # 19| -1: [ClassInstanceExpr] new (...) # 19| -3: [TypeAccess] Object -# 19| 1: [Method] invoke +# 19| 3: [Method] invoke # 19| 5: [BlockStmt] { ... } # 19| 0: [ReturnStmt] return ... # 19| 0: [MethodAccess] get(...) # 19| -1: [ThisAccess] this -# 19| 1: [Method] set +# 19| 4: [Method] set #-----| 4: (Parameters) # 19| 0: [Parameter] a0 # 19| 5: [BlockStmt] { ... } @@ -291,7 +291,7 @@ delegatedProperties.kt: # 19| 1: [Constructor] # 19| 5: [BlockStmt] { ... } # 19| 0: [SuperConstructorInvocationStmt] super(...) -# 19| 1: [Method] +# 19| 2: [Method] # 19| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 19| 0: [Parameter] value @@ -306,18 +306,18 @@ delegatedProperties.kt: # 19| 1: [Constructor] # 19| 5: [BlockStmt] { ... } # 19| 0: [SuperConstructorInvocationStmt] super(...) -# 19| 1: [Method] get +# 19| 2: [Method] get # 19| 5: [BlockStmt] { ... } # 19| 0: [ReturnStmt] return ... # 19| 0: [MethodAccess] (...) # 19| -1: [ClassInstanceExpr] new (...) # 19| -3: [TypeAccess] Object -# 19| 1: [Method] invoke +# 19| 3: [Method] invoke # 19| 5: [BlockStmt] { ... } # 19| 0: [ReturnStmt] return ... # 19| 0: [MethodAccess] get(...) # 19| -1: [ThisAccess] this -# 19| 1: [Method] set +# 19| 4: [Method] set #-----| 4: (Parameters) # 19| 0: [Parameter] a0 # 19| 5: [BlockStmt] { ... } @@ -349,7 +349,7 @@ delegatedProperties.kt: # 23| 1: [Constructor] # 23| 5: [BlockStmt] { ... } # 23| 0: [SuperConstructorInvocationStmt] super(...) -# 23| 1: [Method] +# 23| 2: [Method] # 23| 3: [TypeAccess] String # 23| 5: [BlockStmt] { ... } # 23| 0: [ReturnStmt] return ... @@ -364,13 +364,13 @@ delegatedProperties.kt: # 23| 1: [Constructor] # 23| 5: [BlockStmt] { ... } # 23| 0: [SuperConstructorInvocationStmt] super(...) -# 23| 1: [Method] get +# 23| 2: [Method] get # 23| 5: [BlockStmt] { ... } # 23| 0: [ReturnStmt] return ... # 23| 0: [MethodAccess] (...) # 23| -1: [ClassInstanceExpr] new (...) # 23| -3: [TypeAccess] Object -# 23| 1: [Method] invoke +# 23| 3: [Method] invoke # 23| 5: [BlockStmt] { ... } # 23| 0: [ReturnStmt] return ... # 23| 0: [MethodAccess] get(...) @@ -382,7 +382,7 @@ delegatedProperties.kt: # 25| 1: [Constructor] # 25| 5: [BlockStmt] { ... } # 25| 0: [SuperConstructorInvocationStmt] super(...) -# 25| 1: [Method] resourceDelegate +# 25| 2: [Method] resourceDelegate # 25| 3: [TypeAccess] ReadWriteProperty # 25| 0: [TypeAccess] Object # 25| 1: [TypeAccess] Integer @@ -405,7 +405,10 @@ delegatedProperties.kt: # 26| 0: [ReturnStmt] return ... # 26| 0: [VarAccess] this.curValue # 26| -1: [ThisAccess] this -# 26| 2: [Method] setCurValue +# 26| 3: [FieldDeclaration] int curValue; +# 26| -1: [TypeAccess] int +# 26| 0: [IntegerLiteral] 0 +# 26| 4: [Method] setCurValue # 26| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 26| 0: [Parameter] @@ -416,9 +419,6 @@ delegatedProperties.kt: # 26| 0: [VarAccess] this.curValue # 26| -1: [ThisAccess] this # 26| 1: [VarAccess] -# 26| 2: [FieldDeclaration] int curValue; -# 26| -1: [TypeAccess] int -# 26| 0: [IntegerLiteral] 0 # 27| 5: [Method] getValue # 27| 3: [TypeAccess] int #-----| 4: (Parameters) @@ -460,7 +460,7 @@ delegatedProperties.kt: # 33| 1: [Constructor] # 33| 5: [BlockStmt] { ... } # 33| 0: [SuperConstructorInvocationStmt] super(...) -# 33| 1: [Method] +# 33| 2: [Method] # 33| 3: [TypeAccess] int # 33| 5: [BlockStmt] { ... } # 33| 0: [ReturnStmt] return ... @@ -472,13 +472,13 @@ delegatedProperties.kt: # 33| 1: [Constructor] # 33| 5: [BlockStmt] { ... } # 33| 0: [SuperConstructorInvocationStmt] super(...) -# 33| 1: [Method] get +# 33| 2: [Method] get # 33| 5: [BlockStmt] { ... } # 33| 0: [ReturnStmt] return ... # 33| 0: [MethodAccess] (...) # 33| -1: [ClassInstanceExpr] new (...) # 33| -3: [TypeAccess] Object -# 33| 1: [Method] invoke +# 33| 3: [Method] invoke # 33| 5: [BlockStmt] { ... } # 33| 0: [ReturnStmt] return ... # 33| 0: [MethodAccess] get(...) @@ -496,7 +496,7 @@ delegatedProperties.kt: # 34| 1: [Constructor] # 34| 5: [BlockStmt] { ... } # 34| 0: [SuperConstructorInvocationStmt] super(...) -# 34| 1: [Method] +# 34| 2: [Method] # 34| 3: [TypeAccess] int # 34| 5: [BlockStmt] { ... } # 34| 0: [ReturnStmt] return ... @@ -508,18 +508,18 @@ delegatedProperties.kt: # 34| 1: [Constructor] # 34| 5: [BlockStmt] { ... } # 34| 0: [SuperConstructorInvocationStmt] super(...) -# 34| 1: [Method] get +# 34| 2: [Method] get # 34| 5: [BlockStmt] { ... } # 34| 0: [ReturnStmt] return ... # 34| 0: [MethodAccess] (...) # 34| -1: [ClassInstanceExpr] new (...) # 34| -3: [TypeAccess] Object -# 34| 1: [Method] invoke +# 34| 3: [Method] invoke # 34| 5: [BlockStmt] { ... } # 34| 0: [ReturnStmt] return ... # 34| 0: [MethodAccess] get(...) # 34| -1: [ThisAccess] this -# 34| 1: [Method] set +# 34| 4: [Method] set #-----| 4: (Parameters) # 34| 0: [Parameter] a0 # 34| 5: [BlockStmt] { ... } @@ -535,7 +535,7 @@ delegatedProperties.kt: # 34| 1: [Constructor] # 34| 5: [BlockStmt] { ... } # 34| 0: [SuperConstructorInvocationStmt] super(...) -# 34| 1: [Method] +# 34| 2: [Method] # 34| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 34| 0: [Parameter] value @@ -550,18 +550,18 @@ delegatedProperties.kt: # 34| 1: [Constructor] # 34| 5: [BlockStmt] { ... } # 34| 0: [SuperConstructorInvocationStmt] super(...) -# 34| 1: [Method] get +# 34| 2: [Method] get # 34| 5: [BlockStmt] { ... } # 34| 0: [ReturnStmt] return ... # 34| 0: [MethodAccess] (...) # 34| -1: [ClassInstanceExpr] new (...) # 34| -3: [TypeAccess] Object -# 34| 1: [Method] invoke +# 34| 3: [Method] invoke # 34| 5: [BlockStmt] { ... } # 34| 0: [ReturnStmt] return ... # 34| 0: [MethodAccess] get(...) # 34| -1: [ThisAccess] this -# 34| 1: [Method] set +# 34| 4: [Method] set #-----| 4: (Parameters) # 34| 0: [Parameter] a0 # 34| 5: [BlockStmt] { ... } @@ -594,13 +594,13 @@ delegatedProperties.kt: # 39| 1: [Constructor] # 39| 5: [BlockStmt] { ... } # 39| 0: [SuperConstructorInvocationStmt] super(...) -# 39| 1: [Method] get +# 39| 2: [Method] get # 39| 5: [BlockStmt] { ... } # 39| 0: [ReturnStmt] return ... # 39| 0: [MethodAccess] (...) # 39| -1: [ClassInstanceExpr] new (...) # 39| -3: [TypeAccess] Object -# 39| 1: [Method] invoke +# 39| 3: [Method] invoke # 39| 5: [BlockStmt] { ... } # 39| 0: [ReturnStmt] return ... # 39| 0: [MethodAccess] get(...) @@ -612,7 +612,7 @@ delegatedProperties.kt: # 39| 1: [Constructor] # 39| 5: [BlockStmt] { ... } # 39| 0: [SuperConstructorInvocationStmt] super(...) -# 39| 1: [Method] +# 39| 2: [Method] # 39| 3: [TypeAccess] int # 39| 5: [BlockStmt] { ... } # 39| 0: [ReturnStmt] return ... @@ -624,20 +624,24 @@ delegatedProperties.kt: # 39| 1: [Constructor] # 39| 5: [BlockStmt] { ... } # 39| 0: [SuperConstructorInvocationStmt] super(...) -# 39| 1: [Method] get +# 39| 2: [Method] get # 39| 5: [BlockStmt] { ... } # 39| 0: [ReturnStmt] return ... # 39| 0: [MethodAccess] (...) # 39| -1: [ClassInstanceExpr] new (...) # 39| -3: [TypeAccess] Object -# 39| 1: [Method] invoke +# 39| 3: [Method] invoke # 39| 5: [BlockStmt] { ... } # 39| 0: [ReturnStmt] return ... # 39| 0: [MethodAccess] get(...) # 39| -1: [ThisAccess] this # 39| -3: [TypeAccess] KProperty0 # 39| 0: [TypeAccess] Integer -# 42| 3: [Method] getVarResource0 +# 42| 3: [FieldDeclaration] ResourceDelegate varResource0$delegate; +# 42| -1: [TypeAccess] ResourceDelegate +# 42| 0: [ClassInstanceExpr] new ResourceDelegate(...) +# 42| -3: [TypeAccess] ResourceDelegate +# 42| 4: [Method] getVarResource0 # 42| 3: [TypeAccess] int # 42| 5: [BlockStmt] { ... } # 42| 0: [ReturnStmt] return ... @@ -650,14 +654,14 @@ delegatedProperties.kt: # 42| 1: [Constructor] # 42| 5: [BlockStmt] { ... } # 42| 0: [SuperConstructorInvocationStmt] super(...) -# 42| 1: [Method] get +# 42| 2: [Method] get #-----| 4: (Parameters) # 42| 0: [Parameter] a0 # 42| 5: [BlockStmt] { ... } # 42| 0: [ReturnStmt] return ... # 42| 0: [MethodAccess] getVarResource0(...) # 42| -1: [VarAccess] a0 -# 42| 1: [Method] invoke +# 42| 3: [Method] invoke #-----| 4: (Parameters) # 42| 0: [Parameter] a0 # 42| 5: [BlockStmt] { ... } @@ -665,7 +669,7 @@ delegatedProperties.kt: # 42| 0: [MethodAccess] get(...) # 42| -1: [ThisAccess] this # 42| 0: [VarAccess] a0 -# 42| 1: [Method] set +# 42| 4: [Method] set #-----| 4: (Parameters) # 42| 0: [Parameter] a0 # 42| 1: [Parameter] a1 @@ -677,7 +681,7 @@ delegatedProperties.kt: # 42| -3: [TypeAccess] KMutableProperty1 # 42| 0: [TypeAccess] Owner # 42| 1: [TypeAccess] Integer -# 42| 3: [Method] setVarResource0 +# 42| 5: [Method] setVarResource0 # 42| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 42| 0: [Parameter] @@ -693,14 +697,14 @@ delegatedProperties.kt: # 42| 1: [Constructor] # 42| 5: [BlockStmt] { ... } # 42| 0: [SuperConstructorInvocationStmt] super(...) -# 42| 1: [Method] get +# 42| 2: [Method] get #-----| 4: (Parameters) # 42| 0: [Parameter] a0 # 42| 5: [BlockStmt] { ... } # 42| 0: [ReturnStmt] return ... # 42| 0: [MethodAccess] getVarResource0(...) # 42| -1: [VarAccess] a0 -# 42| 1: [Method] invoke +# 42| 3: [Method] invoke #-----| 4: (Parameters) # 42| 0: [Parameter] a0 # 42| 5: [BlockStmt] { ... } @@ -708,7 +712,7 @@ delegatedProperties.kt: # 42| 0: [MethodAccess] get(...) # 42| -1: [ThisAccess] this # 42| 0: [VarAccess] a0 -# 42| 1: [Method] set +# 42| 4: [Method] set #-----| 4: (Parameters) # 42| 0: [Parameter] a0 # 42| 1: [Parameter] a1 @@ -721,10 +725,6 @@ delegatedProperties.kt: # 42| 0: [TypeAccess] Owner # 42| 1: [TypeAccess] Integer # 42| 2: [VarAccess] -# 42| 3: [FieldDeclaration] ResourceDelegate varResource0$delegate; -# 42| -1: [TypeAccess] ResourceDelegate -# 42| 0: [ClassInstanceExpr] new ResourceDelegate(...) -# 42| -3: [TypeAccess] ResourceDelegate # 45| 5: [Class] ResourceDelegate # 45| 1: [Constructor] ResourceDelegate # 45| 5: [BlockStmt] { ... } @@ -786,7 +786,7 @@ delegatedProperties.kt: # 62| 0: [ReturnStmt] return ... # 62| 0: [VarAccess] this.anotherClassInt # 62| -1: [ThisAccess] this -# 62| 2: [FieldDeclaration] int anotherClassInt; +# 62| 3: [FieldDeclaration] int anotherClassInt; # 62| -1: [TypeAccess] int # 62| 0: [VarAccess] anotherClassInt # 63| 8: [Class] Base @@ -806,7 +806,7 @@ delegatedProperties.kt: # 63| 0: [ReturnStmt] return ... # 63| 0: [VarAccess] this.baseClassInt # 63| -1: [ThisAccess] this -# 63| 2: [FieldDeclaration] int baseClassInt; +# 63| 3: [FieldDeclaration] int baseClassInt; # 63| -1: [TypeAccess] int # 63| 0: [VarAccess] baseClassInt # 65| 9: [Class] MyClass @@ -859,7 +859,10 @@ delegatedProperties.kt: # 65| 0: [ReturnStmt] return ... # 65| 0: [VarAccess] this.memberInt # 65| -1: [ThisAccess] this -# 65| 2: [Method] setMemberInt +# 65| 3: [FieldDeclaration] int memberInt; +# 65| -1: [TypeAccess] int +# 65| 0: [VarAccess] memberInt +# 65| 4: [Method] setMemberInt # 65| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 65| 0: [Parameter] @@ -870,19 +873,57 @@ delegatedProperties.kt: # 65| 0: [VarAccess] this.memberInt # 65| -1: [ThisAccess] this # 65| 1: [VarAccess] -# 65| 2: [FieldDeclaration] int memberInt; -# 65| -1: [TypeAccess] int -# 65| 0: [VarAccess] memberInt -# 65| 5: [Method] getAnotherClassInstance +# 65| 5: [FieldDeclaration] ClassWithDelegate anotherClassInstance; +# 65| -1: [TypeAccess] ClassWithDelegate +# 65| 0: [VarAccess] anotherClassInstance +# 65| 6: [Method] getAnotherClassInstance # 65| 3: [TypeAccess] ClassWithDelegate # 65| 5: [BlockStmt] { ... } # 65| 0: [ReturnStmt] return ... # 65| 0: [VarAccess] this.anotherClassInstance # 65| -1: [ThisAccess] this -# 65| 5: [FieldDeclaration] ClassWithDelegate anotherClassInstance; -# 65| -1: [TypeAccess] ClassWithDelegate -# 65| 0: [VarAccess] anotherClassInstance -# 66| 7: [Method] getDelegatedToMember1 +# 66| 7: [FieldDeclaration] KMutableProperty0 delegatedToMember1$delegate; +# 66| -1: [TypeAccess] KMutableProperty0 +# 66| 0: [TypeAccess] Integer +# 66| 0: [PropertyRefExpr] ...::... +# 66| -4: [AnonymousClass] new KMutableProperty0(...) { ... } +# 66| 1: [Constructor] +#-----| 4: (Parameters) +# 66| 0: [Parameter] +# 66| 5: [BlockStmt] { ... } +# 66| 0: [SuperConstructorInvocationStmt] super(...) +# 66| 1: [ExprStmt] ; +# 66| 0: [AssignExpr] ...=... +# 66| 0: [VarAccess] this. +# 66| -1: [ThisAccess] this +# 66| 1: [VarAccess] +# 66| 2: [FieldDeclaration] MyClass ; +# 66| -1: [TypeAccess] MyClass +# 66| 3: [Method] get +# 66| 5: [BlockStmt] { ... } +# 66| 0: [ReturnStmt] return ... +# 66| 0: [MethodAccess] getMemberInt(...) +# 66| -1: [VarAccess] this. +# 66| -1: [ThisAccess] this +# 66| 4: [Method] invoke +# 66| 5: [BlockStmt] { ... } +# 66| 0: [ReturnStmt] return ... +# 66| 0: [MethodAccess] get(...) +# 66| -1: [ThisAccess] this +# 66| 5: [Method] set +#-----| 4: (Parameters) +# 66| 0: [Parameter] a0 +# 66| 5: [BlockStmt] { ... } +# 66| 0: [ReturnStmt] return ... +# 66| 0: [MethodAccess] setMemberInt(...) +# 66| -1: [VarAccess] this. +# 66| -1: [ThisAccess] this +# 66| 0: [VarAccess] a0 +# 66| -3: [TypeAccess] KMutableProperty0 +# 66| 0: [TypeAccess] Integer +# 66| 0: [ThisAccess] MyClass.this +# 66| 0: [TypeAccess] MyClass +# 66| 8: [Method] getDelegatedToMember1 # 66| 3: [TypeAccess] int # 66| 5: [BlockStmt] { ... } # 66| 0: [ReturnStmt] return ... @@ -897,14 +938,14 @@ delegatedProperties.kt: # 66| 1: [Constructor] # 66| 5: [BlockStmt] { ... } # 66| 0: [SuperConstructorInvocationStmt] super(...) -# 66| 1: [Method] get +# 66| 2: [Method] get #-----| 4: (Parameters) # 66| 0: [Parameter] a0 # 66| 5: [BlockStmt] { ... } # 66| 0: [ReturnStmt] return ... # 66| 0: [MethodAccess] getDelegatedToMember1(...) # 66| -1: [VarAccess] a0 -# 66| 1: [Method] invoke +# 66| 3: [Method] invoke #-----| 4: (Parameters) # 66| 0: [Parameter] a0 # 66| 5: [BlockStmt] { ... } @@ -912,7 +953,7 @@ delegatedProperties.kt: # 66| 0: [MethodAccess] get(...) # 66| -1: [ThisAccess] this # 66| 0: [VarAccess] a0 -# 66| 1: [Method] set +# 66| 4: [Method] set #-----| 4: (Parameters) # 66| 0: [Parameter] a0 # 66| 1: [Parameter] a1 @@ -924,7 +965,7 @@ delegatedProperties.kt: # 66| -3: [TypeAccess] KMutableProperty1 # 66| 0: [TypeAccess] MyClass # 66| 1: [TypeAccess] Integer -# 66| 7: [Method] setDelegatedToMember1 +# 66| 9: [Method] setDelegatedToMember1 # 66| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 66| 0: [Parameter] @@ -942,14 +983,14 @@ delegatedProperties.kt: # 66| 1: [Constructor] # 66| 5: [BlockStmt] { ... } # 66| 0: [SuperConstructorInvocationStmt] super(...) -# 66| 1: [Method] get +# 66| 2: [Method] get #-----| 4: (Parameters) # 66| 0: [Parameter] a0 # 66| 5: [BlockStmt] { ... } # 66| 0: [ReturnStmt] return ... # 66| 0: [MethodAccess] getDelegatedToMember1(...) # 66| -1: [VarAccess] a0 -# 66| 1: [Method] invoke +# 66| 3: [Method] invoke #-----| 4: (Parameters) # 66| 0: [Parameter] a0 # 66| 5: [BlockStmt] { ... } @@ -957,7 +998,7 @@ delegatedProperties.kt: # 66| 0: [MethodAccess] get(...) # 66| -1: [ThisAccess] this # 66| 0: [VarAccess] a0 -# 66| 1: [Method] set +# 66| 4: [Method] set #-----| 4: (Parameters) # 66| 0: [Parameter] a0 # 66| 1: [Parameter] a1 @@ -970,48 +1011,43 @@ delegatedProperties.kt: # 66| 0: [TypeAccess] MyClass # 66| 1: [TypeAccess] Integer # 66| 3: [VarAccess] -# 66| 7: [FieldDeclaration] KMutableProperty0 delegatedToMember1$delegate; -# 66| -1: [TypeAccess] KMutableProperty0 -# 66| 0: [TypeAccess] Integer -# 66| 0: [PropertyRefExpr] ...::... -# 66| -4: [AnonymousClass] new KMutableProperty0(...) { ... } -# 66| 1: [Constructor] +# 67| 10: [FieldDeclaration] KMutableProperty1 delegatedToMember2$delegate; +# 67| -1: [TypeAccess] KMutableProperty1 +# 67| 0: [TypeAccess] MyClass +# 67| 1: [TypeAccess] Integer +# 67| 0: [PropertyRefExpr] ...::... +# 67| -4: [AnonymousClass] new KMutableProperty1(...) { ... } +# 67| 1: [Constructor] +# 67| 5: [BlockStmt] { ... } +# 67| 0: [SuperConstructorInvocationStmt] super(...) +# 67| 2: [Method] get #-----| 4: (Parameters) -# 66| 0: [Parameter] -# 66| 5: [BlockStmt] { ... } -# 66| 0: [SuperConstructorInvocationStmt] super(...) -# 66| 1: [ExprStmt] ; -# 66| 0: [AssignExpr] ...=... -# 66| 0: [VarAccess] this. -# 66| -1: [ThisAccess] this -# 66| 1: [VarAccess] -# 66| 1: [FieldDeclaration] MyClass ; -# 66| -1: [TypeAccess] MyClass -# 66| 1: [Method] get -# 66| 5: [BlockStmt] { ... } -# 66| 0: [ReturnStmt] return ... -# 66| 0: [MethodAccess] getMemberInt(...) -# 66| -1: [VarAccess] this. -# 66| -1: [ThisAccess] this -# 66| 1: [Method] invoke -# 66| 5: [BlockStmt] { ... } -# 66| 0: [ReturnStmt] return ... -# 66| 0: [MethodAccess] get(...) -# 66| -1: [ThisAccess] this -# 66| 1: [Method] set +# 67| 0: [Parameter] a0 +# 67| 5: [BlockStmt] { ... } +# 67| 0: [ReturnStmt] return ... +# 67| 0: [MethodAccess] getMemberInt(...) +# 67| -1: [VarAccess] a0 +# 67| 3: [Method] invoke #-----| 4: (Parameters) -# 66| 0: [Parameter] a0 -# 66| 5: [BlockStmt] { ... } -# 66| 0: [ReturnStmt] return ... -# 66| 0: [MethodAccess] setMemberInt(...) -# 66| -1: [VarAccess] this. -# 66| -1: [ThisAccess] this -# 66| 0: [VarAccess] a0 -# 66| -3: [TypeAccess] KMutableProperty0 -# 66| 0: [TypeAccess] Integer -# 66| 0: [ThisAccess] MyClass.this -# 66| 0: [TypeAccess] MyClass -# 67| 10: [Method] getDelegatedToMember2 +# 67| 0: [Parameter] a0 +# 67| 5: [BlockStmt] { ... } +# 67| 0: [ReturnStmt] return ... +# 67| 0: [MethodAccess] get(...) +# 67| -1: [ThisAccess] this +# 67| 0: [VarAccess] a0 +# 67| 4: [Method] set +#-----| 4: (Parameters) +# 67| 0: [Parameter] a0 +# 67| 1: [Parameter] a1 +# 67| 5: [BlockStmt] { ... } +# 67| 0: [ReturnStmt] return ... +# 67| 0: [MethodAccess] setMemberInt(...) +# 67| -1: [VarAccess] a0 +# 67| 0: [VarAccess] a1 +# 67| -3: [TypeAccess] KMutableProperty1 +# 67| 0: [TypeAccess] MyClass +# 67| 1: [TypeAccess] Integer +# 67| 11: [Method] getDelegatedToMember2 # 67| 3: [TypeAccess] int # 67| 5: [BlockStmt] { ... } # 67| 0: [ReturnStmt] return ... @@ -1027,14 +1063,14 @@ delegatedProperties.kt: # 67| 1: [Constructor] # 67| 5: [BlockStmt] { ... } # 67| 0: [SuperConstructorInvocationStmt] super(...) -# 67| 1: [Method] get +# 67| 2: [Method] get #-----| 4: (Parameters) # 67| 0: [Parameter] a0 # 67| 5: [BlockStmt] { ... } # 67| 0: [ReturnStmt] return ... # 67| 0: [MethodAccess] getDelegatedToMember2(...) # 67| -1: [VarAccess] a0 -# 67| 1: [Method] invoke +# 67| 3: [Method] invoke #-----| 4: (Parameters) # 67| 0: [Parameter] a0 # 67| 5: [BlockStmt] { ... } @@ -1042,7 +1078,7 @@ delegatedProperties.kt: # 67| 0: [MethodAccess] get(...) # 67| -1: [ThisAccess] this # 67| 0: [VarAccess] a0 -# 67| 1: [Method] set +# 67| 4: [Method] set #-----| 4: (Parameters) # 67| 0: [Parameter] a0 # 67| 1: [Parameter] a1 @@ -1054,7 +1090,7 @@ delegatedProperties.kt: # 67| -3: [TypeAccess] KMutableProperty1 # 67| 0: [TypeAccess] MyClass # 67| 1: [TypeAccess] Integer -# 67| 10: [Method] setDelegatedToMember2 +# 67| 12: [Method] setDelegatedToMember2 # 67| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 67| 0: [Parameter] @@ -1073,14 +1109,14 @@ delegatedProperties.kt: # 67| 1: [Constructor] # 67| 5: [BlockStmt] { ... } # 67| 0: [SuperConstructorInvocationStmt] super(...) -# 67| 1: [Method] get +# 67| 2: [Method] get #-----| 4: (Parameters) # 67| 0: [Parameter] a0 # 67| 5: [BlockStmt] { ... } # 67| 0: [ReturnStmt] return ... # 67| 0: [MethodAccess] getDelegatedToMember2(...) # 67| -1: [VarAccess] a0 -# 67| 1: [Method] invoke +# 67| 3: [Method] invoke #-----| 4: (Parameters) # 67| 0: [Parameter] a0 # 67| 5: [BlockStmt] { ... } @@ -1088,7 +1124,7 @@ delegatedProperties.kt: # 67| 0: [MethodAccess] get(...) # 67| -1: [ThisAccess] this # 67| 0: [VarAccess] a0 -# 67| 1: [Method] set +# 67| 4: [Method] set #-----| 4: (Parameters) # 67| 0: [Parameter] a0 # 67| 1: [Parameter] a1 @@ -1101,43 +1137,50 @@ delegatedProperties.kt: # 67| 0: [TypeAccess] MyClass # 67| 1: [TypeAccess] Integer # 67| 3: [VarAccess] -# 67| 10: [FieldDeclaration] KMutableProperty1 delegatedToMember2$delegate; -# 67| -1: [TypeAccess] KMutableProperty1 -# 67| 0: [TypeAccess] MyClass -# 67| 1: [TypeAccess] Integer -# 67| 0: [PropertyRefExpr] ...::... -# 67| -4: [AnonymousClass] new KMutableProperty1(...) { ... } -# 67| 1: [Constructor] -# 67| 5: [BlockStmt] { ... } -# 67| 0: [SuperConstructorInvocationStmt] super(...) -# 67| 1: [Method] get +# 69| 13: [FieldDeclaration] KMutableProperty0 delegatedToExtMember1$delegate; +# 69| -1: [TypeAccess] KMutableProperty0 +# 69| 0: [TypeAccess] Integer +# 69| 0: [PropertyRefExpr] ...::... +# 69| -4: [AnonymousClass] new KMutableProperty0(...) { ... } +# 69| 1: [Constructor] #-----| 4: (Parameters) -# 67| 0: [Parameter] a0 -# 67| 5: [BlockStmt] { ... } -# 67| 0: [ReturnStmt] return ... -# 67| 0: [MethodAccess] getMemberInt(...) -# 67| -1: [VarAccess] a0 -# 67| 1: [Method] invoke +# 69| 0: [Parameter] +# 69| 5: [BlockStmt] { ... } +# 69| 0: [SuperConstructorInvocationStmt] super(...) +# 69| 1: [ExprStmt] ; +# 69| 0: [AssignExpr] ...=... +# 69| 0: [VarAccess] this. +# 69| -1: [ThisAccess] this +# 69| 1: [VarAccess] +# 69| 2: [FieldDeclaration] MyClass ; +# 69| -1: [TypeAccess] MyClass +# 69| 3: [Method] get +# 69| 5: [BlockStmt] { ... } +# 69| 0: [ReturnStmt] return ... +# 69| 0: [MethodAccess] getExtDelegated(...) +# 69| -1: [TypeAccess] DelegatedPropertiesKt +# 69| 0: [VarAccess] this. +# 69| -1: [ThisAccess] this +# 69| 4: [Method] invoke +# 69| 5: [BlockStmt] { ... } +# 69| 0: [ReturnStmt] return ... +# 69| 0: [MethodAccess] get(...) +# 69| -1: [ThisAccess] this +# 69| 5: [Method] set #-----| 4: (Parameters) -# 67| 0: [Parameter] a0 -# 67| 5: [BlockStmt] { ... } -# 67| 0: [ReturnStmt] return ... -# 67| 0: [MethodAccess] get(...) -# 67| -1: [ThisAccess] this -# 67| 0: [VarAccess] a0 -# 67| 1: [Method] set -#-----| 4: (Parameters) -# 67| 0: [Parameter] a0 -# 67| 1: [Parameter] a1 -# 67| 5: [BlockStmt] { ... } -# 67| 0: [ReturnStmt] return ... -# 67| 0: [MethodAccess] setMemberInt(...) -# 67| -1: [VarAccess] a0 -# 67| 0: [VarAccess] a1 -# 67| -3: [TypeAccess] KMutableProperty1 -# 67| 0: [TypeAccess] MyClass -# 67| 1: [TypeAccess] Integer -# 69| 13: [Method] getDelegatedToExtMember1 +# 69| 0: [Parameter] a0 +# 69| 5: [BlockStmt] { ... } +# 69| 0: [ReturnStmt] return ... +# 69| 0: [MethodAccess] setExtDelegated(...) +# 69| -1: [TypeAccess] DelegatedPropertiesKt +# 69| 0: [VarAccess] this. +# 69| -1: [ThisAccess] this +# 69| 1: [VarAccess] a0 +# 69| -3: [TypeAccess] KMutableProperty0 +# 69| 0: [TypeAccess] Integer +# 69| 0: [ThisAccess] MyClass.this +# 69| 0: [TypeAccess] MyClass +# 69| 14: [Method] getDelegatedToExtMember1 # 69| 3: [TypeAccess] int # 69| 5: [BlockStmt] { ... } # 69| 0: [ReturnStmt] return ... @@ -1152,14 +1195,14 @@ delegatedProperties.kt: # 69| 1: [Constructor] # 69| 5: [BlockStmt] { ... } # 69| 0: [SuperConstructorInvocationStmt] super(...) -# 69| 1: [Method] get +# 69| 2: [Method] get #-----| 4: (Parameters) # 69| 0: [Parameter] a0 # 69| 5: [BlockStmt] { ... } # 69| 0: [ReturnStmt] return ... # 69| 0: [MethodAccess] getDelegatedToExtMember1(...) # 69| -1: [VarAccess] a0 -# 69| 1: [Method] invoke +# 69| 3: [Method] invoke #-----| 4: (Parameters) # 69| 0: [Parameter] a0 # 69| 5: [BlockStmt] { ... } @@ -1167,7 +1210,7 @@ delegatedProperties.kt: # 69| 0: [MethodAccess] get(...) # 69| -1: [ThisAccess] this # 69| 0: [VarAccess] a0 -# 69| 1: [Method] set +# 69| 4: [Method] set #-----| 4: (Parameters) # 69| 0: [Parameter] a0 # 69| 1: [Parameter] a1 @@ -1179,7 +1222,7 @@ delegatedProperties.kt: # 69| -3: [TypeAccess] KMutableProperty1 # 69| 0: [TypeAccess] MyClass # 69| 1: [TypeAccess] Integer -# 69| 13: [Method] setDelegatedToExtMember1 +# 69| 15: [Method] setDelegatedToExtMember1 # 69| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 69| 0: [Parameter] @@ -1197,14 +1240,14 @@ delegatedProperties.kt: # 69| 1: [Constructor] # 69| 5: [BlockStmt] { ... } # 69| 0: [SuperConstructorInvocationStmt] super(...) -# 69| 1: [Method] get +# 69| 2: [Method] get #-----| 4: (Parameters) # 69| 0: [Parameter] a0 # 69| 5: [BlockStmt] { ... } # 69| 0: [ReturnStmt] return ... # 69| 0: [MethodAccess] getDelegatedToExtMember1(...) # 69| -1: [VarAccess] a0 -# 69| 1: [Method] invoke +# 69| 3: [Method] invoke #-----| 4: (Parameters) # 69| 0: [Parameter] a0 # 69| 5: [BlockStmt] { ... } @@ -1212,7 +1255,7 @@ delegatedProperties.kt: # 69| 0: [MethodAccess] get(...) # 69| -1: [ThisAccess] this # 69| 0: [VarAccess] a0 -# 69| 1: [Method] set +# 69| 4: [Method] set #-----| 4: (Parameters) # 69| 0: [Parameter] a0 # 69| 1: [Parameter] a1 @@ -1225,50 +1268,45 @@ delegatedProperties.kt: # 69| 0: [TypeAccess] MyClass # 69| 1: [TypeAccess] Integer # 69| 3: [VarAccess] -# 69| 13: [FieldDeclaration] KMutableProperty0 delegatedToExtMember1$delegate; -# 69| -1: [TypeAccess] KMutableProperty0 -# 69| 0: [TypeAccess] Integer -# 69| 0: [PropertyRefExpr] ...::... -# 69| -4: [AnonymousClass] new KMutableProperty0(...) { ... } -# 69| 1: [Constructor] +# 70| 16: [FieldDeclaration] KMutableProperty1 delegatedToExtMember2$delegate; +# 70| -1: [TypeAccess] KMutableProperty1 +# 70| 0: [TypeAccess] MyClass +# 70| 1: [TypeAccess] Integer +# 70| 0: [PropertyRefExpr] ...::... +# 70| -4: [AnonymousClass] new KMutableProperty1(...) { ... } +# 70| 1: [Constructor] +# 70| 5: [BlockStmt] { ... } +# 70| 0: [SuperConstructorInvocationStmt] super(...) +# 70| 2: [Method] get #-----| 4: (Parameters) -# 69| 0: [Parameter] -# 69| 5: [BlockStmt] { ... } -# 69| 0: [SuperConstructorInvocationStmt] super(...) -# 69| 1: [ExprStmt] ; -# 69| 0: [AssignExpr] ...=... -# 69| 0: [VarAccess] this. -# 69| -1: [ThisAccess] this -# 69| 1: [VarAccess] -# 69| 1: [FieldDeclaration] MyClass ; -# 69| -1: [TypeAccess] MyClass -# 69| 1: [Method] get -# 69| 5: [BlockStmt] { ... } -# 69| 0: [ReturnStmt] return ... -# 69| 0: [MethodAccess] getExtDelegated(...) -# 69| -1: [TypeAccess] DelegatedPropertiesKt -# 69| 0: [VarAccess] this. -# 69| -1: [ThisAccess] this -# 69| 1: [Method] invoke -# 69| 5: [BlockStmt] { ... } -# 69| 0: [ReturnStmt] return ... -# 69| 0: [MethodAccess] get(...) -# 69| -1: [ThisAccess] this -# 69| 1: [Method] set +# 70| 0: [Parameter] a0 +# 70| 5: [BlockStmt] { ... } +# 70| 0: [ReturnStmt] return ... +# 70| 0: [MethodAccess] getExtDelegated(...) +# 70| -1: [TypeAccess] DelegatedPropertiesKt +# 70| 0: [VarAccess] a0 +# 70| 3: [Method] invoke #-----| 4: (Parameters) -# 69| 0: [Parameter] a0 -# 69| 5: [BlockStmt] { ... } -# 69| 0: [ReturnStmt] return ... -# 69| 0: [MethodAccess] setExtDelegated(...) -# 69| -1: [TypeAccess] DelegatedPropertiesKt -# 69| 0: [VarAccess] this. -# 69| -1: [ThisAccess] this -# 69| 1: [VarAccess] a0 -# 69| -3: [TypeAccess] KMutableProperty0 -# 69| 0: [TypeAccess] Integer -# 69| 0: [ThisAccess] MyClass.this -# 69| 0: [TypeAccess] MyClass -# 70| 16: [Method] getDelegatedToExtMember2 +# 70| 0: [Parameter] a0 +# 70| 5: [BlockStmt] { ... } +# 70| 0: [ReturnStmt] return ... +# 70| 0: [MethodAccess] get(...) +# 70| -1: [ThisAccess] this +# 70| 0: [VarAccess] a0 +# 70| 4: [Method] set +#-----| 4: (Parameters) +# 70| 0: [Parameter] a0 +# 70| 1: [Parameter] a1 +# 70| 5: [BlockStmt] { ... } +# 70| 0: [ReturnStmt] return ... +# 70| 0: [MethodAccess] setExtDelegated(...) +# 70| -1: [TypeAccess] DelegatedPropertiesKt +# 70| 0: [VarAccess] a0 +# 70| 1: [VarAccess] a1 +# 70| -3: [TypeAccess] KMutableProperty1 +# 70| 0: [TypeAccess] MyClass +# 70| 1: [TypeAccess] Integer +# 70| 17: [Method] getDelegatedToExtMember2 # 70| 3: [TypeAccess] int # 70| 5: [BlockStmt] { ... } # 70| 0: [ReturnStmt] return ... @@ -1284,14 +1322,14 @@ delegatedProperties.kt: # 70| 1: [Constructor] # 70| 5: [BlockStmt] { ... } # 70| 0: [SuperConstructorInvocationStmt] super(...) -# 70| 1: [Method] get +# 70| 2: [Method] get #-----| 4: (Parameters) # 70| 0: [Parameter] a0 # 70| 5: [BlockStmt] { ... } # 70| 0: [ReturnStmt] return ... # 70| 0: [MethodAccess] getDelegatedToExtMember2(...) # 70| -1: [VarAccess] a0 -# 70| 1: [Method] invoke +# 70| 3: [Method] invoke #-----| 4: (Parameters) # 70| 0: [Parameter] a0 # 70| 5: [BlockStmt] { ... } @@ -1299,7 +1337,7 @@ delegatedProperties.kt: # 70| 0: [MethodAccess] get(...) # 70| -1: [ThisAccess] this # 70| 0: [VarAccess] a0 -# 70| 1: [Method] set +# 70| 4: [Method] set #-----| 4: (Parameters) # 70| 0: [Parameter] a0 # 70| 1: [Parameter] a1 @@ -1311,7 +1349,7 @@ delegatedProperties.kt: # 70| -3: [TypeAccess] KMutableProperty1 # 70| 0: [TypeAccess] MyClass # 70| 1: [TypeAccess] Integer -# 70| 16: [Method] setDelegatedToExtMember2 +# 70| 18: [Method] setDelegatedToExtMember2 # 70| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 70| 0: [Parameter] @@ -1330,14 +1368,14 @@ delegatedProperties.kt: # 70| 1: [Constructor] # 70| 5: [BlockStmt] { ... } # 70| 0: [SuperConstructorInvocationStmt] super(...) -# 70| 1: [Method] get +# 70| 2: [Method] get #-----| 4: (Parameters) # 70| 0: [Parameter] a0 # 70| 5: [BlockStmt] { ... } # 70| 0: [ReturnStmt] return ... # 70| 0: [MethodAccess] getDelegatedToExtMember2(...) # 70| -1: [VarAccess] a0 -# 70| 1: [Method] invoke +# 70| 3: [Method] invoke #-----| 4: (Parameters) # 70| 0: [Parameter] a0 # 70| 5: [BlockStmt] { ... } @@ -1345,7 +1383,7 @@ delegatedProperties.kt: # 70| 0: [MethodAccess] get(...) # 70| -1: [ThisAccess] this # 70| 0: [VarAccess] a0 -# 70| 1: [Method] set +# 70| 4: [Method] set #-----| 4: (Parameters) # 70| 0: [Parameter] a0 # 70| 1: [Parameter] a1 @@ -1358,77 +1396,6 @@ delegatedProperties.kt: # 70| 0: [TypeAccess] MyClass # 70| 1: [TypeAccess] Integer # 70| 3: [VarAccess] -# 70| 16: [FieldDeclaration] KMutableProperty1 delegatedToExtMember2$delegate; -# 70| -1: [TypeAccess] KMutableProperty1 -# 70| 0: [TypeAccess] MyClass -# 70| 1: [TypeAccess] Integer -# 70| 0: [PropertyRefExpr] ...::... -# 70| -4: [AnonymousClass] new KMutableProperty1(...) { ... } -# 70| 1: [Constructor] -# 70| 5: [BlockStmt] { ... } -# 70| 0: [SuperConstructorInvocationStmt] super(...) -# 70| 1: [Method] get -#-----| 4: (Parameters) -# 70| 0: [Parameter] a0 -# 70| 5: [BlockStmt] { ... } -# 70| 0: [ReturnStmt] return ... -# 70| 0: [MethodAccess] getExtDelegated(...) -# 70| -1: [TypeAccess] DelegatedPropertiesKt -# 70| 0: [VarAccess] a0 -# 70| 1: [Method] invoke -#-----| 4: (Parameters) -# 70| 0: [Parameter] a0 -# 70| 5: [BlockStmt] { ... } -# 70| 0: [ReturnStmt] return ... -# 70| 0: [MethodAccess] get(...) -# 70| -1: [ThisAccess] this -# 70| 0: [VarAccess] a0 -# 70| 1: [Method] set -#-----| 4: (Parameters) -# 70| 0: [Parameter] a0 -# 70| 1: [Parameter] a1 -# 70| 5: [BlockStmt] { ... } -# 70| 0: [ReturnStmt] return ... -# 70| 0: [MethodAccess] setExtDelegated(...) -# 70| -1: [TypeAccess] DelegatedPropertiesKt -# 70| 0: [VarAccess] a0 -# 70| 1: [VarAccess] a1 -# 70| -3: [TypeAccess] KMutableProperty1 -# 70| 0: [TypeAccess] MyClass -# 70| 1: [TypeAccess] Integer -# 72| 19: [Method] getDelegatedToBaseClass1 -# 72| 3: [TypeAccess] int -# 72| 5: [BlockStmt] { ... } -# 72| 0: [ReturnStmt] return ... -# 72| 0: [MethodAccess] getValue(...) -# 72| -2: [TypeAccess] Integer -# 72| -1: [TypeAccess] PropertyReferenceDelegatesKt -# 72| 0: [VarAccess] this.delegatedToBaseClass1$delegate -# 72| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this -# 72| 2: [PropertyRefExpr] ...::... -# 72| -4: [AnonymousClass] new KProperty1(...) { ... } -# 72| 1: [Constructor] -# 72| 5: [BlockStmt] { ... } -# 72| 0: [SuperConstructorInvocationStmt] super(...) -# 72| 1: [Method] get -#-----| 4: (Parameters) -# 72| 0: [Parameter] a0 -# 72| 5: [BlockStmt] { ... } -# 72| 0: [ReturnStmt] return ... -# 72| 0: [MethodAccess] getDelegatedToBaseClass1(...) -# 72| -1: [VarAccess] a0 -# 72| 1: [Method] invoke -#-----| 4: (Parameters) -# 72| 0: [Parameter] a0 -# 72| 5: [BlockStmt] { ... } -# 72| 0: [ReturnStmt] return ... -# 72| 0: [MethodAccess] get(...) -# 72| -1: [ThisAccess] this -# 72| 0: [VarAccess] a0 -# 72| -3: [TypeAccess] KProperty1 -# 72| 0: [TypeAccess] MyClass -# 72| 1: [TypeAccess] Integer # 72| 19: [FieldDeclaration] KProperty0 delegatedToBaseClass1$delegate; # 72| -1: [TypeAccess] KProperty0 # 72| 0: [TypeAccess] Integer @@ -1444,15 +1411,15 @@ delegatedProperties.kt: # 72| 0: [VarAccess] this. # 72| -1: [ThisAccess] this # 72| 1: [VarAccess] -# 72| 1: [FieldDeclaration] MyClass ; +# 72| 2: [FieldDeclaration] MyClass ; # 72| -1: [TypeAccess] MyClass -# 72| 1: [Method] get +# 72| 3: [Method] get # 72| 5: [BlockStmt] { ... } # 72| 0: [ReturnStmt] return ... # 72| 0: [MethodAccess] getBaseClassInt(...) # 72| -1: [VarAccess] this. # 72| -1: [ThisAccess] this -# 72| 1: [Method] invoke +# 72| 4: [Method] invoke # 72| 5: [BlockStmt] { ... } # 72| 0: [ReturnStmt] return ... # 72| 0: [MethodAccess] get(...) @@ -1461,7 +1428,67 @@ delegatedProperties.kt: # 72| 0: [TypeAccess] Integer # 72| 0: [ThisAccess] MyClass.this # 72| 0: [TypeAccess] MyClass -# 73| 21: [Method] getDelegatedToBaseClass2 +# 72| 20: [Method] getDelegatedToBaseClass1 +# 72| 3: [TypeAccess] int +# 72| 5: [BlockStmt] { ... } +# 72| 0: [ReturnStmt] return ... +# 72| 0: [MethodAccess] getValue(...) +# 72| -2: [TypeAccess] Integer +# 72| -1: [TypeAccess] PropertyReferenceDelegatesKt +# 72| 0: [VarAccess] this.delegatedToBaseClass1$delegate +# 72| -1: [ThisAccess] this +# 1| 1: [ThisAccess] this +# 72| 2: [PropertyRefExpr] ...::... +# 72| -4: [AnonymousClass] new KProperty1(...) { ... } +# 72| 1: [Constructor] +# 72| 5: [BlockStmt] { ... } +# 72| 0: [SuperConstructorInvocationStmt] super(...) +# 72| 2: [Method] get +#-----| 4: (Parameters) +# 72| 0: [Parameter] a0 +# 72| 5: [BlockStmt] { ... } +# 72| 0: [ReturnStmt] return ... +# 72| 0: [MethodAccess] getDelegatedToBaseClass1(...) +# 72| -1: [VarAccess] a0 +# 72| 3: [Method] invoke +#-----| 4: (Parameters) +# 72| 0: [Parameter] a0 +# 72| 5: [BlockStmt] { ... } +# 72| 0: [ReturnStmt] return ... +# 72| 0: [MethodAccess] get(...) +# 72| -1: [ThisAccess] this +# 72| 0: [VarAccess] a0 +# 72| -3: [TypeAccess] KProperty1 +# 72| 0: [TypeAccess] MyClass +# 72| 1: [TypeAccess] Integer +# 73| 21: [FieldDeclaration] KProperty1 delegatedToBaseClass2$delegate; +# 73| -1: [TypeAccess] KProperty1 +# 73| 0: [TypeAccess] Base +# 73| 1: [TypeAccess] Integer +# 73| 0: [PropertyRefExpr] ...::... +# 73| -4: [AnonymousClass] new KProperty1(...) { ... } +# 73| 1: [Constructor] +# 73| 5: [BlockStmt] { ... } +# 73| 0: [SuperConstructorInvocationStmt] super(...) +# 73| 2: [Method] get +#-----| 4: (Parameters) +# 73| 0: [Parameter] a0 +# 73| 5: [BlockStmt] { ... } +# 73| 0: [ReturnStmt] return ... +# 73| 0: [MethodAccess] getBaseClassInt(...) +# 73| -1: [VarAccess] a0 +# 73| 3: [Method] invoke +#-----| 4: (Parameters) +# 73| 0: [Parameter] a0 +# 73| 5: [BlockStmt] { ... } +# 73| 0: [ReturnStmt] return ... +# 73| 0: [MethodAccess] get(...) +# 73| -1: [ThisAccess] this +# 73| 0: [VarAccess] a0 +# 73| -3: [TypeAccess] KProperty1 +# 73| 0: [TypeAccess] Base +# 73| 1: [TypeAccess] Integer +# 73| 22: [Method] getDelegatedToBaseClass2 # 73| 3: [TypeAccess] int # 73| 5: [BlockStmt] { ... } # 73| 0: [ReturnStmt] return ... @@ -1477,14 +1504,14 @@ delegatedProperties.kt: # 73| 1: [Constructor] # 73| 5: [BlockStmt] { ... } # 73| 0: [SuperConstructorInvocationStmt] super(...) -# 73| 1: [Method] get +# 73| 2: [Method] get #-----| 4: (Parameters) # 73| 0: [Parameter] a0 # 73| 5: [BlockStmt] { ... } # 73| 0: [ReturnStmt] return ... # 73| 0: [MethodAccess] getDelegatedToBaseClass2(...) # 73| -1: [VarAccess] a0 -# 73| 1: [Method] invoke +# 73| 3: [Method] invoke #-----| 4: (Parameters) # 73| 0: [Parameter] a0 # 73| 5: [BlockStmt] { ... } @@ -1495,66 +1522,6 @@ delegatedProperties.kt: # 73| -3: [TypeAccess] KProperty1 # 73| 0: [TypeAccess] MyClass # 73| 1: [TypeAccess] Integer -# 73| 21: [FieldDeclaration] KProperty1 delegatedToBaseClass2$delegate; -# 73| -1: [TypeAccess] KProperty1 -# 73| 0: [TypeAccess] Base -# 73| 1: [TypeAccess] Integer -# 73| 0: [PropertyRefExpr] ...::... -# 73| -4: [AnonymousClass] new KProperty1(...) { ... } -# 73| 1: [Constructor] -# 73| 5: [BlockStmt] { ... } -# 73| 0: [SuperConstructorInvocationStmt] super(...) -# 73| 1: [Method] get -#-----| 4: (Parameters) -# 73| 0: [Parameter] a0 -# 73| 5: [BlockStmt] { ... } -# 73| 0: [ReturnStmt] return ... -# 73| 0: [MethodAccess] getBaseClassInt(...) -# 73| -1: [VarAccess] a0 -# 73| 1: [Method] invoke -#-----| 4: (Parameters) -# 73| 0: [Parameter] a0 -# 73| 5: [BlockStmt] { ... } -# 73| 0: [ReturnStmt] return ... -# 73| 0: [MethodAccess] get(...) -# 73| -1: [ThisAccess] this -# 73| 0: [VarAccess] a0 -# 73| -3: [TypeAccess] KProperty1 -# 73| 0: [TypeAccess] Base -# 73| 1: [TypeAccess] Integer -# 75| 23: [Method] getDelegatedToAnotherClass1 -# 75| 3: [TypeAccess] int -# 75| 5: [BlockStmt] { ... } -# 75| 0: [ReturnStmt] return ... -# 75| 0: [MethodAccess] getValue(...) -# 75| -2: [TypeAccess] Integer -# 75| -1: [TypeAccess] PropertyReferenceDelegatesKt -# 75| 0: [VarAccess] this.delegatedToAnotherClass1$delegate -# 75| -1: [ThisAccess] this -# 1| 1: [ThisAccess] this -# 75| 2: [PropertyRefExpr] ...::... -# 75| -4: [AnonymousClass] new KProperty1(...) { ... } -# 75| 1: [Constructor] -# 75| 5: [BlockStmt] { ... } -# 75| 0: [SuperConstructorInvocationStmt] super(...) -# 75| 1: [Method] get -#-----| 4: (Parameters) -# 75| 0: [Parameter] a0 -# 75| 5: [BlockStmt] { ... } -# 75| 0: [ReturnStmt] return ... -# 75| 0: [MethodAccess] getDelegatedToAnotherClass1(...) -# 75| -1: [VarAccess] a0 -# 75| 1: [Method] invoke -#-----| 4: (Parameters) -# 75| 0: [Parameter] a0 -# 75| 5: [BlockStmt] { ... } -# 75| 0: [ReturnStmt] return ... -# 75| 0: [MethodAccess] get(...) -# 75| -1: [ThisAccess] this -# 75| 0: [VarAccess] a0 -# 75| -3: [TypeAccess] KProperty1 -# 75| 0: [TypeAccess] MyClass -# 75| 1: [TypeAccess] Integer # 75| 23: [FieldDeclaration] KProperty0 delegatedToAnotherClass1$delegate; # 75| -1: [TypeAccess] KProperty0 # 75| 0: [TypeAccess] Integer @@ -1570,15 +1537,15 @@ delegatedProperties.kt: # 75| 0: [VarAccess] this. # 75| -1: [ThisAccess] this # 75| 1: [VarAccess] -# 75| 1: [FieldDeclaration] ClassWithDelegate ; +# 75| 2: [FieldDeclaration] ClassWithDelegate ; # 75| -1: [TypeAccess] ClassWithDelegate -# 75| 1: [Method] get +# 75| 3: [Method] get # 75| 5: [BlockStmt] { ... } # 75| 0: [ReturnStmt] return ... # 75| 0: [MethodAccess] getAnotherClassInt(...) # 75| -1: [VarAccess] this. # 75| -1: [ThisAccess] this -# 75| 1: [Method] invoke +# 75| 4: [Method] invoke # 75| 5: [BlockStmt] { ... } # 75| 0: [ReturnStmt] return ... # 75| 0: [MethodAccess] get(...) @@ -1588,7 +1555,68 @@ delegatedProperties.kt: # 75| 0: [MethodAccess] getAnotherClassInstance(...) # 75| -1: [ThisAccess] MyClass.this # 75| 0: [TypeAccess] MyClass -# 77| 25: [Method] getDelegatedToTopLevel +# 75| 24: [Method] getDelegatedToAnotherClass1 +# 75| 3: [TypeAccess] int +# 75| 5: [BlockStmt] { ... } +# 75| 0: [ReturnStmt] return ... +# 75| 0: [MethodAccess] getValue(...) +# 75| -2: [TypeAccess] Integer +# 75| -1: [TypeAccess] PropertyReferenceDelegatesKt +# 75| 0: [VarAccess] this.delegatedToAnotherClass1$delegate +# 75| -1: [ThisAccess] this +# 1| 1: [ThisAccess] this +# 75| 2: [PropertyRefExpr] ...::... +# 75| -4: [AnonymousClass] new KProperty1(...) { ... } +# 75| 1: [Constructor] +# 75| 5: [BlockStmt] { ... } +# 75| 0: [SuperConstructorInvocationStmt] super(...) +# 75| 2: [Method] get +#-----| 4: (Parameters) +# 75| 0: [Parameter] a0 +# 75| 5: [BlockStmt] { ... } +# 75| 0: [ReturnStmt] return ... +# 75| 0: [MethodAccess] getDelegatedToAnotherClass1(...) +# 75| -1: [VarAccess] a0 +# 75| 3: [Method] invoke +#-----| 4: (Parameters) +# 75| 0: [Parameter] a0 +# 75| 5: [BlockStmt] { ... } +# 75| 0: [ReturnStmt] return ... +# 75| 0: [MethodAccess] get(...) +# 75| -1: [ThisAccess] this +# 75| 0: [VarAccess] a0 +# 75| -3: [TypeAccess] KProperty1 +# 75| 0: [TypeAccess] MyClass +# 75| 1: [TypeAccess] Integer +# 77| 25: [FieldDeclaration] KMutableProperty0 delegatedToTopLevel$delegate; +# 77| -1: [TypeAccess] KMutableProperty0 +# 77| 0: [TypeAccess] Integer +# 77| 0: [PropertyRefExpr] ...::... +# 77| -4: [AnonymousClass] new KMutableProperty0(...) { ... } +# 77| 1: [Constructor] +# 77| 5: [BlockStmt] { ... } +# 77| 0: [SuperConstructorInvocationStmt] super(...) +# 77| 2: [Method] get +# 77| 5: [BlockStmt] { ... } +# 77| 0: [ReturnStmt] return ... +# 77| 0: [MethodAccess] getTopLevelInt(...) +# 77| -1: [TypeAccess] DelegatedPropertiesKt +# 77| 3: [Method] invoke +# 77| 5: [BlockStmt] { ... } +# 77| 0: [ReturnStmt] return ... +# 77| 0: [MethodAccess] get(...) +# 77| -1: [ThisAccess] this +# 77| 4: [Method] set +#-----| 4: (Parameters) +# 77| 0: [Parameter] a0 +# 77| 5: [BlockStmt] { ... } +# 77| 0: [ReturnStmt] return ... +# 77| 0: [MethodAccess] setTopLevelInt(...) +# 77| -1: [TypeAccess] DelegatedPropertiesKt +# 77| 0: [VarAccess] a0 +# 77| -3: [TypeAccess] KMutableProperty0 +# 77| 0: [TypeAccess] Integer +# 77| 26: [Method] getDelegatedToTopLevel # 77| 3: [TypeAccess] int # 77| 5: [BlockStmt] { ... } # 77| 0: [ReturnStmt] return ... @@ -1603,14 +1631,14 @@ delegatedProperties.kt: # 77| 1: [Constructor] # 77| 5: [BlockStmt] { ... } # 77| 0: [SuperConstructorInvocationStmt] super(...) -# 77| 1: [Method] get +# 77| 2: [Method] get #-----| 4: (Parameters) # 77| 0: [Parameter] a0 # 77| 5: [BlockStmt] { ... } # 77| 0: [ReturnStmt] return ... # 77| 0: [MethodAccess] getDelegatedToTopLevel(...) # 77| -1: [VarAccess] a0 -# 77| 1: [Method] invoke +# 77| 3: [Method] invoke #-----| 4: (Parameters) # 77| 0: [Parameter] a0 # 77| 5: [BlockStmt] { ... } @@ -1618,7 +1646,7 @@ delegatedProperties.kt: # 77| 0: [MethodAccess] get(...) # 77| -1: [ThisAccess] this # 77| 0: [VarAccess] a0 -# 77| 1: [Method] set +# 77| 4: [Method] set #-----| 4: (Parameters) # 77| 0: [Parameter] a0 # 77| 1: [Parameter] a1 @@ -1630,7 +1658,7 @@ delegatedProperties.kt: # 77| -3: [TypeAccess] KMutableProperty1 # 77| 0: [TypeAccess] MyClass # 77| 1: [TypeAccess] Integer -# 77| 25: [Method] setDelegatedToTopLevel +# 77| 27: [Method] setDelegatedToTopLevel # 77| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 77| 0: [Parameter] @@ -1648,14 +1676,14 @@ delegatedProperties.kt: # 77| 1: [Constructor] # 77| 5: [BlockStmt] { ... } # 77| 0: [SuperConstructorInvocationStmt] super(...) -# 77| 1: [Method] get +# 77| 2: [Method] get #-----| 4: (Parameters) # 77| 0: [Parameter] a0 # 77| 5: [BlockStmt] { ... } # 77| 0: [ReturnStmt] return ... # 77| 0: [MethodAccess] getDelegatedToTopLevel(...) # 77| -1: [VarAccess] a0 -# 77| 1: [Method] invoke +# 77| 3: [Method] invoke #-----| 4: (Parameters) # 77| 0: [Parameter] a0 # 77| 5: [BlockStmt] { ... } @@ -1663,7 +1691,7 @@ delegatedProperties.kt: # 77| 0: [MethodAccess] get(...) # 77| -1: [ThisAccess] this # 77| 0: [VarAccess] a0 -# 77| 1: [Method] set +# 77| 4: [Method] set #-----| 4: (Parameters) # 77| 0: [Parameter] a0 # 77| 1: [Parameter] a1 @@ -1676,35 +1704,26 @@ delegatedProperties.kt: # 77| 0: [TypeAccess] MyClass # 77| 1: [TypeAccess] Integer # 77| 3: [VarAccess] -# 77| 25: [FieldDeclaration] KMutableProperty0 delegatedToTopLevel$delegate; -# 77| -1: [TypeAccess] KMutableProperty0 -# 77| 0: [TypeAccess] Integer -# 77| 0: [PropertyRefExpr] ...::... -# 77| -4: [AnonymousClass] new KMutableProperty0(...) { ... } -# 77| 1: [Constructor] -# 77| 5: [BlockStmt] { ... } -# 77| 0: [SuperConstructorInvocationStmt] super(...) -# 77| 1: [Method] get -# 77| 5: [BlockStmt] { ... } -# 77| 0: [ReturnStmt] return ... -# 77| 0: [MethodAccess] getTopLevelInt(...) -# 77| -1: [TypeAccess] DelegatedPropertiesKt -# 77| 1: [Method] invoke -# 77| 5: [BlockStmt] { ... } -# 77| 0: [ReturnStmt] return ... -# 77| 0: [MethodAccess] get(...) -# 77| -1: [ThisAccess] this -# 77| 1: [Method] set -#-----| 4: (Parameters) -# 77| 0: [Parameter] a0 -# 77| 5: [BlockStmt] { ... } -# 77| 0: [ReturnStmt] return ... -# 77| 0: [MethodAccess] setTopLevelInt(...) -# 77| -1: [TypeAccess] DelegatedPropertiesKt -# 77| 0: [VarAccess] a0 -# 77| -3: [TypeAccess] KMutableProperty0 -# 77| 0: [TypeAccess] Integer -# 79| 28: [Method] getMax +# 79| 28: [FieldDeclaration] KProperty0 max$delegate; +# 79| -1: [TypeAccess] KProperty0 +# 79| 0: [TypeAccess] Integer +# 79| 0: [PropertyRefExpr] ...::... +# 79| -4: [AnonymousClass] new KProperty0(...) { ... } +# 79| 1: [Constructor] +# 79| 5: [BlockStmt] { ... } +# 79| 0: [SuperConstructorInvocationStmt] super(...) +# 79| 2: [Method] get +# 79| 5: [BlockStmt] { ... } +# 79| 0: [ReturnStmt] return ... +# 79| 0: [VarAccess] MAX_VALUE +# 79| 3: [Method] invoke +# 79| 5: [BlockStmt] { ... } +# 79| 0: [ReturnStmt] return ... +# 79| 0: [MethodAccess] get(...) +# 79| -1: [ThisAccess] this +# 79| -3: [TypeAccess] KProperty0 +# 79| 0: [TypeAccess] Integer +# 79| 29: [Method] getMax # 79| 3: [TypeAccess] int # 79| 5: [BlockStmt] { ... } # 79| 0: [ReturnStmt] return ... @@ -1719,14 +1738,14 @@ delegatedProperties.kt: # 79| 1: [Constructor] # 79| 5: [BlockStmt] { ... } # 79| 0: [SuperConstructorInvocationStmt] super(...) -# 79| 1: [Method] get +# 79| 2: [Method] get #-----| 4: (Parameters) # 79| 0: [Parameter] a0 # 79| 5: [BlockStmt] { ... } # 79| 0: [ReturnStmt] return ... # 79| 0: [MethodAccess] getMax(...) # 79| -1: [VarAccess] a0 -# 79| 1: [Method] invoke +# 79| 3: [Method] invoke #-----| 4: (Parameters) # 79| 0: [Parameter] a0 # 79| 5: [BlockStmt] { ... } @@ -1737,25 +1756,6 @@ delegatedProperties.kt: # 79| -3: [TypeAccess] KProperty1 # 79| 0: [TypeAccess] MyClass # 79| 1: [TypeAccess] Integer -# 79| 28: [FieldDeclaration] KProperty0 max$delegate; -# 79| -1: [TypeAccess] KProperty0 -# 79| 0: [TypeAccess] Integer -# 79| 0: [PropertyRefExpr] ...::... -# 79| -4: [AnonymousClass] new KProperty0(...) { ... } -# 79| 1: [Constructor] -# 79| 5: [BlockStmt] { ... } -# 79| 0: [SuperConstructorInvocationStmt] super(...) -# 79| 1: [Method] get -# 79| 5: [BlockStmt] { ... } -# 79| 0: [ReturnStmt] return ... -# 79| 0: [VarAccess] MAX_VALUE -# 79| 1: [Method] invoke -# 79| 5: [BlockStmt] { ... } -# 79| 0: [ReturnStmt] return ... -# 79| 0: [MethodAccess] get(...) -# 79| -1: [ThisAccess] this -# 79| -3: [TypeAccess] KProperty0 -# 79| 0: [TypeAccess] Integer # 81| 30: [Method] fn # 81| 3: [TypeAccess] Unit # 81| 5: [BlockStmt] { ... } @@ -1774,20 +1774,20 @@ delegatedProperties.kt: # 82| 0: [VarAccess] this. # 82| -1: [ThisAccess] this # 82| 1: [VarAccess] -# 82| 1: [FieldDeclaration] MyClass ; +# 82| 2: [FieldDeclaration] MyClass ; # 82| -1: [TypeAccess] MyClass -# 82| 1: [Method] get +# 82| 3: [Method] get # 82| 5: [BlockStmt] { ... } # 82| 0: [ReturnStmt] return ... # 82| 0: [MethodAccess] getMemberInt(...) # 82| -1: [VarAccess] this. # 82| -1: [ThisAccess] this -# 82| 1: [Method] invoke +# 82| 4: [Method] invoke # 82| 5: [BlockStmt] { ... } # 82| 0: [ReturnStmt] return ... # 82| 0: [MethodAccess] get(...) # 82| -1: [ThisAccess] this -# 82| 1: [Method] set +# 82| 5: [Method] set #-----| 4: (Parameters) # 82| 0: [Parameter] a0 # 82| 5: [BlockStmt] { ... } @@ -1804,7 +1804,7 @@ delegatedProperties.kt: # 82| 1: [Constructor] # 82| 5: [BlockStmt] { ... } # 82| 0: [SuperConstructorInvocationStmt] super(...) -# 82| 1: [Method] +# 82| 2: [Method] # 82| 3: [TypeAccess] int # 82| 5: [BlockStmt] { ... } # 82| 0: [ReturnStmt] return ... @@ -1818,18 +1818,18 @@ delegatedProperties.kt: # 82| 1: [Constructor] # 82| 5: [BlockStmt] { ... } # 82| 0: [SuperConstructorInvocationStmt] super(...) -# 82| 1: [Method] get +# 82| 2: [Method] get # 82| 5: [BlockStmt] { ... } # 82| 0: [ReturnStmt] return ... # 82| 0: [MethodAccess] (...) # 82| -1: [ClassInstanceExpr] new (...) # 82| -3: [TypeAccess] Object -# 82| 1: [Method] invoke +# 82| 3: [Method] invoke # 82| 5: [BlockStmt] { ... } # 82| 0: [ReturnStmt] return ... # 82| 0: [MethodAccess] get(...) # 82| -1: [ThisAccess] this -# 82| 1: [Method] set +# 82| 4: [Method] set #-----| 4: (Parameters) # 82| 0: [Parameter] a0 # 82| 5: [BlockStmt] { ... } @@ -1845,7 +1845,7 @@ delegatedProperties.kt: # 82| 1: [Constructor] # 82| 5: [BlockStmt] { ... } # 82| 0: [SuperConstructorInvocationStmt] super(...) -# 82| 1: [Method] +# 82| 2: [Method] # 82| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 82| 0: [Parameter] value @@ -1862,18 +1862,18 @@ delegatedProperties.kt: # 82| 1: [Constructor] # 82| 5: [BlockStmt] { ... } # 82| 0: [SuperConstructorInvocationStmt] super(...) -# 82| 1: [Method] get +# 82| 2: [Method] get # 82| 5: [BlockStmt] { ... } # 82| 0: [ReturnStmt] return ... # 82| 0: [MethodAccess] (...) # 82| -1: [ClassInstanceExpr] new (...) # 82| -3: [TypeAccess] Object -# 82| 1: [Method] invoke +# 82| 3: [Method] invoke # 82| 5: [BlockStmt] { ... } # 82| 0: [ReturnStmt] return ... # 82| 0: [MethodAccess] get(...) # 82| -1: [ThisAccess] this -# 82| 1: [Method] set +# 82| 4: [Method] set #-----| 4: (Parameters) # 82| 0: [Parameter] a0 # 82| 5: [BlockStmt] { ... } @@ -2849,7 +2849,7 @@ exprs.kt: # 142| 0: [ReturnStmt] return ... # 142| 0: [VarAccess] this.n # 142| -1: [ThisAccess] this -# 142| 2: [FieldDeclaration] int n; +# 142| 3: [FieldDeclaration] int n; # 142| -1: [TypeAccess] int # 142| 0: [VarAccess] n # 143| 4: [Method] foo @@ -2875,14 +2875,14 @@ exprs.kt: # 148| 0: [SuperConstructorInvocationStmt] super(...) # 148| 1: [BlockStmt] { ... } # 168| 6: [Class] Direction -# 0| 1: [Method] values -# 0| 3: [TypeAccess] Direction[] -# 0| 0: [TypeAccess] Direction -# 0| 1: [Method] valueOf +# 0| 2: [Method] valueOf # 0| 3: [TypeAccess] Direction #-----| 4: (Parameters) # 0| 0: [Parameter] value # 0| 0: [TypeAccess] String +# 0| 3: [Method] values +# 0| 3: [TypeAccess] Direction[] +# 0| 0: [TypeAccess] Direction # 168| 4: [Constructor] Direction # 168| 5: [BlockStmt] { ... } # 168| 0: [ExprStmt] ; @@ -2907,14 +2907,14 @@ exprs.kt: # 169| 0: [ClassInstanceExpr] new Direction(...) # 169| -3: [TypeAccess] Direction # 172| 7: [Class] Color -# 0| 1: [Method] values -# 0| 3: [TypeAccess] Color[] -# 0| 0: [TypeAccess] Color -# 0| 1: [Method] valueOf +# 0| 2: [Method] valueOf # 0| 3: [TypeAccess] Color #-----| 4: (Parameters) # 0| 0: [Parameter] value # 0| 0: [TypeAccess] String +# 0| 3: [Method] values +# 0| 3: [TypeAccess] Color[] +# 0| 0: [TypeAccess] Color # 172| 4: [Constructor] Color #-----| 4: (Parameters) # 172| 0: [Parameter] rgb @@ -2934,7 +2934,7 @@ exprs.kt: # 172| 0: [ReturnStmt] return ... # 172| 0: [VarAccess] this.rgb # 172| -1: [ThisAccess] this -# 172| 5: [FieldDeclaration] int rgb; +# 172| 6: [FieldDeclaration] int rgb; # 172| -1: [TypeAccess] int # 172| 0: [VarAccess] rgb # 173| 7: [FieldDeclaration] Color RED; @@ -2967,7 +2967,7 @@ exprs.kt: # 186| 0: [ReturnStmt] return ... # 186| 0: [VarAccess] this.a1 # 186| -1: [ThisAccess] this -# 186| 2: [FieldDeclaration] int a1; +# 186| 3: [FieldDeclaration] int a1; # 186| -1: [TypeAccess] int # 186| 0: [IntegerLiteral] 1 # 187| 4: [Method] getObject @@ -2988,12 +2988,6 @@ exprs.kt: # 190| 0: [ExprStmt] ; # 190| 0: [KtInitializerAssignExpr] ...=... # 190| 0: [VarAccess] a3 -# 190| 2: [Method] getA3 -# 190| 3: [TypeAccess] String -# 190| 5: [BlockStmt] { ... } -# 190| 0: [ReturnStmt] return ... -# 190| 0: [VarAccess] this.a3 -# 190| -1: [ThisAccess] this # 190| 2: [FieldDeclaration] String a3; # 190| -1: [TypeAccess] String # 190| 0: [MethodAccess] toString(...) @@ -3001,6 +2995,12 @@ exprs.kt: # 190| 0: [MethodAccess] getA1(...) # 190| -1: [ThisAccess] this # 190| 1: [VarAccess] a2 +# 190| 3: [Method] getA3 +# 190| 3: [TypeAccess] String +# 190| 5: [BlockStmt] { ... } +# 190| 0: [ReturnStmt] return ... +# 190| 0: [VarAccess] this.a3 +# 190| -1: [ThisAccess] this # 189| 1: [ExprStmt] ; # 189| 0: [ClassInstanceExpr] new (...) # 189| -3: [TypeAccess] Interface1 @@ -3494,7 +3494,7 @@ funcExprs.kt: # 22| 1: [Constructor] # 22| 5: [BlockStmt] { ... } # 22| 0: [SuperConstructorInvocationStmt] super(...) -# 22| 1: [Method] invoke +# 22| 2: [Method] invoke # 22| 3: [TypeAccess] int # 22| 5: [BlockStmt] { ... } # 22| 0: [ReturnStmt] return ... @@ -3509,7 +3509,7 @@ funcExprs.kt: # 23| 1: [Constructor] # 23| 5: [BlockStmt] { ... } # 23| 0: [SuperConstructorInvocationStmt] super(...) -# 23| 1: [Method] invoke +# 23| 2: [Method] invoke # 23| 3: [TypeAccess] Object # 23| 5: [BlockStmt] { ... } # 23| 0: [ReturnStmt] return ... @@ -3524,7 +3524,7 @@ funcExprs.kt: # 24| 1: [Constructor] # 24| 5: [BlockStmt] { ... } # 24| 0: [SuperConstructorInvocationStmt] super(...) -# 24| 1: [Method] invoke +# 24| 2: [Method] invoke # 24| 3: [TypeAccess] Object # 24| 5: [BlockStmt] { ... } # 24| 0: [ReturnStmt] return ... @@ -3540,7 +3540,7 @@ funcExprs.kt: # 25| 1: [Constructor] # 25| 5: [BlockStmt] { ... } # 25| 0: [SuperConstructorInvocationStmt] super(...) -# 25| 1: [Method] invoke +# 25| 2: [Method] invoke # 25| 3: [TypeAccess] int #-----| 4: (Parameters) # 25| 0: [Parameter] a @@ -3560,7 +3560,7 @@ funcExprs.kt: # 26| 1: [Constructor] # 26| 5: [BlockStmt] { ... } # 26| 0: [SuperConstructorInvocationStmt] super(...) -# 26| 1: [Method] invoke +# 26| 2: [Method] invoke # 26| 3: [TypeAccess] int #-----| 4: (Parameters) # 26| 0: [Parameter] it @@ -3580,7 +3580,7 @@ funcExprs.kt: # 27| 1: [Constructor] # 27| 5: [BlockStmt] { ... } # 27| 0: [SuperConstructorInvocationStmt] super(...) -# 27| 1: [Method] invoke +# 27| 2: [Method] invoke # 27| 3: [TypeAccess] int #-----| 4: (Parameters) # 27| 0: [Parameter] @@ -3606,7 +3606,7 @@ funcExprs.kt: # 29| 1: [Constructor] # 29| 5: [BlockStmt] { ... } # 29| 0: [SuperConstructorInvocationStmt] super(...) -# 29| 1: [Method] invoke +# 29| 2: [Method] invoke # 29| 3: [TypeAccess] Object #-----| 4: (Parameters) # 29| 0: [Parameter] a @@ -3626,7 +3626,7 @@ funcExprs.kt: # 30| 1: [Constructor] # 30| 5: [BlockStmt] { ... } # 30| 0: [SuperConstructorInvocationStmt] super(...) -# 30| 1: [Method] invoke +# 30| 2: [Method] invoke # 30| 3: [TypeAccess] int #-----| 4: (Parameters) # 30| 0: [Parameter] @@ -3649,7 +3649,7 @@ funcExprs.kt: # 31| 1: [Constructor] # 31| 5: [BlockStmt] { ... } # 31| 0: [SuperConstructorInvocationStmt] super(...) -# 31| 1: [Method] invoke +# 31| 2: [Method] invoke # 31| 3: [TypeAccess] int #-----| 4: (Parameters) # 31| 0: [Parameter] @@ -3672,7 +3672,7 @@ funcExprs.kt: # 32| 1: [Constructor] # 32| 5: [BlockStmt] { ... } # 32| 0: [SuperConstructorInvocationStmt] super(...) -# 32| 1: [ExtensionMethod] invoke +# 32| 2: [ExtensionMethod] invoke # 32| 3: [TypeAccess] int #-----| 4: (Parameters) # 32| 0: [Parameter] $this$functionExpression3 @@ -3697,7 +3697,7 @@ funcExprs.kt: # 33| 1: [Constructor] # 33| 5: [BlockStmt] { ... } # 33| 0: [SuperConstructorInvocationStmt] super(...) -# 33| 1: [Method] invoke +# 33| 2: [Method] invoke # 33| 3: [TypeAccess] Function1 # 33| 0: [TypeAccess] Integer # 33| 1: [TypeAccess] Double @@ -3711,7 +3711,7 @@ funcExprs.kt: # 33| 1: [Constructor] # 33| 5: [BlockStmt] { ... } # 33| 0: [SuperConstructorInvocationStmt] super(...) -# 33| 1: [Method] invoke +# 33| 2: [Method] invoke # 33| 3: [TypeAccess] double #-----| 4: (Parameters) # 33| 0: [Parameter] b @@ -3736,7 +3736,7 @@ funcExprs.kt: # 35| 1: [Constructor] # 35| 5: [BlockStmt] { ... } # 35| 0: [SuperConstructorInvocationStmt] super(...) -# 35| 1: [Method] invoke +# 35| 2: [Method] invoke # 35| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 35| 0: [Parameter] a0 @@ -3821,7 +3821,7 @@ funcExprs.kt: # 36| 1: [Constructor] # 36| 5: [BlockStmt] { ... } # 36| 0: [SuperConstructorInvocationStmt] super(...) -# 36| 1: [Method] invoke +# 36| 2: [Method] invoke # 36| 3: [TypeAccess] String #-----| 4: (Parameters) # 36| 0: [Parameter] a0 @@ -3873,7 +3873,7 @@ funcExprs.kt: # 36| 5: [BlockStmt] { ... } # 36| 0: [ReturnStmt] return ... # 36| 0: [StringLiteral] -# 36| 1: [Method] invoke +# 36| 2: [Method] invoke #-----| 4: (Parameters) # 36| 0: [Parameter] a0 # 36| 5: [BlockStmt] { ... } @@ -4012,14 +4012,14 @@ funcExprs.kt: # 38| 0: [VarAccess] this. # 38| -1: [ThisAccess] this # 38| 1: [VarAccess] -# 38| 1: [Method] invoke +# 38| 2: [FieldDeclaration] FuncRef ; +# 38| -1: [TypeAccess] FuncRef +# 38| 3: [Method] invoke # 38| 5: [BlockStmt] { ... } # 38| 0: [ReturnStmt] return ... # 38| 0: [MethodAccess] f0(...) # 38| -1: [VarAccess] this. # 38| -1: [ThisAccess] this -# 38| 1: [FieldDeclaration] FuncRef ; -# 38| -1: [TypeAccess] FuncRef # 38| -3: [TypeAccess] Function0 # 38| 0: [TypeAccess] Integer # 38| 0: [ClassInstanceExpr] new FuncRef(...) @@ -4039,14 +4039,14 @@ funcExprs.kt: # 39| 0: [VarAccess] this. # 39| -1: [ThisAccess] this # 39| 1: [VarAccess] -# 39| 1: [Method] invoke +# 39| 2: [FieldDeclaration] Companion ; +# 39| -1: [TypeAccess] Companion +# 39| 3: [Method] invoke # 39| 5: [BlockStmt] { ... } # 39| 0: [ReturnStmt] return ... # 39| 0: [MethodAccess] f0(...) # 39| -1: [VarAccess] this. # 39| -1: [ThisAccess] this -# 39| 1: [FieldDeclaration] Companion ; -# 39| -1: [TypeAccess] Companion # 39| -3: [TypeAccess] Function0 # 39| 0: [TypeAccess] Integer # 39| 0: [VarAccess] Companion @@ -4066,7 +4066,9 @@ funcExprs.kt: # 40| 0: [VarAccess] this. # 40| -1: [ThisAccess] this # 40| 1: [VarAccess] -# 40| 1: [Method] invoke +# 40| 2: [FieldDeclaration] FuncRef ; +# 40| -1: [TypeAccess] FuncRef +# 40| 3: [Method] invoke #-----| 4: (Parameters) # 40| 0: [Parameter] a0 # 40| 5: [BlockStmt] { ... } @@ -4075,8 +4077,6 @@ funcExprs.kt: # 40| -1: [VarAccess] this. # 40| -1: [ThisAccess] this # 40| 0: [VarAccess] a0 -# 40| 1: [FieldDeclaration] FuncRef ; -# 40| -1: [TypeAccess] FuncRef # 40| -3: [TypeAccess] Function1 # 40| 0: [TypeAccess] Integer # 40| 1: [TypeAccess] Integer @@ -4091,7 +4091,7 @@ funcExprs.kt: # 41| 1: [Constructor] # 41| 5: [BlockStmt] { ... } # 41| 0: [SuperConstructorInvocationStmt] super(...) -# 41| 1: [Method] invoke +# 41| 2: [Method] invoke #-----| 4: (Parameters) # 41| 0: [Parameter] a0 # 41| 1: [Parameter] a1 @@ -4120,7 +4120,9 @@ funcExprs.kt: # 42| 0: [VarAccess] this. # 42| -1: [ThisAccess] this # 42| 1: [VarAccess] -# 42| 1: [Method] invoke +# 42| 2: [FieldDeclaration] int ; +# 42| -1: [TypeAccess] int +# 42| 3: [Method] invoke #-----| 4: (Parameters) # 42| 0: [Parameter] a0 # 42| 5: [BlockStmt] { ... } @@ -4130,8 +4132,6 @@ funcExprs.kt: # 42| 0: [VarAccess] this. # 42| -1: [ThisAccess] this # 42| 1: [VarAccess] a0 -# 42| 1: [FieldDeclaration] int ; -# 42| -1: [TypeAccess] int # 42| -3: [TypeAccess] Function1 # 42| 0: [TypeAccess] Integer # 42| 1: [TypeAccess] Integer @@ -4145,7 +4145,7 @@ funcExprs.kt: # 43| 1: [Constructor] # 43| 5: [BlockStmt] { ... } # 43| 0: [SuperConstructorInvocationStmt] super(...) -# 43| 1: [Method] invoke +# 43| 2: [Method] invoke #-----| 4: (Parameters) # 43| 0: [Parameter] a0 # 43| 1: [Parameter] a1 @@ -4175,7 +4175,9 @@ funcExprs.kt: # 44| 0: [VarAccess] this. # 44| -1: [ThisAccess] this # 44| 1: [VarAccess] -# 44| 1: [Method] invoke +# 44| 2: [FieldDeclaration] FuncRef ; +# 44| -1: [TypeAccess] FuncRef +# 44| 3: [Method] invoke #-----| 4: (Parameters) # 44| 0: [Parameter] a0 # 44| 1: [Parameter] a1 @@ -4226,8 +4228,6 @@ funcExprs.kt: # 44| 19: [VarAccess] a19 # 44| 20: [VarAccess] a20 # 44| 21: [VarAccess] a21 -# 44| 1: [FieldDeclaration] FuncRef ; -# 44| -1: [TypeAccess] FuncRef # 44| -3: [TypeAccess] Function22 # 44| 0: [TypeAccess] Integer # 44| 1: [TypeAccess] Integer @@ -4270,7 +4270,9 @@ funcExprs.kt: # 45| 0: [VarAccess] this. # 45| -1: [ThisAccess] this # 45| 1: [VarAccess] -# 45| 1: [Method] invoke +# 45| 2: [FieldDeclaration] FuncRef ; +# 45| -1: [TypeAccess] FuncRef +# 45| 3: [Method] invoke #-----| 4: (Parameters) # 45| 0: [Parameter] a0 # 45| 5: [BlockStmt] { ... } @@ -4393,8 +4395,6 @@ funcExprs.kt: # 45| 1: [ArrayAccess] ...[...] # 45| 0: [VarAccess] a0 # 45| 1: [IntegerLiteral] 22 -# 45| 1: [FieldDeclaration] FuncRef ; -# 45| -1: [TypeAccess] FuncRef # 45| -3: [TypeAccess] FunctionN # 45| 0: [TypeAccess] String # 45| 0: [ClassInstanceExpr] new FuncRef(...) @@ -4408,7 +4408,7 @@ funcExprs.kt: # 46| 1: [Constructor] # 46| 5: [BlockStmt] { ... } # 46| 0: [SuperConstructorInvocationStmt] super(...) -# 46| 1: [Method] invoke +# 46| 2: [Method] invoke #-----| 4: (Parameters) # 46| 0: [Parameter] a0 # 46| 5: [BlockStmt] { ... } @@ -4541,7 +4541,7 @@ funcExprs.kt: # 48| 1: [Constructor] # 48| 5: [BlockStmt] { ... } # 48| 0: [SuperConstructorInvocationStmt] super(...) -# 48| 1: [Method] local +# 48| 2: [Method] local # 48| 3: [TypeAccess] int # 48| 5: [BlockStmt] { ... } # 48| 0: [ReturnStmt] return ... @@ -4554,7 +4554,7 @@ funcExprs.kt: # 49| 1: [Constructor] # 49| 5: [BlockStmt] { ... } # 49| 0: [SuperConstructorInvocationStmt] super(...) -# 49| 1: [Method] invoke +# 49| 2: [Method] invoke # 49| 5: [BlockStmt] { ... } # 49| 0: [ReturnStmt] return ... # 49| 0: [MethodAccess] local(...) @@ -4571,7 +4571,7 @@ funcExprs.kt: # 51| 1: [Constructor] # 51| 5: [BlockStmt] { ... } # 51| 0: [SuperConstructorInvocationStmt] super(...) -# 51| 1: [Method] invoke +# 51| 2: [Method] invoke # 51| 5: [BlockStmt] { ... } # 51| 0: [ReturnStmt] return ... # 51| 0: [ClassInstanceExpr] new FuncRef(...) @@ -4755,7 +4755,7 @@ funcExprs.kt: # 75| 1: [Constructor] # 75| 5: [BlockStmt] { ... } # 75| 0: [SuperConstructorInvocationStmt] super(...) -# 75| 1: [Method] invoke +# 75| 2: [Method] invoke # 75| 3: [TypeAccess] String #-----| 4: (Parameters) # 75| 0: [Parameter] a @@ -4813,7 +4813,9 @@ kFunctionInvoke.kt: # 8| 0: [VarAccess] this. # 8| -1: [ThisAccess] this # 8| 1: [VarAccess] -# 8| 1: [Method] invoke +# 8| 2: [FieldDeclaration] A ; +# 8| -1: [TypeAccess] A +# 8| 3: [Method] invoke #-----| 4: (Parameters) # 8| 0: [Parameter] a0 # 8| 5: [BlockStmt] { ... } @@ -4822,8 +4824,6 @@ kFunctionInvoke.kt: # 8| -1: [VarAccess] this. # 8| -1: [ThisAccess] this # 8| 0: [VarAccess] a0 -# 8| 1: [FieldDeclaration] A ; -# 8| -1: [TypeAccess] A # 8| -3: [TypeAccess] Function1 # 8| 0: [TypeAccess] String # 8| 1: [TypeAccess] Unit @@ -4857,7 +4857,7 @@ localFunctionCalls.kt: # 5| 1: [Constructor] # 5| 5: [BlockStmt] { ... } # 5| 0: [SuperConstructorInvocationStmt] super(...) -# 5| 1: [Method] a +# 5| 2: [Method] a #-----| 2: (Generic Parameters) # 5| 0: [TypeVariable] T # 5| 3: [TypeAccess] int @@ -4890,7 +4890,7 @@ localFunctionCalls.kt: # 9| 1: [Constructor] # 9| 5: [BlockStmt] { ... } # 9| 0: [SuperConstructorInvocationStmt] super(...) -# 9| 1: [ExtensionMethod] f1 +# 9| 2: [ExtensionMethod] f1 #-----| 2: (Generic Parameters) # 9| 0: [TypeVariable] T1 # 9| 3: [TypeAccess] int @@ -4957,7 +4957,11 @@ samConversion.kt: # 2| 0: [VarAccess] this. # 2| -1: [ThisAccess] this # 2| 1: [VarAccess] -# 2| 1: [Method] accept +# 2| 2: [FieldDeclaration] Function1 ; +# 2| -1: [TypeAccess] Function1 +# 2| 0: [TypeAccess] Integer +# 2| 1: [TypeAccess] Boolean +# 2| 3: [Method] accept # 2| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 2| 0: [Parameter] i @@ -4967,17 +4971,13 @@ samConversion.kt: # 2| 0: [MethodAccess] invoke(...) # 2| -1: [VarAccess] # 2| 0: [VarAccess] i -# 2| 1: [FieldDeclaration] Function1 ; -# 2| -1: [TypeAccess] Function1 -# 2| 0: [TypeAccess] Integer -# 2| 1: [TypeAccess] Boolean # 2| -3: [TypeAccess] IntPredicate # 2| 0: [LambdaExpr] ...->... # 2| -4: [AnonymousClass] new Function1(...) { ... } # 2| 1: [Constructor] # 2| 5: [BlockStmt] { ... } # 2| 0: [SuperConstructorInvocationStmt] super(...) -# 2| 1: [Method] invoke +# 2| 2: [Method] invoke # 2| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 2| 0: [Parameter] it @@ -5008,7 +5008,12 @@ samConversion.kt: # 4| 0: [VarAccess] this. # 4| -1: [ThisAccess] this # 4| 1: [VarAccess] -# 4| 1: [Method] fn1 +# 4| 2: [FieldDeclaration] Function2 ; +# 4| -1: [TypeAccess] Function2 +# 4| 0: [TypeAccess] Integer +# 4| 1: [TypeAccess] Integer +# 4| 2: [TypeAccess] Unit +# 4| 3: [Method] fn1 # 4| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 4| 0: [Parameter] i @@ -5021,18 +5026,13 @@ samConversion.kt: # 4| -1: [VarAccess] # 4| 0: [VarAccess] i # 4| 1: [VarAccess] j -# 4| 1: [FieldDeclaration] Function2 ; -# 4| -1: [TypeAccess] Function2 -# 4| 0: [TypeAccess] Integer -# 4| 1: [TypeAccess] Integer -# 4| 2: [TypeAccess] Unit # 4| -3: [TypeAccess] InterfaceFn1 # 4| 0: [LambdaExpr] ...->... # 4| -4: [AnonymousClass] new Function2(...) { ... } # 4| 1: [Constructor] # 4| 5: [BlockStmt] { ... } # 4| 0: [SuperConstructorInvocationStmt] super(...) -# 4| 1: [Method] invoke +# 4| 2: [Method] invoke # 4| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 4| 0: [Parameter] a @@ -5062,7 +5062,12 @@ samConversion.kt: # 5| 0: [VarAccess] this. # 5| -1: [ThisAccess] this # 5| 1: [VarAccess] -# 5| 1: [Method] fn1 +# 5| 2: [FieldDeclaration] Function2 ; +# 5| -1: [TypeAccess] Function2 +# 5| 0: [TypeAccess] Integer +# 5| 1: [TypeAccess] Integer +# 5| 2: [TypeAccess] Unit +# 5| 3: [Method] fn1 # 5| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 5| 0: [Parameter] i @@ -5075,18 +5080,13 @@ samConversion.kt: # 5| -1: [VarAccess] # 5| 0: [VarAccess] i # 5| 1: [VarAccess] j -# 5| 1: [FieldDeclaration] Function2 ; -# 5| -1: [TypeAccess] Function2 -# 5| 0: [TypeAccess] Integer -# 5| 1: [TypeAccess] Integer -# 5| 2: [TypeAccess] Unit # 5| -3: [TypeAccess] InterfaceFn1 # 5| 0: [MemberRefExpr] ...::... # 5| -4: [AnonymousClass] new Function2(...) { ... } # 5| 1: [Constructor] # 5| 5: [BlockStmt] { ... } # 5| 0: [SuperConstructorInvocationStmt] super(...) -# 5| 1: [Method] invoke +# 5| 2: [Method] invoke #-----| 4: (Parameters) # 5| 0: [Parameter] a0 # 5| 1: [Parameter] a1 @@ -5116,7 +5116,12 @@ samConversion.kt: # 7| 0: [VarAccess] this. # 7| -1: [ThisAccess] this # 7| 1: [VarAccess] -# 7| 1: [ExtensionMethod] ext +# 7| 2: [FieldDeclaration] Function2 ; +# 7| -1: [TypeAccess] Function2 +# 7| 0: [TypeAccess] String +# 7| 1: [TypeAccess] Integer +# 7| 2: [TypeAccess] Boolean +# 7| 3: [ExtensionMethod] ext # 7| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 7| 0: [Parameter] @@ -5129,18 +5134,13 @@ samConversion.kt: # 7| -1: [VarAccess] # 7| 0: [ExtensionReceiverAccess] this # 7| 1: [VarAccess] i -# 7| 1: [FieldDeclaration] Function2 ; -# 7| -1: [TypeAccess] Function2 -# 7| 0: [TypeAccess] String -# 7| 1: [TypeAccess] Integer -# 7| 2: [TypeAccess] Boolean # 7| -3: [TypeAccess] InterfaceFnExt1 # 7| 0: [LambdaExpr] ...->... # 7| -4: [AnonymousClass] new Function2(...) { ... } # 7| 1: [Constructor] # 7| 5: [BlockStmt] { ... } # 7| 0: [SuperConstructorInvocationStmt] super(...) -# 7| 1: [ExtensionMethod] invoke +# 7| 2: [ExtensionMethod] invoke # 7| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 7| 0: [Parameter] $this$InterfaceFnExt1 @@ -5172,7 +5172,11 @@ samConversion.kt: # 9| 0: [VarAccess] this. # 9| -1: [ThisAccess] this # 9| 1: [VarAccess] -# 9| 1: [Method] accept +# 9| 2: [FieldDeclaration] Function1 ; +# 9| -1: [TypeAccess] Function1 +# 9| 0: [TypeAccess] Integer +# 9| 1: [TypeAccess] Boolean +# 9| 3: [Method] accept # 9| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 9| 0: [Parameter] i @@ -5182,10 +5186,6 @@ samConversion.kt: # 9| 0: [MethodAccess] invoke(...) # 9| -1: [VarAccess] # 9| 0: [VarAccess] i -# 9| 1: [FieldDeclaration] Function1 ; -# 9| -1: [TypeAccess] Function1 -# 9| 0: [TypeAccess] Integer -# 9| 1: [TypeAccess] Boolean # 9| -3: [TypeAccess] IntPredicate # 9| 0: [WhenExpr] when ... # 9| 0: [WhenBranch] ... -> ... @@ -5196,7 +5196,7 @@ samConversion.kt: # 9| 1: [Constructor] # 9| 5: [BlockStmt] { ... } # 9| 0: [SuperConstructorInvocationStmt] super(...) -# 9| 1: [Method] invoke +# 9| 2: [Method] invoke # 9| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 10| 0: [Parameter] j @@ -5219,7 +5219,7 @@ samConversion.kt: # 11| 1: [Constructor] # 11| 5: [BlockStmt] { ... } # 11| 0: [SuperConstructorInvocationStmt] super(...) -# 11| 1: [Method] invoke +# 11| 2: [Method] invoke # 11| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 12| 0: [Parameter] j @@ -5307,7 +5307,7 @@ samConversion.kt: # 41| 1: [Constructor] # 41| 5: [BlockStmt] { ... } # 41| 0: [SuperConstructorInvocationStmt] super(...) -# 41| 1: [Method] invoke +# 41| 2: [Method] invoke #-----| 4: (Parameters) # 41| 0: [Parameter] a0 # 41| 5: [BlockStmt] { ... } @@ -5447,7 +5447,10 @@ samConversion.kt: # 42| 0: [VarAccess] this. # 42| -1: [ThisAccess] this # 42| 1: [VarAccess] -# 42| 1: [Method] accept +# 42| 2: [FieldDeclaration] FunctionN ; +# 42| -1: [TypeAccess] FunctionN +# 42| 0: [TypeAccess] Boolean +# 42| 3: [Method] accept # 42| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 42| 0: [Parameter] i0 @@ -5527,9 +5530,6 @@ samConversion.kt: # 42| 22: [VarAccess] i22 # 42| -1: [TypeAccess] Object # 42| 0: [IntegerLiteral] 23 -# 42| 1: [FieldDeclaration] FunctionN ; -# 42| -1: [TypeAccess] FunctionN -# 42| 0: [TypeAccess] Boolean # 42| -3: [TypeAccess] BigArityPredicate # 42| 0: [VarAccess] a # 43| 2: [LocalVariableDeclStmt] var ...; @@ -5548,7 +5548,10 @@ samConversion.kt: # 43| 0: [VarAccess] this. # 43| -1: [ThisAccess] this # 43| 1: [VarAccess] -# 43| 1: [Method] accept +# 43| 2: [FieldDeclaration] FunctionN ; +# 43| -1: [TypeAccess] FunctionN +# 43| 0: [TypeAccess] Boolean +# 43| 3: [Method] accept # 43| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 43| 0: [Parameter] i0 @@ -5628,16 +5631,13 @@ samConversion.kt: # 43| 22: [VarAccess] i22 # 43| -1: [TypeAccess] Object # 43| 0: [IntegerLiteral] 23 -# 43| 1: [FieldDeclaration] FunctionN ; -# 43| -1: [TypeAccess] FunctionN -# 43| 0: [TypeAccess] Boolean # 43| -3: [TypeAccess] BigArityPredicate # 43| 0: [LambdaExpr] ...->... # 43| -4: [AnonymousClass] new FunctionN(...) { ... } # 43| 1: [Constructor] # 43| 5: [BlockStmt] { ... } # 43| 0: [SuperConstructorInvocationStmt] super(...) -# 43| 1: [Method] invoke +# 43| 2: [Method] invoke # 43| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 43| 0: [Parameter] i0 @@ -5689,7 +5689,7 @@ samConversion.kt: # 45| 5: [BlockStmt] { ... } # 45| 0: [ReturnStmt] return ... # 45| 0: [BooleanLiteral] true -# 43| 1: [Method] invoke +# 43| 2: [Method] invoke #-----| 4: (Parameters) # 43| 0: [Parameter] a0 # 43| 5: [BlockStmt] { ... } @@ -5830,7 +5830,11 @@ samConversion.kt: # 46| 0: [VarAccess] this. # 46| -1: [ThisAccess] this # 46| 1: [VarAccess] -# 46| 1: [Method] fn +# 46| 2: [FieldDeclaration] Function1 ; +# 46| -1: [TypeAccess] Function1 +# 46| 0: [TypeAccess] Integer +# 46| 1: [TypeAccess] Boolean +# 46| 3: [Method] fn # 46| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 46| 0: [Parameter] i @@ -5840,10 +5844,6 @@ samConversion.kt: # 46| 0: [MethodAccess] invoke(...) # 46| -1: [VarAccess] # 46| 0: [VarAccess] i -# 46| 1: [FieldDeclaration] Function1 ; -# 46| -1: [TypeAccess] Function1 -# 46| 0: [TypeAccess] Integer -# 46| 1: [TypeAccess] Boolean # 46| -3: [TypeAccess] SomePredicate # 46| 0: [TypeAccess] Integer # 46| 0: [LambdaExpr] ...->... @@ -5851,7 +5851,7 @@ samConversion.kt: # 46| 1: [Constructor] # 46| 5: [BlockStmt] { ... } # 46| 0: [SuperConstructorInvocationStmt] super(...) -# 46| 1: [Method] invoke +# 46| 2: [Method] invoke # 46| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 46| 0: [Parameter] a diff --git a/java/ql/test/kotlin/library-tests/exprs_typeaccess/PrintAst.expected b/java/ql/test/kotlin/library-tests/exprs_typeaccess/PrintAst.expected index ae2d5911e7e..a3ed7a0d3a0 100644 --- a/java/ql/test/kotlin/library-tests/exprs_typeaccess/PrintAst.expected +++ b/java/ql/test/kotlin/library-tests/exprs_typeaccess/PrintAst.expected @@ -34,7 +34,7 @@ A.kt: # 13| 0: [ReturnStmt] return ... # 13| 0: [VarAccess] this.prop # 13| -1: [ThisAccess] this -# 13| 6: [FieldDeclaration] int prop; +# 13| 7: [FieldDeclaration] int prop; # 13| -1: [TypeAccess] int # 13| 0: [MethodAccess] fn(...) # 13| -1: [ThisAccess] A.this @@ -74,14 +74,14 @@ A.kt: # 20| 0: [VarAccess] B.x # 20| -1: [TypeAccess] B # 23| 11: [Class] Enu -# 0| 1: [Method] values -# 0| 3: [TypeAccess] Enu[] -# 0| 0: [TypeAccess] Enu -# 0| 1: [Method] valueOf +# 0| 2: [Method] valueOf # 0| 3: [TypeAccess] Enu #-----| 4: (Parameters) # 0| 0: [Parameter] value # 0| 0: [TypeAccess] String +# 0| 3: [Method] values +# 0| 3: [TypeAccess] Enu[] +# 0| 0: [TypeAccess] Enu # 23| 4: [Constructor] Enu # 23| 5: [BlockStmt] { ... } # 23| 0: [ExprStmt] ; diff --git a/java/ql/test/kotlin/library-tests/generics/PrintAst.expected b/java/ql/test/kotlin/library-tests/generics/PrintAst.expected index 37f27bdb483..619ba5f3bcc 100644 --- a/java/ql/test/kotlin/library-tests/generics/PrintAst.expected +++ b/java/ql/test/kotlin/library-tests/generics/PrintAst.expected @@ -98,15 +98,15 @@ generics.kt: # 13| 0: [ExprStmt] ; # 13| 0: [KtInitializerAssignExpr] ...=... # 13| 0: [VarAccess] t -# 13| 2: [Method] getT +# 13| 2: [FieldDeclaration] T t; +# 13| -1: [TypeAccess] T +# 13| 0: [VarAccess] t +# 13| 3: [Method] getT # 13| 3: [TypeAccess] T # 13| 5: [BlockStmt] { ... } # 13| 0: [ReturnStmt] return ... # 13| 0: [VarAccess] this.t # 13| -1: [ThisAccess] this -# 13| 2: [FieldDeclaration] T t; -# 13| -1: [TypeAccess] T -# 13| 0: [VarAccess] t # 14| 4: [Method] f1 # 14| 3: [TypeAccess] Unit #-----| 4: (Parameters) diff --git a/java/ql/test/kotlin/library-tests/jvmstatic-annotation/JavaUser.java b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/JavaUser.java new file mode 100644 index 00000000000..fc079df1ba8 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/JavaUser.java @@ -0,0 +1,22 @@ +public class JavaUser { + + public static void test() { + + HasCompanion.staticMethod("1"); + HasCompanion.Companion.nonStaticMethod("2"); + HasCompanion.setStaticProp(HasCompanion.Companion.getNonStaticProp()); + HasCompanion.Companion.setNonStaticProp(HasCompanion.getStaticProp()); + HasCompanion.Companion.setPropWithStaticGetter(HasCompanion.Companion.getPropWithStaticSetter()); + HasCompanion.setPropWithStaticSetter(HasCompanion.getPropWithStaticGetter()); + + // These extract as static methods, since there is no proxy method in the non-companion object case. + NonCompanion.staticMethod("1"); + NonCompanion.INSTANCE.nonStaticMethod("2"); + NonCompanion.setStaticProp(NonCompanion.INSTANCE.getNonStaticProp()); + NonCompanion.INSTANCE.setNonStaticProp(NonCompanion.getStaticProp()); + NonCompanion.INSTANCE.setPropWithStaticGetter(NonCompanion.INSTANCE.getPropWithStaticSetter()); + NonCompanion.setPropWithStaticSetter(NonCompanion.getPropWithStaticGetter()); + + } + +} diff --git a/java/ql/test/kotlin/library-tests/jvmstatic-annotation/PrintAst.expected b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/PrintAst.expected new file mode 100644 index 00000000000..1376baa4f1d --- /dev/null +++ b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/PrintAst.expected @@ -0,0 +1,441 @@ +JavaUser.java: +# 0| [CompilationUnit] JavaUser +# 1| 1: [Class] JavaUser +# 3| 2: [Method] test +# 3| 3: [TypeAccess] void +# 3| 5: [BlockStmt] { ... } +# 5| 0: [ExprStmt] ; +# 5| 0: [MethodAccess] staticMethod(...) +# 5| -1: [TypeAccess] HasCompanion +# 5| 0: [StringLiteral] "1" +# 6| 1: [ExprStmt] ; +# 6| 0: [MethodAccess] nonStaticMethod(...) +# 6| -1: [VarAccess] HasCompanion.Companion +# 6| -1: [TypeAccess] HasCompanion +# 6| 0: [StringLiteral] "2" +# 7| 2: [ExprStmt] ; +# 7| 0: [MethodAccess] setStaticProp(...) +# 7| -1: [TypeAccess] HasCompanion +# 7| 0: [MethodAccess] getNonStaticProp(...) +# 7| -1: [VarAccess] HasCompanion.Companion +# 7| -1: [TypeAccess] HasCompanion +# 8| 3: [ExprStmt] ; +# 8| 0: [MethodAccess] setNonStaticProp(...) +# 8| -1: [VarAccess] HasCompanion.Companion +# 8| -1: [TypeAccess] HasCompanion +# 8| 0: [MethodAccess] getStaticProp(...) +# 8| -1: [TypeAccess] HasCompanion +# 9| 4: [ExprStmt] ; +# 9| 0: [MethodAccess] setPropWithStaticGetter(...) +# 9| -1: [VarAccess] HasCompanion.Companion +# 9| -1: [TypeAccess] HasCompanion +# 9| 0: [MethodAccess] getPropWithStaticSetter(...) +# 9| -1: [VarAccess] HasCompanion.Companion +# 9| -1: [TypeAccess] HasCompanion +# 10| 5: [ExprStmt] ; +# 10| 0: [MethodAccess] setPropWithStaticSetter(...) +# 10| -1: [TypeAccess] HasCompanion +# 10| 0: [MethodAccess] getPropWithStaticGetter(...) +# 10| -1: [TypeAccess] HasCompanion +# 13| 6: [ExprStmt] ; +# 13| 0: [MethodAccess] staticMethod(...) +# 13| -1: [TypeAccess] NonCompanion +# 13| 0: [StringLiteral] "1" +# 14| 7: [ExprStmt] ; +# 14| 0: [MethodAccess] nonStaticMethod(...) +# 14| -1: [VarAccess] NonCompanion.INSTANCE +# 14| -1: [TypeAccess] NonCompanion +# 14| 0: [StringLiteral] "2" +# 15| 8: [ExprStmt] ; +# 15| 0: [MethodAccess] setStaticProp(...) +# 15| -1: [TypeAccess] NonCompanion +# 15| 0: [MethodAccess] getNonStaticProp(...) +# 15| -1: [VarAccess] NonCompanion.INSTANCE +# 15| -1: [TypeAccess] NonCompanion +# 16| 9: [ExprStmt] ; +# 16| 0: [MethodAccess] setNonStaticProp(...) +# 16| -1: [VarAccess] NonCompanion.INSTANCE +# 16| -1: [TypeAccess] NonCompanion +# 16| 0: [MethodAccess] getStaticProp(...) +# 16| -1: [TypeAccess] NonCompanion +# 17| 10: [ExprStmt] ; +# 17| 0: [MethodAccess] setPropWithStaticGetter(...) +# 17| -1: [VarAccess] NonCompanion.INSTANCE +# 17| -1: [TypeAccess] NonCompanion +# 17| 0: [MethodAccess] getPropWithStaticSetter(...) +# 17| -1: [VarAccess] NonCompanion.INSTANCE +# 17| -1: [TypeAccess] NonCompanion +# 18| 11: [ExprStmt] ; +# 18| 0: [MethodAccess] setPropWithStaticSetter(...) +# 18| -1: [TypeAccess] NonCompanion +# 18| 0: [MethodAccess] getPropWithStaticGetter(...) +# 18| -1: [TypeAccess] NonCompanion +test.kt: +# 0| [CompilationUnit] test +# 0| 1: [Class] TestKt +# 49| 1: [Method] externalUser +# 49| 3: [TypeAccess] Unit +# 49| 5: [BlockStmt] { ... } +# 52| 0: [ExprStmt] ; +# 52| 0: [ImplicitCoercionToUnitExpr] +# 52| 0: [TypeAccess] Unit +# 52| 1: [MethodAccess] staticMethod(...) +# 52| -1: [VarAccess] Companion +# 52| 0: [StringLiteral] 1 +# 53| 1: [ExprStmt] ; +# 53| 0: [ImplicitCoercionToUnitExpr] +# 53| 0: [TypeAccess] Unit +# 53| 1: [MethodAccess] nonStaticMethod(...) +# 53| -1: [VarAccess] Companion +# 53| 0: [StringLiteral] 2 +# 54| 2: [ExprStmt] ; +# 54| 0: [MethodAccess] setStaticProp(...) +# 54| -1: [VarAccess] Companion +# 54| 0: [MethodAccess] getNonStaticProp(...) +# 54| -1: [VarAccess] Companion +# 55| 3: [ExprStmt] ; +# 55| 0: [MethodAccess] setNonStaticProp(...) +# 55| -1: [VarAccess] Companion +# 55| 0: [MethodAccess] getStaticProp(...) +# 55| -1: [VarAccess] Companion +# 56| 4: [ExprStmt] ; +# 56| 0: [MethodAccess] setPropWithStaticGetter(...) +# 56| -1: [VarAccess] Companion +# 56| 0: [MethodAccess] getPropWithStaticSetter(...) +# 56| -1: [VarAccess] Companion +# 57| 5: [ExprStmt] ; +# 57| 0: [MethodAccess] setPropWithStaticSetter(...) +# 57| -1: [VarAccess] Companion +# 57| 0: [MethodAccess] getPropWithStaticGetter(...) +# 57| -1: [VarAccess] Companion +# 60| 6: [ExprStmt] ; +# 60| 0: [ImplicitCoercionToUnitExpr] +# 60| 0: [TypeAccess] Unit +# 60| 1: [MethodAccess] staticMethod(...) +# 60| -1: [TypeAccess] NonCompanion +# 60| 0: [StringLiteral] 1 +# 61| 7: [ExprStmt] ; +# 61| 0: [ImplicitCoercionToUnitExpr] +# 61| 0: [TypeAccess] Unit +# 61| 1: [MethodAccess] nonStaticMethod(...) +# 61| -1: [VarAccess] INSTANCE +# 61| 0: [StringLiteral] 2 +# 62| 8: [ExprStmt] ; +# 62| 0: [MethodAccess] setStaticProp(...) +# 62| -1: [TypeAccess] NonCompanion +# 62| 0: [MethodAccess] getNonStaticProp(...) +# 62| -1: [VarAccess] INSTANCE +# 63| 9: [ExprStmt] ; +# 63| 0: [MethodAccess] setNonStaticProp(...) +# 63| -1: [VarAccess] INSTANCE +# 63| 0: [MethodAccess] getStaticProp(...) +# 63| -1: [TypeAccess] NonCompanion +# 64| 10: [ExprStmt] ; +# 64| 0: [MethodAccess] setPropWithStaticGetter(...) +# 64| -1: [VarAccess] INSTANCE +# 64| 0: [MethodAccess] getPropWithStaticSetter(...) +# 64| -1: [VarAccess] INSTANCE +# 65| 11: [ExprStmt] ; +# 65| 0: [MethodAccess] setPropWithStaticSetter(...) +# 65| -1: [TypeAccess] NonCompanion +# 65| 0: [MethodAccess] getPropWithStaticGetter(...) +# 65| -1: [TypeAccess] NonCompanion +# 9| 2: [Class] HasCompanion +#-----| -3: (Annotations) +# 9| 2: [Constructor] HasCompanion +# 9| 5: [BlockStmt] { ... } +# 9| 0: [SuperConstructorInvocationStmt] super(...) +# 9| 1: [BlockStmt] { ... } +# 11| 3: [Class] Companion +#-----| -3: (Annotations) +# 11| 1: [Constructor] Companion +# 11| 5: [BlockStmt] { ... } +# 11| 0: [SuperConstructorInvocationStmt] super(...) +# 11| 1: [BlockStmt] { ... } +# 16| 0: [ExprStmt] ; +# 16| 0: [KtInitializerAssignExpr] ...=... +# 16| 0: [VarAccess] staticProp +# 17| 1: [ExprStmt] ; +# 17| 0: [KtInitializerAssignExpr] ...=... +# 17| 0: [VarAccess] nonStaticProp +# 13| 2: [Method] staticMethod +#-----| 1: (Annotations) +# 13| 3: [TypeAccess] String +#-----| 4: (Parameters) +# 13| 0: [Parameter] s +#-----| -1: (Annotations) +# 13| 0: [TypeAccess] String +# 13| 5: [BlockStmt] { ... } +# 13| 0: [ReturnStmt] return ... +# 13| 0: [MethodAccess] nonStaticMethod(...) +# 13| -1: [ThisAccess] this +# 13| 0: [VarAccess] s +# 14| 3: [Method] nonStaticMethod +#-----| 1: (Annotations) +# 14| 3: [TypeAccess] String +#-----| 4: (Parameters) +# 14| 0: [Parameter] s +#-----| -1: (Annotations) +# 14| 0: [TypeAccess] String +# 14| 5: [BlockStmt] { ... } +# 14| 0: [ReturnStmt] return ... +# 14| 0: [MethodAccess] staticMethod(...) +# 14| -1: [ThisAccess] this +# 14| 0: [VarAccess] s +# 16| 4: [FieldDeclaration] String staticProp; +# 16| -1: [TypeAccess] String +# 16| 0: [StringLiteral] a +# 16| 5: [Method] getStaticProp +#-----| 1: (Annotations) +# 16| 3: [TypeAccess] String +# 16| 5: [BlockStmt] { ... } +# 16| 0: [ReturnStmt] return ... +# 16| 0: [VarAccess] this.staticProp +# 16| -1: [ThisAccess] this +# 16| 6: [Method] setStaticProp +# 16| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 16| 0: [Parameter] +#-----| -1: (Annotations) +# 16| 0: [TypeAccess] String +# 16| 5: [BlockStmt] { ... } +# 16| 0: [ExprStmt] ; +# 16| 0: [AssignExpr] ...=... +# 16| 0: [VarAccess] this.staticProp +# 16| -1: [ThisAccess] this +# 16| 1: [VarAccess] +# 17| 7: [FieldDeclaration] String nonStaticProp; +# 17| -1: [TypeAccess] String +# 17| 0: [StringLiteral] b +# 17| 8: [Method] getNonStaticProp +#-----| 1: (Annotations) +# 17| 3: [TypeAccess] String +# 17| 5: [BlockStmt] { ... } +# 17| 0: [ReturnStmt] return ... +# 17| 0: [VarAccess] this.nonStaticProp +# 17| -1: [ThisAccess] this +# 17| 9: [Method] setNonStaticProp +# 17| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 17| 0: [Parameter] +#-----| -1: (Annotations) +# 17| 0: [TypeAccess] String +# 17| 5: [BlockStmt] { ... } +# 17| 0: [ExprStmt] ; +# 17| 0: [AssignExpr] ...=... +# 17| 0: [VarAccess] this.nonStaticProp +# 17| -1: [ThisAccess] this +# 17| 1: [VarAccess] +# 20| 10: [Method] getPropWithStaticGetter +#-----| 1: (Annotations) +# 20| 3: [TypeAccess] String +# 20| 5: [BlockStmt] { ... } +# 20| 0: [ReturnStmt] return ... +# 20| 0: [MethodAccess] getPropWithStaticSetter(...) +# 20| -1: [ThisAccess] this +# 21| 11: [Method] setPropWithStaticGetter +# 21| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 21| 0: [Parameter] s +#-----| -1: (Annotations) +# 21| 0: [TypeAccess] String +# 21| 5: [BlockStmt] { ... } +# 21| 0: [ExprStmt] ; +# 21| 0: [MethodAccess] setPropWithStaticSetter(...) +# 21| -1: [ThisAccess] this +# 21| 0: [VarAccess] s +# 24| 12: [Method] getPropWithStaticSetter +#-----| 1: (Annotations) +# 24| 3: [TypeAccess] String +# 24| 5: [BlockStmt] { ... } +# 24| 0: [ReturnStmt] return ... +# 24| 0: [MethodAccess] getPropWithStaticGetter(...) +# 24| -1: [ThisAccess] this +# 25| 13: [Method] setPropWithStaticSetter +#-----| 1: (Annotations) +# 25| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 25| 0: [Parameter] s +#-----| -1: (Annotations) +# 25| 0: [TypeAccess] String +# 25| 5: [BlockStmt] { ... } +# 25| 0: [ExprStmt] ; +# 25| 0: [MethodAccess] setPropWithStaticGetter(...) +# 25| -1: [ThisAccess] this +# 25| 0: [VarAccess] s +# 13| 4: [Method] staticMethod +#-----| 1: (Annotations) +# 13| 3: [TypeAccess] String +#-----| 4: (Parameters) +# 13| 0: [Parameter] s +#-----| -1: (Annotations) +# 13| 0: [TypeAccess] String +# 13| 5: [BlockStmt] { ... } +# 13| 0: [ReturnStmt] return ... +# 13| 0: [MethodAccess] staticMethod(...) +# 13| -1: [VarAccess] HasCompanion.Companion +# 13| -1: [TypeAccess] HasCompanion +# 13| 0: [VarAccess] s +# 16| 5: [Method] getStaticProp +#-----| 1: (Annotations) +# 16| 3: [TypeAccess] String +# 16| 5: [BlockStmt] { ... } +# 16| 0: [ReturnStmt] return ... +# 16| 0: [MethodAccess] getStaticProp(...) +# 16| -1: [VarAccess] HasCompanion.Companion +# 16| -1: [TypeAccess] HasCompanion +# 16| 6: [Method] setStaticProp +# 16| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 16| 0: [Parameter] +#-----| -1: (Annotations) +# 16| 0: [TypeAccess] String +# 16| 5: [BlockStmt] { ... } +# 16| 0: [ReturnStmt] return ... +# 16| 0: [MethodAccess] setStaticProp(...) +# 16| -1: [VarAccess] HasCompanion.Companion +# 16| -1: [TypeAccess] HasCompanion +# 16| 0: [VarAccess] +# 20| 7: [Method] getPropWithStaticGetter +#-----| 1: (Annotations) +# 20| 3: [TypeAccess] String +# 20| 5: [BlockStmt] { ... } +# 20| 0: [ReturnStmt] return ... +# 20| 0: [MethodAccess] getPropWithStaticGetter(...) +# 20| -1: [VarAccess] HasCompanion.Companion +# 20| -1: [TypeAccess] HasCompanion +# 25| 8: [Method] setPropWithStaticSetter +#-----| 1: (Annotations) +# 25| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 25| 0: [Parameter] s +#-----| -1: (Annotations) +# 25| 0: [TypeAccess] String +# 25| 5: [BlockStmt] { ... } +# 25| 0: [ReturnStmt] return ... +# 25| 0: [MethodAccess] setPropWithStaticSetter(...) +# 25| -1: [VarAccess] HasCompanion.Companion +# 25| -1: [TypeAccess] HasCompanion +# 25| 0: [VarAccess] s +# 31| 3: [Class] NonCompanion +#-----| -3: (Annotations) +# 31| 2: [Constructor] NonCompanion +# 31| 5: [BlockStmt] { ... } +# 31| 0: [SuperConstructorInvocationStmt] super(...) +# 31| 1: [BlockStmt] { ... } +# 36| 0: [ExprStmt] ; +# 36| 0: [KtInitializerAssignExpr] ...=... +# 36| 0: [VarAccess] staticProp +# 37| 1: [ExprStmt] ; +# 37| 0: [KtInitializerAssignExpr] ...=... +# 37| 0: [VarAccess] nonStaticProp +# 33| 3: [Method] staticMethod +#-----| 1: (Annotations) +# 33| 3: [TypeAccess] String +#-----| 4: (Parameters) +# 33| 0: [Parameter] s +#-----| -1: (Annotations) +# 33| 0: [TypeAccess] String +# 33| 5: [BlockStmt] { ... } +# 33| 0: [ReturnStmt] return ... +# 33| 0: [MethodAccess] nonStaticMethod(...) +# 33| -1: [VarAccess] NonCompanion.INSTANCE +# 33| -1: [TypeAccess] NonCompanion +# 33| 0: [VarAccess] s +# 34| 4: [Method] nonStaticMethod +#-----| 1: (Annotations) +# 34| 3: [TypeAccess] String +#-----| 4: (Parameters) +# 34| 0: [Parameter] s +#-----| -1: (Annotations) +# 34| 0: [TypeAccess] String +# 34| 5: [BlockStmt] { ... } +# 34| 0: [ReturnStmt] return ... +# 34| 0: [MethodAccess] staticMethod(...) +# 34| -1: [TypeAccess] NonCompanion +# 34| 0: [VarAccess] s +# 36| 5: [FieldDeclaration] String staticProp; +# 36| -1: [TypeAccess] String +# 36| 0: [StringLiteral] a +# 36| 6: [Method] getStaticProp +#-----| 1: (Annotations) +# 36| 3: [TypeAccess] String +# 36| 5: [BlockStmt] { ... } +# 36| 0: [ReturnStmt] return ... +# 36| 0: [VarAccess] NonCompanion.INSTANCE.staticProp +# 36| -1: [VarAccess] NonCompanion.INSTANCE +# 36| -1: [TypeAccess] NonCompanion +# 36| 7: [Method] setStaticProp +# 36| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 36| 0: [Parameter] +#-----| -1: (Annotations) +# 36| 0: [TypeAccess] String +# 36| 5: [BlockStmt] { ... } +# 36| 0: [ExprStmt] ; +# 36| 0: [AssignExpr] ...=... +# 36| 0: [VarAccess] NonCompanion.INSTANCE.staticProp +# 36| -1: [VarAccess] NonCompanion.INSTANCE +# 36| -1: [TypeAccess] NonCompanion +# 36| 1: [VarAccess] +# 37| 8: [FieldDeclaration] String nonStaticProp; +# 37| -1: [TypeAccess] String +# 37| 0: [StringLiteral] b +# 37| 9: [Method] getNonStaticProp +#-----| 1: (Annotations) +# 37| 3: [TypeAccess] String +# 37| 5: [BlockStmt] { ... } +# 37| 0: [ReturnStmt] return ... +# 37| 0: [VarAccess] this.nonStaticProp +# 37| -1: [ThisAccess] this +# 37| 10: [Method] setNonStaticProp +# 37| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 37| 0: [Parameter] +#-----| -1: (Annotations) +# 37| 0: [TypeAccess] String +# 37| 5: [BlockStmt] { ... } +# 37| 0: [ExprStmt] ; +# 37| 0: [AssignExpr] ...=... +# 37| 0: [VarAccess] this.nonStaticProp +# 37| -1: [ThisAccess] this +# 37| 1: [VarAccess] +# 40| 11: [Method] getPropWithStaticGetter +#-----| 1: (Annotations) +# 40| 3: [TypeAccess] String +# 40| 5: [BlockStmt] { ... } +# 40| 0: [ReturnStmt] return ... +# 40| 0: [MethodAccess] getPropWithStaticSetter(...) +# 40| -1: [VarAccess] NonCompanion.INSTANCE +# 40| -1: [TypeAccess] NonCompanion +# 41| 12: [Method] setPropWithStaticGetter +# 41| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 41| 0: [Parameter] s +#-----| -1: (Annotations) +# 41| 0: [TypeAccess] String +# 41| 5: [BlockStmt] { ... } +# 41| 0: [ExprStmt] ; +# 41| 0: [MethodAccess] setPropWithStaticSetter(...) +# 41| -1: [TypeAccess] NonCompanion +# 41| 0: [VarAccess] s +# 44| 13: [Method] getPropWithStaticSetter +#-----| 1: (Annotations) +# 44| 3: [TypeAccess] String +# 44| 5: [BlockStmt] { ... } +# 44| 0: [ReturnStmt] return ... +# 44| 0: [MethodAccess] getPropWithStaticGetter(...) +# 44| -1: [TypeAccess] NonCompanion +# 45| 14: [Method] setPropWithStaticSetter +#-----| 1: (Annotations) +# 45| 3: [TypeAccess] Unit +#-----| 4: (Parameters) +# 45| 0: [Parameter] s +#-----| -1: (Annotations) +# 45| 0: [TypeAccess] String +# 45| 5: [BlockStmt] { ... } +# 45| 0: [ExprStmt] ; +# 45| 0: [MethodAccess] setPropWithStaticGetter(...) +# 45| -1: [VarAccess] NonCompanion.INSTANCE +# 45| -1: [TypeAccess] NonCompanion +# 45| 0: [VarAccess] s diff --git a/java/ql/test/kotlin/library-tests/jvmstatic-annotation/PrintAst.qlref b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/PrintAst.qlref new file mode 100644 index 00000000000..c7fd5faf239 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/PrintAst.qlref @@ -0,0 +1 @@ +semmle/code/java/PrintAst.ql \ No newline at end of file diff --git a/java/ql/test/kotlin/library-tests/jvmstatic-annotation/test.expected b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/test.expected new file mode 100644 index 00000000000..ae431e80343 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/test.expected @@ -0,0 +1,74 @@ +staticMembers +| JavaUser.java:1:14:1:21 | JavaUser | JavaUser.java:3:22:3:25 | test | Method | +| test.kt:0:0:0:0 | TestKt | test.kt:49:1:67:1 | externalUser | Method | +| test.kt:9:1:29:1 | HasCompanion | test.kt:11:3:27:3 | Companion | Class | +| test.kt:9:1:29:1 | HasCompanion | test.kt:11:3:27:3 | Companion | Field | +| test.kt:9:1:29:1 | HasCompanion | test.kt:13:16:13:71 | staticMethod | Method | +| test.kt:9:1:29:1 | HasCompanion | test.kt:16:16:16:43 | getStaticProp | Method | +| test.kt:9:1:29:1 | HasCompanion | test.kt:16:16:16:43 | setStaticProp | Method | +| test.kt:9:1:29:1 | HasCompanion | test.kt:20:18:20:45 | getPropWithStaticGetter | Method | +| test.kt:9:1:29:1 | HasCompanion | test.kt:25:18:25:60 | setPropWithStaticSetter | Method | +| test.kt:31:1:47:1 | NonCompanion | test.kt:31:1:47:1 | INSTANCE | Field | +| test.kt:31:1:47:1 | NonCompanion | test.kt:33:14:33:69 | staticMethod | Method | +| test.kt:31:1:47:1 | NonCompanion | test.kt:36:14:36:41 | getStaticProp | Method | +| test.kt:31:1:47:1 | NonCompanion | test.kt:36:14:36:41 | setStaticProp | Method | +| test.kt:31:1:47:1 | NonCompanion | test.kt:40:16:40:43 | getPropWithStaticGetter | Method | +| test.kt:31:1:47:1 | NonCompanion | test.kt:45:16:45:58 | setPropWithStaticSetter | Method | +#select +| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:5:5:5:34 | staticMethod(...) | JavaUser.java:5:5:5:16 | HasCompanion | static | +| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:7:5:7:73 | setStaticProp(...) | JavaUser.java:7:5:7:16 | HasCompanion | static | +| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:8:45:8:72 | getStaticProp(...) | JavaUser.java:8:45:8:56 | HasCompanion | static | +| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:10:5:10:80 | setPropWithStaticSetter(...) | JavaUser.java:10:5:10:16 | HasCompanion | static | +| test.kt:9:1:29:1 | HasCompanion | JavaUser.java:10:42:10:79 | getPropWithStaticGetter(...) | JavaUser.java:10:42:10:53 | HasCompanion | static | +| test.kt:11:3:27:3 | Companion | JavaUser.java:6:5:6:47 | nonStaticMethod(...) | JavaUser.java:6:5:6:26 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | JavaUser.java:7:32:7:72 | getNonStaticProp(...) | JavaUser.java:7:32:7:53 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | JavaUser.java:8:5:8:73 | setNonStaticProp(...) | JavaUser.java:8:5:8:26 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | JavaUser.java:9:5:9:100 | setPropWithStaticGetter(...) | JavaUser.java:9:5:9:26 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | JavaUser.java:9:52:9:99 | getPropWithStaticSetter(...) | JavaUser.java:9:52:9:73 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:13:16:13:71 | staticMethod(...) | test.kt:13:16:13:71 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:13:54:13:71 | nonStaticMethod(...) | test.kt:13:54:13:71 | this | instance | +| test.kt:11:3:27:3 | Companion | test.kt:14:46:14:60 | staticMethod(...) | test.kt:14:46:14:60 | this | instance | +| test.kt:11:3:27:3 | Companion | test.kt:16:16:16:43 | getStaticProp(...) | test.kt:16:16:16:43 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:16:16:16:43 | setStaticProp(...) | test.kt:16:16:16:43 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:20:18:20:45 | getPropWithStaticGetter(...) | test.kt:20:18:20:45 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:20:26:20:45 | getPropWithStaticSetter(...) | test.kt:20:26:20:45 | this | instance | +| test.kt:11:3:27:3 | Companion | test.kt:21:24:21:43 | setPropWithStaticSetter(...) | test.kt:21:24:21:43 | this | instance | +| test.kt:11:3:27:3 | Companion | test.kt:24:15:24:34 | getPropWithStaticGetter(...) | test.kt:24:15:24:34 | this | instance | +| test.kt:11:3:27:3 | Companion | test.kt:25:18:25:60 | setPropWithStaticSetter(...) | test.kt:25:18:25:60 | HasCompanion.Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:25:35:25:54 | setPropWithStaticGetter(...) | test.kt:25:35:25:54 | this | instance | +| test.kt:11:3:27:3 | Companion | test.kt:52:16:52:32 | staticMethod(...) | test.kt:52:3:52:14 | Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:53:16:53:35 | nonStaticMethod(...) | test.kt:53:3:53:14 | Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:54:3:54:25 | setStaticProp(...) | test.kt:54:3:54:14 | Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:54:42:54:54 | getNonStaticProp(...) | test.kt:54:29:54:40 | Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:55:3:55:28 | setNonStaticProp(...) | test.kt:55:3:55:14 | Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:55:45:55:54 | getStaticProp(...) | test.kt:55:32:55:43 | Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:56:3:56:35 | setPropWithStaticGetter(...) | test.kt:56:3:56:14 | Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:56:52:56:71 | getPropWithStaticSetter(...) | test.kt:56:39:56:50 | Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:57:3:57:35 | setPropWithStaticSetter(...) | test.kt:57:3:57:14 | Companion | instance | +| test.kt:11:3:27:3 | Companion | test.kt:57:52:57:71 | getPropWithStaticGetter(...) | test.kt:57:39:57:50 | Companion | instance | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:13:5:13:34 | staticMethod(...) | JavaUser.java:13:5:13:16 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:14:5:14:46 | nonStaticMethod(...) | JavaUser.java:14:5:14:25 | NonCompanion.INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:15:5:15:72 | setStaticProp(...) | JavaUser.java:15:5:15:16 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:15:32:15:71 | getNonStaticProp(...) | JavaUser.java:15:32:15:52 | NonCompanion.INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:16:5:16:72 | setNonStaticProp(...) | JavaUser.java:16:5:16:25 | NonCompanion.INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:16:44:16:71 | getStaticProp(...) | JavaUser.java:16:44:16:55 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:17:5:17:98 | setPropWithStaticGetter(...) | JavaUser.java:17:5:17:25 | NonCompanion.INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:17:51:17:97 | getPropWithStaticSetter(...) | JavaUser.java:17:51:17:71 | NonCompanion.INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:18:5:18:80 | setPropWithStaticSetter(...) | JavaUser.java:18:5:18:16 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | JavaUser.java:18:42:18:79 | getPropWithStaticGetter(...) | JavaUser.java:18:42:18:53 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | test.kt:33:52:33:69 | nonStaticMethod(...) | test.kt:33:52:33:69 | NonCompanion.INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | test.kt:34:44:34:58 | staticMethod(...) | test.kt:34:44:34:58 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | test.kt:40:24:40:43 | getPropWithStaticSetter(...) | test.kt:40:24:40:43 | NonCompanion.INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | test.kt:41:22:41:41 | setPropWithStaticSetter(...) | test.kt:41:22:41:41 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | test.kt:44:13:44:32 | getPropWithStaticGetter(...) | test.kt:44:13:44:32 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | test.kt:45:33:45:52 | setPropWithStaticGetter(...) | test.kt:45:33:45:52 | NonCompanion.INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | test.kt:60:16:60:32 | staticMethod(...) | test.kt:60:16:60:32 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | test.kt:61:16:61:35 | nonStaticMethod(...) | test.kt:61:3:61:14 | INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | test.kt:62:3:62:25 | setStaticProp(...) | test.kt:62:3:62:25 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | test.kt:62:42:62:54 | getNonStaticProp(...) | test.kt:62:29:62:40 | INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | test.kt:63:3:63:28 | setNonStaticProp(...) | test.kt:63:3:63:14 | INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | test.kt:63:45:63:54 | getStaticProp(...) | test.kt:63:45:63:54 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | test.kt:64:3:64:35 | setPropWithStaticGetter(...) | test.kt:64:3:64:14 | INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | test.kt:64:52:64:71 | getPropWithStaticSetter(...) | test.kt:64:39:64:50 | INSTANCE | instance | +| test.kt:31:1:47:1 | NonCompanion | test.kt:65:3:65:35 | setPropWithStaticSetter(...) | test.kt:65:3:65:35 | NonCompanion | static | +| test.kt:31:1:47:1 | NonCompanion | test.kt:65:52:65:71 | getPropWithStaticGetter(...) | test.kt:65:52:65:71 | NonCompanion | static | diff --git a/java/ql/test/kotlin/library-tests/jvmstatic-annotation/test.kt b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/test.kt new file mode 100644 index 00000000000..cbf553725b4 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/test.kt @@ -0,0 +1,67 @@ +// Test both definining static members, and referring to an object's other static members, in companion object and non-companion object contexts. +// For the companion object all the references to other properties and methods should extract as ordinary instance calls and field read and writes, +// but those methods / getters / setters that are annotated static should get an additional static proxy method defined on the surrounding class-- +// for example, we should see (using Java notation) public static String HasCompanion.staticMethod(String s) { return Companion.staticMethod(s); }. +// For the non-companion object, the static-annotated methods should themselves be extracted as static members, and calls / gets / sets that use them +// should extract as static calls. Static members using non-static ones should extract like staticMethod(...) { INSTANCE.nonStaticMethod(...) }, +// where the reference to INSTANCE replaces what would normally be a `this` reference. + +public class HasCompanion { + + companion object { + + @JvmStatic fun staticMethod(s: String): String = nonStaticMethod(s) + fun nonStaticMethod(s: String): String = staticMethod(s) + + @JvmStatic var staticProp: String = "a" + var nonStaticProp: String = "b" + + var propWithStaticGetter: String + @JvmStatic get() = propWithStaticSetter + set(s: String) { propWithStaticSetter = s } + + var propWithStaticSetter: String + get() = propWithStaticGetter + @JvmStatic set(s: String) { propWithStaticGetter = s } + + } + +} + +object NonCompanion { + + @JvmStatic fun staticMethod(s: String): String = nonStaticMethod(s) + fun nonStaticMethod(s: String): String = staticMethod(s) + + @JvmStatic var staticProp: String = "a" + var nonStaticProp: String = "b" + + var propWithStaticGetter: String + @JvmStatic get() = propWithStaticSetter + set(s: String) { propWithStaticSetter = s } + + var propWithStaticSetter: String + get() = propWithStaticGetter + @JvmStatic set(s: String) { propWithStaticGetter = s } + +} + +fun externalUser() { + + // These all extract as instance calls (to HasCompanion.Companion), since a Kotlin caller won't use the static proxy methods generated by the @JvmStatic annotation. + HasCompanion.staticMethod("1") + HasCompanion.nonStaticMethod("2") + HasCompanion.staticProp = HasCompanion.nonStaticProp + HasCompanion.nonStaticProp = HasCompanion.staticProp + HasCompanion.propWithStaticGetter = HasCompanion.propWithStaticSetter + HasCompanion.propWithStaticSetter = HasCompanion.propWithStaticGetter + + // These extract as static methods, since there is no proxy method in the non-companion object case. + NonCompanion.staticMethod("1") + NonCompanion.nonStaticMethod("2") + NonCompanion.staticProp = NonCompanion.nonStaticProp + NonCompanion.nonStaticProp = NonCompanion.staticProp + NonCompanion.propWithStaticGetter = NonCompanion.propWithStaticSetter + NonCompanion.propWithStaticSetter = NonCompanion.propWithStaticGetter + +} diff --git a/java/ql/test/kotlin/library-tests/jvmstatic-annotation/test.ql b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/test.ql new file mode 100644 index 00000000000..725ba05a106 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/jvmstatic-annotation/test.ql @@ -0,0 +1,16 @@ +import java + +query predicate staticMembers(RefType declType, Member m, string kind) { + m.fromSource() and + m.isStatic() and + m.getDeclaringType() = declType and + kind = m.getAPrimaryQlClass() +} + +from Call call, Callable callable, RefType declType, Expr qualifier, string callType +where + call.getCallee() = callable and + declType = callable.getDeclaringType() and + qualifier = call.getQualifier() and + if callable.isStatic() then callType = "static" else callType = "instance" +select declType, call, qualifier, callType diff --git a/java/ql/test/kotlin/library-tests/lazy-val-multiple-constructors/test.expected b/java/ql/test/kotlin/library-tests/lazy-val-multiple-constructors/test.expected new file mode 100644 index 00000000000..52760d1a6be --- /dev/null +++ b/java/ql/test/kotlin/library-tests/lazy-val-multiple-constructors/test.expected @@ -0,0 +1,2 @@ +| test.kt:3:20:3:32 | new KProperty1(...) { ... } | test.kt:3:20:3:32 | ...::... | +| test.kt:3:28:3:32 | new Function0(...) { ... } | test.kt:3:28:3:32 | ...->... | diff --git a/java/ql/test/kotlin/library-tests/lazy-val-multiple-constructors/test.kt b/java/ql/test/kotlin/library-tests/lazy-val-multiple-constructors/test.kt new file mode 100644 index 00000000000..2797b2f0fef --- /dev/null +++ b/java/ql/test/kotlin/library-tests/lazy-val-multiple-constructors/test.kt @@ -0,0 +1,12 @@ +public class Test { + + val lazyVal: Int by lazy { 5 } + + // Both of these constructors will need to extract the implicit classes created by `lazyVal` and initialize it-- + // This test checks we don't introduce any inconsistency this way. + + constructor(x: Int) { } + + constructor(y: String) { } + +} diff --git a/java/ql/test/kotlin/library-tests/lazy-val-multiple-constructors/test.ql b/java/ql/test/kotlin/library-tests/lazy-val-multiple-constructors/test.ql new file mode 100644 index 00000000000..4e3af808af7 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/lazy-val-multiple-constructors/test.ql @@ -0,0 +1,4 @@ +import java + +from AnonymousClass ac +select ac, ac.getClassInstanceExpr() diff --git a/java/ql/test/kotlin/library-tests/methods/clinit.expected b/java/ql/test/kotlin/library-tests/methods/clinit.expected index 8e4a65ab39a..ea5b5392d82 100644 --- a/java/ql/test/kotlin/library-tests/methods/clinit.expected +++ b/java/ql/test/kotlin/library-tests/methods/clinit.expected @@ -1 +1,2 @@ | clinit.kt:0:0:0:0 | | file://:0:0:0:0 | void | +| enumClass.kt:0:0:0:0 | | file://:0:0:0:0 | void | diff --git a/java/ql/test/kotlin/library-tests/methods/dataClass.kt b/java/ql/test/kotlin/library-tests/methods/dataClass.kt new file mode 100644 index 00000000000..c960238ca3a --- /dev/null +++ b/java/ql/test/kotlin/library-tests/methods/dataClass.kt @@ -0,0 +1 @@ +data class DataClass(val x: Int, var y: String) diff --git a/java/ql/test/kotlin/library-tests/methods/delegates.kt b/java/ql/test/kotlin/library-tests/methods/delegates.kt new file mode 100644 index 00000000000..cd475a51cec --- /dev/null +++ b/java/ql/test/kotlin/library-tests/methods/delegates.kt @@ -0,0 +1,12 @@ +import kotlin.properties.Delegates + +class MyClass { + val lazyProp by lazy { + 5 + } + + var observableProp: String by Delegates.observable("") { + prop, old, new -> + println("Was $old, now $new") + } +} diff --git a/java/ql/test/kotlin/library-tests/methods/enumClass.kt b/java/ql/test/kotlin/library-tests/methods/enumClass.kt new file mode 100644 index 00000000000..89568c0d5f4 --- /dev/null +++ b/java/ql/test/kotlin/library-tests/methods/enumClass.kt @@ -0,0 +1,4 @@ +enum class EnumClass(val v: Int) { + enum1(1), + enum2(1) +} diff --git a/java/ql/test/kotlin/library-tests/methods/exprs.expected b/java/ql/test/kotlin/library-tests/methods/exprs.expected index a08c7cda44e..b0a7e618de8 100644 --- a/java/ql/test/kotlin/library-tests/methods/exprs.expected +++ b/java/ql/test/kotlin/library-tests/methods/exprs.expected @@ -12,6 +12,218 @@ | clinit.kt:3:1:3:24 | int | TypeAccess | | clinit.kt:3:1:3:24 | int | TypeAccess | | clinit.kt:3:24:3:24 | 0 | IntegerLiteral | +| dataClass.kt:0:0:0:0 | 31 | IntegerLiteral | +| dataClass.kt:0:0:0:0 | "..." | StringTemplateExpr | +| dataClass.kt:0:0:0:0 | (...)... | CastExpr | +| dataClass.kt:0:0:0:0 | ) | StringLiteral | +| dataClass.kt:0:0:0:0 | , | StringLiteral | +| dataClass.kt:0:0:0:0 | ... !is ... | NotInstanceOfExpr | +| dataClass.kt:0:0:0:0 | ... (value not-equals) ... | ValueNEExpr | +| dataClass.kt:0:0:0:0 | ... (value not-equals) ... | ValueNEExpr | +| dataClass.kt:0:0:0:0 | ... == ... | EQExpr | +| dataClass.kt:0:0:0:0 | ...=... | AssignExpr | +| dataClass.kt:0:0:0:0 | DataClass | TypeAccess | +| dataClass.kt:0:0:0:0 | DataClass | TypeAccess | +| dataClass.kt:0:0:0:0 | DataClass | TypeAccess | +| dataClass.kt:0:0:0:0 | DataClass | TypeAccess | +| dataClass.kt:0:0:0:0 | DataClass( | StringLiteral | +| dataClass.kt:0:0:0:0 | Object | TypeAccess | +| dataClass.kt:0:0:0:0 | String | TypeAccess | +| dataClass.kt:0:0:0:0 | String | TypeAccess | +| dataClass.kt:0:0:0:0 | boolean | TypeAccess | +| dataClass.kt:0:0:0:0 | false | BooleanLiteral | +| dataClass.kt:0:0:0:0 | false | BooleanLiteral | +| dataClass.kt:0:0:0:0 | false | BooleanLiteral | +| dataClass.kt:0:0:0:0 | hashCode(...) | MethodAccess | +| dataClass.kt:0:0:0:0 | hashCode(...) | MethodAccess | +| dataClass.kt:0:0:0:0 | int | TypeAccess | +| dataClass.kt:0:0:0:0 | int | TypeAccess | +| dataClass.kt:0:0:0:0 | new DataClass(...) | ClassInstanceExpr | +| dataClass.kt:0:0:0:0 | other | VarAccess | +| dataClass.kt:0:0:0:0 | other | VarAccess | +| dataClass.kt:0:0:0:0 | other | VarAccess | +| dataClass.kt:0:0:0:0 | plus(...) | MethodAccess | +| dataClass.kt:0:0:0:0 | result | LocalVariableDeclExpr | +| dataClass.kt:0:0:0:0 | result | VarAccess | +| dataClass.kt:0:0:0:0 | result | VarAccess | +| dataClass.kt:0:0:0:0 | result | VarAccess | +| dataClass.kt:0:0:0:0 | this | ThisAccess | +| dataClass.kt:0:0:0:0 | this | ThisAccess | +| dataClass.kt:0:0:0:0 | this | ThisAccess | +| dataClass.kt:0:0:0:0 | this | ThisAccess | +| dataClass.kt:0:0:0:0 | this | ThisAccess | +| dataClass.kt:0:0:0:0 | this | ThisAccess | +| dataClass.kt:0:0:0:0 | this | ThisAccess | +| dataClass.kt:0:0:0:0 | this | ThisAccess | +| dataClass.kt:0:0:0:0 | this | ThisAccess | +| dataClass.kt:0:0:0:0 | this.x | VarAccess | +| dataClass.kt:0:0:0:0 | this.x | VarAccess | +| dataClass.kt:0:0:0:0 | this.x | VarAccess | +| dataClass.kt:0:0:0:0 | this.x | VarAccess | +| dataClass.kt:0:0:0:0 | this.y | VarAccess | +| dataClass.kt:0:0:0:0 | this.y | VarAccess | +| dataClass.kt:0:0:0:0 | this.y | VarAccess | +| dataClass.kt:0:0:0:0 | this.y | VarAccess | +| dataClass.kt:0:0:0:0 | times(...) | MethodAccess | +| dataClass.kt:0:0:0:0 | tmp0_other_with_cast | LocalVariableDeclExpr | +| dataClass.kt:0:0:0:0 | tmp0_other_with_cast | VarAccess | +| dataClass.kt:0:0:0:0 | tmp0_other_with_cast | VarAccess | +| dataClass.kt:0:0:0:0 | tmp0_other_with_cast.x | VarAccess | +| dataClass.kt:0:0:0:0 | tmp0_other_with_cast.y | VarAccess | +| dataClass.kt:0:0:0:0 | true | BooleanLiteral | +| dataClass.kt:0:0:0:0 | true | BooleanLiteral | +| dataClass.kt:0:0:0:0 | when ... | WhenExpr | +| dataClass.kt:0:0:0:0 | when ... | WhenExpr | +| dataClass.kt:0:0:0:0 | when ... | WhenExpr | +| dataClass.kt:0:0:0:0 | when ... | WhenExpr | +| dataClass.kt:0:0:0:0 | x | VarAccess | +| dataClass.kt:0:0:0:0 | x= | StringLiteral | +| dataClass.kt:0:0:0:0 | y | VarAccess | +| dataClass.kt:0:0:0:0 | y= | StringLiteral | +| dataClass.kt:1:22:1:31 | ...=... | KtInitializerAssignExpr | +| dataClass.kt:1:22:1:31 | int | TypeAccess | +| dataClass.kt:1:22:1:31 | int | TypeAccess | +| dataClass.kt:1:22:1:31 | int | TypeAccess | +| dataClass.kt:1:22:1:31 | int | TypeAccess | +| dataClass.kt:1:22:1:31 | this | ThisAccess | +| dataClass.kt:1:22:1:31 | this.x | VarAccess | +| dataClass.kt:1:22:1:31 | x | VarAccess | +| dataClass.kt:1:22:1:31 | x | VarAccess | +| dataClass.kt:1:34:1:46 | ...=... | AssignExpr | +| dataClass.kt:1:34:1:46 | ...=... | KtInitializerAssignExpr | +| dataClass.kt:1:34:1:46 | | VarAccess | +| dataClass.kt:1:34:1:46 | String | TypeAccess | +| dataClass.kt:1:34:1:46 | String | TypeAccess | +| dataClass.kt:1:34:1:46 | String | TypeAccess | +| dataClass.kt:1:34:1:46 | String | TypeAccess | +| dataClass.kt:1:34:1:46 | String | TypeAccess | +| dataClass.kt:1:34:1:46 | Unit | TypeAccess | +| dataClass.kt:1:34:1:46 | this | ThisAccess | +| dataClass.kt:1:34:1:46 | this | ThisAccess | +| dataClass.kt:1:34:1:46 | this.y | VarAccess | +| dataClass.kt:1:34:1:46 | this.y | VarAccess | +| dataClass.kt:1:34:1:46 | y | VarAccess | +| dataClass.kt:1:34:1:46 | y | VarAccess | +| delegates.kt:1:9:1:12 | this | ThisAccess | +| delegates.kt:1:9:1:12 | this | ThisAccess | +| delegates.kt:1:9:1:12 | this | ThisAccess | +| delegates.kt:4:18:6:5 | ...::... | PropertyRefExpr | +| delegates.kt:4:18:6:5 | ...=... | KtInitializerAssignExpr | +| delegates.kt:4:18:6:5 | Integer | TypeAccess | +| delegates.kt:4:18:6:5 | Integer | TypeAccess | +| delegates.kt:4:18:6:5 | KProperty1 | TypeAccess | +| delegates.kt:4:18:6:5 | Lazy | TypeAccess | +| delegates.kt:4:18:6:5 | MyClass | TypeAccess | +| delegates.kt:4:18:6:5 | a0 | VarAccess | +| delegates.kt:4:18:6:5 | a0 | VarAccess | +| delegates.kt:4:18:6:5 | get(...) | MethodAccess | +| delegates.kt:4:18:6:5 | getLazyProp(...) | MethodAccess | +| delegates.kt:4:18:6:5 | int | TypeAccess | +| delegates.kt:4:18:6:5 | lazyProp$delegate | VarAccess | +| delegates.kt:4:18:6:5 | this | ThisAccess | +| delegates.kt:4:18:6:5 | this | ThisAccess | +| delegates.kt:4:18:6:5 | this.lazyProp$delegate | VarAccess | +| delegates.kt:4:21:6:5 | Integer | TypeAccess | +| delegates.kt:4:21:6:5 | Integer | TypeAccess | +| delegates.kt:4:21:6:5 | LazyKt | TypeAccess | +| delegates.kt:4:21:6:5 | LazyKt | TypeAccess | +| delegates.kt:4:21:6:5 | getValue(...) | MethodAccess | +| delegates.kt:4:21:6:5 | lazy(...) | MethodAccess | +| delegates.kt:4:26:6:5 | ...->... | LambdaExpr | +| delegates.kt:4:26:6:5 | Function0 | TypeAccess | +| delegates.kt:4:26:6:5 | Integer | TypeAccess | +| delegates.kt:4:26:6:5 | int | TypeAccess | +| delegates.kt:5:9:5:9 | 5 | IntegerLiteral | +| delegates.kt:8:32:11:5 | ...::... | PropertyRefExpr | +| delegates.kt:8:32:11:5 | ...::... | PropertyRefExpr | +| delegates.kt:8:32:11:5 | ...=... | KtInitializerAssignExpr | +| delegates.kt:8:32:11:5 | KMutableProperty1 | TypeAccess | +| delegates.kt:8:32:11:5 | KMutableProperty1 | TypeAccess | +| delegates.kt:8:32:11:5 | MyClass | TypeAccess | +| delegates.kt:8:32:11:5 | MyClass | TypeAccess | +| delegates.kt:8:32:11:5 | Object | TypeAccess | +| delegates.kt:8:32:11:5 | ReadWriteProperty | TypeAccess | +| delegates.kt:8:32:11:5 | String | TypeAccess | +| delegates.kt:8:32:11:5 | String | TypeAccess | +| delegates.kt:8:32:11:5 | String | TypeAccess | +| delegates.kt:8:32:11:5 | String | TypeAccess | +| delegates.kt:8:32:11:5 | String | TypeAccess | +| delegates.kt:8:32:11:5 | Unit | TypeAccess | +| delegates.kt:8:32:11:5 | a0 | VarAccess | +| delegates.kt:8:32:11:5 | a0 | VarAccess | +| delegates.kt:8:32:11:5 | a0 | VarAccess | +| delegates.kt:8:32:11:5 | a0 | VarAccess | +| delegates.kt:8:32:11:5 | a0 | VarAccess | +| delegates.kt:8:32:11:5 | a0 | VarAccess | +| delegates.kt:8:32:11:5 | a1 | VarAccess | +| delegates.kt:8:32:11:5 | a1 | VarAccess | +| delegates.kt:8:32:11:5 | get(...) | MethodAccess | +| delegates.kt:8:32:11:5 | get(...) | MethodAccess | +| delegates.kt:8:32:11:5 | getObservableProp(...) | MethodAccess | +| delegates.kt:8:32:11:5 | getObservableProp(...) | MethodAccess | +| delegates.kt:8:32:11:5 | observableProp$delegate | VarAccess | +| delegates.kt:8:32:11:5 | setObservableProp(...) | MethodAccess | +| delegates.kt:8:32:11:5 | setObservableProp(...) | MethodAccess | +| delegates.kt:8:32:11:5 | this | ThisAccess | +| delegates.kt:8:32:11:5 | this | ThisAccess | +| delegates.kt:8:32:11:5 | this | ThisAccess | +| delegates.kt:8:32:11:5 | this | ThisAccess | +| delegates.kt:8:32:11:5 | this.observableProp$delegate | VarAccess | +| delegates.kt:8:32:11:5 | this.observableProp$delegate | VarAccess | +| delegates.kt:8:35:8:43 | INSTANCE | VarAccess | +| delegates.kt:8:35:11:5 | | VarAccess | +| delegates.kt:8:35:11:5 | getValue(...) | MethodAccess | +| delegates.kt:8:35:11:5 | setValue(...) | MethodAccess | +| delegates.kt:8:45:11:5 | String | TypeAccess | +| delegates.kt:8:45:11:5 | observable(...) | MethodAccess | +| delegates.kt:8:57:8:62 | | StringLiteral | +| delegates.kt:8:66:11:5 | ...->... | LambdaExpr | +| delegates.kt:8:66:11:5 | Function3,String,String,Unit> | TypeAccess | +| delegates.kt:8:66:11:5 | KProperty | TypeAccess | +| delegates.kt:8:66:11:5 | String | TypeAccess | +| delegates.kt:8:66:11:5 | String | TypeAccess | +| delegates.kt:8:66:11:5 | Unit | TypeAccess | +| delegates.kt:8:66:11:5 | Unit | TypeAccess | +| delegates.kt:9:9:9:12 | ? ... | WildcardTypeAccess | +| delegates.kt:9:9:9:12 | KProperty | TypeAccess | +| delegates.kt:9:15:9:17 | String | TypeAccess | +| delegates.kt:9:20:9:22 | String | TypeAccess | +| delegates.kt:10:9:10:37 | ConsoleKt | TypeAccess | +| delegates.kt:10:9:10:37 | println(...) | MethodAccess | +| delegates.kt:10:17:10:36 | "..." | StringTemplateExpr | +| delegates.kt:10:18:10:21 | Was | StringLiteral | +| delegates.kt:10:23:10:25 | old | VarAccess | +| delegates.kt:10:26:10:31 | , now | StringLiteral | +| delegates.kt:10:33:10:35 | new | VarAccess | +| enumClass.kt:0:0:0:0 | EnumClass | TypeAccess | +| enumClass.kt:0:0:0:0 | EnumClass | TypeAccess | +| enumClass.kt:0:0:0:0 | EnumClass[] | TypeAccess | +| enumClass.kt:0:0:0:0 | String | TypeAccess | +| enumClass.kt:1:1:4:1 | EnumClass | TypeAccess | +| enumClass.kt:1:1:4:1 | Unit | TypeAccess | +| enumClass.kt:1:1:4:1 | new Enum(...) | ClassInstanceExpr | +| enumClass.kt:1:22:1:31 | ...=... | KtInitializerAssignExpr | +| enumClass.kt:1:22:1:31 | int | TypeAccess | +| enumClass.kt:1:22:1:31 | int | TypeAccess | +| enumClass.kt:1:22:1:31 | int | TypeAccess | +| enumClass.kt:1:22:1:31 | this | ThisAccess | +| enumClass.kt:1:22:1:31 | this.v | VarAccess | +| enumClass.kt:1:22:1:31 | v | VarAccess | +| enumClass.kt:1:22:1:31 | v | VarAccess | +| enumClass.kt:2:5:2:13 | ...=... | KtInitializerAssignExpr | +| enumClass.kt:2:5:2:13 | EnumClass | TypeAccess | +| enumClass.kt:2:5:2:13 | EnumClass | TypeAccess | +| enumClass.kt:2:5:2:13 | EnumClass | TypeAccess | +| enumClass.kt:2:5:2:13 | EnumClass.enum1 | VarAccess | +| enumClass.kt:2:5:2:13 | new EnumClass(...) | ClassInstanceExpr | +| enumClass.kt:2:11:2:11 | 1 | IntegerLiteral | +| enumClass.kt:3:5:3:12 | ...=... | KtInitializerAssignExpr | +| enumClass.kt:3:5:3:12 | EnumClass | TypeAccess | +| enumClass.kt:3:5:3:12 | EnumClass | TypeAccess | +| enumClass.kt:3:5:3:12 | EnumClass | TypeAccess | +| enumClass.kt:3:5:3:12 | EnumClass.enum2 | VarAccess | +| enumClass.kt:3:5:3:12 | new EnumClass(...) | ClassInstanceExpr | +| enumClass.kt:3:11:3:11 | 1 | IntegerLiteral | | methods2.kt:4:1:5:1 | Unit | TypeAccess | | methods2.kt:4:26:4:31 | int | TypeAccess | | methods2.kt:4:34:4:39 | int | TypeAccess | @@ -84,3 +296,4 @@ | methods.kt:16:13:16:31 | Unit | TypeAccess | | methods.kt:17:14:17:33 | Unit | TypeAccess | | methods.kt:18:5:18:36 | Unit | TypeAccess | +| methods.kt:19:12:19:29 | Unit | TypeAccess | diff --git a/java/ql/test/kotlin/library-tests/methods/methods.expected b/java/ql/test/kotlin/library-tests/methods/methods.expected index 87832f2ed87..11fa8762e28 100644 --- a/java/ql/test/kotlin/library-tests/methods/methods.expected +++ b/java/ql/test/kotlin/library-tests/methods/methods.expected @@ -1,24 +1,59 @@ methods -| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:0:0:0:0 | | () | | -| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | getTopLevelInt | getTopLevelInt() | public, static | -| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | setTopLevelInt | setTopLevelInt(int) | public, static | -| methods2.kt:0:0:0:0 | Methods2Kt | methods2.kt:4:1:5:1 | fooBarTopLevelMethod | fooBarTopLevelMethod(int,int) | public, static | -| methods2.kt:7:1:10:1 | Class2 | methods2.kt:8:5:9:5 | fooBarClassMethod | fooBarClassMethod(int,int) | public | -| methods3.kt:0:0:0:0 | Methods3Kt | methods3.kt:3:1:3:42 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) | public, static | -| methods3.kt:5:1:7:1 | Class3 | methods3.kt:6:5:6:46 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) | public | -| methods4.kt:5:3:9:3 | InsideNestedTest | methods4.kt:7:5:7:34 | m | m(foo.bar.NestedTest.InsideNestedTest) | public | -| methods5.kt:0:0:0:0 | Methods5Kt | methods5.kt:3:1:11:1 | x | x() | public, static | -| methods5.kt:5:3:5:27 | | methods5.kt:5:3:5:27 | a | a(int) | public | -| methods5.kt:9:3:9:32 | | methods5.kt:9:3:9:32 | f1 | f1(foo.bar.C1,int) | public | -| methods.kt:0:0:0:0 | MethodsKt | methods.kt:2:1:3:1 | topLevelMethod | topLevelMethod(int,int) | public, static | -| methods.kt:5:1:19:1 | Class | methods.kt:6:5:7:5 | classMethod | classMethod(int,int) | public | -| methods.kt:5:1:19:1 | Class | methods.kt:9:5:12:5 | anotherClassMethod | anotherClassMethod(int,int) | public | -| methods.kt:5:1:19:1 | Class | methods.kt:14:12:14:29 | publicFun | publicFun() | public | -| methods.kt:5:1:19:1 | Class | methods.kt:15:15:15:35 | protectedFun | protectedFun() | protected | -| methods.kt:5:1:19:1 | Class | methods.kt:16:13:16:31 | privateFun | privateFun() | private | -| methods.kt:5:1:19:1 | Class | methods.kt:17:14:17:33 | internalFun | internalFun() | internal | -| methods.kt:5:1:19:1 | Class | methods.kt:18:5:18:36 | noExplicitVisibilityFun | noExplicitVisibilityFun() | public | +| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:0:0:0:0 | | () | | Compiler generated | +| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | getTopLevelInt | getTopLevelInt() | public, static | Compiler generated | +| clinit.kt:0:0:0:0 | ClinitKt | clinit.kt:3:1:3:24 | setTopLevelInt | setTopLevelInt(int) | public, static | Compiler generated | +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | component1 | component1() | public | Compiler generated | +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | component2 | component2() | public | Compiler generated | +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | copy | copy(int,java.lang.String) | public | Compiler generated | +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | equals | equals(java.lang.Object) | override, public | Compiler generated | +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | hashCode | hashCode() | override, public | Compiler generated | +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | toString | toString() | override, public | Compiler generated | +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:1:22:1:31 | getX | getX() | public | Compiler generated | +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:1:34:1:46 | getY | getY() | public | Compiler generated | +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:1:34:1:46 | setY | setY(java.lang.String) | public | Compiler generated | +| delegates.kt:3:1:12:1 | MyClass | delegates.kt:4:18:6:5 | getLazyProp | getLazyProp() | public | Compiler generated | +| delegates.kt:3:1:12:1 | MyClass | delegates.kt:8:32:11:5 | getObservableProp | getObservableProp() | public | Compiler generated | +| delegates.kt:3:1:12:1 | MyClass | delegates.kt:8:32:11:5 | setObservableProp | setObservableProp(java.lang.String) | public | Compiler generated | +| delegates.kt:4:18:6:5 | new KProperty1(...) { ... } | delegates.kt:4:18:6:5 | get | get(MyClass) | override, public | | +| delegates.kt:4:18:6:5 | new KProperty1(...) { ... } | delegates.kt:4:18:6:5 | invoke | invoke(MyClass) | override, public | | +| delegates.kt:4:26:6:5 | new Function0(...) { ... } | delegates.kt:4:26:6:5 | invoke | invoke() | override, public | | +| delegates.kt:8:32:11:5 | new KMutableProperty1(...) { ... } | delegates.kt:8:32:11:5 | get | get(MyClass) | override, public | | +| delegates.kt:8:32:11:5 | new KMutableProperty1(...) { ... } | delegates.kt:8:32:11:5 | get | get(MyClass) | override, public | | +| delegates.kt:8:32:11:5 | new KMutableProperty1(...) { ... } | delegates.kt:8:32:11:5 | invoke | invoke(MyClass) | override, public | | +| delegates.kt:8:32:11:5 | new KMutableProperty1(...) { ... } | delegates.kt:8:32:11:5 | invoke | invoke(MyClass) | override, public | | +| delegates.kt:8:32:11:5 | new KMutableProperty1(...) { ... } | delegates.kt:8:32:11:5 | set | set(MyClass,java.lang.String) | override, public | | +| delegates.kt:8:32:11:5 | new KMutableProperty1(...) { ... } | delegates.kt:8:32:11:5 | set | set(MyClass,java.lang.String) | override, public | | +| delegates.kt:8:66:11:5 | new Function3,String,String,Unit>(...) { ... } | delegates.kt:8:66:11:5 | invoke | invoke(kotlin.reflect.KProperty,java.lang.String,java.lang.String) | override, public | | +| enumClass.kt:1:1:4:1 | EnumClass | enumClass.kt:0:0:0:0 | | () | | Compiler generated | +| enumClass.kt:1:1:4:1 | EnumClass | enumClass.kt:0:0:0:0 | valueOf | valueOf(java.lang.String) | public, static | Compiler generated | +| enumClass.kt:1:1:4:1 | EnumClass | enumClass.kt:0:0:0:0 | values | values() | public, static | Compiler generated | +| enumClass.kt:1:1:4:1 | EnumClass | enumClass.kt:1:22:1:31 | getV | getV() | public | Compiler generated | +| methods2.kt:0:0:0:0 | Methods2Kt | methods2.kt:4:1:5:1 | fooBarTopLevelMethod | fooBarTopLevelMethod(int,int) | public, static | | +| methods2.kt:7:1:10:1 | Class2 | methods2.kt:8:5:9:5 | fooBarClassMethod | fooBarClassMethod(int,int) | public | | +| methods3.kt:0:0:0:0 | Methods3Kt | methods3.kt:3:1:3:42 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) | public, static | | +| methods3.kt:5:1:7:1 | Class3 | methods3.kt:6:5:6:46 | fooBarTopLevelMethodExt | fooBarTopLevelMethodExt(int,int) | public | | +| methods4.kt:5:3:9:3 | InsideNestedTest | methods4.kt:7:5:7:34 | m | m(foo.bar.NestedTest.InsideNestedTest) | public | | +| methods5.kt:0:0:0:0 | Methods5Kt | methods5.kt:3:1:11:1 | x | x() | public, static | | +| methods5.kt:5:3:5:27 | | methods5.kt:5:3:5:27 | a | a(int) | public | | +| methods5.kt:9:3:9:32 | | methods5.kt:9:3:9:32 | f1 | f1(foo.bar.C1,int) | public | | +| methods.kt:0:0:0:0 | MethodsKt | methods.kt:2:1:3:1 | topLevelMethod | topLevelMethod(int,int) | public, static | | +| methods.kt:5:1:20:1 | Class | methods.kt:6:5:7:5 | classMethod | classMethod(int,int) | public | | +| methods.kt:5:1:20:1 | Class | methods.kt:9:5:12:5 | anotherClassMethod | anotherClassMethod(int,int) | public | | +| methods.kt:5:1:20:1 | Class | methods.kt:14:12:14:29 | publicFun | publicFun() | public | | +| methods.kt:5:1:20:1 | Class | methods.kt:15:15:15:35 | protectedFun | protectedFun() | protected | | +| methods.kt:5:1:20:1 | Class | methods.kt:16:13:16:31 | privateFun | privateFun() | private | | +| methods.kt:5:1:20:1 | Class | methods.kt:17:14:17:33 | internalFun | internalFun() | internal | | +| methods.kt:5:1:20:1 | Class | methods.kt:18:5:18:36 | noExplicitVisibilityFun | noExplicitVisibilityFun() | public | | +| methods.kt:5:1:20:1 | Class | methods.kt:19:12:19:29 | inlineFun | inlineFun() | inline, public | | constructors +| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:1:6:1:47 | DataClass | DataClass(int,java.lang.String) | +| delegates.kt:3:1:12:1 | MyClass | delegates.kt:3:1:12:1 | MyClass | MyClass() | +| delegates.kt:4:18:6:5 | new KProperty1(...) { ... } | delegates.kt:4:18:6:5 | | | +| delegates.kt:4:26:6:5 | new Function0(...) { ... } | delegates.kt:4:26:6:5 | | | +| delegates.kt:8:32:11:5 | new KMutableProperty1(...) { ... } | delegates.kt:8:32:11:5 | | | +| delegates.kt:8:32:11:5 | new KMutableProperty1(...) { ... } | delegates.kt:8:32:11:5 | | | +| delegates.kt:8:66:11:5 | new Function3,String,String,Unit>(...) { ... } | delegates.kt:8:66:11:5 | | | +| enumClass.kt:1:1:4:1 | EnumClass | enumClass.kt:1:6:4:1 | EnumClass | EnumClass(int) | | methods2.kt:7:1:10:1 | Class2 | methods2.kt:7:1:10:1 | Class2 | Class2() | | methods3.kt:5:1:7:1 | Class3 | methods3.kt:5:1:7:1 | Class3 | Class3() | | methods4.kt:3:1:11:1 | NestedTest | methods4.kt:3:1:11:1 | NestedTest | NestedTest() | @@ -26,7 +61,7 @@ constructors | methods5.kt:5:3:5:27 | | methods5.kt:5:3:5:27 | | | | methods5.kt:9:3:9:32 | | methods5.kt:9:3:9:32 | | | | methods5.kt:13:1:13:14 | C1 | methods5.kt:13:1:13:14 | C1 | C1() | -| methods.kt:5:1:19:1 | Class | methods.kt:5:1:19:1 | Class | Class() | +| methods.kt:5:1:20:1 | Class | methods.kt:5:1:20:1 | Class | Class() | extensions | methods3.kt:3:1:3:42 | fooBarTopLevelMethodExt | file://:0:0:0:0 | int | | methods3.kt:6:5:6:46 | fooBarTopLevelMethodExt | file://:0:0:0:0 | int | diff --git a/java/ql/test/kotlin/library-tests/methods/methods.kt b/java/ql/test/kotlin/library-tests/methods/methods.kt index b59937bc861..48f480f8748 100644 --- a/java/ql/test/kotlin/library-tests/methods/methods.kt +++ b/java/ql/test/kotlin/library-tests/methods/methods.kt @@ -16,5 +16,6 @@ class Class { private fun privateFun() {} internal fun internalFun() {} fun noExplicitVisibilityFun() {} + inline fun inlineFun() {} } diff --git a/java/ql/test/kotlin/library-tests/methods/methods.ql b/java/ql/test/kotlin/library-tests/methods/methods.ql index 12526711da1..365d41ff1ee 100644 --- a/java/ql/test/kotlin/library-tests/methods/methods.ql +++ b/java/ql/test/kotlin/library-tests/methods/methods.ql @@ -1,10 +1,15 @@ import java -query predicate methods(RefType declType, Method m, string signature, string modifiers) { +query predicate methods( + RefType declType, Method m, string signature, string modifiers, string compilerGenerated +) { m.fromSource() and declType = m.getDeclaringType() and signature = m.getSignature() and - modifiers = concat(string s | m.hasModifier(s) | s, ", ") + modifiers = concat(string s | m.hasModifier(s) | s, ", ") and + if m.isCompilerGenerated() + then compilerGenerated = "Compiler generated" + else compilerGenerated = "" } query predicate constructors(RefType declType, Constructor c, string signature) { diff --git a/java/ql/test/kotlin/library-tests/methods/parameters.expected b/java/ql/test/kotlin/library-tests/methods/parameters.expected index 3e34c2c3b86..2b35e69e502 100644 --- a/java/ql/test/kotlin/library-tests/methods/parameters.expected +++ b/java/ql/test/kotlin/library-tests/methods/parameters.expected @@ -1,4 +1,23 @@ | clinit.kt:3:1:3:24 | setTopLevelInt | clinit.kt:3:1:3:24 | | 0 | +| dataClass.kt:0:0:0:0 | copy | dataClass.kt:1:22:1:31 | x | 0 | +| dataClass.kt:0:0:0:0 | copy | dataClass.kt:1:34:1:46 | y | 1 | +| dataClass.kt:0:0:0:0 | equals | dataClass.kt:0:0:0:0 | other | 0 | +| dataClass.kt:1:34:1:46 | setY | dataClass.kt:1:34:1:46 | | 0 | +| delegates.kt:4:18:6:5 | get | delegates.kt:4:18:6:5 | a0 | 0 | +| delegates.kt:4:18:6:5 | invoke | delegates.kt:4:18:6:5 | a0 | 0 | +| delegates.kt:8:32:11:5 | get | delegates.kt:8:32:11:5 | a0 | 0 | +| delegates.kt:8:32:11:5 | get | delegates.kt:8:32:11:5 | a0 | 0 | +| delegates.kt:8:32:11:5 | invoke | delegates.kt:8:32:11:5 | a0 | 0 | +| delegates.kt:8:32:11:5 | invoke | delegates.kt:8:32:11:5 | a0 | 0 | +| delegates.kt:8:32:11:5 | set | delegates.kt:8:32:11:5 | a0 | 0 | +| delegates.kt:8:32:11:5 | set | delegates.kt:8:32:11:5 | a0 | 0 | +| delegates.kt:8:32:11:5 | set | delegates.kt:8:32:11:5 | a1 | 1 | +| delegates.kt:8:32:11:5 | set | delegates.kt:8:32:11:5 | a1 | 1 | +| delegates.kt:8:32:11:5 | setObservableProp | delegates.kt:8:32:11:5 | | 0 | +| delegates.kt:8:66:11:5 | invoke | delegates.kt:9:9:9:12 | prop | 0 | +| delegates.kt:8:66:11:5 | invoke | delegates.kt:9:15:9:17 | old | 1 | +| delegates.kt:8:66:11:5 | invoke | delegates.kt:9:20:9:22 | new | 2 | +| enumClass.kt:0:0:0:0 | valueOf | enumClass.kt:0:0:0:0 | value | 0 | | methods2.kt:4:1:5:1 | fooBarTopLevelMethod | methods2.kt:4:26:4:31 | x | 0 | | methods2.kt:4:1:5:1 | fooBarTopLevelMethod | methods2.kt:4:34:4:39 | y | 1 | | methods2.kt:8:5:9:5 | fooBarClassMethod | methods2.kt:8:27:8:32 | x | 0 | diff --git a/java/ql/test/kotlin/library-tests/reflection/PrintAst.expected b/java/ql/test/kotlin/library-tests/reflection/PrintAst.expected index c29df0de6ef..dd47be234c3 100644 --- a/java/ql/test/kotlin/library-tests/reflection/PrintAst.expected +++ b/java/ql/test/kotlin/library-tests/reflection/PrintAst.expected @@ -26,7 +26,7 @@ reflection.kt: # 50| 1: [Constructor] # 50| 5: [BlockStmt] { ... } # 50| 0: [SuperConstructorInvocationStmt] super(...) -# 50| 1: [Method] get +# 50| 2: [Method] get #-----| 4: (Parameters) # 50| 0: [Parameter] a0 # 50| 5: [BlockStmt] { ... } @@ -34,7 +34,7 @@ reflection.kt: # 50| 0: [MethodAccess] getLastChar(...) # 50| -1: [TypeAccess] ReflectionKt # 50| 0: [VarAccess] a0 -# 50| 1: [Method] invoke +# 50| 3: [Method] invoke #-----| 4: (Parameters) # 50| 0: [Parameter] a0 # 50| 5: [BlockStmt] { ... } @@ -62,16 +62,16 @@ reflection.kt: # 51| 0: [VarAccess] this. # 51| -1: [ThisAccess] this # 51| 1: [VarAccess] -# 51| 1: [FieldDeclaration] String ; +# 51| 2: [FieldDeclaration] String ; # 51| -1: [TypeAccess] String -# 51| 1: [Method] get +# 51| 3: [Method] get # 51| 5: [BlockStmt] { ... } # 51| 0: [ReturnStmt] return ... # 51| 0: [MethodAccess] getLastChar(...) # 51| -1: [TypeAccess] ReflectionKt # 51| 0: [VarAccess] this. # 51| -1: [ThisAccess] this -# 51| 1: [Method] invoke +# 51| 4: [Method] invoke # 51| 5: [BlockStmt] { ... } # 51| 0: [ReturnStmt] return ... # 51| 0: [MethodAccess] get(...) @@ -124,7 +124,7 @@ reflection.kt: # 97| 1: [Constructor] # 97| 5: [BlockStmt] { ... } # 97| 0: [SuperConstructorInvocationStmt] super(...) -# 97| 1: [Method] invoke +# 97| 2: [Method] invoke #-----| 4: (Parameters) # 97| 0: [Parameter] a0 # 97| 5: [BlockStmt] { ... } @@ -148,7 +148,7 @@ reflection.kt: # 98| 1: [Constructor] # 98| 5: [BlockStmt] { ... } # 98| 0: [SuperConstructorInvocationStmt] super(...) -# 98| 1: [Method] invoke +# 98| 2: [Method] invoke #-----| 4: (Parameters) # 98| 0: [Parameter] a0 # 98| 5: [BlockStmt] { ... } @@ -180,7 +180,10 @@ reflection.kt: # 99| 0: [VarAccess] this. # 99| -1: [ThisAccess] this # 99| 1: [VarAccess] -# 99| 1: [Method] invoke +# 99| 2: [FieldDeclaration] Class2 ; +# 99| -1: [TypeAccess] Class2 +# 99| 0: [TypeAccess] Integer +# 99| 3: [Method] invoke #-----| 4: (Parameters) # 99| 0: [Parameter] a0 # 99| 5: [BlockStmt] { ... } @@ -191,9 +194,6 @@ reflection.kt: # 99| -2: [VarAccess] this. # 99| -1: [ThisAccess] this # 99| 0: [VarAccess] a0 -# 99| 1: [FieldDeclaration] Class2 ; -# 99| -1: [TypeAccess] Class2 -# 99| 0: [TypeAccess] Integer # 99| -3: [TypeAccess] Function1> # 99| 0: [TypeAccess] String # 99| 1: [TypeAccess] Inner @@ -260,7 +260,7 @@ reflection.kt: # 126| 1: [Constructor] # 126| 5: [BlockStmt] { ... } # 126| 0: [SuperConstructorInvocationStmt] super(...) -# 126| 1: [Method] fn1 +# 126| 2: [Method] fn1 # 126| 3: [TypeAccess] Unit # 126| 5: [BlockStmt] { ... } # 126| 0: [ExprStmt] ; @@ -274,7 +274,7 @@ reflection.kt: # 126| 1: [Constructor] # 126| 5: [BlockStmt] { ... } # 126| 0: [SuperConstructorInvocationStmt] super(...) -# 126| 1: [Method] invoke +# 126| 2: [Method] invoke # 126| 5: [BlockStmt] { ... } # 126| 0: [ReturnStmt] return ... # 126| 0: [MethodAccess] fn1(...) @@ -296,7 +296,7 @@ reflection.kt: # 7| 1: [Constructor] # 7| 5: [BlockStmt] { ... } # 7| 0: [SuperConstructorInvocationStmt] super(...) -# 7| 1: [Method] invoke +# 7| 2: [Method] invoke #-----| 4: (Parameters) # 7| 0: [Parameter] a0 # 7| 1: [Parameter] a1 @@ -321,14 +321,14 @@ reflection.kt: # 10| 1: [Constructor] # 10| 5: [BlockStmt] { ... } # 10| 0: [SuperConstructorInvocationStmt] super(...) -# 10| 1: [Method] get +# 10| 2: [Method] get #-----| 4: (Parameters) # 10| 0: [Parameter] a0 # 10| 5: [BlockStmt] { ... } # 10| 0: [ReturnStmt] return ... # 10| 0: [MethodAccess] getP0(...) # 10| -1: [VarAccess] a0 -# 10| 1: [Method] invoke +# 10| 3: [Method] invoke #-----| 4: (Parameters) # 10| 0: [Parameter] a0 # 10| 5: [BlockStmt] { ... } @@ -367,7 +367,11 @@ reflection.kt: # 14| 0: [VarAccess] this. # 14| -1: [ThisAccess] this # 14| 1: [VarAccess] -# 14| 1: [Method] invoke +# 14| 2: [FieldDeclaration] KProperty1 ; +# 14| -1: [TypeAccess] KProperty1 +# 14| 0: [TypeAccess] C +# 14| 1: [TypeAccess] Integer +# 14| 3: [Method] invoke #-----| 4: (Parameters) # 14| 0: [Parameter] a0 # 14| 5: [BlockStmt] { ... } @@ -376,10 +380,6 @@ reflection.kt: # 14| -1: [VarAccess] this. # 14| -1: [ThisAccess] this # 14| 0: [VarAccess] a0 -# 14| 1: [FieldDeclaration] KProperty1 ; -# 14| -1: [TypeAccess] KProperty1 -# 14| 0: [TypeAccess] C -# 14| 1: [TypeAccess] Integer # 14| -3: [TypeAccess] Function1 # 14| 0: [TypeAccess] C # 14| 1: [TypeAccess] Integer @@ -398,15 +398,15 @@ reflection.kt: # 15| 0: [VarAccess] this. # 15| -1: [ThisAccess] this # 15| 1: [VarAccess] -# 15| 1: [FieldDeclaration] C ; +# 15| 2: [FieldDeclaration] C ; # 15| -1: [TypeAccess] C -# 15| 1: [Method] get +# 15| 3: [Method] get # 15| 5: [BlockStmt] { ... } # 15| 0: [ReturnStmt] return ... # 15| 0: [MethodAccess] getP0(...) # 15| -1: [VarAccess] this. # 15| -1: [ThisAccess] this -# 15| 1: [Method] invoke +# 15| 4: [Method] invoke # 15| 5: [BlockStmt] { ... } # 15| 0: [ReturnStmt] return ... # 15| 0: [MethodAccess] get(...) @@ -422,14 +422,14 @@ reflection.kt: # 17| 1: [Constructor] # 17| 5: [BlockStmt] { ... } # 17| 0: [SuperConstructorInvocationStmt] super(...) -# 17| 1: [Method] get +# 17| 2: [Method] get #-----| 4: (Parameters) # 17| 0: [Parameter] a0 # 17| 5: [BlockStmt] { ... } # 17| 0: [ReturnStmt] return ... # 17| 0: [MethodAccess] getP1(...) # 17| -1: [VarAccess] a0 -# 17| 1: [Method] invoke +# 17| 3: [Method] invoke #-----| 4: (Parameters) # 17| 0: [Parameter] a0 # 17| 5: [BlockStmt] { ... } @@ -437,7 +437,7 @@ reflection.kt: # 17| 0: [MethodAccess] get(...) # 17| -1: [ThisAccess] this # 17| 0: [VarAccess] a0 -# 17| 1: [Method] set +# 17| 4: [Method] set #-----| 4: (Parameters) # 17| 0: [Parameter] a0 # 17| 1: [Parameter] a1 @@ -478,7 +478,11 @@ reflection.kt: # 21| 0: [VarAccess] this. # 21| -1: [ThisAccess] this # 21| 1: [VarAccess] -# 21| 1: [Method] invoke +# 21| 2: [FieldDeclaration] KMutableProperty1 ; +# 21| -1: [TypeAccess] KMutableProperty1 +# 21| 0: [TypeAccess] C +# 21| 1: [TypeAccess] Integer +# 21| 3: [Method] invoke #-----| 4: (Parameters) # 21| 0: [Parameter] a0 # 21| 1: [Parameter] a1 @@ -489,10 +493,6 @@ reflection.kt: # 21| -1: [ThisAccess] this # 21| 0: [VarAccess] a0 # 21| 1: [VarAccess] a1 -# 21| 1: [FieldDeclaration] KMutableProperty1 ; -# 21| -1: [TypeAccess] KMutableProperty1 -# 21| 0: [TypeAccess] C -# 21| 1: [TypeAccess] Integer # 21| -3: [TypeAccess] Function2 # 21| 0: [TypeAccess] C # 21| 1: [TypeAccess] Integer @@ -512,20 +512,20 @@ reflection.kt: # 22| 0: [VarAccess] this. # 22| -1: [ThisAccess] this # 22| 1: [VarAccess] -# 22| 1: [FieldDeclaration] C ; +# 22| 2: [FieldDeclaration] C ; # 22| -1: [TypeAccess] C -# 22| 1: [Method] get +# 22| 3: [Method] get # 22| 5: [BlockStmt] { ... } # 22| 0: [ReturnStmt] return ... # 22| 0: [MethodAccess] getP1(...) # 22| -1: [VarAccess] this. # 22| -1: [ThisAccess] this -# 22| 1: [Method] invoke +# 22| 4: [Method] invoke # 22| 5: [BlockStmt] { ... } # 22| 0: [ReturnStmt] return ... # 22| 0: [MethodAccess] get(...) # 22| -1: [ThisAccess] this -# 22| 1: [Method] set +# 22| 5: [Method] set #-----| 4: (Parameters) # 22| 0: [Parameter] a0 # 22| 5: [BlockStmt] { ... } @@ -556,7 +556,7 @@ reflection.kt: # 24| 1: [Constructor] # 24| 5: [BlockStmt] { ... } # 24| 0: [SuperConstructorInvocationStmt] super(...) -# 24| 1: [Method] invoke +# 24| 2: [Method] invoke # 24| 3: [TypeAccess] boolean #-----| 4: (Parameters) # 24| 0: [Parameter] it @@ -608,7 +608,7 @@ reflection.kt: # 33| 0: [ReturnStmt] return ... # 33| 0: [VarAccess] this.p0 # 33| -1: [ThisAccess] this -# 33| 2: [FieldDeclaration] int p0; +# 33| 3: [FieldDeclaration] int p0; # 33| -1: [TypeAccess] int # 33| 0: [IntegerLiteral] 1 # 34| 4: [Method] getP1 @@ -617,7 +617,10 @@ reflection.kt: # 34| 0: [ReturnStmt] return ... # 34| 0: [VarAccess] this.p1 # 34| -1: [ThisAccess] this -# 34| 4: [Method] setP1 +# 34| 5: [FieldDeclaration] int p1; +# 34| -1: [TypeAccess] int +# 34| 0: [IntegerLiteral] 2 +# 34| 6: [Method] setP1 # 34| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 34| 0: [Parameter] @@ -628,9 +631,6 @@ reflection.kt: # 34| 0: [VarAccess] this.p1 # 34| -1: [ThisAccess] this # 34| 1: [VarAccess] -# 34| 4: [FieldDeclaration] int p1; -# 34| -1: [TypeAccess] int -# 34| 0: [IntegerLiteral] 2 # 36| 7: [Method] getP2 # 36| 3: [TypeAccess] int # 36| 5: [BlockStmt] { ... } @@ -678,7 +678,7 @@ reflection.kt: # 60| 1: [Constructor] # 60| 5: [BlockStmt] { ... } # 60| 0: [SuperConstructorInvocationStmt] super(...) -# 60| 1: [Method] invoke +# 60| 2: [Method] invoke #-----| 4: (Parameters) # 60| 0: [Parameter] a0 # 60| 1: [Parameter] a1 @@ -707,7 +707,10 @@ reflection.kt: # 61| 0: [VarAccess] this. # 61| -1: [ThisAccess] this # 61| 1: [VarAccess] -# 61| 1: [Method] invoke +# 61| 2: [FieldDeclaration] Generic ; +# 61| -1: [TypeAccess] Generic +# 61| 0: [TypeAccess] Integer +# 61| 3: [Method] invoke #-----| 4: (Parameters) # 61| 0: [Parameter] a0 # 61| 5: [BlockStmt] { ... } @@ -716,9 +719,6 @@ reflection.kt: # 61| -1: [VarAccess] this. # 61| -1: [ThisAccess] this # 61| 0: [VarAccess] a0 -# 61| 1: [FieldDeclaration] Generic ; -# 61| -1: [TypeAccess] Generic -# 61| 0: [TypeAccess] Integer # 61| -3: [TypeAccess] Function1 # 61| 0: [TypeAccess] Integer # 61| 1: [TypeAccess] String @@ -733,7 +733,7 @@ reflection.kt: # 62| 1: [Constructor] # 62| 5: [BlockStmt] { ... } # 62| 0: [SuperConstructorInvocationStmt] super(...) -# 62| 1: [Method] invoke +# 62| 2: [Method] invoke #-----| 4: (Parameters) # 62| 0: [Parameter] a0 # 62| 5: [BlockStmt] { ... } @@ -761,7 +761,10 @@ reflection.kt: # 63| 0: [VarAccess] this. # 63| -1: [ThisAccess] this # 63| 1: [VarAccess] -# 63| 1: [Method] invoke +# 63| 2: [FieldDeclaration] Generic ; +# 63| -1: [TypeAccess] Generic +# 63| 0: [TypeAccess] Integer +# 63| 3: [Method] invoke # 63| 5: [BlockStmt] { ... } # 63| 0: [ReturnStmt] return ... # 63| 0: [MethodAccess] ext1(...) @@ -769,9 +772,6 @@ reflection.kt: # 63| -1: [TypeAccess] ReflectionKt # 63| 0: [VarAccess] this. # 63| -1: [ThisAccess] this -# 63| 1: [FieldDeclaration] Generic ; -# 63| -1: [TypeAccess] Generic -# 63| 0: [TypeAccess] Integer # 63| -3: [TypeAccess] Function0 # 63| 0: [TypeAccess] String # 63| 0: [ClassInstanceExpr] new Generic(...) @@ -785,7 +785,7 @@ reflection.kt: # 64| 1: [Constructor] # 64| 5: [BlockStmt] { ... } # 64| 0: [SuperConstructorInvocationStmt] super(...) -# 64| 1: [Method] invoke +# 64| 2: [Method] invoke #-----| 4: (Parameters) # 64| 0: [Parameter] a0 # 64| 5: [BlockStmt] { ... } @@ -812,16 +812,16 @@ reflection.kt: # 65| 0: [VarAccess] this. # 65| -1: [ThisAccess] this # 65| 1: [VarAccess] -# 65| 1: [Method] invoke +# 65| 2: [FieldDeclaration] Generic ; +# 65| -1: [TypeAccess] Generic +# 65| 0: [TypeAccess] Integer +# 65| 3: [Method] invoke # 65| 5: [BlockStmt] { ... } # 65| 0: [ReturnStmt] return ... # 65| 0: [MethodAccess] ext2(...) # 65| -1: [TypeAccess] ReflectionKt # 65| 0: [VarAccess] this. # 65| -1: [ThisAccess] this -# 65| 1: [FieldDeclaration] Generic ; -# 65| -1: [TypeAccess] Generic -# 65| 0: [TypeAccess] Integer # 65| -3: [TypeAccess] Function0 # 65| 0: [TypeAccess] String # 65| 0: [ClassInstanceExpr] new Generic(...) @@ -835,14 +835,14 @@ reflection.kt: # 67| 1: [Constructor] # 67| 5: [BlockStmt] { ... } # 67| 0: [SuperConstructorInvocationStmt] super(...) -# 67| 1: [Method] get +# 67| 2: [Method] get #-----| 4: (Parameters) # 67| 0: [Parameter] a0 # 67| 5: [BlockStmt] { ... } # 67| 0: [ReturnStmt] return ... # 67| 0: [MethodAccess] getP2(...) # 67| -1: [VarAccess] a0 -# 67| 1: [Method] invoke +# 67| 3: [Method] invoke #-----| 4: (Parameters) # 67| 0: [Parameter] a0 # 67| 5: [BlockStmt] { ... } @@ -850,7 +850,7 @@ reflection.kt: # 67| 0: [MethodAccess] get(...) # 67| -1: [ThisAccess] this # 67| 0: [VarAccess] a0 -# 67| 1: [Method] set +# 67| 4: [Method] set #-----| 4: (Parameters) # 67| 0: [Parameter] a0 # 67| 1: [Parameter] a1 @@ -878,21 +878,21 @@ reflection.kt: # 68| 0: [VarAccess] this. # 68| -1: [ThisAccess] this # 68| 1: [VarAccess] -# 68| 1: [FieldDeclaration] Generic ; +# 68| 2: [FieldDeclaration] Generic ; # 68| -1: [TypeAccess] Generic # 68| 0: [TypeAccess] Integer -# 68| 1: [Method] get +# 68| 3: [Method] get # 68| 5: [BlockStmt] { ... } # 68| 0: [ReturnStmt] return ... # 68| 0: [MethodAccess] getP2(...) # 68| -1: [VarAccess] this. # 68| -1: [ThisAccess] this -# 68| 1: [Method] invoke +# 68| 4: [Method] invoke # 68| 5: [BlockStmt] { ... } # 68| 0: [ReturnStmt] return ... # 68| 0: [MethodAccess] get(...) # 68| -1: [ThisAccess] this -# 68| 1: [Method] set +# 68| 5: [Method] set #-----| 4: (Parameters) # 68| 0: [Parameter] a0 # 68| 5: [BlockStmt] { ... } @@ -921,15 +921,15 @@ reflection.kt: # 70| 0: [VarAccess] this. # 70| -1: [ThisAccess] this # 70| 1: [VarAccess] -# 70| 1: [FieldDeclaration] IntCompanionObject ; +# 70| 2: [FieldDeclaration] IntCompanionObject ; # 70| -1: [TypeAccess] IntCompanionObject -# 70| 1: [Method] get +# 70| 3: [Method] get # 70| 5: [BlockStmt] { ... } # 70| 0: [ReturnStmt] return ... # 70| 0: [MethodAccess] getMAX_VALUE(...) # 70| -1: [VarAccess] this. # 70| -1: [ThisAccess] this -# 70| 1: [Method] invoke +# 70| 4: [Method] invoke # 70| 5: [BlockStmt] { ... } # 70| 0: [ReturnStmt] return ... # 70| 0: [MethodAccess] get(...) @@ -945,11 +945,11 @@ reflection.kt: # 71| 1: [Constructor] # 71| 5: [BlockStmt] { ... } # 71| 0: [SuperConstructorInvocationStmt] super(...) -# 71| 1: [Method] get +# 71| 2: [Method] get # 71| 5: [BlockStmt] { ... } # 71| 0: [ReturnStmt] return ... # 71| 0: [VarAccess] MAX_VALUE -# 71| 1: [Method] invoke +# 71| 3: [Method] invoke # 71| 5: [BlockStmt] { ... } # 71| 0: [ReturnStmt] return ... # 71| 0: [MethodAccess] get(...) @@ -971,20 +971,20 @@ reflection.kt: # 72| 0: [VarAccess] this. # 72| -1: [ThisAccess] this # 72| 1: [VarAccess] -# 72| 1: [FieldDeclaration] Rectangle ; +# 72| 2: [FieldDeclaration] Rectangle ; # 72| -1: [TypeAccess] Rectangle -# 72| 1: [Method] get +# 72| 3: [Method] get # 72| 5: [BlockStmt] { ... } # 72| 0: [ReturnStmt] return ... # 72| 0: [VarAccess] this..height # 72| -1: [VarAccess] this. # 72| -1: [ThisAccess] this -# 72| 1: [Method] invoke +# 72| 4: [Method] invoke # 72| 5: [BlockStmt] { ... } # 72| 0: [ReturnStmt] return ... # 72| 0: [MethodAccess] get(...) # 72| -1: [ThisAccess] this -# 72| 1: [Method] set +# 72| 5: [Method] set #-----| 4: (Parameters) # 72| 0: [Parameter] a0 # 72| 5: [BlockStmt] { ... } @@ -1040,15 +1040,15 @@ reflection.kt: # 83| 0: [ExprStmt] ; # 83| 0: [KtInitializerAssignExpr] ...=... # 83| 0: [VarAccess] value -# 83| 4: [Method] getValue +# 83| 4: [FieldDeclaration] T value; +# 83| -1: [TypeAccess] T +# 83| 0: [VarAccess] value +# 83| 5: [Method] getValue # 83| 3: [TypeAccess] T # 83| 5: [BlockStmt] { ... } # 83| 0: [ReturnStmt] return ... # 83| 0: [VarAccess] this.value # 83| -1: [ThisAccess] this -# 83| 4: [FieldDeclaration] T value; -# 83| -1: [TypeAccess] T -# 83| 0: [VarAccess] value # 85| 6: [Class,GenericType,ParameterizedType] Inner #-----| -2: (Generic Parameters) # 85| 0: [TypeVariable] T1 @@ -1082,7 +1082,10 @@ reflection.kt: # 90| 0: [VarAccess] this. # 90| -1: [ThisAccess] this # 90| 1: [VarAccess] -# 90| 1: [Method] invoke +# 90| 2: [FieldDeclaration] Class2 ; +# 90| -1: [TypeAccess] Class2 +# 90| 0: [TypeAccess] T +# 90| 3: [Method] invoke #-----| 4: (Parameters) # 90| 0: [Parameter] a0 # 90| 5: [BlockStmt] { ... } @@ -1093,9 +1096,6 @@ reflection.kt: # 90| -2: [VarAccess] this. # 90| -1: [ThisAccess] this # 90| 0: [VarAccess] a0 -# 90| 1: [FieldDeclaration] Class2 ; -# 90| -1: [TypeAccess] Class2 -# 90| 0: [TypeAccess] T # 90| -3: [TypeAccess] Function1> # 90| 0: [TypeAccess] String # 90| 1: [TypeAccess] Inner @@ -1118,7 +1118,10 @@ reflection.kt: # 105| 0: [ReturnStmt] return ... # 105| 0: [VarAccess] this.prop1 # 105| -1: [ThisAccess] this -# 105| 2: [Method] setProp1 +# 105| 3: [FieldDeclaration] int prop1; +# 105| -1: [TypeAccess] int +# 105| 0: [VarAccess] prop1 +# 105| 4: [Method] setProp1 # 105| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 105| 0: [Parameter] @@ -1129,9 +1132,6 @@ reflection.kt: # 105| 0: [VarAccess] this.prop1 # 105| -1: [ThisAccess] this # 105| 1: [VarAccess] -# 105| 2: [FieldDeclaration] int prop1; -# 105| -1: [TypeAccess] int -# 105| 0: [VarAccess] prop1 # 107| 7: [Class] Derived1 # 107| 1: [Constructor] Derived1 #-----| 4: (Parameters) @@ -1159,20 +1159,20 @@ reflection.kt: # 109| 0: [VarAccess] this. # 109| -1: [ThisAccess] this # 109| 1: [VarAccess] -# 109| 1: [FieldDeclaration] Derived1 ; +# 109| 2: [FieldDeclaration] Derived1 ; # 109| -1: [TypeAccess] Derived1 -# 109| 1: [Method] get +# 109| 3: [Method] get # 109| 5: [BlockStmt] { ... } # 109| 0: [ReturnStmt] return ... # 109| 0: [MethodAccess] getProp1(...) # 109| -1: [VarAccess] this. # 109| -1: [ThisAccess] this -# 109| 1: [Method] invoke +# 109| 4: [Method] invoke # 109| 5: [BlockStmt] { ... } # 109| 0: [ReturnStmt] return ... # 109| 0: [MethodAccess] get(...) # 109| -1: [ThisAccess] this -# 109| 1: [Method] set +# 109| 5: [Method] set #-----| 4: (Parameters) # 109| 0: [Parameter] a0 # 109| 5: [BlockStmt] { ... } @@ -1197,7 +1197,7 @@ reflection.kt: # 115| 1: [Constructor] # 115| 5: [BlockStmt] { ... } # 115| 0: [SuperConstructorInvocationStmt] super(...) -# 115| 1: [Method] fn1 +# 115| 2: [Method] fn1 # 115| 3: [TypeAccess] Unit #-----| 4: (Parameters) # 115| 0: [Parameter] i @@ -1210,7 +1210,7 @@ reflection.kt: # 116| 1: [Constructor] # 116| 5: [BlockStmt] { ... } # 116| 0: [SuperConstructorInvocationStmt] super(...) -# 116| 1: [Method] invoke +# 116| 2: [Method] invoke #-----| 4: (Parameters) # 116| 0: [Parameter] a0 # 116| 5: [BlockStmt] { ... } diff --git a/java/ql/test/kotlin/library-tests/reflection/reflection.expected b/java/ql/test/kotlin/library-tests/reflection/reflection.expected index 577130728ec..9b6899f4b6e 100644 --- a/java/ql/test/kotlin/library-tests/reflection/reflection.expected +++ b/java/ql/test/kotlin/library-tests/reflection/reflection.expected @@ -230,4 +230,15 @@ modifiers | reflection.kt:126:9:126:13 | ...::... | reflection.kt:126:9:126:13 | invoke | override | | reflection.kt:126:9:126:13 | ...::... | reflection.kt:126:9:126:13 | invoke | public | compGenerated +| file:///Class2.class:0:0:0:0 | getValue | 3 | +| file:///Class2.class:0:0:0:0 | getValue | 3 | +| file:///KTypeProjection.class:0:0:0:0 | contravariant | 8 | +| file:///KTypeProjection.class:0:0:0:0 | covariant | 8 | +| file:///KTypeProjection.class:0:0:0:0 | invariant | 8 | +| reflection.kt:33:9:33:23 | getP0 | 3 | +| reflection.kt:34:9:34:23 | getP1 | 3 | +| reflection.kt:34:9:34:23 | setP1 | 3 | +| reflection.kt:83:17:83:28 | getValue | 3 | +| reflection.kt:105:18:105:31 | getProp1 | 3 | +| reflection.kt:105:18:105:31 | setProp1 | 3 | | reflection.kt:126:9:126:13 | | 1 | diff --git a/java/ql/test/kotlin/library-tests/stmts/loops.expected b/java/ql/test/kotlin/library-tests/stmts/loops.expected index 57c59b35d3a..83fd4aa5072 100644 --- a/java/ql/test/kotlin/library-tests/stmts/loops.expected +++ b/java/ql/test/kotlin/library-tests/stmts/loops.expected @@ -1,7 +1,6 @@ breakLabel | stmts.kt:25:24:25:33 | break | loop | continueLabel -breakTarget +jumpTarget | stmts.kt:25:24:25:33 | break | stmts.kt:23:11:27:5 | while (...) | -continueTarget | stmts.kt:29:9:29:16 | continue | stmts.kt:28:5:29:16 | while (...) | diff --git a/java/ql/test/kotlin/library-tests/stmts/loops.ql b/java/ql/test/kotlin/library-tests/stmts/loops.ql index 87b88738125..6887d3409ba 100644 --- a/java/ql/test/kotlin/library-tests/stmts/loops.ql +++ b/java/ql/test/kotlin/library-tests/stmts/loops.ql @@ -4,6 +4,4 @@ query predicate breakLabel(BreakStmt s, string label) { s.getLabel() = label } query predicate continueLabel(ContinueStmt s, string label) { s.getLabel() = label } -query predicate breakTarget(KtBreakStmt s, KtLoopStmt l) { s.getLoopStmt() = l } - -query predicate continueTarget(KtContinueStmt s, KtLoopStmt l) { s.getLoopStmt() = l } +query predicate jumpTarget(JumpStmt s, StmtParent p) { s.getTarget() = p } diff --git a/java/ql/test/kotlin/library-tests/stmts/stmts.expected b/java/ql/test/kotlin/library-tests/stmts/stmts.expected index e73b8e82407..89dbb959287 100644 --- a/java/ql/test/kotlin/library-tests/stmts/stmts.expected +++ b/java/ql/test/kotlin/library-tests/stmts/stmts.expected @@ -29,7 +29,8 @@ enclosing | stmts.kt:18:37:18:37 | ; | stmts.kt:18:26:18:56 | ... -> ... | | stmts.kt:18:52:18:52 | ; | stmts.kt:18:26:18:56 | ... -> ... | | stmts.kt:19:5:19:16 | return ... | stmts.kt:2:41:20:1 | { ... } | -| stmts.kt:23:11:27:5 | while (...) | stmts.kt:22:27:30:1 | { ... } | +| stmts.kt:23:11:27:5 |