Repository navigation
SONARJAVA-7300 Decouple the Sonar Java frontend from Eclipse JDT core - #6485
aurelien-coet-sonarsource wants to merge 4 commits into
Conversation
d50bf37 to
80b9ad3
Compare
|
/pvf |
|
📊 Performance Validation complete |
c0370cd to
b88c5c0
Compare
b88c5c0 to
c4b1cf5
Compare
|
/pvf |
|
📊 Performance Validation complete |
58bc4a9 to
d4d7696
Compare
|
/pvf |
| private static final Logger LOG = LoggerFactory.getLogger(JDTParserConfig.class); | ||
|
|
||
| private static final String MAXIMUM_ECJ_WARNINGS = "42000"; | ||
| private static final Set<String> JRE_JARS = new HashSet<>(Arrays.asList("rt.jar", "jrt-fs.jar", "android.jar")); |
There was a problem hiding this comment.
⚠️ Cross-PR: Release-API JDK resolution from #6459 lost or uncompilable after refactor
Breaks when this PR and #6459 both merge, and the second one is rebased onto the neutral JParserConfig interface without moving the release-API logic into JDTParserConfig.jdtParser().
How
- This PR turns
JParserConfiginto an interface. ItsastParser()now returnsJParser, and it no longer has aclasspathfield (JParserConfig.java:29-35). - The ECJ setup moved to
JDTParserConfig.jdtParser(), which still passes the unfiltered classpath tosetEnvironmentand checks it against the oldJRE_JARSset (JDTParserConfig.java:57,110). Nothing in it sets the release option. - #6459 edits the old abstract
JParserConfig. It addsOPTION_RELEASE, addsuseReleaseApiOfConfiguredJdk(options)operating onclasspath, and passes a filtered environment list tosetEnvironment. Its tests useastParser()as anASTParsertogether withJParser.parse(astParser, ...). - As a result, #6459's code no longer compiles against this layout. If someone resolves the conflict by keeping this PR's version of the file, release-API JDK selection is dropped without any error.
Fix
- This PR: If it lands second, port #6459's
OPTION_RELEASE,useReleaseApiOfConfiguredJdkand filtered-environment logic intoJDTParserConfig.jdtParser(). - #6459: If it lands second, move the logic into
JDTParserConfig.jdtParser(). SwitchJParserTest/JParserTestUtilstoJParserConfig.parse(unitName, source), and move theJParserConfigTestchecks toJDTParserConfig.
Compared 96acea5 with #6459 at ac3fd7c
Was this helpful? React with 👍 / 👎
|
📊 Performance Validation complete |
cba5e05 to
7e1aebc
Compare
Use semantic interfaces for shared operations and expose annotation element defaults through MethodSymbol. Extract neutral nullability data while retaining JUtils and JSymbolMetadataNullabilityHelper.
Move JDT parsing and semantic implementations into org.sonar.java.jdt. Use the existing semantic and diagnostic API contracts directly, retain parser and shared utility contracts, and create environment cleanup callbacks in the JDT parser.
7e1aebc to
c979713
Compare
c979713 to
5170c8d
Compare
Code Review
|
| Auto-apply | Compact | Unblock |
|
|
|
Was this helpful? React with 👍 / 👎 | Gitar
|
|
/pvf |
|
Projects with unexpected PVF results:
|
|
📊 Performance Validation complete Projects with unexpected PVF results:
|




Summary by Gitar
FrontendApiTestand replaced it withJdtClassesLayoutTestandClassLayoutTestUtilsto check the JDT layoutWRAPPER_TO_PRIMITIVEandPRIMITIVE_TO_WRAPPERpublic immutable maps inJUtilsSymbol.MethodSymbol.annotationElementDefaultValue()as semantic API typesThis will update automatically on new commits.