* <code>false</code>, the request will be a method exit request.
*/
private EventRequest createMethodRequest(JDIDebugTarget target,
Object classFilter, boolean entry) throws CoreException {
EventRequest request = null;
EventRequestManager manager = target.getEventRequestManager();
if (manager != null) {
try {
if (entry) {
if (classFilter instanceof ClassType && getMethodName() != null
&& getMethodSignature() != null) {
// use a line breakpoint if possible for better performance
ClassType clazz = (ClassType) classFilter;
if (clazz.name().equals(getTypeName())) {
// only use line breakpoint when there is an exact match
Method method = clazz.concreteMethodByName(
getMethodName(), getMethodSignature());
if (method != null && !method.isNative()) {
Location location = method.location();
if (location != null && location.codeIndex() != -1) {
request = manager
.createBreakpointRequest(location);
}
}
}
}
if (request == null) {
request = manager.createMethodEntryRequest();
if (classFilter instanceof String) {
((MethodEntryRequest) request)
.addClassFilter((String) classFilter);
} else if (classFilter instanceof ReferenceType) {
((MethodEntryRequest) request)
.addClassFilter((ReferenceType) classFilter);
}
}
} else {
request = manager.createMethodExitRequest();
if (classFilter instanceof String) {
((MethodExitRequest) request)
.addClassFilter((String) classFilter);
} else if (classFilter instanceof ReferenceType) {
((MethodExitRequest) request)