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 @@ -33,6 +33,7 @@
import org.eclipse.debug.ui.IValueDetailListener;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.debug.core.IEvaluationRunnable;
import org.eclipse.jdt.debug.core.IJavaArray;
import org.eclipse.jdt.debug.core.IJavaArrayType;
Expand Down Expand Up @@ -466,6 +467,17 @@ private Expression getCompiledExpression(IJavaObject javaObject, IJavaDebugTarge
.getCompiledExpression(snippet, javaObject);
if (res != null) {
Expression exp = new Expression(res, evaluationEngine);
if (exp.getExpression().hasErrors()) {
boolean hasModuleError = false;
for (int prblemID : exp.getExpression().getProblemIDs()) {
if (prblemID == IProblem.ConflictingPackageFromModules || prblemID == IProblem.ConflictingPackageFromOtherModules) {
hasModuleError = true;
}
}
if (hasModuleError) {
return null;
}
}
fCacheMap.put(key, exp);
return exp;
}
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.debug/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.debug; singleton:=true
Bundle-Version: 3.23.100.qualifier
Bundle-Version: 3.24.0.qualifier
Bundle-ClassPath: jdimodel.jar
Bundle-Activator: org.eclipse.jdt.internal.debug.core.JDIDebugPlugin
Bundle-Vendor: %providerName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -13,6 +13,8 @@
*******************************************************************************/
package org.eclipse.jdt.debug.eval;

import java.util.List;

import org.eclipse.jdt.core.dom.Message;

/**
Expand Down Expand Up @@ -62,4 +64,12 @@ public interface ICompiledExpression {
*/
public String[] getErrorMessages();

/**
* Returns the list of <code>IProblem</code> id's of the compiled expression
*
* @return the list of IProblem id's of the compiled expression
* @since 3.24
*/
public List<Integer> getProblemIDs();

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2024 IBM Corporation and others.
* Copyright (c) 2000, 2025 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 @@ -630,6 +630,7 @@ private ICompiledExpression createExpressionFromAST(String snippet, EvaluationSo
DebugPlugin.log(new Status(IStatus.WARNING, DebugPlugin.getUniqueIdentifier(), "Compile error during code evaluation: " //$NON-NLS-1$
+ problem.getMessage()));
}
errorSequence.addProblemID(problemId);
}
}
if (snippetError || runMethodError) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2015 IBM Corporation and others.
* Copyright (c) 2000, 2025 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 @@ -30,11 +30,13 @@ public class InstructionSequence implements ICompiledExpression {
private final List<String> fErrors;
private final String fSnippet;
private CoreException fException;
private final List<Integer> fProblemIDs;

public InstructionSequence(String snippet) {
fInstructions = new ArrayList<>(10);
fErrors = new ArrayList<>();
fSnippet = snippet;
fProblemIDs = new ArrayList<>();
}

/**
Expand Down Expand Up @@ -147,4 +149,20 @@ public Instruction get(int address) {
public int getEnd() {
return fInstructions.size() - 1;
}

/**
* Adds the <code>IProblem<code> id of the error.
*/
public void addProblemID(int probID) {
fProblemIDs.add(probID);
}

/**
* @see org.eclipse.jdt.debug.eval.ICompiledExpression#getProblemIDs()
*/
@Override
public List<Integer> getProblemIDs() {
return fProblemIDs;
}

}
Loading