Commit Graph

431 Commits

Author SHA1 Message Date
Owen Mansel-Chan
a5e6f6daf9 Replace "javax" with javaxOrJakarta()
This is just a find-replace of `"javax` with `javaxOrJakarta() + "`.
2026-02-16 11:02:12 +00:00
Tom Hvitved
7024b07dd2 Java: Adapt to changes in FlowSummaryImpl
Missing manual models were added using the following code added to `FlowSummaryImpl.qll`:

```ql
    private predicate testsummaryElement(
      Input::SummarizedCallableBase c, string namespace, string type, boolean subtypes, string name,
      string signature, string ext, string originalInput, string originalOutput, string kind,
      string provenance, string model, boolean isExact
    ) {
      exists(string input, string output, Callable baseCallable |
        summaryModel(namespace, type, subtypes, name, signature, ext, originalInput, originalOutput,
          kind, provenance, model) and
        baseCallable = interpretElement(namespace, type, subtypes, name, signature, ext, isExact) and
        (
          c.asCallable() = baseCallable and input = originalInput and output = originalOutput
          or
          correspondingKotlinParameterDefaultsArgSpec(baseCallable, c.asCallable(), originalInput,
            input) and
          correspondingKotlinParameterDefaultsArgSpec(baseCallable, c.asCallable(), originalOutput,
            output)
        )
      )
    }

    private predicate testsummaryElement2(
      string namespace, string type, boolean subtypes, string name, string signature, string ext,
      string originalInput, string originalOutput, string kind, string provenance, string model,
      string namespace2, string type2
    ) {
      exists(Input::SummarizedCallableBase c |
        testsummaryElement(c, namespace2, type2, _, _, _, ext, originalInput, originalOutput, kind,
          provenance, model, false) and
        testsummaryElement(c, namespace, type, subtypes, name, _, _, _, _, _, provenance, _, true) and
        signature = paramsString(c.asCallable()) and
        not testsummaryElement(c, _, _, _, _, _, _, originalInput, originalOutput, kind, provenance,
          _, true)
      )
    }

    private string getAMissingManualModel(string namespace2, string type2) {
      exists(
        string namespace, string type, boolean subtypes, string name, string signature, string ext,
        string originalInput, string originalOutput, string kind, string provenance, string model
      |
        testsummaryElement2(namespace, type, subtypes, name, signature, ext, originalInput,
          originalOutput, kind, provenance, model, namespace2, type2) and
        result =
          "- [\"" + namespace + "\", \"" + type + "\", True, \"" + name + "\", \"" + signature +
            "\", \"\", \"" + originalInput + "\", \"" + originalOutput + "\", \"" + kind + "\", \"" +
            provenance + "\"]"
      )
    }
```
2026-01-26 12:40:15 +01:00
Tom Hvitved
3ba256a72a C#/Java: Go back to access path limit 2 2025-12-03 15:05:02 +01:00
Felicity Chapman
caf6b950ac Remove trailing periods from @name metadata in query files
Fixed 73 .ql query files where the @name metadata contained an ending period.
This ensures consistency with the CodeQL query metadata style guidelines.
2025-11-26 14:29:51 +00:00
Anders Schack-Mulligen
06df5c0bd1 Java: Introduce SsaCapturedDefinition and replace uses of getAnUltimateDefinition. 2025-11-12 09:06:17 +01:00
Anders Schack-Mulligen
07e635636c Java: Replace getAFirstUse with top-level predicate. 2025-11-12 09:06:16 +01:00
Michael Nebel
77113b2e42 Java: Fix some Ql4Ql violations. 2025-09-01 15:04:08 +02:00
Mathias Vorreiter Pedersen
e903d76fa0 Merge pull request #19443 from MathiasVP/generate-more-value-preserving-summaries-2
Shared: Generate more value-preserving flow summaries
2025-05-14 09:12:28 +01:00
Michael Nebel
ee83ca9125 Java: Update model generator implementation and test expected output. 2025-05-13 13:44:42 +01:00
Mathias Vorreiter Pedersen
bce5f2539f C++/C#/Java/Rust: Fixup tests. 2025-05-02 16:52:05 +01:00
Mathias Vorreiter Pedersen
4d2f2b89e7 Shared/Java/C#/Rust/C++: Rename 'captureHeuristicFlow' to 'captureFlow'. 2025-05-02 14:02:41 +01:00
Simon Friis Vindum
c6d95ceeb0 Shared: Remove the language-specific model generator scripts 2025-05-02 13:21:10 +02:00
Mathias Vorreiter Pedersen
d5bc95daeb Merge branch 'main' into generate-more-value-preserving-summaries-2 2025-05-02 10:51:11 +01:00
Mathias Vorreiter Pedersen
07641e48ab Java: Fixup queries and accept test changes. 2025-04-30 20:34:32 +01:00
Michael Nebel
c9d01bc607 Shared: Sprinkle some predicate defaults and clean up. 2025-04-29 15:22:13 +02:00
Michael Nebel
2535055de0 Java: Re-factor implementation to use the new model generator interface. 2025-04-29 15:22:07 +02:00
Michael Nebel
b5c596b2ce Shared: Split model printing of summaries and sources/sinks into separate param modules. 2025-04-29 15:21:59 +02:00
Michael Nebel
89fd9a4dd5 C#/Java/Rust: Change the tag for the model generator debugging queries. 2025-04-29 12:02:37 +02:00
Michael Nebel
2a0097ea56 C#/Java/Rust: Use Mixed flow from capture summary models queries and adjust other queries to the re-factored implementation. 2025-04-25 15:49:47 +02:00
Mathias Vorreiter Pedersen
b6c658767e Java: Fixup MaD input. 2025-04-10 14:01:11 +01:00
Simon Friis Vindum
70550950d8 Java, C#: Ensure variable is used in all disjuncts 2025-01-29 10:30:26 +01:00
Simon Friis Vindum
13e0829d19 Shared: Generalize the number of columns in a generated MaD row 2025-01-28 15:36:09 +01:00
Michael Nebel
0bfc1b6ea8 Also move the postprocessing queries to the library pack. 2024-12-12 15:03:03 +01:00
Michael Nebel
941b0abbf6 Move modules to the library packs. 2024-12-12 15:03:01 +01:00
Michael Nebel
0a1d2d0bbb Java: Update all test util paths to point to the new location. 2024-12-12 13:21:25 +01:00
Michael Nebel
91cfb30513 Java: Move test utilities to the java query pack. 2024-12-12 13:21:22 +01:00
Michael Nebel
55cfbccd43 C#/Java: Exclude summaries using callbacks in fields, properties and synthetic fields. 2024-11-06 16:29:19 +01:00
Michael Nebel
a86cd181a6 Java: Make language specific modifications. 2024-11-06 16:29:16 +01:00
Anders Schack-Mulligen
6081ba5902 Merge pull request #17604 from aschackmull/java/neutral-overrides
Java/C#: Add overrides to the interpretation of neutral MaD models.
2024-10-01 14:55:54 +02:00
Anders Schack-Mulligen
ec0bd4494c Java: Add overrides to the interpretation of neutral MaD models. 2024-09-30 13:11:49 +02:00
Michael Nebel
80497f551e Shared: Only make unlifted models in case the API itself is relevant. 2024-09-27 09:22:25 +02:00
Michael Nebel
8310faa2e9 C#/Java: Add a query that uses both content based and non-content based model generation. 2024-09-27 09:22:11 +02:00
Michael Nebel
e6085759ae Shared: Put the content of CaptureSummaryFlowQuery into the shared library code. 2024-09-24 15:46:44 +02:00
Michael Nebel
fd45d2dcbb Shared: Move the model generator implementation to an internal folder. 2024-09-24 15:27:29 +02:00
Michael Nebel
22c2522aac Shared: Make a ContentSensitive module with predicates and classes related to content flow. 2024-09-24 15:16:16 +02:00
Michael Nebel
2033818e39 Java: Use the shared model generator implementation. 2024-09-19 12:20:51 +02:00
Michael Nebel
4a9e3ee3aa Merge pull request #17363 from michaelnebel/modelgen/fieldbasedimprovements
C#/Java: Content based model generation improvements.
2024-09-19 10:49:11 +02:00
Michael Nebel
68165bbce4 C#/Java: Address review comments. 2024-09-17 16:09:17 +02:00
Ian Lynagh
41ed6e6695 Java: Deprecate RefType.nestedName(), and add RefType.getNestedName() 2024-09-16 17:16:25 +01:00
Michael Nebel
9149a17d79 Java: Only keep the best generated model in terms of taint/value. 2024-09-10 15:23:38 +02:00
Michael Nebel
d2c98c86dc Java: Improve content based model generation. 2024-09-10 15:23:20 +02:00
Michael Nebel
e1048cf8ea Java/C#: Address review comments. 2024-09-05 19:23:05 +02:00
Michael Nebel
5ddcb16cd6 Java: Add content based model generation test. 2024-09-03 12:58:01 +02:00
Michael Nebel
6365e5edff Java: Initial implementation of content based model generation. 2024-09-03 09:45:11 +02:00
Michael Nebel
e81fdc951a Merge pull request #17246 from michaelnebel/modelgendebug
C#/Java: Add some model generator summary debugging queries.
2024-08-26 16:13:03 +02:00
Michael Nebel
34d83a6b0d C#/Java: Address review comments. 2024-08-26 15:02:27 +02:00
Michael Nebel
fd311d5143 Java: Add some summary debugging queries. 2024-08-20 16:28:15 +02:00
Tom Hvitved
d638b5c7d4 Sync shared file 2024-08-13 15:27:38 +02:00
Michael Nebel
e23ff3e499 Java: Sync files and make language specific implementation. 2024-06-27 11:27:08 +02:00
Michael Nebel
c687dcb094 Java: Sync files and make language specific implementation. 2024-06-24 13:07:39 +02:00