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