Clean up Java 27 compatibility hack
還沒有人認領這個 Issue。
評估
研究方向
從 src/main/java/software/coley/sourcesolver/util/compat 開始,檢查相容性提交 05b54eb0fabf4b57702d875d808d9ea219c4283d,重點關注 JavacParser 工廠呼叫及其 Java 27 契約。在決定應如何處理 parser 建構之前,先審查所引用的 OpenJDK 變更;完成的標準是清理相容性邏輯,同時不破壞 AST 範圍解析。
由索引模型根據 Issue 內容生成。
描述
Compatibility commit: 05b54eb0fabf4b57702d875d808d9ea219c4283d
Compatibility logic: https://github.com/Col-E/SourceSolver/tree/master/src/main/java/software/coley/sourcesolver/util/compat
Somehow the parser factory call didn't totally break.
// Build parser for source and extract the end-pos table so that we can resolve AST ranges
JavacParser parser = factory.newParser(source,
false /* keepJavadoc */,
true /* keepEndPos */,
false /* keepLineMap */
);
The contract is different now, but doesn't immediately cause problems.
// Build parser for source and extract the end-pos table so that we can resolve AST ranges
JavacParser parser = factory.newParser(source,
false /* keepJavadoc */,
true /* keepLineMap */,
false /* parseModuleInfo */
);
We may want to also have some compat logic for building the parser instances...
Rant
This dogshit compatibility hack exists because we don't have maven/gradle support for Java 27 yet, but people already noticed because they try and run consuming projects on bleeding edge releases... yay.
I would have liked to use multi-release jars, but oh my god this is impossible. Because we use --add-exports we cannot use --release. And guess what mutli-release support in Maven/Gradle loves to use? Yeah.
I'm sure there's a way around it but I wasted 2.5 hours on this already...
Most javac internal changes can be found here:
https://github.com/openjdk/jdk/pulls?q=is%3Apr+author%3Acushon- 31058: Clean up calls to deprecated getStartPosition and getEndPosition methods
- 29994: Don't require a CompilationUnit for end position APIs
- 29463: Store end positions on more trees
- 28610: Store end positions directly in JCTree
- 主要語言
- Java
- 星號
- 12
- 分支
- 2
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
相似的 Issue
-
Bug feat:Syntax
難度 2/5 1-3 小時 新手友好度 80/100
ignatov/intellij-erlang#1342 ·
維護者通常 1 天內回覆
-
Flaky EnrollmentCoordinatorTest.theNewSettingsShouldNotInheritTheFormerOnesBackoff on Windows可能已有人在做 @NassimBtk 今天認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 78/100
MetricsHub/metricshub-community#1636 ·
維護者通常 1 天內回覆
-
[Bug] no hint/error message for max picture size可能已有人在做 @flahamue 今天認領。 未關閉Type: Bug
難度 2/5 1-3 小時 新手友好度 68/100
it-at-m/raumreservierung#439 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
-
Copy/paste broken on Linux: ClassCastException (HeapByteBuffer → byte[]) in ClipboardActions.paste未關閉3rd party problem bug
難度 2/5 1-3 小時 新手友好度 68/100