protected boolean isClosureCall(final String name, final Expression objectExpression, final Expression arguments) { if (objectExpression instanceof ClosureExpression && ("call".equals(name) || "doCall".equals(name))) return true; if (objectExpression == VariableExpression.THIS_EXPRESSION) { FieldNode fieldNode = typeCheckingContext.getEnclosingClassNode().getDeclaredField(name); if (fieldNode != null) { ClassNode type = fieldNode.getType(); if (CLOSURE_TYPE.equals(type) && !typeCheckingContext.getEnclosingClassNode().hasPossibleMethod(name, arguments)) { return true; } } } else { if (!"call".equals(name) && !"doCall".equals(name)) return false; } return (getType(objectExpression).equals(CLOSURE_TYPE)); }
private boolean isClosureCall(MethodCallExpression call) { // are we a local variable? // it should not be an explicitly "this" qualified method call // and the current class should have a possible method ClassNode classNode = controller.getClassNode(); String methodName = call.getMethodAsString(); if (methodName==null) return false; if (!call.isImplicitThis()) return false; if (!AsmClassGenerator.isThisExpression(call.getObjectExpression())) return false; FieldNode field = classNode.getDeclaredField(methodName); if (field == null) return false; if (isStaticInvocation(call) && !field.isStatic()) return false; Expression arguments = call.getArguments(); return ! classNode.hasPossibleMethod(methodName, arguments); }
leftFieldName = ((PropertyExpression) leftExpression).getPropertyAsString(); FieldNode fn = tryGetFieldNode(weavedType, leftFieldName); if (fieldHelper == null || fn == null && !fieldHelper.hasPossibleMethod(Traits.helperSetterName(new FieldNode(leftFieldName, 0, ClassHelper.OBJECT_TYPE, weavedType, null)), rightExpression)) { return createAssignmentToField(rightExpression, operation, leftFieldName);
boolean inInnerClass = isInnerClass(currentClass); if (currentMethod != null && !currentMethod.isStatic()) { if (currentClass.hasPossibleMethod(methodName, args)) { foundInstanceMethod = true; if (currentClass.getOuterClass().hasPossibleMethod(methodName, args)) { object = new PropertyExpression(new ClassExpression(currentClass.getOuterClass()), new ConstantExpression("this")); } else if (hasPossibleStaticMethod(currentClass.getOuterClass(), methodName, args, true)
private boolean isClosureCall(MethodCallExpression call) { // are we a local variable? // it should not be an explicitly "this" qualified method call // and the current class should have a possible method String methodName = call.getMethodAsString(); if (methodName==null) return false; if (!call.isImplicitThis()) return false; if (!isThisExpression(call.getObjectExpression())) return false; //if (isNotExplicitThisInClosure(call.isImplicitThis()) return false; if (classNode.getDeclaredField(methodName) == null) return false; Expression arguments = call.getArguments(); return ! classNode.hasPossibleMethod(methodName, arguments); }
private boolean isClosureCall(MethodCallExpression call) { // are we a local variable? // it should not be an explicitly "this" qualified method call // and the current class should have a possible method String methodName = call.getMethodAsString(); if (methodName==null) return false; if (!call.isImplicitThis()) return false; if (!isThisExpression(call.getObjectExpression())) return false; //if (isNotExplicitThisInClosure(call.isImplicitThis()) return false; if (classNode.getDeclaredField(methodName) == null) return false; Expression arguments = call.getArguments(); return ! classNode.hasPossibleMethod(methodName, arguments); }
private boolean isClosureCall(MethodCallExpression call) { // are we a local variable? // it should not be an explicitly "this" qualified method call // and the current class should have a possible method String methodName = call.getMethodAsString(); if (methodName==null) return false; if (!call.isImplicitThis()) return false; if (!isThisExpression(call.getObjectExpression())) return false; FieldNode field = classNode.getDeclaredField(methodName); if (field == null) return false; if (isStaticInvocation(call) && !field.isStatic()) return false; Expression arguments = call.getArguments(); return ! classNode.hasPossibleMethod(methodName, arguments); }
private boolean isClosureCall(MethodCallExpression call) { // are we a local variable? // it should not be an explicitly "this" qualified method call // and the current class should have a possible method ClassNode classNode = controller.getClassNode(); String methodName = call.getMethodAsString(); if (methodName==null) return false; if (!call.isImplicitThis()) return false; if (!AsmClassGenerator.isThisExpression(call.getObjectExpression())) return false; FieldNode field = classNode.getDeclaredField(methodName); if (field == null) return false; if (isStaticInvocation(call) && !field.isStatic()) return false; Expression arguments = call.getArguments(); return ! classNode.hasPossibleMethod(methodName, arguments); }
boolean lookForPossibleStaticMethod = !methodName.equals("call"); if (currentMethod != null && !currentMethod.isStatic()) { if (currentClass.hasPossibleMethod(methodName, args)) { lookForPossibleStaticMethod = false;
boolean lookForPossibleStaticMethod = true; if(this.currentMethod != null && !this.currentMethod.isStatic()) { if(currentClass.hasPossibleMethod(methodName, args)) { lookForPossibleStaticMethod = false;
boolean lookForPossibleStaticMethod = true; if(this.currentMethod != null && !this.currentMethod.isStatic()) { if(currentClass.hasPossibleMethod(methodName, args)) { lookForPossibleStaticMethod = false;
boolean lookForPossibleStaticMethod = !methodName.equals("call"); if (currentMethod != null && !currentMethod.isStatic()) { if (currentClass.hasPossibleMethod(methodName, args)) { lookForPossibleStaticMethod = false;