in com.microsoft.java.debug.core/src/main/java/com/microsoft/java/debug/core/adapter/handler/SetBreakpointsRequestHandler.java [217:262]
public static boolean handleEvaluationResult(IDebugAdapterContext context, ThreadReference bpThread, IEvaluatableBreakpoint breakpoint,
Value value, Throwable ex) {
if (StringUtils.isNotBlank(breakpoint.getLogMessage())) {
if (ex != null) {
logger.log(Level.SEVERE, String.format("[Logpoint]: %s", ex.getMessage() != null ? ex.getMessage() : ex.toString()), ex);
context.getProtocolServer().sendEvent(new Events.UserNotificationEvent(
Events.UserNotificationEvent.NotificationType.ERROR,
String.format("[Logpoint] Log message '%s' error: %s", breakpoint.getLogMessage(), ex.getMessage())));
}
return true;
} else {
boolean resume = false;
boolean resultNotBoolean = false;
if (value != null && ex == null) {
if (value instanceof BooleanValue) {
resume = !((BooleanValue) value).booleanValue();
} else if (value instanceof ObjectReference
&& ((ObjectReference) value).type().name().equals("java.lang.Boolean")) {
// get boolean value from java.lang.Boolean object
Field field = ((ReferenceType) ((ObjectReference) value).type()).fieldByName("value");
resume = !((BooleanValue) ((ObjectReference) value).getValue(field)).booleanValue();
} else {
resultNotBoolean = true;
}
}
if (resume) {
return true;
} else {
if (context.isVmTerminated()) {
// do nothing
} else if (ex != null) {
if (!(ex instanceof VMDisconnectedException || ex.getCause() instanceof VMDisconnectedException)) {
logger.log(Level.SEVERE, String.format("[ConditionalBreakpoint]: %s", ex.getMessage() != null ? ex.getMessage() : ex.toString()), ex);
context.getProtocolServer().sendEvent(new Events.UserNotificationEvent(
Events.UserNotificationEvent.NotificationType.ERROR,
String.format("Breakpoint condition '%s' error: %s", breakpoint.getCondition(), ex.getMessage())));
}
} else if (value == null || resultNotBoolean) {
context.getProtocolServer().sendEvent(new Events.UserNotificationEvent(
Events.UserNotificationEvent.NotificationType.WARNING,
String.format("Result of breakpoint condition '%s' is not a boolean, please correct your expression.", breakpoint.getCondition())));
}
return false;
}
}
}