Esempio n. 1
0
  void validateConstructorInvocation(Method method)
      throws InvalidTypeException, InvocationException {
    /*
     * Method must be in this class.
     */
    ReferenceTypeImpl declType = (ReferenceTypeImpl) method.declaringType();
    if (!declType.equals(this)) {
      throw new IllegalArgumentException("Invalid constructor");
    }

    /*
     * Method must be a constructor
     */
    if (!method.isConstructor()) {
      throw new IllegalArgumentException("Cannot create instance with non-constructor");
    }
  }
 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);
   }
 }
 protected boolean acceptLocation(
     final DebugProcessImpl debugProcess, ReferenceType classType, final Location loc) {
   Method method = loc.method();
   // Some frameworks may create synthetic methods with lines mapped to user code, see IDEA-143852
   // if (DebuggerUtils.isSynthetic(method)) { return false; }
   if (isAnonymousClass(classType)) {
     if ((method.isConstructor() && loc.codeIndex() == 0) || method.isBridge()) return false;
   }
   return ApplicationManager.getApplication()
       .runReadAction(
           new Computable<Boolean>() {
             @Override
             public Boolean compute() {
               SourcePosition position = debugProcess.getPositionManager().getSourcePosition(loc);
               if (position == null) return false;
               JavaLineBreakpointType type = getXBreakpointType();
               if (type == null) return true;
               return type.matchesPosition(LineBreakpoint.this, position);
             }
           });
 }