Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 173898 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/debug/core/logicalstructures/JavaLogicalStructure.java (-5 / +45 lines)
Lines 10-16 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.debug.core.logicalstructures;
11
package org.eclipse.jdt.internal.debug.core.logicalstructures;
12
12
13
import com.ibm.icu.text.MessageFormat;
13
import java.util.HashMap;
14
import java.util.Map;
14
15
15
import org.eclipse.core.resources.IResource;
16
import org.eclipse.core.resources.IResource;
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.CoreException;
Lines 21-26 Link Here
21
import org.eclipse.debug.core.DebugEvent;
22
import org.eclipse.debug.core.DebugEvent;
22
import org.eclipse.debug.core.DebugException;
23
import org.eclipse.debug.core.DebugException;
23
import org.eclipse.debug.core.DebugPlugin;
24
import org.eclipse.debug.core.DebugPlugin;
25
import org.eclipse.debug.core.IDebugEventSetListener;
24
import org.eclipse.debug.core.ILogicalStructureType;
26
import org.eclipse.debug.core.ILogicalStructureType;
25
import org.eclipse.debug.core.IStatusHandler;
27
import org.eclipse.debug.core.IStatusHandler;
26
import org.eclipse.debug.core.model.IDebugTarget;
28
import org.eclipse.debug.core.model.IDebugTarget;
Lines 47-53 Link Here
47
import org.eclipse.jdt.debug.eval.IEvaluationResult;
49
import org.eclipse.jdt.debug.eval.IEvaluationResult;
48
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
50
import org.eclipse.jdt.internal.debug.core.JDIDebugPlugin;
49
51
50
public class JavaLogicalStructure implements ILogicalStructureType {
52
import com.ibm.icu.text.MessageFormat;
53
54
public class JavaLogicalStructure implements ILogicalStructureType, IDebugEventSetListener {
51
55
52
	private static IStatusHandler fgStackFrameProvider;
56
	private static IStatusHandler fgStackFrameProvider;
53
57
Lines 77-82 Link Here
77
     * or <code>null</code> if this structure was defined by the user.
81
     * or <code>null</code> if this structure was defined by the user.
78
	 */
82
	 */
79
    private String fContributingPluginId= null;
83
    private String fContributingPluginId= null;
84
    
85
    private Map fCache = new HashMap();
80
	
86
	
81
	/**
87
	/**
82
	 * Performs the evaluations.
88
	 * Performs the evaluations.
Lines 176-181 Link Here
176
		fValue= value;
182
		fValue= value;
177
		fDescription= description;
183
		fDescription= description;
178
		fVariables= variables;
184
		fVariables= variables;
185
		init();
186
	}
187
	
188
	public void init() {
189
		DebugPlugin.getDefault().addDebugEventListener(this);
179
	}
190
	}
180
191
181
	/**
192
	/**
Lines 210-215 Link Here
210
			fVariables[j][1]= variableValue;
221
			fVariables[j][1]= variableValue;
211
		}
222
		}
212
        fContributingPluginId= configurationElement.getContributor().getName();
223
        fContributingPluginId= configurationElement.getContributor().getName();
224
        init();
213
	}
225
	}
214
	
226
	
215
	/**
227
	/**
Lines 222-231 Link Here
222
		return getType((IJavaObject) value) != null;
234
		return getType((IJavaObject) value) != null;
223
	}
235
	}
224
236
225
	/**
237
	
226
	 * @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate#getLogicalStructure(IValue)
238
	/* (non-Javadoc)
239
	 * @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate#getLogicalStructure(org.eclipse.debug.core.model.IValue)
227
	 */
240
	 */
228
	public IValue getLogicalStructure(IValue value) {
241
	public synchronized IValue getLogicalStructure(IValue value) throws CoreException {
242
		IValue logical = (IValue) fCache.get(value);
243
		if (logical != null) {
244
			return logical;
245
		}
246
		logical = internalGetLogicalStructure(value);
247
		if (logical != null) {
248
			fCache.put(value, logical);
249
		}
250
		return logical;
251
	}
252
253
	private IValue internalGetLogicalStructure(IValue value) {
229
		if (!(value instanceof IJavaObject)) {
254
		if (!(value instanceof IJavaObject)) {
230
			return value;
255
			return value;
231
		}
256
		}
Lines 477-480 Link Here
477
	public String getId() {
502
	public String getId() {
478
		return JDIDebugPlugin.getUniqueIdentifier() + fType + fDescription;
503
		return JDIDebugPlugin.getUniqueIdentifier() + fType + fDescription;
479
	}
504
	}
505
506
	/* (non-Javadoc)
507
	 * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
508
	 */
509
	public synchronized void handleDebugEvents(DebugEvent[] events) {
510
		for (int i = 0; i < events.length; i++) {
511
			DebugEvent event = events[i];
512
			if (event.getKind() == DebugEvent.RESUME) {
513
				if (event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
514
					fCache.clear();
515
				}
516
			}
517
		}
518
		
519
	}
480
}
520
}

Return to bug 173898