public MethodNode(String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code) { this.name = name; this.modifiers = modifiers; this.code = code; setReturnType(returnType); VariableScope scope = new VariableScope(); setVariableScope(scope); setParameters(parameters); this.hasDefault = false; this.exceptions = exceptions; this.staticConstructor = (name != null && name.equals("<clinit>")); }
public void setParameters(Parameter[] parameters) { invalidateCachedData(); VariableScope scope = new VariableScope(); this.parameters = parameters; if (parameters != null && parameters.length > 0) { for (Parameter para : parameters) { if (para.hasInitialExpression()) { this.hasDefaultValue = true; } para.setInStaticContext(isStatic()); scope.putDeclaredVariable(para); } } setVariableScope(scope); }
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor) { pushState(node.isStatic()); inConstructor = isConstructor; node.setVariableScope(currentScope); visitAnnotations(node); // GROOVY-2156 Parameter[] parameters = node.getParameters(); for (Parameter parameter : parameters) { visitAnnotations(parameter); } declare(node.getParameters(), node); visitClassCodeContainer(node.getCode()); popState(); }
private MethodNode copyMethod(MethodNode method, String newName) { // can't hurt to set return type to void MethodNode newMethod = new MethodNode(newName, method.getModifiers(), ClassHelper.VOID_TYPE, method.getParameters(), method.getExceptions(), method.getCode()); newMethod.addAnnotations(method.getAnnotations()); newMethod.setSynthetic(method.isSynthetic()); newMethod.setDeclaringClass(method.getDeclaringClass()); newMethod.setSourcePosition(method); newMethod.setVariableScope(method.getVariableScope()); newMethod.setGenericsTypes(method.getGenericsTypes()); newMethod.setAnnotationDefault(method.hasAnnotationDefault()); return newMethod; }
"Must have a VariableScope by now! for expression: " + expression + " class: " + name); } else { method.setVariableScope(varScope.copy());
public MethodNode(String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code) { this.name = name; this.modifiers = modifiers; this.code = code; setReturnType(returnType); VariableScope scope = new VariableScope(); setVariableScope(scope); setParameters(parameters); this.hasDefault = false; this.exceptions = exceptions; this.staticConstructor = (name != null && name.equals("<clinit>")); }
public MethodNode(String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code) { this.name = name; this.modifiers = modifiers; this.code = code; setReturnType(returnType); VariableScope scope = new VariableScope(); setVariableScope(scope); setParameters(parameters); this.hasDefault = false; this.exceptions = exceptions; }
public MethodNode(String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code) { this.name = name; this.modifiers = modifiers; this.code = code; setReturnType(returnType); VariableScope scope = new VariableScope(); setVariableScope(scope); setParameters(parameters); this.hasDefault = false; this.exceptions = exceptions; }
public MethodNode(String name, int modifiers, ClassNode returnType, Parameter[] parameters, ClassNode[] exceptions, Statement code) { this.name = name; this.modifiers = modifiers; this.code = code; setReturnType(returnType); VariableScope scope = new VariableScope(); setVariableScope(scope); setParameters(parameters); this.exceptions = exceptions; }
public void setParameters(Parameter[] parameters) { invalidateCachedData(); VariableScope scope = new VariableScope(); this.parameters = parameters; if (parameters != null && parameters.length > 0) { for (Parameter para : parameters) { if (para.hasInitialExpression()) { this.hasDefaultValue = true; } para.setInStaticContext(isStatic()); scope.putDeclaredVariable(para); } } setVariableScope(scope); }
public void setParameters(Parameter[] parameters) { invalidateCachedData(); VariableScope scope = new VariableScope(); this.parameters = parameters; if (parameters != null && parameters.length > 0) { for (int i = 0; i < parameters.length; i++) { Parameter para = parameters[i]; if (para.hasInitialExpression()) { this.hasDefaultValue = true; } para.setInStaticContext(isStatic()); scope.putDeclaredVariable(para); } } setVariableScope(scope); }
public void setParameters(Parameter[] parameters) { invalidateCachedData(); VariableScope scope = new VariableScope(); this.parameters = parameters; if (parameters != null && parameters.length > 0) { for (int i = 0; i < parameters.length; i++) { Parameter para = parameters[i]; if (para.hasInitialExpression()) { this.hasDefaultValue = true; } para.setInStaticContext(isStatic()); scope.putDeclaredVariable(para); } } setVariableScope(scope); }
public void setParameters(Parameter[] parameters) { invalidateCachedData(); VariableScope scope = new VariableScope(); this.parameters = parameters; if (parameters != null && parameters.length > 0) { for (int i = 0; i < parameters.length; i++) { Parameter para = parameters[i]; if (para.hasInitialExpression()) { this.hasDefaultValue = true; } para.setInStaticContext(isStatic()); scope.putDeclaredVariable(para); } } setVariableScope(scope); }
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor) { pushState(node.isStatic()); node.setVariableScope(currentScope); // GROOVY-2156 Parameter[] parameters = node.getParameters(); for (int i = 0; i < parameters.length; i++) { Parameter parameter = parameters[i]; visitAnnotations(parameter); } declare(node.getParameters(), node); super.visitConstructorOrMethod(node, isConstructor); popState(); }
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor) { pushState(node.isStatic()); node.setVariableScope(currentScope); // GROOVY-2156 Parameter[] parameters = node.getParameters(); for (int i = 0; i < parameters.length; i++) { Parameter parameter = parameters[i]; visitAnnotations(parameter); } declare(node.getParameters(), node); super.visitConstructorOrMethod(node, isConstructor); popState(); }
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor) { pushState(node.isStatic()); node.setVariableScope(currentScope); // GROOVY-2156 Parameter[] parameters = node.getParameters(); for (int i = 0; i < parameters.length; i++) { Parameter parameter = parameters[i]; visitAnnotations(parameter); } declare(node.getParameters(), node); super.visitConstructorOrMethod(node, isConstructor); popState(); }
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor) { pushState(node.isStatic()); inConstructor = isConstructor; node.setVariableScope(currentScope); visitAnnotations(node); // GROOVY-2156 Parameter[] parameters = node.getParameters(); for (Parameter parameter : parameters) { visitAnnotations(parameter); } declare(node.getParameters(), node); visitClassCodeContainer(node.getCode()); popState(); }
"Must have a VariableScope by now! for expression: " + expression + " class: " + name); } else { method.setVariableScope(varScope.copy());
"Must have a VariableScope by now! for expression: " + expression + " class: " + name); } else { method.setVariableScope(varScope.copy());
"Must have a VariableScope by now! for expression: " + expression + " class: " + name); } else { method.setVariableScope(varScope.copy());