Skip to content

Commit 5568c42

Browse files
Merge branch 'master' into BETA_JAVA25
2 parents f19bd48 + f05df38 commit 5568c42

File tree

8 files changed

+67
-53
lines changed

8 files changed

+67
-53
lines changed

org.eclipse.jdt.debug.ui/plugin.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,13 +1049,6 @@
10491049
label="%AddLambdaEntryBreakpoint.label"
10501050
menubarPath="debug">
10511051
</action>
1052-
<action
1053-
label="%EnableBreakpoint.label"
1054-
helpContextId="enable_disable_breakpoint_action_context"
1055-
class="org.eclipse.debug.ui.actions.RulerEnableDisableBreakpointActionDelegate"
1056-
menubarPath="debug"
1057-
id="org.eclipse.jdt.debug.ui.actions.EnableDisableBreakpointRulerActionDelegate">
1058-
</action>
10591052
<action
10601053
class="org.eclipse.jdt.internal.debug.ui.actions.RulerToggleHitBreakpointActionDelegate"
10611054
icon="icons/full/obj16/brkp_obj.png"
@@ -1070,6 +1063,13 @@
10701063
label="%ToggleTriggerpointAction.label"
10711064
menubarPath="debug">
10721065
</action>
1066+
<action
1067+
label="%EnableBreakpoint.label"
1068+
helpContextId="enable_disable_breakpoint_action_context"
1069+
class="org.eclipse.debug.ui.actions.RulerEnableDisableBreakpointActionDelegate"
1070+
menubarPath="debug"
1071+
id="org.eclipse.jdt.debug.ui.actions.EnableDisableBreakpointRulerActionDelegate">
1072+
</action>
10731073
<action
10741074
class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
10751075
helpContextId="manage_breakpoint_action_context"

org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/JavaDetailFormattersManager.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.eclipse.debug.ui.IValueDetailListener;
3434
import org.eclipse.jdt.core.IJavaProject;
3535
import org.eclipse.jdt.core.IType;
36+
import org.eclipse.jdt.core.compiler.IProblem;
3637
import org.eclipse.jdt.debug.core.IEvaluationRunnable;
3738
import org.eclipse.jdt.debug.core.IJavaArray;
3839
import org.eclipse.jdt.debug.core.IJavaArrayType;
@@ -466,6 +467,17 @@ private Expression getCompiledExpression(IJavaObject javaObject, IJavaDebugTarge
466467
.getCompiledExpression(snippet, javaObject);
467468
if (res != null) {
468469
Expression exp = new Expression(res, evaluationEngine);
470+
if (exp.getExpression().hasErrors()) {
471+
boolean hasModuleError = false;
472+
for (int prblemID : exp.getExpression().getProblemIDs()) {
473+
if (prblemID == IProblem.ConflictingPackageFromModules || prblemID == IProblem.ConflictingPackageFromOtherModules) {
474+
hasModuleError = true;
475+
}
476+
}
477+
if (hasModuleError) {
478+
return null;
479+
}
480+
}
469481
fCacheMap.put(key, exp);
470482
return exp;
471483
}

org.eclipse.jdt.debug/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.jdt.debug; singleton:=true
5-
Bundle-Version: 3.23.150.qualifier
5+
Bundle-Version: 3.24.50.qualifier
66
Bundle-ClassPath: jdimodel.jar
77
Bundle-Activator: org.eclipse.jdt.internal.debug.core.JDIDebugPlugin
88
Bundle-Vendor: %providerName

org.eclipse.jdt.debug/eval/org/eclipse/jdt/debug/eval/ICompiledExpression.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2011 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,6 +13,8 @@
1313
*******************************************************************************/
1414
package org.eclipse.jdt.debug.eval;
1515

16+
import java.util.List;
17+
1618
import org.eclipse.jdt.core.dom.Message;
1719

1820
/**
@@ -62,4 +64,12 @@ public interface ICompiledExpression {
6264
*/
6365
public String[] getErrorMessages();
6466

67+
/**
68+
* Returns the list of <code>IProblem</code> id's of the compiled expression
69+
*
70+
* @return the list of IProblem id's of the compiled expression
71+
* @since 3.24
72+
*/
73+
public List<Integer> getProblemIDs();
74+
6575
}

org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/engine/ASTEvaluationEngine.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2024 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -630,6 +630,7 @@ private ICompiledExpression createExpressionFromAST(String snippet, EvaluationSo
630630
DebugPlugin.log(new Status(IStatus.WARNING, DebugPlugin.getUniqueIdentifier(), "Compile error during code evaluation: " //$NON-NLS-1$
631631
+ problem.getMessage()));
632632
}
633+
errorSequence.addProblemID(problemId);
633634
}
634635
}
635636
if (snippetError || runMethodError) {

org.eclipse.jdt.debug/eval/org/eclipse/jdt/internal/debug/eval/ast/instructions/InstructionSequence.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2015 IBM Corporation and others.
2+
* Copyright (c) 2000, 2025 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -30,11 +30,13 @@ public class InstructionSequence implements ICompiledExpression {
3030
private final List<String> fErrors;
3131
private final String fSnippet;
3232
private CoreException fException;
33+
private final List<Integer> fProblemIDs;
3334

3435
public InstructionSequence(String snippet) {
3536
fInstructions = new ArrayList<>(10);
3637
fErrors = new ArrayList<>();
3738
fSnippet = snippet;
39+
fProblemIDs = new ArrayList<>();
3840
}
3941

4042
/**
@@ -147,4 +149,20 @@ public Instruction get(int address) {
147149
public int getEnd() {
148150
return fInstructions.size() - 1;
149151
}
152+
153+
/**
154+
* Adds the <code>IProblem<code> id of the error.
155+
*/
156+
public void addProblemID(int probID) {
157+
fProblemIDs.add(probID);
158+
}
159+
160+
/**
161+
* @see org.eclipse.jdt.debug.eval.ICompiledExpression#getProblemIDs()
162+
*/
163+
@Override
164+
public List<Integer> getProblemIDs() {
165+
return fProblemIDs;
166+
}
167+
150168
}

org.eclipse.jdt.launching/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Export-Package: org.eclipse.jdt.internal.launching;x-friends:="org.eclipse.jdt.d
1515
org.eclipse.jdt.launching.sourcelookup.advanced,
1616
org.eclipse.jdt.launching.sourcelookup.containers
1717
Require-Bundle: org.eclipse.core.resources;bundle-version="[3.14.0,4.0.0)",
18-
org.eclipse.jdt.core;bundle-version="[3.40.0,4.0.0)",
18+
org.eclipse.jdt.core;bundle-version="[3.43.0,4.0.0)",
1919
org.eclipse.debug.core;bundle-version="[3.22.0,4.0.0)",
2020
org.eclipse.jdt.debug;bundle-version="[3.21.0,4.0.0)",
2121
org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)",

org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/environments/EnvironmentsManager.java

Lines changed: 14 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
*
99
* SPDX-License-Identifier: EPL-2.0
1010
*
11-
* This is an implementation of an early-draft specification developed under the Java
12-
* Community Process (JCP) and is made available for testing and evaluation purposes
13-
* only. The code is not compatible with any specification of the JCP.
14-
*
1511
* Contributors:
1612
* IBM Corporation - initial API and implementation
1713
*
@@ -29,6 +25,8 @@
2925
import java.util.Set;
3026
import java.util.SortedSet;
3127
import java.util.TreeSet;
28+
import java.util.regex.Matcher;
29+
import java.util.regex.Pattern;
3230

3331
import javax.xml.parsers.DocumentBuilder;
3432

@@ -68,6 +66,8 @@
6866
*/
6967
public class EnvironmentsManager implements IExecutionEnvironmentsManager, IVMInstallChangedListener, IPreferenceChangeListener {
7068

69+
private static final Pattern EE_PATTERN = Pattern.compile("(\\d+)"); //$NON-NLS-1$
70+
7171
/**
7272
* Extension configuration element name.
7373
*/
@@ -207,41 +207,15 @@ public synchronized Analyzer[] getAnalyzers() {
207207

208208
private String getExecutionEnvironmentCompliance(IExecutionEnvironment executionEnvironment) {
209209
String desc = executionEnvironment.getId();
210-
if (desc.indexOf(JavaCore.VERSION_25) != -1) {
211-
return JavaCore.VERSION_25;
212-
} else if (desc.indexOf(JavaCore.VERSION_24) != -1) {
213-
return JavaCore.VERSION_24;
214-
} else if (desc.indexOf(JavaCore.VERSION_23) != -1) {
215-
return JavaCore.VERSION_23;
216-
} else if (desc.indexOf(JavaCore.VERSION_22) != -1) {
217-
return JavaCore.VERSION_22;
218-
} else if (desc.indexOf(JavaCore.VERSION_21) != -1) {
219-
return JavaCore.VERSION_21;
220-
} else if (desc.indexOf(JavaCore.VERSION_20) != -1) {
221-
return JavaCore.VERSION_20;
222-
} else if (desc.indexOf(JavaCore.VERSION_19) != -1) {
223-
return JavaCore.VERSION_19;
224-
} else if (desc.indexOf(JavaCore.VERSION_18) != -1) {
225-
return JavaCore.VERSION_18;
226-
} else if (desc.indexOf(JavaCore.VERSION_17) != -1) {
227-
return JavaCore.VERSION_17;
228-
} else if (desc.indexOf(JavaCore.VERSION_16) != -1) {
229-
return JavaCore.VERSION_16;
230-
} else if (desc.indexOf(JavaCore.VERSION_15) != -1) {
231-
return JavaCore.VERSION_15;
232-
} else if (desc.indexOf(JavaCore.VERSION_14) != -1) {
233-
return JavaCore.VERSION_14;
234-
} else if (desc.indexOf(JavaCore.VERSION_13) != -1) {
235-
return JavaCore.VERSION_13;
236-
} else if (desc.indexOf(JavaCore.VERSION_12) != -1) {
237-
return JavaCore.VERSION_12;
238-
} else if (desc.indexOf(JavaCore.VERSION_11) != -1) {
239-
return JavaCore.VERSION_11;
240-
} else if (desc.indexOf(JavaCore.VERSION_10) != -1) {
241-
return JavaCore.VERSION_10;
242-
} else if (desc.indexOf(JavaCore.VERSION_9) != -1) {
243-
return JavaCore.VERSION_9;
244-
} else if (desc.indexOf(JavaCore.VERSION_1_8) != -1) {
210+
// For java version > 1.8 we can simply extract the version from the string by searching the numbers
211+
Matcher matcher = EE_PATTERN.matcher(desc);
212+
if (matcher.find()) {
213+
String group = matcher.group(1);
214+
if (Integer.parseInt(group) >= 9) {
215+
return group;
216+
}
217+
}
218+
if (desc.indexOf(JavaCore.VERSION_1_8) != -1) {
245219
return JavaCore.VERSION_1_8;
246220
} else if (desc.indexOf(JavaCore.VERSION_1_7) != -1) {
247221
return JavaCore.VERSION_1_7;
@@ -257,10 +231,9 @@ private String getExecutionEnvironmentCompliance(IExecutionEnvironment execution
257231
return JavaCore.VERSION_1_2;
258232
} else if (desc.indexOf(JavaCore.VERSION_1_1) != -1) {
259233
return JavaCore.VERSION_1_1;
260-
} else if (desc.indexOf("1.0") != -1) { //$NON-NLS-1$
234+
} else {
261235
return "1.0"; //$NON-NLS-1$
262236
}
263-
return JavaCore.VERSION_1_3;
264237
}
265238

266239
private synchronized void initializeExtensions() {

0 commit comments

Comments
 (0)