View | Details | Raw Unified | Return to bug 70997 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaLineBreakpoint.java (-16 / +20 lines)
Lines 235-250 Link Here
235
	 * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#newRequest(org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, com.sun.jdi.ReferenceType)
235
	 * @see org.eclipse.jdt.internal.debug.core.breakpoints.JavaBreakpoint#newRequest(org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget, com.sun.jdi.ReferenceType)
236
	 */
236
	 */
237
	protected EventRequest newRequest(JDIDebugTarget target, ReferenceType type) throws CoreException {
237
	protected EventRequest newRequest(JDIDebugTarget target, ReferenceType type) throws CoreException {
238
		Location location= null;
238
		int lineNumber = getLineNumber();			
239
		int lineNumber= getLineNumber();			
239
		List locations = determineLocations(lineNumber, type);
240
		location= determineLocation(lineNumber, type);
240
		EventRequest lastRequest = null;
241
		if (location == null) {
241
		if (locations == null || locations.isEmpty()) {
242
			// could be an inner type not yet loaded, or line information not available
242
			// could be an inner type not yet loaded, or line information not available
243
			return null;
243
			return null;
244
		} else {
245
		    Iterator iterator = locations.iterator();
246
		    while (iterator.hasNext()) {
247
		        Location location = (Location) iterator.next();
248
		        EventRequest request = createLineBreakpointRequest(location, target);
249
		        if (iterator.hasNext()) {
250
		            registerRequest(request, target);
251
		        } else {
252
		            lastRequest = request;
253
		        }
254
		    }
244
		}
255
		}
245
		
256
		return lastRequest;		
246
		EventRequest request = createLineBreakpointRequest(location, target);	
247
		return request;		
248
	}	
257
	}	
249
258
250
	/**
259
	/**
Lines 280-289 Link Here
280
	}
289
	}
281
		
290
		
282
	/**
291
	/**
283
	 * Returns a location for the line number in the given type.
292
	 * Returns a list of locations of the given line number in the given type.
284
	 * Returns <code>null</code> if a location cannot be determined.
293
	 * Returns <code>null</code> if locations cannot be determined.
285
	 */
294
	 */
286
	protected Location determineLocation(int lineNumber, ReferenceType type) {
295
	protected List determineLocations(int lineNumber, ReferenceType type) {
287
		List locations= null;
296
		List locations= null;
288
		try {
297
		try {
289
			locations= type.locationsOfLine(lineNumber);
298
			locations= type.locationsOfLine(lineNumber);
Lines 312-323 Link Here
312
			JDIDebugPlugin.log(e);
321
			JDIDebugPlugin.log(e);
313
			return null;
322
			return null;
314
		}
323
		}
315
		
324
		return locations;
316
		if (locations != null && locations.size() > 0) {
317
			return (Location) locations.get(0);
318
		} 
319
		
320
		return null;
321
	}
325
	}
322
	
326
	
323
	/**
327
	/**
(-)model/org/eclipse/jdt/internal/debug/core/breakpoints/JavaStratumLineBreakpoint.java (-6 / +10 lines)
Lines 12-17 Link Here
12
12
13
import java.util.Iterator;
13
import java.util.Iterator;
14
import java.util.List;
14
import java.util.List;
15
import java.util.ListIterator;
15
import java.util.Map;
16
import java.util.Map;
16
17
17
import org.eclipse.core.resources.IResource;
18
import org.eclipse.core.resources.IResource;
Lines 259-268 Link Here
259
	}
260
	}
260
261
261
	/**
262
	/**
262
	 * Returns a location for the line number in the given type.
263
	 * Returns a list of locations for the given line number in the given type.
263
	 * Returns <code>null</code> if a location cannot be determined.
264
	 * Returns <code>null</code> if a location cannot be determined.
264
	 */
265
	 */
265
	protected Location determineLocation(int lineNumber, ReferenceType type) {
266
	protected List determineLocations(int lineNumber, ReferenceType type) {
266
		List locations;
267
		List locations;
267
		String sourcePath;
268
		String sourcePath;
268
		try {
269
		try {
Lines 300-317 Link Here
300
		
301
		
301
		if (sourcePath == null) {
302
		if (sourcePath == null) {
302
			if (locations.size() > 0) {
303
			if (locations.size() > 0) {
303
				return (Location)locations.get(0);
304
				return locations;
304
			}
305
			}
305
		} else {
306
		} else {
306
			for (Iterator iter = locations.iterator(); iter.hasNext();) {
307
			for (ListIterator iter = locations.listIterator(); iter.hasNext();) {
307
				Location location = (Location) iter.next();
308
				Location location = (Location) iter.next();
308
				try {
309
				try {
309
					if (sourcePath.equals(location.sourcePath())) {
310
					if (!sourcePath.equals(location.sourcePath())) {
310
						return location;
311
						iter.remove();
311
					}
312
					}
312
				} catch (AbsentInformationException e1) {
313
				} catch (AbsentInformationException e1) {
313
					// nothing to do;
314
					// nothing to do;
314
				}
315
				}
316
			}
317
			if (locations.size() > 0) {
318
			    return locations;
315
			}
319
			}
316
		}
320
		}
317
		
321
		

Return to bug 70997