private void addFactoryMethod(EclipseNode singletonClass, TypeDeclaration astNode, TypeReference typeReference, TypeDeclaration innerClass, FieldDeclaration field) { MethodDeclaration factoryMethod = new MethodDeclaration(astNode.compilationResult); factoryMethod.modifiers = AccStatic | ClassFileConstants.AccPublic; factoryMethod.returnType = typeReference; factoryMethod.sourceStart = astNode.sourceStart; factoryMethod.sourceEnd = astNode.sourceEnd; factoryMethod.selector = "getInstance".toCharArray(); factoryMethod.bits = ECLIPSE_DO_NOT_TOUCH_FLAG; long pS = factoryMethod.sourceStart; long pE = factoryMethod.sourceEnd; long p = (long) pS << 32 | pE; FieldReference ref = new FieldReference(field.name, p); ref.receiver = new SingleNameReference(innerClass.name, p); ReturnStatement statement = new ReturnStatement(ref, astNode.sourceStart, astNode.sourceEnd); factoryMethod.statements = new Statement[]{statement}; EclipseHandlerUtil.injectMethod(singletonClass, factoryMethod); }
protected SingleNameReference newSingleNameReference(char[] source, long positions) { return new SingleNameReference(source, positions); } public CompilationUnitDeclaration parseCompilationUnit(
protected SingleNameReference newSingleNameReference(char[] source, long positions) { return new SingleNameReference(source, positions); } public CompilationUnitDeclaration parseCompilationUnit(
protected SingleNameReference newSingleNameReference(char[] source, long positions) { return new SingleNameReference(source, positions); } public CompilationUnitDeclaration parseCompilationUnit(
protected SingleNameReference newSingleNameReference(char[] source, long positions) { return new SingleNameReference(source, positions); } public CompilationUnitDeclaration parseCompilationUnit(
protected SingleNameReference newSingleNameReference(char[] source, long positions) { return new SingleNameReference(source, positions); } public CompilationUnitDeclaration parseCompilationUnit(
protected SingleNameReference newSingleNameReference(char[] source, long positions) { return new SingleNameReference(source, positions); } public CompilationUnitDeclaration parseCompilationUnit(
protected SingleNameReference newSingleNameReference(char[] source, long positions) { return new SingleNameReference(source, positions); } public CompilationUnitDeclaration parseCompilationUnit(
public Expression[] createPseudoExpressions(TypeBinding[] p) { // from 15.13.1: // ... the reference is treated as if it were an invocation with argument expressions of types P1..Pn // ... the reference is treated as if it were an invocation with argument expressions of types P2..Pn // (the different sets of types are passed from our resolveType to scope.getMethod(..), see someMethod, anotherMethod) Expression[] expressions = new Expression[p.length]; long pos = (((long)this.sourceStart)<<32)+this.sourceEnd; for (int i = 0; i < p.length; i++) { expressions[i] = new SingleNameReference(("fakeArg"+i).toCharArray(), pos); //$NON-NLS-1$ expressions[i].resolvedType = p[i]; } return expressions; }
public Expression[] createPseudoExpressions(TypeBinding[] p) { // from 15.13.1: // ... the reference is treated as if it were an invocation with argument expressions of types P1..Pn // ... the reference is treated as if it were an invocation with argument expressions of types P2..Pn // (the different sets of types are passed from our resolveType to scope.getMethod(..), see someMethod, anotherMethod) Expression[] expressions = new Expression[p.length]; long pos = (((long)this.sourceStart)<<32)+this.sourceEnd; for (int i = 0; i < p.length; i++) { expressions[i] = new SingleNameReference(("fakeArg"+i).toCharArray(), pos); //$NON-NLS-1$ expressions[i].resolvedType = p[i]; } return expressions; }
public Expression[] createPseudoExpressions(TypeBinding[] p) { // from 15.13.1: // ... the reference is treated as if it were an invocation with argument expressions of types P1..Pn // ... the reference is treated as if it were an invocation with argument expressions of types P2..Pn // (the different sets of types are passed from our resolveType to scope.getMethod(..), see someMethod, anotherMethod) Expression[] expressions = new Expression[p.length]; long pos = (((long)this.sourceStart)<<32)+this.sourceEnd; for (int i = 0; i < p.length; i++) { expressions[i] = new SingleNameReference(("fakeArg"+i).toCharArray(), pos); //$NON-NLS-1$ expressions[i].resolvedType = p[i]; } return expressions; }
public Expression[] createPseudoExpressions(TypeBinding[] p) { // from 15.13.1: // ... the reference is treated as if it were an invocation with argument expressions of types P1..Pn // ... the reference is treated as if it were an invocation with argument expressions of types P2..Pn // (the different sets of types are passed from our resolveType to scope.getMethod(..), see someMethod, anotherMethod) Expression[] expressions = new Expression[p.length]; long pos = (((long)this.sourceStart)<<32)+this.sourceEnd; for (int i = 0; i < p.length; i++) { expressions[i] = new SingleNameReference(("fakeArg"+i).toCharArray(), pos); //$NON-NLS-1$ expressions[i].resolvedType = p[i]; } return expressions; }
public Expression[] createPseudoExpressions(TypeBinding[] p) { // from 15.13.1: // ... the reference is treated as if it were an invocation with argument expressions of types P1..Pn // ... the reference is treated as if it were an invocation with argument expressions of types P2..Pn // (the different sets of types are passed from our resolveType to scope.getMethod(..), see someMethod, anotherMethod) Expression[] expressions = new Expression[p.length]; long pos = (((long)this.sourceStart)<<32)+this.sourceEnd; for (int i = 0; i < p.length; i++) { expressions[i] = new SingleNameReference(("fakeArg"+i).toCharArray(), pos); //$NON-NLS-1$ expressions[i].resolvedType = p[i]; } return expressions; }
public Expression[] createPseudoExpressions(TypeBinding[] p) { if (this.descriptor == null) return null; // from 15.28.1: // ... the reference is treated as if it were an invocation with argument expressions of types P1..Pn // ... the reference is treated as if it were an invocation with argument expressions of types P2..Pn // (the different sets of types are passed from our resolveType to scope.getMethod(..), see someMethod, anotherMethod) Expression[] expressions = new Expression[p.length]; long pos = (((long)this.sourceStart)<<32)+this.sourceEnd; for (int i = 0; i < p.length; i++) { expressions[i] = new SingleNameReference(("fakeArg"+i).toCharArray(), pos); //$NON-NLS-1$ expressions[i].resolvedType = p[i]; } return expressions; }
@Override public boolean visitIdentifier(lombok.ast.Identifier node) { SingleNameReference ref = new SingleNameReference(toName(node), pos(node)); return set(node, ref); }
@Override public boolean visitIdentifier(lombok.ast.Identifier node) { SingleNameReference ref = new SingleNameReference(toName(node), pos(node)); return set(node, ref); }
@Override public boolean visitIdentifier(lombok.ast.Identifier node) { SingleNameReference ref = new SingleNameReference(toName(node), pos(node)); return set(node, ref); }
@Override public boolean visitVariableReference(VariableReference node) { SingleNameReference ref = new SingleNameReference(toName(node.astIdentifier()), pos(node)); return set(node, ref); }
@Override public boolean visitVariableReference(VariableReference node) { SingleNameReference ref = new SingleNameReference(toName(node.astIdentifier()), pos(node)); return set(node, ref); }
@Override public boolean visitVariableReference(VariableReference node) { SingleNameReference ref = new SingleNameReference(toName(node.astIdentifier()), pos(node)); return set(node, ref); }