Skip to content

Commit

Permalink
Use new return-type of JC.getAllJavaSourceVersionsSupportedByCompiler()
Browse files Browse the repository at this point in the history
Leverage the new return-type of
JavaCore.getAllJavaSourceVersionsSupportedByCompiler(), adjusted in
eclipse-jdt/eclipse.jdt.core#2770
  • Loading branch information
HannesWell authored and iloveeclipse committed Aug 7, 2024
1 parent e2aacdf commit 1190120
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ public static String getExecutionEnvironmentCompliance(IExecutionEnvironment exe
if(JavaCore.isJavaSourceVersionSupportedByCompiler(compliance)) {
return compliance;
}
return JavaCore.getFirstJavaSourceVersionSupportedByCompiler();
return JavaCore.getAllJavaSourceVersionsSupportedByCompiler().first();
}
}

Expand Down Expand Up @@ -1192,7 +1192,7 @@ public static String getExecutionEnvironmentCompliance(IExecutionEnvironment exe
} else if (desc.indexOf(JavaCore.VERSION_1_8) != -1) {
return JavaCore.VERSION_1_8;
}
return JavaCore.getFirstJavaSourceVersionSupportedByCompiler();
return JavaCore.getAllJavaSourceVersionsSupportedByCompiler().first();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public void widgetSelected(SelectionEvent e) {
fJRE50InfoText= new Link(infoComposite, SWT.WRAP);
fJRE50InfoText.setFont(composite.getFont());
// set a text: not the real one, just for layouting
String versionLabel= getVersionLabel(JavaCore.getFirstJavaSourceVersionSupportedByCompiler());
String versionLabel= getVersionLabel(JavaCore.getAllJavaSourceVersionsSupportedByCompiler().first());
fJRE50InfoText.setText(Messages.format(PreferencesMessages.ComplianceConfigurationBlock_jrecompliance_info_project, new String[] { versionLabel, versionLabel }));
fJRE50InfoText.setVisible(false);
fJRE50InfoText.addSelectionListener(new SelectionListener() {
Expand Down Expand Up @@ -1170,8 +1170,8 @@ private void updateComplianceDefaultSettings(boolean rememberOld, String oldComp
reportPreview= WARNING;
assertAsId= ERROR;
enumAsId= ERROR;
source= JavaCore.getFirstJavaSourceVersionSupportedByCompiler();
target= JavaCore.getFirstJavaSourceVersionSupportedByCompiler();
source= JavaCore.getAllJavaSourceVersionsSupportedByCompiler().first();
target= JavaCore.getAllJavaSourceVersionsSupportedByCompiler().first();
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,8 @@ private void initializeJvmFields () {
fInstalledJVMs= getWorkspaceJREs();
Arrays.sort(fInstalledJVMs, (i0, i1) -> {
if (i1 instanceof IVMInstall2 && i0 instanceof IVMInstall2) {
String cc0= JavaModelUtil.getCompilerCompliance((IVMInstall2) i0, JavaCore.getFirstJavaSourceVersionSupportedByCompiler());
String cc1= JavaModelUtil.getCompilerCompliance((IVMInstall2) i1, JavaCore.getFirstJavaSourceVersionSupportedByCompiler());
String cc0= JavaModelUtil.getCompilerCompliance((IVMInstall2) i0, JavaCore.getAllJavaSourceVersionsSupportedByCompiler().first());
String cc1= JavaModelUtil.getCompilerCompliance((IVMInstall2) i1, JavaCore.getAllJavaSourceVersionsSupportedByCompiler().first());
int result= JavaCore.compareJavaVersions(cc1, cc0);
if (result != 0)
return result;
Expand Down

0 comments on commit 1190120

Please sign in to comment.