@Override public void unregisterBreakpoint( @NotNull XLineBreakpoint<CloudLineBreakpointProperties> ideBreakpoint, boolean temporary) { // If the state was set to disabled as a result of a server update, // then we do not need to update the server side. if (!ideBreakpoint.getProperties().isDisabledByServer()) { String breakpointId = ideBreakpoint.getUserData(CLOUD_ID); if (!Strings.isNullOrEmpty(breakpointId)) { process.getStateController().deleteBreakpointAsync(breakpointId); } else { LOG.warn("could not delete breakpoint because it was not added through the cloud handler."); } } // reset this flag: either it has been disabled by the server or the client has deleted it, in // both cases we need to add it again, if it is re-enabled ideBreakpoint.getProperties().setAddedOnServer(false); } }
@SuppressWarnings("ConstantConditions") @Override public void saveTo(@NotNull final XLineBreakpoint<CloudLineBreakpointProperties> ideBreakpoint) { CloudLineBreakpointProperties properties = ideBreakpoint.getProperties(); if (properties == null) { LOG.error( "Could not save changes to the breakpoint because for some reason it does not have cloud " + "properties."); return; } XBreakpointBase lineBreakpointImpl = ideBreakpoint instanceof XBreakpointBase ? (XBreakpointBase) ideBreakpoint : null; if (rootNode != null && lineBreakpointImpl != null) { List<String> expressionsToSave = new ArrayList<String>(); List<? extends WatchNode> children = rootNode.getAllChildren(); if (children != null) { for (WatchNode node : rootNode.getAllChildren()) { expressionsToSave.add(node.getExpression().getExpression()); } if (properties.setWatchExpressions( expressionsToSave.toArray(new String[expressionsToSave.size()]))) { lineBreakpointImpl.fireBreakpointChanged(); } } } }
.getProperties() .setWatchExpressions( serverBreakpoint newXIdeBreakpoint.getProperties().setCreatedByServer(false); com.intellij.debugger.ui.breakpoints.Breakpoint cloudIdeBreakpoint = BreakpointManager.getJavaBreakpoint(newXIdeBreakpoint);
when(xLineBreakpoint.getProperties()).thenReturn(cloudLineBreakpointProperties);
null); List<XExpression> watches = new ArrayList<XExpression>(); for (String watchExpression : breakpoint.getProperties().getWatchExpressions()) { watches.add( debuggerEditorsProvider.createExpression(
isA(CloudLineBreakpointProperties.class))) .thenReturn(mockLineBreakpoint); when(mockLineBreakpoint.getProperties()).thenReturn(new CloudLineBreakpointProperties()); VirtualFile projectDir = mock(VirtualFile.class); when(projectDir.getPath()).thenReturn("/project/dir");
if (ideBreakpoint.getProperties().isCreatedByServer()) { if (ideBreakpoint.getProperties().isAddedOnServer() && !ideBreakpoint.getProperties().isDisabledByServer()) {