@Override public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) { CtMethod<Object> m = factory.Core().createMethod(); m.setSimpleName(CharOperation.charToString(methodDeclaration.selector)); if (methodDeclaration.binding != null) { m.setExtendedModifiers(getModifiers(methodDeclaration.binding.modifiers, true, true)); } for (CtExtendedModifier extendedModifier : getModifiers(methodDeclaration.modifiers, false, true)) { m.addModifier(extendedModifier.getKind()); // avoid to keep implicit AND explicit modifier of the same kind. } m.setDefaultMethod(methodDeclaration.isDefaultMethod()); context.enter(m, methodDeclaration); // Create block if (!methodDeclaration.isAbstract() && (methodDeclaration.modifiers & ClassFileConstants.AccNative) == 0) { context.enter(getFactory().Core().createBlock(), methodDeclaration); context.exit(methodDeclaration); } // We consider the receiver as a standard argument (i.e. as a parameter) Receiver receiver = methodDeclaration.receiver; if (receiver != null) { receiver.traverse(this, methodDeclaration.scope); } return true; }
m.setType(references.getTypeReference(methodDeclaration.returnType.resolvedType)); m.setModifiers(getModifiers(methodDeclaration.modifiers)); m.setDefaultMethod(methodDeclaration.isDefaultMethod()); if (methodDeclaration.thrownExceptions != null) { for (TypeReference r : methodDeclaration.thrownExceptions) {
if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0 && !this.isDefaultMethod()) { if(!this.binding.isOverriding() && !this.binding.isImplementing()) { if (this.binding.isPrivate() || this.binding.isFinal() || this.binding.declaringClass.isFinal()) {
if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0 && !this.isDefaultMethod()) { if(!this.binding.isOverriding() && !this.binding.isImplementing()) { if (this.binding.isPrivate() || this.binding.isFinal() || this.binding.declaringClass.isFinal()) {
if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0 && !this.isDefaultMethod()) { if(!this.binding.isOverriding() && !this.binding.isImplementing()) { if (this.binding.isPrivate() || this.binding.isFinal() || this.binding.declaringClass.isFinal()) {
if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0 && !this.isDefaultMethod()) { if(!this.binding.isOverriding() && !this.binding.isImplementing()) { if (this.binding.isPrivate() || this.binding.isFinal() || this.binding.declaringClass.isFinal()) {
if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0 && !this.isDefaultMethod()) { if(!this.binding.isOverriding() && !this.binding.isImplementing()) { if (this.binding.isPrivate() || this.binding.isFinal() || this.binding.declaringClass.isFinal()) {
if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0 && !this.isDefaultMethod()) { if(!this.binding.isOverriding() && !this.binding.isImplementing()) { if (this.binding.isPrivate() || this.binding.isFinal() || this.binding.declaringClass.isFinal()) {
if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0 && !this.isDefaultMethod()) { if(!this.binding.isOverriding() && !this.binding.isImplementing()) { if (this.binding.isPrivate() || this.binding.isFinal() || this.binding.declaringClass.isFinal()) {
if (!this.binding.isStatic() && (this.bits & ASTNode.CanBeStatic) != 0 && !this.isDefaultMethod()) { if(!this.binding.isOverriding() && !this.binding.isImplementing()) { if (this.binding.isPrivate() || this.binding.isFinal() || this.binding.declaringClass.isFinal()) {