Skip to content

Commit

Permalink
Merge pull request #1272 from jarthana/master
Browse files Browse the repository at this point in the history
[22] Merge BETA_JAVA22 to master #2167
  • Loading branch information
jarthana authored Mar 20, 2024
2 parents bf5168d + e23cf43 commit c7ecdca
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 26 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.jdt.astview.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.eclipse.jdt.astview.feature"
label="Java AST View"
version="1.2.200.qualifier"
version="1.2.250.qualifier"
provider-name="Eclipse.org"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.astview/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.jdt.astview
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.astview; singleton:=true
Bundle-Version: 1.6.100.qualifier
Bundle-Version: 1.6.150.qualifier
Bundle-Activator: org.eclipse.jdt.astview.ASTViewPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -138,6 +138,7 @@
public class ASTView extends ViewPart implements IShowInSource, IShowInTargetList {

static final int JLS_LATEST= AST.getJLSLatest();
private static final int JLS22= ASTHelper.JLS22;
private static final int JLS21= ASTHelper.JLS21;
private static final int JLS20= ASTHelper.JLS20;
private static final int JLS19= ASTHelper.JLS19;
Expand Down Expand Up @@ -520,6 +521,7 @@ public ASTView() {
case JLS19:
case JLS20:
case JLS21:
case JLS22:
fCurrentASTLevel= level;
}
} catch (NumberFormatException e) {
Expand Down Expand Up @@ -1147,6 +1149,7 @@ public void run() {
new ASTLevelToggle("AST Level 1&9 (19)", JLS19), //$NON-NLS-1$
new ASTLevelToggle("AST Level 2&0 (20)", JLS20), //$NON-NLS-1$
new ASTLevelToggle("AST Level 2&1 (21)", JLS21), //$NON-NLS-1$
new ASTLevelToggle("AST Level 2&2 (22)", JLS22), //$NON-NLS-1$
};

fAddToTrayAction= new Action() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2023 IBM Corporation and others.
* Copyright (c) 2019, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -37,6 +37,7 @@ public class ASTHelper {
public static final int JLS19 = AST.JLS19;
public static final int JLS20 = AST.JLS20;
public static final int JLS21 = AST.JLS21;
public static final int JLS22 = AST.JLS22;

private static boolean isNodeTypeSupportedInAST(AST ast, int nodeType) {
switch (nodeType) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -78,7 +78,7 @@ public final class JavaModelUtil {
*/
public static final String VERSION_LATEST;
static {
VERSION_LATEST= JavaCore.VERSION_21; // make sure it is not inlined
VERSION_LATEST= JavaCore.VERSION_22; // make sure it is not inlined
}

public static final int VALIDATE_EDIT_CHANGED_CONTENT= 10003;
Expand Down Expand Up @@ -864,6 +864,10 @@ public static boolean is21OrHigher(String compliance) {
return !isVersionLessThan(compliance, JavaCore.VERSION_21);
}

public static boolean is22OrHigher(String compliance) {
return !isVersionLessThan(compliance, JavaCore.VERSION_22);
}

/**
* Checks if the given project or workspace has source compliance 1.2 or greater.
*
Expand Down Expand Up @@ -1048,6 +1052,17 @@ public static boolean is21OrHigher(IJavaProject project) {
return is21OrHigher(getSourceCompliance(project));
}

/**
* Checks if the given project or workspace has source compliance 22 or greater.
*
* @param project the project to test or <code>null</code> to test the workspace settings
* @return <code>true</code> if the given project or workspace has source compliance 22 or
* greater.
*/
public static boolean is22OrHigher(IJavaProject project) {
return is22OrHigher(getSourceCompliance(project));
}

public static String getSourceCompliance(IJavaProject project) {
return project != null ? project.getOption(JavaCore.COMPILER_SOURCE, true) : JavaCore.getOption(JavaCore.COMPILER_SOURCE);
}
Expand Down Expand Up @@ -1098,6 +1113,8 @@ public static String getCompilerCompliance(IVMInstall2 vMInstall, String default
String version= vMInstall.getJavaVersion();
if (version == null) {
return defaultCompliance;
} else if (version.startsWith(JavaCore.VERSION_22)) {
return JavaCore.VERSION_22;
} else if (version.startsWith(JavaCore.VERSION_21)) {
return JavaCore.VERSION_21;
} else if (version.startsWith(JavaCore.VERSION_20)) {
Expand Down Expand Up @@ -1152,7 +1169,9 @@ public static String getExecutionEnvironmentCompliance(IExecutionEnvironment exe

// fallback:
String desc= executionEnvironment.getId();
if (desc.indexOf(JavaCore.VERSION_21) != -1) {
if (desc.indexOf(JavaCore.VERSION_22) != -1) {
return JavaCore.VERSION_22;
} else if (desc.indexOf(JavaCore.VERSION_21) != -1) {
return JavaCore.VERSION_21;
} else if (desc.indexOf(JavaCore.VERSION_20) != -1) {
return JavaCore.VERSION_20;
Expand Down
16 changes: 8 additions & 8 deletions org.eclipse.jdt.ui/.settings/.api_filters
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.jdt.ui" version="2">
<resource path="META-INF/MANIFEST.MF">
<filter id="924844039">
<message_arguments>
<message_argument value="3.32.100"/>
<message_argument value="3.32.0"/>
</message_arguments>
</filter>
</resource>
<resource path="internal compatibility/org/eclipse/jdt/internal/corext/SourceRange.java" type="org.eclipse.jdt.internal.corext.SourceRange">
<filter id="574619656">
<message_arguments>
Expand Down Expand Up @@ -201,14 +209,6 @@
</message_arguments>
</filter>
</resource>
<resource path="ui/org/eclipse/jdt/ui/text/java/IInvocationContext.java" type="org.eclipse.jdt.ui.text.java.IInvocationContext">
<filter id="576720909">
<message_arguments>
<message_argument value="IInvocationContextCore"/>
<message_argument value="IInvocationContext"/>
</message_arguments>
</filter>
</resource>
<resource path="ui/org/eclipse/jdt/ui/text/java/correction/ASTRewriteCorrectionProposal.java" type="org.eclipse.jdt.ui.text.java.correction.ASTRewriteCorrectionProposal">
<filter id="643850349">
<message_arguments>
Expand Down
Binary file modified org.eclipse.jdt.ui/jar-in-jar-loader.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -156,6 +156,7 @@ public class ComplianceConfigurationBlock extends OptionsConfigurationBlock {
private static final String VERSION_19 = JavaCore.VERSION_19;
private static final String VERSION_20 = JavaCore.VERSION_20;
private static final String VERSION_21 = JavaCore.VERSION_21;
private static final String VERSION_22 = JavaCore.VERSION_22;
private static final String VERSION_LATEST = JavaCore.latestSupportedJavaVersion();
private static final String VERSION_JSR14= "jsr14"; //$NON-NLS-1$

Expand Down Expand Up @@ -313,7 +314,7 @@ public void enablePreferenceContent(boolean enable) {
private Composite createComplianceTabContent(Composite folder) {

final String[] complianceVersions= new String[] { VERSION_1_3, VERSION_1_4,
VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11, VERSION_12, VERSION_13, VERSION_14, VERSION_15, VERSION_16, VERSION_17, VERSION_18, VERSION_19, VERSION_20, VERSION_21 };
VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11, VERSION_12, VERSION_13, VERSION_14, VERSION_15, VERSION_16, VERSION_17, VERSION_18, VERSION_19, VERSION_20, VERSION_21, VERSION_22 };
final String[] complianceLabels= new String[] {
PreferencesMessages.ComplianceConfigurationBlock_version13,
PreferencesMessages.ComplianceConfigurationBlock_version14,
Expand All @@ -333,11 +334,12 @@ private Composite createComplianceTabContent(Composite folder) {
PreferencesMessages.ComplianceConfigurationBlock_version_18,
PreferencesMessages.ComplianceConfigurationBlock_version_19,
PreferencesMessages.ComplianceConfigurationBlock_version_20,
PreferencesMessages.ComplianceConfigurationBlock_version_21
PreferencesMessages.ComplianceConfigurationBlock_version_21,
PreferencesMessages.ComplianceConfigurationBlock_version_22
};

String[] targetVersions= new String[] { VERSION_CLDC_1_1, VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4,
VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11, VERSION_12, VERSION_13, VERSION_14, VERSION_15, VERSION_16, VERSION_17, VERSION_18, VERSION_19, VERSION_20, VERSION_21 };
VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11, VERSION_12, VERSION_13, VERSION_14, VERSION_15, VERSION_16, VERSION_17, VERSION_18, VERSION_19, VERSION_20, VERSION_21, VERSION_22 };
String[] targetLabels= new String[] {
PreferencesMessages.ComplianceConfigurationBlock_versionCLDC11,
PreferencesMessages.ComplianceConfigurationBlock_version11,
Expand All @@ -360,15 +362,17 @@ private Composite createComplianceTabContent(Composite folder) {
PreferencesMessages.ComplianceConfigurationBlock_version_18,
PreferencesMessages.ComplianceConfigurationBlock_version_19,
PreferencesMessages.ComplianceConfigurationBlock_version_20,
PreferencesMessages.ComplianceConfigurationBlock_version_21
PreferencesMessages.ComplianceConfigurationBlock_version_21,
PreferencesMessages.ComplianceConfigurationBlock_version_22

};
if (ComplianceConfigurationBlock.VERSION_JSR14.equals(getValue(PREF_CODEGEN_TARGET_PLATFORM))) {
targetVersions= append(targetVersions, ComplianceConfigurationBlock.VERSION_JSR14);
targetLabels= append(targetLabels, ComplianceConfigurationBlock.VERSION_JSR14);
}

String[] sourceVersions= new String[] { VERSION_1_3, VERSION_1_4,
VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11, VERSION_12, VERSION_13, VERSION_14, VERSION_15, VERSION_16, VERSION_17, VERSION_18, VERSION_19, VERSION_20, VERSION_21 };
VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, VERSION_9, VERSION_10, VERSION_11, VERSION_12, VERSION_13, VERSION_14, VERSION_15, VERSION_16, VERSION_17, VERSION_18, VERSION_19, VERSION_20, VERSION_21, VERSION_22 };
String[] sourceLabels= new String[] {
PreferencesMessages.ComplianceConfigurationBlock_version13,
PreferencesMessages.ComplianceConfigurationBlock_version14,
Expand All @@ -388,7 +392,8 @@ private Composite createComplianceTabContent(Composite folder) {
PreferencesMessages.ComplianceConfigurationBlock_version_18,
PreferencesMessages.ComplianceConfigurationBlock_version_19,
PreferencesMessages.ComplianceConfigurationBlock_version_20,
PreferencesMessages.ComplianceConfigurationBlock_version_21
PreferencesMessages.ComplianceConfigurationBlock_version_21,
PreferencesMessages.ComplianceConfigurationBlock_version_22
};

final ScrolledPageContent sc1 = new ScrolledPageContent(folder);
Expand Down Expand Up @@ -848,9 +853,9 @@ private void validateComplianceStatus() {
}
}

// //TODO: Comment once Java SE 21 has been shipped:
//TODO: Comment once Java SE 22 has been shipped:
// String selectedCompliance= getValue(PREF_COMPLIANCE);
// if (VERSION_21.equals(selectedCompliance)) {
// if (VERSION_22.equals(selectedCompliance)) {
// fJRE50InfoText.setText(
// "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP."); //$NON-NLS-1$
// isVisible= true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2023 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -864,6 +864,7 @@ private PreferencesMessages() {
public static String ComplianceConfigurationBlock_version_19;
public static String ComplianceConfigurationBlock_version_20;
public static String ComplianceConfigurationBlock_version_21;
public static String ComplianceConfigurationBlock_version_22;
public static String ComplianceConfigurationBlock_versionCLDC11;
public static String ComplianceConfigurationBlock_src_greater_compliance;
public static String ComplianceConfigurationBlock_classfile_greater_compliance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2000, 2023 IBM Corporation and others.
# Copyright (c) 2000, 2024 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -617,6 +617,7 @@ ComplianceConfigurationBlock_version_18=18
ComplianceConfigurationBlock_version_19=19
ComplianceConfigurationBlock_version_20=20
ComplianceConfigurationBlock_version_21=21
ComplianceConfigurationBlock_version_22=22
ComplianceConfigurationBlock_versionCLDC11=CLDC 1.1

ComplianceConfigurationBlock_needsbuild_title=Compiler Settings Changed
Expand Down

0 comments on commit c7ecdca

Please sign in to comment.