Commit Graph

7325 Commits

Author SHA1 Message Date
Erik Krogh Kristensen
636d5e341c Merge pull request #11652 from erik-krogh/static-useInstanceOf
Java/C#/GO: Use instanceof in more places
2022-12-12 17:52:04 +01:00
Edward Minnix III
0ebfee8b11 Merge pull request #11241 from egregius313/egregius313/webview-file-access
Java: Query to detect Android Webview file access
2022-12-12 11:12:26 -05:00
erik-krogh
873d3553cd Merge branch 'main' into static-useInstanceOf 2022-12-12 15:36:54 +01:00
Chris Smowton
77004f3e15 Merge pull request #11258 from smowton/smowton/feature/kotlin-annotation-extraction
Kotlin: extract annotations
2022-12-12 09:52:49 +00:00
Michael Nebel
e0f1b38439 Merge pull request #11580 from michaelnebel/renamenegativemodels
C#/Java: Rename Negative Summary Model to Neutral Model
2022-12-12 07:59:06 +01:00
erik-krogh
8262fbbfb5 Java/C#/GO: Use instanceof in more places 2022-12-11 18:32:19 +01:00
Chris Smowton
5282c86158 Apply review feedback 2022-12-09 18:07:14 +00:00
Edward Minnix III
4278997a2c Reword WebView file access query description
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com>
2022-12-09 11:36:09 -05:00
Edward Minnix III
8c8e71dd82 Grammar, concision, and style edits
Co-authored-by: Sam Browning <106113886+sabrowning1@users.noreply.github.com>
2022-12-09 11:35:02 -05:00
Michael Nebel
4835d14865 Java/C#: Delete the deprecated NeutralModelCsv class. 2022-12-09 15:11:49 +01:00
Michael Nebel
67732cbfa0 Java: Remove unneeded import for RegenerateModels.py. 2022-12-09 15:04:43 +01:00
Michael Nebel
1d103f57a0 C#/Java: Rename CaptureNegativeSummaryModels test to CaptureNeutralModels. 2022-12-09 15:04:43 +01:00
Michael Nebel
2cb88037a4 C#/Java: Rename Negative Summary Model to Neutral Model in conversion and generator tooling. 2022-12-09 15:04:43 +01:00
Michael Nebel
3af00a8f3f Java: Rename Negative Summary Model to Neutral Model. 2022-12-09 15:04:43 +01:00
Michael Nebel
079d48c42a Sync files. 2022-12-09 15:04:42 +01:00
Chris Smowton
b8ed3b7dbf Accept annotation test changes
These are notnull annotations that no longer get inappropriately attached to constructors
2022-12-09 12:57:20 +00:00
Chris Smowton
40e902eca9 Look through generic annotation types extracted from Kotlin 2022-12-09 11:52:28 +00:00
Chris Smowton
65dc0dc326 Add dummy extensible predicate definition to integration test 2022-12-09 11:17:37 +00:00
Chris Smowton
a161d79cd8 Remove no-longer-needed expected diagnostics 2022-12-09 10:33:06 +00:00
Chris Smowton
251513c1d3 Format ql 2022-12-09 10:33:06 +00:00
Chris Smowton
f5dc5155f9 Don't introduce @NotNull on Kotlin methods that already have that annotation
This usually can't happen, but delegates pointing at Java appear to be synthesised with this normally-hidden annotation
2022-12-09 10:33:05 +00:00
Chris Smowton
c8e2ae8563 Accept integration test changes
These introduce newly-extracted annotations, and note that enum constants no longer get type-access expressions in some circumstances
2022-12-09 10:33:05 +00:00
Chris Smowton
7a7c08b185 Tolerate generic annotations
This causes them to render properly in PrintAst output due to `getAnnotationElement` working as expected, and will hide the fact that they are represented by raw types in bytecode.
2022-12-09 10:33:05 +00:00
Chris Smowton
f6888c727f PrintAst: Assign indices to annotation children that don't have source locations
This avoids them all tying at rank 1 as before.
2022-12-09 10:33:05 +00:00
Chris Smowton
8ca05d8fef Exclude annotations from consistency check due to intentionally missing children 2022-12-09 10:33:05 +00:00
Chris Smowton
70ebb41d67 Restore nullability annotations
This is imperfect since arguments to those annotations will be missing, but at least the common case of a plain `@NotNull` or `@Nullable` will be right, and the `@NotNull`s introduced by the Kotlin compiler will be present as expected.
2022-12-09 10:33:05 +00:00
Chris Smowton
8bbb34a498 Convert kotlin.Deprecated back into a no-arg java.lang.Deprecated if applicable
This at least maintains consistency with the Java extractor, although we lose its arguments if any were supplied Java-side.
2022-12-09 10:33:05 +00:00
Chris Smowton
658c7a20cf Don't extract error expressions when a default value is missing
This is a shortcoming of the Kotlin extractor, but at least this way we don't introduce an inconsistency if the annotation is later seen from .kt source or by the Java extractor
2022-12-09 10:33:05 +00:00
Chris Smowton
5b2834c833 Restrict type access extraction to classes extracted from source
Type accesses have anonymous IDs, so we mimic the Java extractor and extract them only when seeing a class in a .kt source file.
2022-12-09 10:33:05 +00:00
Chris Smowton
f9b878fe98 Add test for .kt defined, Java used repeatable annotation 2022-12-09 10:33:04 +00:00
Chris Smowton
73df3166eb Test varargs annotation 2022-12-09 10:33:04 +00:00
Chris Smowton
6d5f962c56 Accept test changes (implicit annotations, restoration of annotation type accesses) 2022-12-09 10:33:03 +00:00
Chris Smowton
d96bca071d Add test for repeatable annotations 2022-12-09 10:33:03 +00:00
Chris Smowton
eaa9595ea2 Restore type-accesses to annotation methods; accept test changes. 2022-12-09 10:33:03 +00:00
Chris Smowton
0146d8229a Accept more test changes due to string quoting and the Java extractor ignoring the Metadata annotation 2022-12-09 10:33:03 +00:00
Chris Smowton
0446145a67 Accept test changes
These are due to changing string literal representation, omitting empty annotations blocks, and changes to how annotation classes are represented in the database.
2022-12-09 10:33:03 +00:00
Chris Smowton
d530817afc Accept annotation_classes test changes 2022-12-09 10:33:03 +00:00
Chris Smowton
06133e74a5 Handle generic annotations 2022-12-09 10:31:34 +00:00
Chris Smowton
14a47f628c Fixup: remove unneeded test file 2022-12-09 10:31:34 +00:00
Chris Smowton
d7213d2d82 Only convert KClass -> Class in annotation context 2022-12-09 10:31:34 +00:00
Chris Smowton
2fd8e61fe2 Add test of Java/Kotlin annotation naming consistency 2022-12-09 10:31:34 +00:00
Tamas Vajk
df595c05f2 WIP: revert some annotation extraction to get proper tree in printast 2022-12-09 10:31:34 +00:00
Tamas Vajk
fed770fcd1 Move kotlin annotations to negative child index 2022-12-09 10:31:33 +00:00
Tamas Vajk
96a407c9c5 WIP: extract annotations for all declarations 2022-12-09 10:31:33 +00:00
Tamas Vajk
3e1d4a7400 Add more annotation tests, add KClass to Class substitution 2022-12-09 10:31:33 +00:00
Tamas Vajk
f465dd5362 Add more annotation tests 2022-12-09 10:31:33 +00:00
Tamas Vajk
a0cd9fea34 Fix more not from source expressions in tests 2022-12-09 10:31:33 +00:00
Tamas Vajk
1898f94472 Filter expressions to source files in tests 2022-12-09 10:31:33 +00:00
Tamas Vajk
b5ae43a887 Remove empty annotations node from PrintAST 2022-12-09 10:31:33 +00:00
Tamas Vajk
3b09cb2224 WIP: Extract annotation values (tests are missing) 2022-12-09 10:31:33 +00:00