.append(" ").append(declaration.getName().getFullyQualifiedName()) .append("(");
if (declaration instanceof org.eclipse.jdt.core.dom.MethodDeclaration) { org.eclipse.jdt.core.dom.MethodDeclaration methodDeclaration = (org.eclipse.jdt.core.dom.MethodDeclaration) declaration; if (methodDeclaration.getName().toString().equals(methodName)) { return methodDeclaration;
if (body.getNodeType() == ASTNode.METHOD_DECLARATION) { MethodDeclaration method = (MethodDeclaration)body; System.out.println("name: " + method.getName().getFullyQualifiedName());
private static SimpleName getUnusedName(CompilationUnit compilationUnit, IProblemLocationCore problem) { ASTNode selectedNode= problem.getCoveringNode(compilationUnit); if (selectedNode instanceof MethodDeclaration) { return ((MethodDeclaration) selectedNode).getName(); } else if (selectedNode instanceof SimpleName) { return (SimpleName) selectedNode; } return null; }
@Override public String getName() { return method.getName().getFullyQualifiedName(); }
protected SimpleName rename(ASTNode node, SimpleName newName) { MethodDeclaration method = (MethodDeclaration) node; SimpleName oldName = method.getName(); method.setName(newName); return oldName; } /**
@Override public boolean visit(MethodDeclaration node) { String name= node.getName().getIdentifier(); if (name.equals(fGetter) || name.equals(fSetter)) return false; return true; }
private static SimpleName getUnusedName(CompilationUnit compilationUnit, IProblemLocation problem) { ASTNode selectedNode= problem.getCoveringNode(compilationUnit); if (selectedNode instanceof MethodDeclaration) { return ((MethodDeclaration) selectedNode).getName(); } else if (selectedNode instanceof SimpleName) { return (SimpleName) selectedNode; } return null; }
public boolean visit(MethodDeclaration node) { if (found(node, node.getName()) && this.resolveBinding) this.foundBinding = node.resolveBinding(); return true; }
@Override public boolean visit(MethodDeclaration node) { try { // TODO: improve the comparison of the method which is visited and the debug // frame inFrame = (node.getName().toString().equals(fFrame.getMethodName())); } catch (DebugException e) { e.printStackTrace(); } return super.visit(node); }
public boolean visit(MethodDeclaration node) { if (node.isConstructor() && fBinding.getKind() == IBinding.TYPE) { ASTNode typeNode= node.getParent(); if (typeNode instanceof AbstractTypeDeclaration) { if (fBinding == ((AbstractTypeDeclaration) typeNode).resolveBinding()) { fResult.add(node.getName()); } } } return true; }
@Override public boolean visit(MethodDeclaration node) { if (node.isConstructor()) { AbstractTypeDeclaration decl= ASTNodes.getParent(node, AbstractTypeDeclaration.class); NameData name= fNames.get(decl.getName().resolveBinding()); if (name != null) { name.addReference(node.getName()); } } return true; } @Override
@Override public boolean visit(MethodDeclaration node) { if (node.isConstructor()) { AbstractTypeDeclaration decl= (AbstractTypeDeclaration) ASTNodes.getParent(node, AbstractTypeDeclaration.class); NameData name= fNames.get(decl.getName().resolveBinding()); if (name != null) { name.addReference(node.getName()); } } return true; } @Override
public boolean visit(MethodDeclaration node) { if (node.isConstructor()) { AbstractTypeDeclaration decl= (AbstractTypeDeclaration) ASTNodes.getParent(node, AbstractTypeDeclaration.class); NameData name= (NameData)fNames.get(decl.getName().resolveBinding()); if (name != null) { name.addReference(node.getName()); } } return true; } public boolean visit(MethodInvocation node) {
private void performSearch() { fResult= new ArrayList<>(); markReferences(); if (!fResult.isEmpty()) { Type returnType= fMethodDeclaration.getReturnType2(); if (returnType != null) { String desc= Messages.format(SearchMessages.MethodExitsFinder_occurrence_return_description, BasicElementLabels.getJavaElementName(fMethodDeclaration.getName().toString())); fResult.add(new OccurrenceLocation(returnType.getStartPosition(), returnType.getLength(), 0, desc)); } } }
@Override public boolean visit(MethodDeclaration node) { String signature = Signatures.getMethodSignatureFromNode(node, true); if (signature != null) { updateDocNode(findDescriptorByName(node.getName().getFullyQualifiedName(), signature), node, getType(), IApiJavadocTag.MEMBER_METHOD); } return false; }
@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); }
protected void initialize() { Assert.isTrue(getDeclaration() instanceof MethodDeclaration); if (getNewElementName() == null) setNewElementName(((MethodDeclaration) getDeclaration()).getName().getIdentifier()); setInsertBefore(true); }
public static RefactoringStatus checkMethodSyntaxErrors(int selectionStart, int selectionLength, CompilationUnit cuNode, String invalidSelectionMessage){ SelectionAnalyzer analyzer= new SelectionAnalyzer(Selection.createFromStartLength(selectionStart, selectionLength), true); cuNode.accept(analyzer); ASTNode coveringNode= analyzer.getLastCoveringNode(); if (! (coveringNode instanceof Block) || ! (coveringNode.getParent() instanceof MethodDeclaration)) return RefactoringStatus.createFatalErrorStatus(invalidSelectionMessage); if (ASTNodes.getMessages(coveringNode, ASTNodes.NODE_ONLY).length == 0) return RefactoringStatus.createFatalErrorStatus(invalidSelectionMessage); MethodDeclaration methodDecl= (MethodDeclaration)coveringNode.getParent(); String message= Messages.format(RefactoringCoreMessages.CodeRefactoringUtil_error_message, BasicElementLabels.getJavaElementName(methodDecl.getName().getIdentifier())); return RefactoringStatus.createFatalErrorStatus(message); }