Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ public IProblemRequestor getProblemRequestor(ICompilationUnit unit) {
@Override
public void setUpSuite() throws Exception {
super.setUpSuite();

IJavaProject mrproject = createJavaProject("ReconcilerMR", new String[] { "src", "src9", "src21" },
new String[] { "JCL18_LIB" }, "bin");
new String[] { "JCL_21_LIB" }, "bin", "21", true);
createFolder("/ReconcilerMR/src/p");
createFolder("/ReconcilerMR/src9/p");
createFolder("/ReconcilerMR/src21/p");
Expand Down Expand Up @@ -112,6 +111,9 @@ void m(B b) {
mrproject.setOption(JavaCore.COMPILER_RELEASE, JavaCore.ENABLED);
mrproject.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
mrproject.setOption(JavaCore.COMPILER_PB_INVALID_JAVADOC, JavaCore.WARNING);
mrproject.setOption(JavaCore.COMPILER_COMPLIANCE, "1.8");
mrproject.setOption(JavaCore.COMPILER_SOURCE, "1.8");
mrproject.setOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, "1.8");
}

@Override
Expand All @@ -136,6 +138,8 @@ public class D {
void m(B b) {
// Calling method m only available from Java 21+
b.m();
// Calling a JDK class should work
System.out.println("Running");
}
}
""";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public SearchableEnvironment(JavaProject project, org.eclipse.jdt.core.ICompilat
|| !JavaCore.IGNORE.equals(project.getOption(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, true));
this.workingCopies = workingCopies;
this.nameLookup = project.newNameLookup(workingCopies, excludeTestCode);
boolean java9plus = JavaCore.callReadOnly(() -> CompilerOptions
boolean java9plus = release >=JavaProject.FIRST_MULTI_RELEASE || JavaCore.callReadOnly(() -> CompilerOptions
Comment thread
stephan-herrmann marked this conversation as resolved.
.versionToJdkLevel(project.getOption(JavaCore.COMPILER_COMPLIANCE, true)) >= ClassFileConstants.JDK9);
if (java9plus) {
this.knownModuleLocations = new HashMap<>();
Expand Down
Loading