onCloseMethod = clazz.getMethod(onCloseMethod.getName(), onCloseMethod.getParameterTypes());
onErrorMethod = clazz.getMethod(onErrorMethod.getName(), onErrorMethod.getParameterTypes());
} catch (NoSuchMethodException e) {
throw new DeploymentException(e.getMessage(), e);
}
<BUG>if (endpoint != null) {
this.onOpen = onOpenMethod;</BUG>
this.onClose = onCloseMethod;
this.onError = onErrorMethod;
} else {

onCloseMethod = clazz.getMethod(onCloseMethod.getName(), onCloseMethod.getParameterTypes());
onErrorMethod = clazz.getMethod(onErrorMethod.getName(), onErrorMethod.getParameterTypes());
} catch (NoSuchMethodException e) {
throw new DeploymentException(e.getMessage(), e);
}
if (programmaticEndpoint) {
this.onOpen = onOpenMethod;
this.onClose = onCloseMethod;
this.onError = onErrorMethod;
} else {
