@Override public boolean visit(ExplicitConstructorCall explicitConstructor, BlockScope scope) { CtInvocation<Object> inv = factory.Core().createInvocation(); inv.setImplicit(explicitConstructor.isImplicitSuper()); inv.setExecutable(references.getExecutableReference(explicitConstructor.binding)); CtTypeReference<?> declaringType = inv.getExecutable().getDeclaringType(); inv.getExecutable().setType(declaringType == null ? null : (CtTypeReference<Object>) declaringType.clone()); context.enter(inv, explicitConstructor); return true; }
List<PsiStatement> psiStatements = Lists .newArrayListWithExpectedSize(statements.length + 1); if (constructorCall != null && !constructorCall.isImplicitSuper()) { } else if (constructorCall != null && !constructorCall.isImplicitSuper()) { block.setStatements(new PsiStatement[]{ toExplicitConstructorCall(block, constructorCall)});
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {
@Override public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } @Override
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {
public SearchMatch newDeclarationMatch(ASTNode reference, IJavaElement element, Binding binding, int accuracy, int length, MatchLocator locator) { this.match = null; int offset = reference.sourceStart; if (this.pattern.findReferences) { if (reference instanceof TypeDeclaration) { TypeDeclaration type = (TypeDeclaration) reference; AbstractMethodDeclaration[] methods = type.methods; if (methods != null) { for (int i = 0, max = methods.length; i < max; i++) { AbstractMethodDeclaration method = methods[i]; boolean synthetic = method.isDefaultConstructor() && method.sourceStart < type.bodyStart; this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, method.isConstructor(), synthetic, method); } } } else if (reference instanceof ConstructorDeclaration) { ConstructorDeclaration constructor = (ConstructorDeclaration) reference; ExplicitConstructorCall call = constructor.constructorCall; boolean synthetic = call != null && call.isImplicitSuper(); this.match = locator.newMethodReferenceMatch(element, binding, accuracy, offset, length, constructor.isConstructor(), synthetic, constructor); } } if (this.match != null) { return this.match; } // super implementation... return locator.newDeclarationMatch(element, binding, accuracy, reference.sourceStart, length); } public int resolveLevel(ASTNode node) {
try { ExplicitConstructorCall explicitConstructorCall = constructorDeclaration.constructorCall; if (explicitConstructorCall != null && !explicitConstructorCall.isImplicitSuper()) { explicitConstructorCall.traverse(this, null);
try { ExplicitConstructorCall explicitConstructorCall = constructorDeclaration.constructorCall; if (explicitConstructorCall != null && !explicitConstructorCall.isImplicitSuper()) { explicitConstructorCall.traverse(this, null);
if (c.constructorCall == null || c.constructorCall.isImplicitSuper()) { //changed to a method MethodDeclaration m = parser.convertToMethodDeclaration(c, this.compilationResult); this.methods[i] = m;
if (c.constructorCall == null || c.constructorCall.isImplicitSuper()) { //changed to a method MethodDeclaration m = parser.convertToMethodDeclaration(c, this.compilationResult); this.methods[i] = m;
if (c.constructorCall == null || c.constructorCall.isImplicitSuper()) { //changed to a method MethodDeclaration m = parser.convertToMethodDeclaration(c, this.compilationResult); this.methods[i] = m;
@Override public void visitExplicitConstructorCall(ExplicitConstructorCall node) { if (node.isImplicitSuper()) { set(node, (Node)null); return; } if (node.isSuperAccess()) { lombok.ast.SuperConstructorInvocation sup = new lombok.ast.SuperConstructorInvocation(); fillList(node.arguments, sup.rawArguments()); fillList(node.typeArguments, sup.rawConstructorTypeArguments()); sup.astQualifier((lombok.ast.Expression) toTree(node.qualification)); setConversionPositionInfo(sup, "typeArguments", toPosition(node.typeArgumentsSourceStart, node.sourceEnd)); set(node, setPosition(node, sup)); return; } lombok.ast.AlternateConstructorInvocation inv = new lombok.ast.AlternateConstructorInvocation(); fillList(node.arguments, inv.rawArguments()); fillList(node.typeArguments, inv.rawConstructorTypeArguments()); setConversionPositionInfo(inv, "typeArguments", toPosition(node.typeArgumentsSourceStart, node.sourceEnd)); set(node, setPosition(node, inv)); }
if (c.constructorCall == null || c.constructorCall.isImplicitSuper()) { //changed to a method MethodDeclaration m = parser.convertToMethodDeclaration(c, this.compilationResult); this.methods[i] = m;
@Override public void visitExplicitConstructorCall(ExplicitConstructorCall node) { if (node.isImplicitSuper()) { set(node, (Node)null); return; } if (node.isSuperAccess()) { lombok.ast.SuperConstructorInvocation sup = new lombok.ast.SuperConstructorInvocation(); fillList(node.arguments, sup.rawArguments()); fillList(node.typeArguments, sup.rawConstructorTypeArguments()); sup.astQualifier((lombok.ast.Expression) toTree(node.qualification)); setConversionPositionInfo(sup, "typeArguments", toPosition(node.typeArgumentsSourceStart, node.sourceEnd)); set(node, setPosition(node, sup)); return; } lombok.ast.AlternateConstructorInvocation inv = new lombok.ast.AlternateConstructorInvocation(); fillList(node.arguments, inv.rawArguments()); fillList(node.typeArguments, inv.rawConstructorTypeArguments()); setConversionPositionInfo(inv, "typeArguments", toPosition(node.typeArgumentsSourceStart, node.sourceEnd)); set(node, setPosition(node, inv)); }
if (c.constructorCall == null || c.constructorCall.isImplicitSuper()) { //changed to a method MethodDeclaration m = parser.convertToMethodDeclaration(c, this.compilationResult); this.methods[i] = m;
if (c.constructorCall == null || c.constructorCall.isImplicitSuper()) { //changed to a method MethodDeclaration m = parser.convertToMethodDeclaration(c, this.compilationResult); this.methods[i] = m;
@Override public void visitExplicitConstructorCall(ExplicitConstructorCall node) { if (node.isImplicitSuper()) { set(node, (Node)null); return; } if (node.isSuperAccess()) { lombok.ast.SuperConstructorInvocation sup = new lombok.ast.SuperConstructorInvocation(); fillList(node.arguments, sup.rawArguments()); fillList(node.typeArguments, sup.rawConstructorTypeArguments()); sup.astQualifier((lombok.ast.Expression) toTree(node.qualification)); setConversionPositionInfo(sup, "typeArguments", toPosition(node.typeArgumentsSourceStart, node.sourceEnd)); set(node, setPosition(node, sup)); return; } lombok.ast.AlternateConstructorInvocation inv = new lombok.ast.AlternateConstructorInvocation(); fillList(node.arguments, inv.rawArguments()); fillList(node.typeArguments, inv.rawConstructorTypeArguments()); setConversionPositionInfo(inv, "typeArguments", toPosition(node.typeArgumentsSourceStart, node.sourceEnd)); set(node, setPosition(node, inv)); }
public boolean visit(ExplicitConstructorCall explicitConstructor, BlockScope scope) { CtInvocation<Object> inv = factory.Core().createInvocation(); if (explicitConstructor.isImplicitSuper()) { inv.setImplicit(true);