예제 #1
0
  protected boolean shouldDisplay(
      EvaluationContext context, @NotNull ObjectReference objInstance, @NotNull Field field) {
    final boolean isSynthetic = DebuggerUtils.isSynthetic(field);
    if (!SHOW_SYNTHETICS && isSynthetic) {
      return false;
    }
    if (SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES && isSynthetic) {
      try {
        final StackFrameProxy frameProxy = context.getFrameProxy();
        if (frameProxy != null) {
          final Location location = frameProxy.location();
          if (location != null
              && objInstance.equals(context.getThisObject())
              && Comparing.equal(objInstance.referenceType(), location.declaringType())
              && StringUtil.startsWith(
                  field.name(), FieldDescriptorImpl.OUTER_LOCAL_VAR_FIELD_PREFIX)) {
            return false;
          }
        }
      } catch (EvaluateException ignored) {
      }
    }
    if (!SHOW_STATIC && field.isStatic()) {
      return false;
    }

    if (!SHOW_STATIC_FINAL && field.isStatic() && field.isFinal()) {
      return false;
    }

    return true;
  }
 protected boolean isXtextSourced(final SuspendContext context) {
   try {
     StackFrameProxy _frameProxy = context.getFrameProxy();
     final Location location = _frameProxy.location();
     DebugProcess _debugProcess = context.getDebugProcess();
     URI _findOriginalDeclaration =
         this._debugProcessExtensions.findOriginalDeclaration(_debugProcess, location);
     return (!Objects.equal(_findOriginalDeclaration, null));
   } catch (Throwable _e) {
     throw Exceptions.sneakyThrow(_e);
   }
 }
 public boolean isEmptyAnonymousClassConstructor(final SuspendContext context) {
   try {
     StackFrameProxy _frameProxy = context.getFrameProxy();
     final Location location = _frameProxy.location();
     boolean _notEquals = (!Objects.equal(location, null));
     if (_notEquals) {
       final Method method = location.method();
       if (((((!Objects.equal(method, null)) && method.isConstructor())
               && method.argumentTypes().isEmpty())
           && (method.declaringType().name().indexOf("$") > 0))) {
         return true;
       }
     }
     return false;
   } catch (Throwable _e) {
     throw Exceptions.sneakyThrow(_e);
   }
 }
 @Override
 public boolean isApplicable(final SuspendContext context) {
   try {
     if ((Objects.equal(context, null) || (!this.isXtextSourced(context)))) {
       return false;
     }
     final DebugProcess debugProcess = context.getDebugProcess();
     final PositionManager positionManager = debugProcess.getPositionManager();
     StackFrameProxy _frameProxy = context.getFrameProxy();
     final Location location = _frameProxy.location();
     boolean _isEmptyAnonymousClassConstructor = this.isEmptyAnonymousClassConstructor(context);
     if (_isEmptyAnonymousClassConstructor) {
       return true;
     }
     SourcePosition _sourcePosition = positionManager.getSourcePosition(location);
     final boolean result = Objects.equal(_sourcePosition, null);
     if (result) {
       return true;
     }
     return false;
   } catch (Throwable _e) {
     throw Exceptions.sneakyThrow(_e);
   }
 }
예제 #5
0
파일: FramesPanel.java 프로젝트: jexp/idea2
 /*invoked in swing thread*/
 private void selectFrame(StackFrameProxy frame) {
   synchronized (myFramesList) {
     final int count = myFramesList.getElementCount();
     final Object selectedValue = myFramesList.getSelectedValue();
     final DefaultListModel model = myFramesList.getModel();
     for (int idx = 0; idx < count; idx++) {
       final Object elem = model.getElementAt(idx);
       if (elem instanceof StackFrameDescriptorImpl) {
         final StackFrameDescriptorImpl item = (StackFrameDescriptorImpl) elem;
         if (frame.equals(item.getFrameProxy())) {
           if (!item.equals(selectedValue)) {
             myFramesList.setSelectedIndex(idx);
           }
           return;
         }
       }
     }
   }
 }