Skip to content

Commit

Permalink
Fix release option in module dialog/page
Browse files Browse the repository at this point in the history
Fixes broken commit c3f2219 .
Fixed approach used here given in
#1958 (comment)
  • Loading branch information
akurtakov committed Jan 24, 2025
1 parent 8c58ba0 commit 744f119
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,9 @@ protected void scanModules() {
}
try {
if (fCurrJProject.getModuleDescription() == null) { // cache default roots when compiling the unnamed module:
String release = fCurrJProject.getOption(JavaCore.COMPILER_RELEASE, true);
if (release == null) {
release = fCurrJProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true);
}
if (release == null) {
release = JavaCore.latestSupportedJavaVersion();
}
String release = JavaCore.ENABLED.equals(fCurrJProject.getOption(JavaCore.COMPILER_RELEASE, true))
? fCurrJProject.getOption(JavaCore.COMPILER_COMPLIANCE, true) : null;

fAllDefaultSystemModules= closure(JavaCore.defaultRootModules(Arrays.asList(fAllSystemRoots), release));
}
} catch (JavaModelException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,13 +803,9 @@ private List<String> defaultIncludedModuleNamesForUnnamedModule() {
roots.add(el);
}
}
String release = fJavaElements[0].getJavaProject().getOption(JavaCore.COMPILER_RELEASE, true);
if (release == null) {
release = fJavaElements[0].getJavaProject().getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true);
}
if (release == null) {
release = JavaCore.latestSupportedJavaVersion();
}
String release = JavaCore.ENABLED.equals(fJavaElements[0].getJavaProject().getOption(JavaCore.COMPILER_RELEASE, true))
? fJavaElements[0].getJavaProject().getOption(JavaCore.COMPILER_COMPLIANCE, true) : null;

return JavaCore.defaultRootModules(roots, release);
}
return Collections.emptyList();
Expand Down

0 comments on commit 744f119

Please sign in to comment.