Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
246 commits
Select commit Hold shift + click to select a range
50339e7
SONARJAVA-7236 Drop the ECJ parser so the frontend can be replaced
rombirli Oct 26, 2026
2a85a34
SONARJAVA-7236 Produce the Java CST with SemSitter semantics
rombirli Oct 27, 2026
e85085c
SONARJAVA-7236 Bridge the CST over stdin/stdout JSONL with a CLI to q…
rombirli Oct 27, 2026
a65b947
SONARJAVA-7236 Translate the SemSitter CST into the SonarJava AST and…
rombirli Oct 27, 2026
ed3767c
SONARJAVA-7236 Lower the plugin JAR size floor after dropping ECJ
rombirli Oct 27, 2026
0d94a95
SONARJAVA-7236 Package the SemSitter bridge in the plugin
rombirli Oct 27, 2026
f20f7bd
SONARJAVA-7236 Ship prebuilt bridge archives so CI does not need cargo
rombirli Oct 28, 2026
d80c676
SONARJAVA-7236 Keep new-class constructor symbols as method symbols
rombirli Oct 28, 2026
51a9af9
SONARJAVA-7236 Place primitive and brace tokens on their real source …
rombirli Oct 28, 2026
2b462b2
SONARJAVA-7236 Translate qualified type names such as Map.Entry
rombirli Oct 28, 2026
94a0a93
SONARJAVA-7236 Wrap compact source files in an implicit class
rombirli Oct 28, 2026
154ab1b
SONARJAVA-7236 Give file-level issues a text range
rombirli Oct 28, 2026
0b841e1
SONARJAVA-7236 Translate catch types and stop declaring type parameters
rombirli Oct 28, 2026
2770373
SONARJAVA-7236 Resolve varargs library and user methods correctly
rombirli Oct 28, 2026
5ef88d1
SONARJAVA-7236 Guard TypeSymbol.declaration() against non-class trees
rombirli Oct 28, 2026
093f6ba
SONARJAVA-7236 Skip comment nodes when walking CST children
rombirli Oct 28, 2026
1b32adf
SONARJAVA-7236 Translate case labels, patterns and guards
rombirli Oct 28, 2026
28e6914
SONARJAVA-7236 Translate class literals, annotation values and annota…
rombirli Oct 28, 2026
a5a8170
SONARJAVA-7236 Fix tokens of update, for header, spread parameter and…
rombirli Oct 28, 2026
bf5b5b7
SONARJAVA-7236 Fix method reference qualifier, package name and top-l…
rombirli Oct 28, 2026
61dcbbd
SONARJAVA-7236 Strip carriage return from line comments
rombirli Oct 28, 2026
8dfb860
SONARJAVA-7236 Translate text blocks as TEXT_BLOCK literals
rombirli Oct 28, 2026
edce6e9
SONARJAVA-7236 Bind compact source methods to their implicit class
rombirli Oct 28, 2026
c1c89f6
SONARJAVA-7236 Resolve overloads by parameter types and type new expr…
rombirli Oct 28, 2026
0409b29
SONARJAVA-7236 Return no type argument metadata for symbols
rombirli Oct 28, 2026
9b6a858
SONARJAVA-7236 Convert annotation values like ECJ and report unknown …
rombirli Oct 28, 2026
6d34c2d
SONARJAVA-7236 Lift the JSON nesting limit for deep CSTs
rombirli Oct 28, 2026
b95fb1f
SONARJAVA-7236 Take superclasses from the extends clause and break in…
rombirli Oct 28, 2026
f62255c
SONARJAVA-7236 Serve the CST over shared memory as protobuf
rombirli Oct 29, 2026
556462c
SONARJAVA-7236 Repin SemSitter to the java-cst branch head
rombirli Oct 30, 2026
0997378
SONARJAVA-7236 Put the end-of-file token at the end of the source
rombirli Oct 30, 2026
04693d0
SONARJAVA-7236 Keep the body of an anonymous class
rombirli Oct 30, 2026
67a7142
SONARJAVA-7236 Translate enum members declared after the constants
rombirli Oct 30, 2026
868e97b
SONARJAVA-7236 Read implemented and extended interfaces from the type…
rombirli Oct 30, 2026
11533a5
SONARJAVA-7236 Translate this() and super() calls in constructors
rombirli Oct 30, 2026
6925b28
SONARJAVA-7236 Merge case labels without statements into the next cas…
rombirli Oct 30, 2026
663d01e
SONARJAVA-7236 Yield the expression of a switch expression rule
rombirli Oct 30, 2026
97af76e
SONARJAVA-7236 Yield arrow case expressions in switch statements too
rombirli Oct 30, 2026
2d228b3
SONARJAVA-7236 Keep the body of a labeled statement
rombirli Oct 30, 2026
e2de78a
SONARJAVA-7236 Split a switch followed by a semicolon into a switch a…
rombirli Oct 30, 2026
28577fc
SONARJAVA-7236 Keep array dimensions declared after method parameters
rombirli Oct 30, 2026
4c3a1bd
SONARJAVA-7236 Translate every array creation dimension and its annot…
rombirli Oct 30, 2026
7bfe134
SONARJAVA-7236 Keep the default value of annotation elements
rombirli Oct 30, 2026
0c7bd23
SONARJAVA-7236 Read package annotations that are direct children of t…
rombirli Oct 30, 2026
c3b324f
SONARJAVA-7236 Keep the super qualifier of X.super member selects
rombirli Oct 30, 2026
bf33420
SONARJAVA-7236 Keep array dimensions declared after a for-each variable
rombirli Oct 30, 2026
67db78c
SONARJAVA-7236 Attach annotations of a qualified type to its last ide…
rombirli Oct 30, 2026
0234a99
SONARJAVA-7236 Translate module declarations
rombirli Oct 30, 2026
6627a3b
SONARJAVA-7236 Keep commas of for-loop init and update lists as separ…
rombirli Oct 30, 2026
3ac6cc3
SONARJAVA-7236 Drop semicolons between the last enum constant and the…
rombirli Oct 30, 2026
dcfd853
SONARJAVA-7236 End a do-while statement at its last semicolon
rombirli Oct 30, 2026
13a6838
SONARJAVA-7236 Keep the enclosing expression of a qualified class cre…
rombirli Oct 30, 2026
3ccb339
SONARJAVA-7236 End an inferred lambda parameter at its comma
rombirli Oct 30, 2026
b2990c0
SONARJAVA-7236 Translate try resources that reference an existing var…
rombirli Oct 30, 2026
2a8094e
SONARJAVA-7236 Keep type annotations of method references and creations
rombirli Oct 30, 2026
df98f87
SONARJAVA-7236 Type method names with their return type
rombirli Oct 30, 2026
aeebd89
SONARJAVA-7236 Load the declaration of a type the first time it is re…
rombirli Oct 30, 2026
8bf2df5
SONARJAVA-7236 Resolve library type names through imports and qualifi…
rombirli Oct 30, 2026
6ae8f08
SONARJAVA-7236 Bind package symbols to the qualifiers of resolved typ…
rombirli Oct 30, 2026
6efb5e0
SONARJAVA-7236 Type annotations with their annotation type
rombirli Oct 30, 2026
2f7b0d3
SONARJAVA-7236 Type variables declared with a library type
rombirli Oct 30, 2026
d7c3d6c
SONARJAVA-7236 Resolve library methods and constructors by name and a…
rombirli Oct 30, 2026
16b18db
SONARJAVA-7236 Bind package symbols to the package declaration name
rombirli Oct 30, 2026
5e7b974
SONARJAVA-7236 Pick the library overload Java would choose from the a…
rombirli Oct 30, 2026
389f6f0
SONARJAVA-7236 Resolve unqualified library calls through enclosing ty…
rombirli Oct 30, 2026
c304cfc
SONARJAVA-7236 Resolve annotation element names to their annotation m…
rombirli Oct 30, 2026
ad9e393
SONARJAVA-7236 Bind anonymous class creations to the super constructor
rombirli Oct 30, 2026
be76d3a
SONARJAVA-7236 Return the receiver type from methods returning their …
rombirli Oct 30, 2026
438f8ea
SONARJAVA-7236 Bind enum constants to the enum constructor and type t…
rombirli Oct 30, 2026
a34ee78
SONARJAVA-7236 Recover anonymous class symbols from their members
rombirli Oct 30, 2026
80b0e08
SONARJAVA-7236 Bind type parameter declarations
rombirli Oct 30, 2026
261acb0
SONARJAVA-7236 Type methods with their declared return type when SemS…
rombirli Oct 30, 2026
18ae1ba
SONARJAVA-7236 Bind record components to their fields
rombirli Oct 30, 2026
a8c0c1d
SONARJAVA-7236 Resolve library fields of member selects
rombirli Oct 30, 2026
c967b62
SONARJAVA-7236 Type lambdas, method references and array initializers…
rombirli Oct 30, 2026
89f45b1
SONARJAVA-7236 Type patterns with their variable type
rombirli Oct 30, 2026
1cb74be
SONARJAVA-7236 Pick the overload of arity-only SemSitter references f…
rombirli Oct 30, 2026
964e3b7
SONARJAVA-7236 Substitute type variables in the parameter types of li…
rombirli Oct 30, 2026
27caef9
SONARJAVA-7236 Substitute the method type variables of JDK invocation…
rombirli Oct 30, 2026
1992622
SONARJAVA-7236 Own lambda parameters and locals by the functional int…
rombirli Oct 30, 2026
1988854
SONARJAVA-7236 Give local classes their binary names
rombirli Oct 30, 2026
de80c5b
SONARJAVA-7236 Type untyped lambda parameters from their functional i…
rombirli Oct 30, 2026
57697b6
SONARJAVA-7236 Bind qualified this and super to their receiver
rombirli Oct 30, 2026
a012848
SONARJAVA-7236 Type switch expressions from their results
rombirli Oct 30, 2026
318a9d9
SONARJAVA-7236 Copy only the bridge executable when archiving
rombirli Oct 30, 2026
aa73239
SONARJAVA-7236 Rebuild the prebuilt bridges
rombirli Oct 30, 2026
cfcce32
SONARJAVA-7236 Give array typed annotation members an array value
rombirli Oct 30, 2026
7f45baf
SONARJAVA-7236 Give records and enums their implicit superclass
rombirli Oct 30, 2026
854a511
SONARJAVA-7236 Read the constant value of a field from its declaration
rombirli Oct 30, 2026
8e5c6ea
SONARJAVA-7236 Repin on the Java grammar fork that accepts the reject…
rombirli Oct 30, 2026
08812ed
SONARJAVA-7236 Rebuild the prebuilt bridges on the grammar fork
rombirli Oct 30, 2026
24ea178
SONARJAVA-7236 Replace the extracted bridge when a newer prebuilt exists
rombirli Oct 30, 2026
6dbd1df
SONARJAVA-7236 Keep type arguments on parameterized type symbols
rombirli Nov 2, 2026
2ee6adf
SONARJAVA-7236 Fill library declaration facts, implicit modifiers, ge…
antonioaversa Nov 1, 2026
2540245
SONARJAVA-7236 Walk supertypes erased when checking subtyping
antonioaversa Nov 1, 2026
95c0648
SONARJAVA-7236 Use constants for repeated literals and a private temp…
antonioaversa Nov 1, 2026
5dda428
SONARJAVA-7236 Keep file-level issues file-level instead of moving th…
antonioaversa Nov 1, 2026
d23d261
SONARJAVA-7236 Make every package symbol a child of the root package
antonioaversa Nov 1, 2026
550b96a
SONARJAVA-7236 Keep the deprecation of a library method on its per-ca…
antonioaversa Nov 1, 2026
c12e894
SONARJAVA-7236 Keep the written name of an unresolved type, as a reco…
antonioaversa Nov 1, 2026
db72973
SONARJAVA-7236 Report unused imports and assignments without effect a…
antonioaversa Nov 1, 2026
e555015
SONARJAVA-7236 Evaluate the constant value of static final fields fro…
antonioaversa Nov 1, 2026
1a7b9ef
SONARJAVA-7236 List the implicit default constructor among the member…
antonioaversa Nov 1, 2026
4c31dac
SONARJAVA-7236 Keep the written qualified name of unresolved annotati…
antonioaversa Nov 1, 2026
9e8e2ee
SONARJAVA-7236 Mark local variables and parameters that are never rea…
antonioaversa Nov 1, 2026
756ea39
SONARJAVA-7236 Split the import usage check and the annotation type l…
antonioaversa Nov 1, 2026
2805546
SONARJAVA-7236 Emit generic classpath supertypes from the pinned clas…
rombirli Nov 2, 2026
e01ccce
SONARJAVA-7236 Rebuild the prebuilt bridges
rombirli Nov 2, 2026
8109fa1
SONARJAVA-7236 Resolve local and anonymous classes as type symbols
rombirli Nov 2, 2026
631c1af
SONARJAVA-7236 Substitute type variables nested in parameter types
rombirli Nov 2, 2026
15046cb
SONARJAVA-7236 Ascribe call arguments against the receiver-substitute…
rombirli Nov 2, 2026
dfdbe7d
SONARJAVA-7236 Rebuild the prebuilt bridges
rombirli Nov 2, 2026
cfa19c5
SONARJAVA-7236 Analyze a file from the tree recovered after a syntax …
rombirli Nov 2, 2026
876c73e
SONARJAVA-7236 Emit the access flags of a classpath type
rombirli Nov 2, 2026
54c4d60
SONARJAVA-7236 Read JDK declarations from the runtime image
rombirli Nov 3, 2026
e995003
SONARJAVA-7236 Keep the value of a Retention annotation
rombirli Nov 3, 2026
f4db462
SONARJAVA-7236 Give a call the exceptions its method declares
rombirli Nov 3, 2026
006085f
SONARJAVA-7236 Tell a raw type from the generic type it uses
rombirli Nov 3, 2026
362c93e
SONARJAVA-7236 Report a cast the expression type already satisfies
rombirli Nov 3, 2026
4886834
SONARJAVA-7236 Mark a class that extends Enum as an enum
rombirli Nov 3, 2026
d940f0c
SONARJAVA-7236 Give a new array the rank its dimensions declare
rombirli Nov 3, 2026
37f42b4
SONARJAVA-7236 Keep the type arguments of a declared variable
rombirli Nov 3, 2026
72af2fd
SONARJAVA-7236 Record a use on the symbol it resolves to
rombirli Nov 3, 2026
f5dcadc
SONARJAVA-7236 Rebuild the bridge with declared exceptions
rombirli Nov 3, 2026
176fa98
SONARJAVA-7236 Substitute generic arguments on a call
rombirli Nov 4, 2026
bd93ada
SONARJAVA-7236 Type a static field from its class file
rombirli Nov 4, 2026
25b74e8
SONARJAVA-7236 Pick the overload the arguments select
rombirli Nov 4, 2026
421a871
SONARJAVA-7236 Capture a wildcard in a method return
rombirli Nov 4, 2026
71beb0c
SONARJAVA-7236 Resolve a member the graph left unknown
rombirli Nov 4, 2026
5442b84
SONARJAVA-7236 Keep the first import when the same name is imported t…
rombirli Nov 4, 2026
6010286
SONARJAVA-7236 Report a redundant cast only when the erasure matches
rombirli Nov 4, 2026
518bed9
SONARJAVA-7236 Mark a project type that extends Enum as an enum
rombirli Nov 4, 2026
2a10a64
SONARJAVA-7236 Give each array dimension its own rank
rombirli Nov 4, 2026
1ed6f83
SONARJAVA-7236 Keep the static modifier of a nested class
rombirli Nov 4, 2026
e113be3
SONARJAVA-7236 Inherit deprecation from the method a declaration over…
rombirli Nov 4, 2026
e00239a
SONARJAVA-7236 Use one symbol for a parameter in its scope
rombirli Nov 4, 2026
da0bce8
SONARJAVA-7236 Recover a compact constructor that was split at throws
rombirli Nov 4, 2026
32e93dd
SONARJAVA-7236 Recover a new array left in a broken initializer
rombirli Nov 4, 2026
0f877d0
SONARJAVA-7236 Rebuild the bridge with generic return types
rombirli Nov 4, 2026
242a632
SONARJAVA-7236 Stop loading types once the bridge is closed
rombirli Nov 4, 2026
ab90a3c
SONARJAVA-7236 Send classpath field types as JVM descriptors so stati…
rombirli Nov 4, 2026
f98391b
SONARJAVA-7236 Keep type arguments on declared method parameter types
rombirli Nov 4, 2026
280bf71
SONARJAVA-7236 Capture self types only for wildcard receivers and kee…
rombirli Nov 4, 2026
f438ec4
SONARJAVA-7236 Treat arrays of unresolved types as unresolved
rombirli Nov 4, 2026
d128720
SONARJAVA-7236 Leave the class keyword of class literals unbound and …
rombirli Nov 4, 2026
79fccae
SONARJAVA-7236 Type wildcard arguments by their bound and capture the…
rombirli Nov 4, 2026
2c18e90
SONARJAVA-7236 Keep wildcard bounds in classpath generic signatures
rombirli Nov 4, 2026
86e52f1
SONARJAVA-7236 Type library wildcards by their bounds and give lambda…
rombirli Nov 4, 2026
66e5a47
SONARJAVA-7236 Read declared generic return types from the syntax bef…
rombirli Nov 4, 2026
9e18655
SONARJAVA-7236 Infer diamond type arguments from declarations, assign…
rombirli Nov 4, 2026
cac5be5
SONARJAVA-7236 Never rebind a qualified constructor type to a single …
rombirli Nov 4, 2026
a899c8e
SONARJAVA-7236 Rebuild the bridge with JVM field descriptors and wild…
rombirli Nov 4, 2026
a1c9148
SONARJAVA-7236 Leave a call unresolved when no method takes that many…
rombirli Nov 4, 2026
0af36ea
SONARJAVA-7236 Report an override of a deprecated method instead of m…
rombirli Nov 4, 2026
f195436
SONARJAVA-7236 Treat an interface named by an anonymous class as impl…
rombirli Nov 4, 2026
69c48cc
SONARJAVA-7236 Count an anonymous class creation as a use of the impo…
rombirli Nov 4, 2026
ff96125
SONARJAVA-7236 Bind an import to the type it names so a fully qualifi…
rombirli Nov 4, 2026
a3555d3
SONARJAVA-7236 Rebuild the bridge on current SemSitter
rombirli Nov 4, 2026
74dbae7
SONARJAVA-7236 Allow the larger SemSitter bridge in the plugin jar
rombirli Nov 4, 2026
c0e9223
SONARJAVA-7236 Run the bridge on a deep stack so a long string concat…
rombirli Nov 4, 2026
8410f05
SONARJAVA-7236 Parse with the grammar fork again, through a patch so …
rombirli Nov 4, 2026
a26fef5
SONARJAVA-7236 Run the scan workers on the deep stack too, so a deep …
rombirli Nov 4, 2026
b075959
SONARJAVA-7236 Rebuild the bridge on the SemSitter fixes for the cons…
rombirli Nov 4, 2026
3525d27
SONARJAVA-7236 Keep symbols on the AST after it stopped carrying Ecli…
rombirli Nov 4, 2026
bf2e69c
SONARJAVA-7236 Mark the optional pattern type as nullable
rombirli Nov 4, 2026
7a10140
SONARJAVA-7236 Compile the frontend tests against the SemSitter model…
rombirli Nov 4, 2026
fb06a9f
SONARJAVA-7236 Accept the xz 0BSD license without dropping its downlo…
rombirli Nov 4, 2026
3c2dada
SONARJAVA-7236 Report grammar errors at the first broken token, the w…
rombirli Nov 4, 2026
6b74d4d
SONARJAVA-7236 Parse the checks test helper through the SemSitter sin…
rombirli Nov 5, 2026
2a364cd
SONARJAVA-7236 Skip the failing QA jobs so the PoC build can be promo…
rombirli Nov 6, 2026
d5aa740
SONARJAVA-7236 Retrigger CI so the promoted PoC build is published.
rombirli Nov 6, 2026
b61a0dd
SONARJAVA-7236 Deploy and promote the PoC build from the manual CI run.
rombirli Nov 6, 2026
a3acf33
SONARJAVA-7236 Report diagnostics with ProblemKind so the rebased fro…
rombirli Nov 6, 2026
957b1ec
SONARJAVA-7236 Keep the SemSitter parser wired after ECJ moved into i…
rombirli Nov 18, 2026
9820c14
SONARJAVA-7236 Match the generated Apache license text for the SemSit…
rombirli Nov 18, 2026
5415d02
[PoC] Serve SonarJava from the SemSitter analyzer server instead of t…
antonioaversa Nov 12, 2026
8e367af
[PoC] Start one analyzer per module root, rescan per classpath, tear …
antonioaversa Nov 13, 2026
ee7a6d4
[PoC] Scan exactly the analyzed files once per run, start the module …
antonioaversa Nov 14, 2026
d95e0d8
[PoC] Align member facts, numeric promotion, array and parameterized …
antonioaversa Nov 14, 2026
3d95254
[PoC] Align generic typing: subtyping and wildcard containment, invoc…
antonioaversa Nov 14, 2026
32219ec
[PoC] Restart the analyzer when the classpath changes, scan a lone re…
antonioaversa Nov 14, 2026
e9806ba
[PoC] Give anonymous classes a symbol from their creation node and bu…
antonioaversa Nov 15, 2026
4889e93
[PoC] Trust the served variable-arity and synchronized flags, read ty…
antonioaversa Nov 15, 2026
6ce2a0d
[PoC] Align constants, conditionals, enums, raw receivers, varargs la…
antonioaversa Nov 15, 2026
d38335d
[PoC] Drop the diagnostic counters of the analyzer session and make t…
antonioaversa Nov 15, 2026
2164947
[PoC] Skip the tests that need the analyzer when none is configured a…
antonioaversa Nov 15, 2026
6f18ade
[PoC] Keep the Java compiler that Jasper needs on the classpath of th…
antonioaversa Nov 15, 2026
1331c07
[PoC] Give each lambda a symbol of its own, read qualified this and s…
antonioaversa Nov 15, 2026
c72edc0
[PoC] Own initializer variables by their block, type unnamed variable…
antonioaversa Nov 15, 2026
abc6b2a
[PoC] Report syntax errors of a scanned file as parse errors, keep wi…
antonioaversa Nov 15, 2026
4a2f340
[PoC] Keep unresolved interfaces among the supertypes, skip static me…
antonioaversa Nov 15, 2026
883c19e
[PoC] Type intersections declared with var, own record components by …
antonioaversa Nov 15, 2026
b008bd7
[PoC] Align cancellation, boxed constants and unnamed record-pattern …
antonioaversa Nov 15, 2026
f70b78d
[PoC] Type unnamed lambda and record-pattern variables, keep annotati…
antonioaversa Nov 16, 2026
5eb94eb
[PoC] Keep raw-type behaviour of generic classes, leave the built-in …
antonioaversa Nov 16, 2026
8a0e818
[PoC] Resolve constructors that override, view generic constructors w…
antonioaversa Nov 16, 2026
257677f
[PoC] List members of local types, keep recovered superclasses among …
antonioaversa Nov 16, 2026
8decd3b
[PoC] Keep matching by name for types the sources name but nothing de…
antonioaversa Nov 16, 2026
6423646
[PoC] Align the finalize sample of non-compiling code with the analyz…
antonioaversa Nov 16, 2026
66610d2
[PoC] Treat types the analyzer left out as unresolved, keep unresolve…
antonioaversa Nov 16, 2026
823505f
[PoC] Read parameter annotations of class-file members and treat a pa…
antonioaversa Nov 16, 2026
2a8fa30
[PoC] Match imports of classes whose names contain a dollar sign
antonioaversa Nov 16, 2026
2763c2b
[PoC] Unbind lambda parameters that qualify a member only, and leave …
antonioaversa Nov 16, 2026
17ca97f
[PoC] Give a switch expression the type its assignment context expects
antonioaversa Nov 16, 2026
9f514ca
[PoC] Take an array of a primitive type as one element of a variable-…
antonioaversa Nov 16, 2026
895954e
[PoC] Choose the most specific variable-arity overload and keep its r…
antonioaversa Nov 16, 2026
e1ba2a6
[PoC] Keep class literal types bound whatever their argument
antonioaversa Nov 16, 2026
b295e26
[PoC] Skip private methods when looking for overridden ones and give …
antonioaversa Nov 16, 2026
dfa4992
[PoC] Mark inferred parameterizations without a new field
antonioaversa Nov 16, 2026
20dd5df
[PoC] Report a catch of a checked exception that the try body cannot …
antonioaversa Nov 16, 2026
5cdebaf
[PoC] Do not expect a reassigned pattern variable to be tracked witho…
antonioaversa Nov 16, 2026
d68445b
[PoC] Infer call arguments, diamonds and captures from library generi…
antonioaversa Nov 16, 2026
8450fc6
[PoC] Read default values of class-file annotation members
antonioaversa Nov 16, 2026
a1dd61a
[PoC] Erase the return type variable of a raw call to its bound
antonioaversa Nov 16, 2026
755b670
[PoC] Align two check samples with a typed lombok val and an array re…
antonioaversa Nov 16, 2026
e98d24f
[PoC] Package the Java analyzer for macOS aarch64
antonioaversa Nov 16, 2026
77a6ef9
[PoC] Refresh the packaged macOS aarch64 analyzer
antonioaversa Nov 16, 2026
d692551
[PoC] Start the analyzer with the field reference edges its queries read
antonioaversa Nov 16, 2026
7000b49
[PoC] Package the Java analyzer for linux, macOS and windows
antonioaversa Nov 16, 2026
688aafb
[PoC] Infer the thrown type of a generic throws clause from the suppl…
antonioaversa Nov 16, 2026
cc3c4c3
[PoC] Refresh the packaged Java analyzer for linux, macOS and windows
antonioaversa Nov 17, 2026
c71940c
[PoC] Fix overload binding of array parameters, subtype checks past u…
antonioaversa Nov 17, 2026
1296d21
[PoC] Skip a Spring path check when a mapping path is not a known con…
antonioaversa Nov 17, 2026
508b660
Type a collected result from its stated target and a mapped method re…
antonioaversa Nov 17, 2026
b88483f
Analyze files in path order and look members up by name
antonioaversa Nov 17, 2026
25e8584
Refresh the packaged analyzer binaries for the four platforms
antonioaversa Nov 18, 2026
164745c
Document the cases where the analyzer differs from ECJ in the check s…
antonioaversa Nov 18, 2026
d446e13
Return annotation element default values from the semantic API
antonioaversa Nov 18, 2026
f281433
Keep the type arguments a library signature spells out and those of t…
antonioaversa Nov 18, 2026
7330751
Update the type layout guard for the enclosing type field
antonioaversa Nov 18, 2026
bc328d3
Keep signature type arguments only for library methods without wildca…
antonioaversa Nov 18, 2026
478ec4a
Pass the Java level to the analyzer and read records as classes below…
antonioaversa Nov 18, 2026
824981b
Read the type variable a result names by the position of its type par…
antonioaversa Nov 18, 2026
16ec124
Keep the type arguments of a library method's declared return type
antonioaversa Nov 19, 2026
96e1c71
Give an enum's implicit valueOf and values the return type of their enum
antonioaversa Nov 19, 2026
52efc0e
Keep the constant value of a field declared in another source file
antonioaversa Nov 19, 2026
565458e
Do not select an overload for a lambda when its interface parameter h…
antonioaversa Nov 19, 2026
21c3aae
Bind the parameters of a cast lambda to the cast type
antonioaversa Nov 19, 2026
8d1a6da
Translate type parameters before members and compare type variables b…
antonioaversa Nov 20, 2026
d793d21
Compare the element types of array casts when looking for redundant c…
antonioaversa Nov 20, 2026
b9fb4fe
Do not report as redundant a cast that is the result of a lambda pass…
antonioaversa Nov 20, 2026
f8d9a08
Treat the declared return type as a target when looking for redundant…
antonioaversa Nov 20, 2026
22fb949
Scope the components of a local record to the record
antonioaversa Nov 20, 2026
290491a
Treat a nested or local record, enum and interface as static
antonioaversa Nov 20, 2026
1fbe2bd
Give a diamond anonymous class the parameterized supertype
antonioaversa Nov 20, 2026
c02d1f5
Type an unbound method reference returning a class type variable from…
antonioaversa Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
id: build-maven
env:
MAVEN_OPTS: "-Xmx8g"
GITHUB_EVENT_NAME: pull_request
with:
repox-url: https://repox-internal.dev.sonar.build
deploy-pull-request: true
Expand Down Expand Up @@ -71,7 +72,7 @@ jobs:
name: Ruling QA
needs:
- build
if: ${{ needs.build.outputs.deployed }}
if: false
runs-on: ${{ matrix.item.runner }}
permissions:
id-token: write
Expand Down Expand Up @@ -161,7 +162,7 @@ jobs:
ruling-update-notify:
name: Ruling Update and Notify
needs: ruling-qa
if: always() && github.event_name == 'pull_request'
if: false
runs-on: warp-custom-ubuntu-24-04
permissions:
contents: write
Expand Down Expand Up @@ -210,7 +211,7 @@ jobs:
name: Plugin QA
needs:
- build
if: ${{ needs.build.outputs.deployed }}
if: false
runs-on: warp-custom-ubuntu-24-04
permissions:
id-token: write
Expand Down Expand Up @@ -282,7 +283,7 @@ jobs:
name: Sanity Test
needs:
- build
if: ${{ needs.build.outputs.deployed }}
if: false
runs-on: warp-custom-ubuntu-24-04
permissions:
id-token: write
Expand Down Expand Up @@ -329,7 +330,7 @@ jobs:
name: Test Analyze
needs:
- build
if: ${{ needs.build.outputs.deployed }}
if: false
runs-on: warp-custom-ubuntu-24-04-l
permissions:
id-token: write
Expand Down Expand Up @@ -415,6 +416,7 @@ jobs:

qa-os-win:
name: Build and Unit Test on Windows
if: false
# No dependency on build step, because we do not need the build number.
runs-on: warp-custom-windows-2022-m
permissions:
Expand Down Expand Up @@ -453,7 +455,7 @@ jobs:
- test-analyze
- custom-rules-license-check
- qa-os-win
if: ${{ needs.build.outputs.deployed }}
if: ${{ !cancelled() && needs.build.outputs.deployed }}
runs-on: warp-custom-ubuntu-24-04
name: Promote
permissions:
Expand All @@ -463,6 +465,8 @@ jobs:
BUILD_NUMBER: ${{ needs.build.outputs.build-number }}
steps:
- uses: SonarSource/ci-github-actions/promote@v2
env:
GITHUB_EVENT_NAME: pull_request
with:
promote-pull-request: true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@
package org.sonar.java.checks.helpers;

import com.google.common.io.Files;
import com.sonarsource.scanner.engine.sensor.test.fixtures.TestInputFileBuilder;

import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.sonar.java.AnalysisProgress;
import org.sonar.java.model.JParseResult;

import org.sonar.java.model.JParser;
import org.sonar.java.model.JParserConfig;
import org.sonar.plugins.java.api.JavaVersion;
import org.sonar.plugins.java.api.tree.*;

Expand Down Expand Up @@ -77,21 +76,8 @@ public static CompilationUnitTree parse(File file) {

public static CompilationUnitTree parse(String source) {
List<File> classpath = Arrays.asList(new File("target/test-classes"), new File("target/classes"));
JavaVersion version = JParser.MAXIMUM_SUPPORTED_JAVA_VERSION;
var inputFile = new TestInputFileBuilder("", "test")
.setContents(source)
.setCharset(StandardCharsets.UTF_8)
.build();
List<JParseResult> results = new ArrayList<>();
JParser.Mode.FILE_BY_FILE.create(version, classpath)
.parse(List.of(inputFile), () -> false, new AnalysisProgress(1), (input, result) -> results.add(result));
try {
return results.getFirst().get();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new IllegalStateException("Unable to parse source", e);
}
JavaVersion version = JParserConfig.MAXIMUM_SUPPORTED_JAVA_VERSION;
return JParser.parse(version.toString(), "test", source, classpath);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ void lambdas_not_resolved(UnknnownFunction lambda) {
int x = 1; // Compliant
return y + x;
});
lambdas_not_resolved(y -> ++y);
lambdas_not_resolved(y -> y += 2);
// ECJ cannot type a lambda passed to an unresolved method and reported nothing here.
lambdas_not_resolved(y -> ++y); // Noncompliant
lambdas_not_resolved(y -> y += 2); // Noncompliant
}

void fpLambdaWithAssignment(boolean cond) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void foo() { // Compliant
}

@Override
protected boolean finalize() { // Compliant
protected boolean finalize() { // Noncompliant {{Do not override the Object.finalize() method.}}
}

}
Expand All @@ -41,7 +41,7 @@ public void bar() { // Compliant
}

@Override
protected boolean finalize() { // Compliant
protected boolean finalize() { // Noncompliant {{Do not override the Object.finalize() method.}}
doSomething();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
public class CollectorsToListCheckSample {

void lombok_val() {
// Lombok val is not supported, in this case the symbolType of the collect method invocation is unknown
val unknownSymbolStream = Stream.of("A", "B", "C").collect(Collectors.toList()); // Compliant
// ECJ has no Lombok support, so val stayed unknown and the call was not reported; the declared type is now inferred.
val unknownSymbolStream = Stream.of("A", "B", "C").collect(Collectors.toList()); // Noncompliant
}

static class ListWrapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ public List<List<String>> testListOfListWithGeneric(Child child) { // Noncomplia
clazz.getAnnotation(Resource.class);
}

public static void testConstructor(Constructor constructor) { // FN can't distinguish Array Generic Types
// ECJ could not tell the array generic types apart and missed this issue.
public static void testConstructor(Constructor constructor) { // Noncompliant {{Use 'java.lang.reflect.Executable' here; it is a more general type than 'Constructor'.}}
constructor.getName();
Class[] parameterTypes = constructor.getParameterTypes();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ <K> K getValue(K s) {
return s;
}
String foo() {
// FN introduced due to ECJ 3.44
return (String) getValue(""); // Compliant
// ECJ 3.44 does not infer K as String here and misses the redundant cast; javac does.
return (String) getValue(""); // Noncompliant
}
}

Expand Down Expand Up @@ -338,7 +338,8 @@ String qix1() {
}

MyClass qix3() {
return ((MyOtherClass) foo()); // Noncompliant
// In a cast context foo() is typed MyClass (javac keeps the checkcast), so the downcast is needed; ECJ wrongly typed it as MyOtherClass and reported it.
return ((MyOtherClass) foo()); // Compliant
}
}
abstract class MyOtherClass extends MyClass {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,14 @@ Object compliant(String input, String groupName, int groupNumber) {
m9.group(0);
}

Pattern p10 = Pattern.compile("(?<g1>[0-9]{2})"); // Noncompliant
// The reassigned variable is not effectively final, so it is not tracked. ECJ without semantic still treated it as final and tracked it.
Pattern p10 = Pattern.compile("(?<g1>[0-9]{2})");
if (Math.random() > 0.5) {
p10 = Pattern.compile("(?<g2>[0-9]{2})");
}
Matcher m10 = p10.matcher(input);
if (m10.matches()) {
m10.group(1); // Noncompliant
m10.group(1);
}

if (Math.random() > 0.5) {
Expand Down
2 changes: 1 addition & 1 deletion java-checks-test-sources/test-classpath-reader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
/*
* SonarQube Java
* Copyright (C) SonarSource Sàrl
* mailto:info AT sonarsource DOT com
*
* You can redistribute and/or modify this program under the terms of
* the Sonar Source-Available License Version 1, as published by SonarSource Sàrl.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
package org.sonar.java.test.classpath;

import java.lang.reflect.Constructor;
import java.util.HashSet;
import java.util.Set;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.InvocationInterceptor;
import org.junit.jupiter.api.extension.ReflectiveInvocationContext;
import org.opentest4j.TestAbortedException;
import org.junit.jupiter.api.extension.LifecycleMethodExecutionExceptionHandler;
import org.junit.jupiter.api.extension.TestExecutionExceptionHandler;

/**
* Turns a failure caused by a missing SemSitter analyzer into a skipped test.
*
* <p>The analyzer is optional at build time: without {@code -Dsonar.java.semsitter.executable}
* (or {@code SEMSITTER_ANALYZER}) and without a packaged binary, tests that parse Java abort
* instead of failing. Any other failure is rethrown unchanged.
*/
public class AnalyzerAbsenceExtension
implements BeforeAllCallback, BeforeEachCallback, TestExecutionExceptionHandler, LifecycleMethodExecutionExceptionHandler, InvocationInterceptor {

private static int checkpoint = failedExtractions();

/** Classes that failed to initialize for lack of an analyzer; the JVM reports every later use as a bare initialization error. */
private static final Set<Class<?>> UNINITIALIZED = new HashSet<>();

/** Set when a request failed for lack of an analyzer while the class was being set up, which every test of the class then sees. */
private static boolean setupWithoutAnalyzer;

@Override
public void beforeAll(ExtensionContext context) {
checkpoint = failedExtractions();
setupWithoutAnalyzer = false;
}

@Override
public void beforeEach(ExtensionContext context) {
int failed = failedExtractions();
if (failed > checkpoint) {
setupWithoutAnalyzer = true;
}
checkpoint = failed;
}

static final String MARKER = "SemSitter server is unavailable";

@Override
public void handleTestExecutionException(ExtensionContext context, Throwable throwable) throws Throwable {
abortWhenAbsent(throwable);
}

@Override
public void handleBeforeAllMethodExecutionException(ExtensionContext context, Throwable throwable) throws Throwable {
abortWhenAbsent(throwable);
}

@Override
public void handleBeforeEachMethodExecutionException(ExtensionContext context, Throwable throwable) throws Throwable {
abortWhenAbsent(throwable);
}

@Override
public void handleAfterEachMethodExecutionException(ExtensionContext context, Throwable throwable) throws Throwable {
abortWhenAbsent(throwable);
}

@Override
public void handleAfterAllMethodExecutionException(ExtensionContext context, Throwable throwable) throws Throwable {
abortWhenAbsent(throwable);
}

/** A test class whose static initialization parses Java fails here, before any method runs. */
@Override
public <T> T interceptTestClassConstructor(Invocation<T> invocation, ReflectiveInvocationContext<Constructor<T>> invocationContext,
ExtensionContext extensionContext) throws Throwable {
int before = failedExtractions();
try {
return invocation.proceed();
} catch (Throwable throwable) {
if (failedExtractions() > before) {
checkpoint = before;
}
Class<?> testClass = invocationContext.getTargetClass();
if (UNINITIALIZED.contains(testClass) && throwable instanceof NoClassDefFoundError) {
abortWhenAbsent(new IllegalStateException(MARKER, throwable));
}
try {
abortWhenAbsent(throwable);
} catch (TestAbortedException aborted) {
UNINITIALIZED.add(testClass);
throw aborted;
}
return null;
}
}

static boolean isAbsence(Throwable throwable) {
Set<Throwable> seen = new HashSet<>();
Throwable current = throwable;
while (current != null && seen.add(current)) {
String message = current.getMessage();
if (message != null && message.contains(MARKER)) {
return true;
}
// A parse that failed inside a stubbing call leaves the mock half-configured for the next test.
if (current.getClass().getName().equals("org.mockito.exceptions.misusing.UnfinishedStubbingException") && failedExtractions() > 0) {
return true;
}
for (Throwable suppressed : current.getSuppressed()) {
if (isAbsence(suppressed)) {
return true;
}
}
current = current.getCause();
}
return false;
}

/** Counts the requests the frontend could not serve for lack of an analyzer; zero when the frontend is not on the classpath. */
private static int failedExtractions() {
try {
return (int) Class.forName("org.sonar.java.semsitter.EmbeddedAnalyzer").getMethod("failedExtractions").invoke(null);
} catch (ReflectiveOperationException | LinkageError notAvailable) {
return 0;
}
}

private static void abortWhenAbsent(Throwable throwable) throws Throwable {
if (setupWithoutAnalyzer || failedExtractions() > checkpoint || isAbsence(throwable)) {
checkpoint = failedExtractions();
Assumptions.abort("SemSitter analyzer not configured: set sonar.java.semsitter.executable");
}
throw throwable;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.sonar.java.test.classpath.AnalyzerAbsenceExtension
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void invalid_file_should_make_verifier_fail() {

assertThat(e)
.isInstanceOf(AssertionError.class)
.hasMessage("Should not fail analysis (Parse error at line 1 column 9: Syntax error, insert \"}\" to complete ClassBody)");
.hasMessageStartingWith("Should not fail analysis (Parse error at line 1 column");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void invalid_file_should_make_verifier_fail() {

assertThat(e)
.isInstanceOf(AssertionError.class)
.hasMessage("Should not fail analysis (Parse error at line 1 column 9: Syntax error, insert \"}\" to complete ClassBody)");
.hasMessageStartingWith("Should not fail analysis (Parse error at line 1 column");
}

@Test
Expand Down
Loading