public void visitStaticMethodCallExpression(StaticMethodCallExpression call) { call.getArguments().visit(this); }
public static Expression getArguments(Expression invocation) { if (invocation instanceof MethodCallExpression) return ((MethodCallExpression) invocation).getArguments(); if (invocation instanceof StaticMethodCallExpression) return ((StaticMethodCallExpression) invocation).getArguments(); if (invocation instanceof ConstructorCallExpression) return ((ConstructorCallExpression) invocation).getArguments(); return null; }
public void visitStaticMethodCallExpression(final StaticMethodCallExpression call) { assertExpressionAuthorized(call); final String typeName = call.getOwnerType().getName(); if (receiversWhiteList != null && !receiversWhiteList.contains(typeName)) { throw new SecurityException("Method calls not allowed on [" + typeName + "]"); } else if (receiversBlackList != null && receiversBlackList.contains(typeName)) { throw new SecurityException("Method calls not allowed on [" + typeName + "]"); } call.getArguments().visit(this); }
@Override public void visitStaticMethodCallExpression(StaticMethodCallExpression expression) { if (expression.getNodeMetaData(StatementMeta.class)!=null) return; super.visitStaticMethodCallExpression(expression); setMethodTarget(expression,expression.getMethod(), expression.getArguments(), true); }
public void writeInvokeStaticMethod(StaticMethodCallExpression call) { makeCall(call, new ClassExpression(call.getOwnerType()), new ConstantExpression(call.getMethod()), call.getArguments(), InvocationWriter.invokeStaticMethod, false, false, false); }
@Override public void visitStaticMethodCallExpression(StaticMethodCallExpression expr) { StaticMethodCallExpression result = new StaticMethodCallExpression( expr.getOwnerType(), expr.getMethod(), replaceExpr(expr.getArguments())); result.setType(expr.getType()); result.setSourcePosition(expr); replaceVisitedExpressionWith(result); }
@Override public void visitStaticMethodCallExpression(StaticMethodCallExpression expr) { StaticMethodCallExpression conversion = new StaticMethodCallExpression( expr.getOwnerType(), recordNa(expr.getMethod()), convert(expr.getArguments())); conversion.setSourcePosition(expr); conversion.setMetaMethod(expr.getMetaMethod()); result = record(conversion); }
Expression transformStaticMethodCallExpression(final StaticMethodCallExpression orig) { MethodNode target = (MethodNode) orig.getNodeMetaData(StaticTypesMarker.DIRECT_METHOD_CALL_TARGET); if (target != null) { MethodCallExpression call = new MethodCallExpression( new ClassExpression(orig.getOwnerType()), orig.getMethod(), orig.getArguments() ); call.setMethodTarget(target); call.setSourcePosition(orig); call.copyNodeMetaData(orig); return transformer.transform(call); } return transformer.superTransform(orig); }
Expression callArguments = call.getArguments();
String baseName = fieldNode.isStatic() ? Traits.STATIC_INIT_METHOD : Traits.INIT_METHOD; StaticMethodCallExpression mce = callX(helperClassNode, baseName + fieldNode.getName(), args(varX("this"))); if (helperClassNode.hasPossibleStaticMethod(mce.getMethod(), mce.getArguments())) { Statement stmt = stmt(assignX(varX(fieldNode.getName(), fieldNode.getType()), mce)); if (isStatic == 0) {
new VariableExpression(weaved), call.getMethod(), transform(call.getArguments()) ); result.setSafe(false);
public void visitStaticMethodCallExpression(final StaticMethodCallExpression call) { assertExpressionAuthorized(call); final String typeName = call.getOwnerType().getName(); if (receiversWhiteList != null && !receiversWhiteList.contains(typeName)) { throw new SecurityException("Method calls not allowed on [" + typeName + "]"); } else if (receiversBlackList != null && receiversBlackList.contains(typeName)) { throw new SecurityException("Method calls not allowed on [" + typeName + "]"); } call.getArguments().visit(this); }
@Override public void visitStaticMethodCallExpression(StaticMethodCallExpression expression) { List<MethodNode> possibleMethods = expression.getOwnerType().getMethods(expression.getMethodAsString()); if (!possibleMethods.isEmpty() && expression.getArguments() instanceof ArgumentListExpression) { ArgumentListExpression actualArguments = (ArgumentListExpression) expression.getArguments(); possibleMethods.stream() .filter(method -> areEquals(method.getParameters(), actualArguments)) .forEach(method -> indexer.addReference(createLocation(method), createLocation(expression))); } super.visitStaticMethodCallExpression(expression); }
@Override public void visitStaticMethodCallExpression(StaticMethodCallExpression expression) { if (expression.getNodeMetaData(StatementMeta.class)!=null) return; super.visitStaticMethodCallExpression(expression); setMethodTarget(expression,expression.getMethod(), expression.getArguments(), true); }
public void writeInvokeStaticMethod(StaticMethodCallExpression call) { makeCall(call, new ClassExpression(call.getOwnerType()), new ConstantExpression(call.getMethod()), call.getArguments(), InvocationWriter.invokeStaticMethod, false, false, false); }
@Override public void visitStaticMethodCallExpression(StaticMethodCallExpression call) { String method = call.getMethod(); Expression arguments = call.getArguments(); if (isCandidateWhereMethod(method, arguments)) { ClassNode classNode = call.getOwnerType(); visitMethodCall(classNode, arguments); } super.visitStaticMethodCallExpression(call); }
public void visitStaticMethodCallExpression(StaticMethodCallExpression call) { onLineNumber(call, "visitStaticMethodCallExpression: \"" + call.getMethod() + "\":"); makeCall( new ClassExpression(call.getOwnerType()), new ConstantExpression(call.getMethod()), call.getArguments(), invokeStaticMethod, false, false, false); }
@Override public void run() { loc(exp); literal(exp.getOwnerType()); literal(exp.getMethod()); visit(((TupleExpression) exp.getArguments()).getExpressions()); } });
public void visitStaticMethodCallExpression(StaticMethodCallExpression call) { onLineNumber(call, "visitStaticMethodCallExpression: \"" + call.getMethod() + "\":"); makeCall( new ClassExpression(call.getOwnerType()), new ConstantExpression(call.getMethod()), call.getArguments(), invokeStaticMethod, false, false, false); }
@Override public void visitStaticMethodCallExpression(StaticMethodCallExpression expr) { StaticMethodCallExpression result = new StaticMethodCallExpression( expr.getOwnerType(), expr.getMethod(), replaceExpr(expr.getArguments())); result.setType(expr.getType()); result.setSourcePosition(expr); replaceVisitedExpressionWith(result); }