private static int hasSpawnpointChanges(IMarkerDelta delta, IScriptBreakpoint breakpoint) {
   final String[] attrs = breakpoint.getUpdatableAttributes();
   try {
     final IMarker marker = delta.getMarker();
     for (int i = 0; i < attrs.length; ++i) {
       final String attr = attrs[i];
       if (IBreakpoint.ENABLED.equals(attr) || IMarker.LINE_NUMBER.equals(attr)) {
         final Object oldValue = delta.getAttribute(attr);
         final Object newValue = marker.getAttribute(attr);
         if (oldValue == null) {
           if (newValue != null) {
             return IMarker.LINE_NUMBER.equals(attr) ? MAJOR_CHANGE : MINOR_CHANGE;
           }
           continue;
         }
         if (newValue == null) {
           return IMarker.LINE_NUMBER.equals(attr) ? MAJOR_CHANGE : MINOR_CHANGE;
         }
         if (!oldValue.equals(newValue)) {
           return IMarker.LINE_NUMBER.equals(attr) ? MAJOR_CHANGE : MINOR_CHANGE;
         }
       }
     }
   } catch (CoreException e) {
     DLTKDebugPlugin.log(e);
   }
   return NO_CHANGES;
 }
  private int hasBreakpointChanges(IMarkerDelta delta, IScriptBreakpoint breakpoint) {
    final String[] attrs = breakpoint.getUpdatableAttributes();
    try {
      final IMarker marker = delta.getMarker();
      for (int i = 0; i < attrs.length; ++i) {
        final String attr = attrs[i];

        final Object oldValue = delta.getAttribute(attr);
        final Object newValue = marker.getAttribute(attr);

        if (oldValue == null) {
          if (newValue != null) {
            return classifyBreakpointChange(delta, breakpoint, attr);
          }
          continue;
        }
        if (newValue == null) {
          return classifyBreakpointChange(delta, breakpoint, attr);
        }
        if (!oldValue.equals(newValue)) {
          return classifyBreakpointChange(delta, breakpoint, attr);
        }
      }
    } catch (CoreException e) {
      DLTKDebugPlugin.log(e);
    }
    return NO_CHANGES;
  }
 private int classifyBreakpointChange(
     IMarkerDelta delta, IScriptBreakpoint breakpoint, String attr) throws CoreException {
   final boolean conditional = ScriptBreakpointUtils.isConditional(breakpoint);
   if (conditional && AbstractScriptBreakpoint.EXPRESSION.equals(attr)) {
     return MAJOR_CHANGE;
   }
   final boolean oldExprState =
       delta.getAttribute(AbstractScriptBreakpoint.EXPRESSION_STATE, false);
   final String oldExpr = delta.getAttribute(AbstractScriptBreakpoint.EXPRESSION, null);
   if (ScriptBreakpointUtils.isConditional(oldExprState, oldExpr) != conditional) {
     return MAJOR_CHANGE;
   }
   if (IMarker.LINE_NUMBER.equals(attr)
       && !target.getOptions().get(DebugOption.DBGP_BREAKPOINT_UPDATE_LINE_NUMBER)) {
     return MAJOR_CHANGE;
   }
   return MINOR_CHANGE;
 }
示例#4
0
 private boolean isErrorDelta(IResourceDelta delta) {
   if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) {
     IMarkerDelta[] markerDeltas = delta.getMarkerDeltas();
     for (IMarkerDelta markerDelta : markerDeltas) {
       if (markerDelta.isSubtypeOf(IMarker.PROBLEM)) {
         int kind = markerDelta.getKind();
         if (kind == IResourceDelta.ADDED || kind == IResourceDelta.REMOVED) return true;
         int severity = markerDelta.getAttribute(IMarker.SEVERITY, -1);
         int newSeverity = markerDelta.getMarker().getAttribute(IMarker.SEVERITY, -1);
         if (newSeverity != severity) return true;
       }
     }
   }
   return false;
 }