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 |
/** |