feat: Java有关重构 - #11
Conversation
…初始化、设置等逻辑移动到JavaService内
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a robust Java management system, featuring a new JavaService for runtime state management and enhanced discovery logic in JavaUtils that includes Windows registry scanning. The UI has been updated to support manual Java path selection, runtime refreshing, and macOS-specific menu integrations. My feedback highlights several critical issues: the use of Isolate.run for refreshing runtimes will fail due to memory isolation and plugin limitations, a layout conflict exists between MainAxisSize.min and Spacer in the settings page, Platform.version is incorrectly used for architecture detection, registry handles lack proper resource cleanup, and the javaSelectedPath setter fails to persist changes to storage.
|
镜像源这个倒是没必要规定,自己觉得哪个镜像源快或者是用官方源也没啥所谓,反正应该也没人看pubspec.lock的变更 |
主要是会一直在提交列表里 |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a robust JavaService and JavaUtils to manage, search, and configure Java runtimes across different platforms, updating the launchers and settings UI accordingly. The code review identified several critical issues, including a UX bug in _pickAndAddJavaRuntime that unexpectedly closes the settings page, potential launcher crashes from saving empty system Java paths, a registry handle leak in JavaUtils, and a race condition where the main UI becomes interactive before Java initialization completes. Additionally, feedback was provided regarding improper reset logic when deleting non-active Java runtimes, and the need for better error handling during JSON parsing and background isolate execution.
重构内容:
searchPotentialJavaExecutables)内的遍历,在Windows下采用搜索注册表的方法(参考PCL2),对于Mac与Linux没有地方测试(java更改为javaSelectedPath,添加javaRuntimes缓存Java的信息实在是铲不动了太多东西要改的了
没有ChangeNotifier真的很难改,这算前面挖的坑了
所以Java部分先改到这 (•_•),我打算开始改UI了
对了最好在contribution.md里面提一嘴统一PUB_HOSTED_URL和FLUTTER_STORAGE_BASE_URL,在我这里很容易因为
pub get一下pubspec.lock就会迎来大变实际上还是有点问题的 在初始化java的时候会阻塞UI,但是改这个要动很多东西所以没打算在现在弄
希望能早点合并喵