Skip to content

Commit 2362dfc

Browse files
committed
Take release level into account when check for java9
Currently in SearchableEnvironment we only check if the project level is larger java9plus but when constructing a release specific SearchableEnvironment this needs to take the release option into account instead. Fix #4399
1 parent 4c82e2b commit 2362dfc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public SearchableEnvironment(JavaProject project, org.eclipse.jdt.core.ICompilat
115115
|| !JavaCore.IGNORE.equals(project.getOption(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, true));
116116
this.workingCopies = workingCopies;
117117
this.nameLookup = project.newNameLookup(workingCopies, excludeTestCode);
118-
boolean java9plus = JavaCore.callReadOnly(() -> CompilerOptions
118+
boolean java9plus = release >=JavaProject.FIRST_MULTI_RELEASE || JavaCore.callReadOnly(() -> CompilerOptions
119119
.versionToJdkLevel(project.getOption(JavaCore.COMPILER_COMPLIANCE, true)) >= ClassFileConstants.JDK9);
120120
if (java9plus) {
121121
this.knownModuleLocations = new HashMap<>();

0 commit comments

Comments
 (0)