@Override public int compare(SimpleName s1, SimpleName s2) { return s1.getStartPosition() - s2.getStartPosition(); } });
private boolean isInRemoved(SimpleName ref, List<int[]> removedStartsEnds) { int start= ref.getStartPosition(); int end= start + ref.getLength(); for (int[] removedStartsEnd : removedStartsEnds) { if (start >= removedStartsEnd[0] && end <= removedStartsEnd[1]) { return true; } } return false; }
@Override public boolean visit(AnnotationTypeMemberDeclaration node) { if ((this.bits & ABORT) != 0) { return false; } if (node.getName().getStartPosition() == this.nameStart) { this.bits |= ABORT; processJavadoc(node); } return false; }
@Override public boolean visit(SuperMethodInvocation node) { if (isExitPoint(node.resolveMethodBinding())) { SimpleName name= node.getName(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fExitDescription)); } return true; }
@Override public boolean visit(MethodInvocation node) { if (isExitPoint(node.resolveMethodBinding())) { SimpleName name= node.getName(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fExitDescription)); } return true; }
public boolean visit(VariableDeclarationFragment node) { SimpleName name = node.getName(); System.out.println("Declaration of '"+name+"' at line"+cu.getLineNumber(name.getStartPosition())); int modifiers = 0; if (node.getParent() instanceof FieldDeclaration){ modifiers = ((FieldDeclaration)node.getParent()).getModifiers(); } else if (node.getParent() instanceof VariableDeclarationStatement){ modifiers = ((VariableDeclarationStatement)node.getParent()).getModifiers(); } return false; }
@Override public boolean visit(SuperMethodInvocation node) { if (matches(node.resolveMethodBinding())) { SimpleName name= node.getName(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fDescription)); } return super.visit(node); }
@Override public boolean visit(SuperMethodInvocation node) { if (matches(node.resolveMethodBinding())) { SimpleName name= node.getName(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fDescription)); } return super.visit(node); }
@Override public boolean visit(MethodInvocation node) { if (matches(node.resolveMethodBinding())) { SimpleName name= node.getName(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fDescription)); } return super.visit(node); }
@Override public boolean visit(MethodInvocation node) { if (matches(node.resolveMethodBinding())) { SimpleName name= node.getName(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fDescription)); } return super.visit(node); }
@Override ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); if (this.ast.apiLevel >= AST.JLS10_INTERNAL && Long.compare(this.ast.scanner.complianceLevel, 10) >= 0) { result.setVar(isVar()); } return result; }
ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); return result; }
ASTNode clone0(AST target) { SimpleName result = new SimpleName(target); result.setSourceRange(getStartPosition(), getLength()); result.setIdentifier(getIdentifier()); return result; }
private static boolean isSideEffectFree(SimpleName simpleName, CompilationUnit completeRoot) { SimpleName nameNode= (SimpleName) NodeFinder.perform(completeRoot, simpleName.getStartPosition(), simpleName.getLength()); SimpleName[] references= LinkedNodeFinder.findByBinding(completeRoot, nameNode.resolveBinding()); for (int i= 0; i < references.length; i++) { if (hasSideEffect(references[i])) return false; } return true; }
private static boolean isSideEffectFree(SimpleName simpleName, CompilationUnit completeRoot) { SimpleName nameNode= (SimpleName) NodeFinder.perform(completeRoot, simpleName.getStartPosition(), simpleName.getLength()); SimpleName[] references= LinkedNodeFinder.findByBinding(completeRoot, nameNode.resolveBinding()); for (int i= 0; i < references.length; i++) { if (hasSideEffect(references[i])) return false; } return true; }
@Override public boolean visit(MethodDeclaration node) { IMethodBinding binding= node.resolveBinding(); if (binding != null && !Modifier.isStatic(binding.getModifiers())) { IMethodBinding method= Bindings.findOverriddenMethodInHierarchy(fSelectedType, binding); if (method != null) { SimpleName name= node.getName(); fResult.add(new OccurrenceLocation(name.getStartPosition(), name.getLength(), 0, fDescription)); } } return super.visit(node); }
public boolean visit(SimpleName node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } String newString= (String) getNewValue(node, SimpleName.IDENTIFIER_PROPERTY); TextEditGroup group = getEditGroup(node, SimpleName.IDENTIFIER_PROPERTY); doTextReplace(node.getStartPosition(), node.getLength(), newString, group); return false; }
@Override public boolean visit(TypeDeclaration node) { handleBodyDeclarations(node.bodyDeclarations()); if (node.getName().getStartPosition() == -1) return true; // this is a fake type created by parsing in class body mode breakLineBefore(node); handleBracedCode(node, node.getName(), this.options.brace_position_for_type_declaration, this.options.indent_body_declarations_compare_to_type_header); this.declarationModifierVisited = false; return true; }
public boolean visit(SimpleName node) { if (!hasChildrenChanges(node)) { return doVisitUnchangedChildren(node); } String newString= (String) getNewValue(node, SimpleName.IDENTIFIER_PROPERTY); TextEditGroup group = getEditGroup(node, SimpleName.IDENTIFIER_PROPERTY); doTextReplace(node.getStartPosition(), node.getLength(), newString, group); return false; }
private QualifiedType createQualifiedType(TypeReference typeReference, long[] positions, org.eclipse.jdt.internal.compiler.ast.Annotation[][] typeAnnotations, char[][] tokens, int index, Type qualifier) { SimpleName simpleName = createSimpleName(typeReference, positions, tokens, index); QualifiedType qualifiedType = new QualifiedType(this.ast); qualifiedType.setQualifier(qualifier); qualifiedType.setName(simpleName); int start = qualifier.getStartPosition(); int end = simpleName.getStartPosition() + simpleName.getLength() - 1; setSourceRangeAnnotationsAndRecordNodes(typeReference, qualifiedType, typeAnnotations, index, start, end); return qualifiedType; }