public static SearchMatch[] removeGenerated(SearchMatch[] returnValue) { List<SearchMatch> result = new ArrayList<SearchMatch>(); for (int j = 0; j < returnValue.length; j++) { SearchMatch searchResult = returnValue[j]; if (searchResult.getElement() instanceof IField) { IField field = (IField) searchResult.getElement(); // can not check for value=lombok because annotation is // not fully resolved IAnnotation annotation = field.getAnnotation("Generated"); if (annotation != null) { // Method generated at field location, skip continue; } } result.add(searchResult); } return result.toArray(new SearchMatch[result.size()]); }
/** * @param match the search match * @return the enclosing {@link IJavaElement}, or null iff none */ public static IJavaElement getEnclosingJavaElement(SearchMatch match) { Object element = match.getElement(); if (element instanceof IJavaElement) return (IJavaElement) element; else return null; }
@Override public void acceptSearchMatch(SearchMatch match) { if (match.getElement() instanceof IJavaElement) { elements.add((IJavaElement) match.getElement()); } } };
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { if (match.getElement() instanceof IMethod) { result.add((IMethod) match.getElement()); } } };
public void acceptSearchMatch(SearchMatch match) throws CoreException { Object element= match.getElement(); if (element instanceof IType) results.add(element); } };
@Override public void acceptSearchMatch(ICompilationUnit unit, SearchMatch match) throws CoreException { for (int i= 0; i < wcOldMethods.length; i++) { if (wcOldMethods[i].equals(match.getElement())) { return; } } super.acceptSearchMatch(unit, match); } };
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { if (!oldField.equals(match.getElement())) { super.acceptSearchMatch(match); } } };
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { Object element= match.getElement(); if (element instanceof IPackageFragment) { packageFragments.add((IPackageFragment) element); } else if (element instanceof IType) { IType enclosingType= (IType) element; packageFragments.add(enclosingType.getPackageFragment()); } } };
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { Object o = match.getElement(); if (o instanceof IJavaElement && ((IJavaElement) o).getAncestor(IJavaElement.COMPILATION_UNIT) != null) { count.incrementAndGet(); } } }, monitor);
@Override public void acceptSearchMatch(ICompilationUnit unit, SearchMatch match) throws CoreException { for (int i= 0; i < wcOldMethods.length; i++) if (wcOldMethods[i].equals(match.getElement())) return; super.acceptSearchMatch(unit, match); } };
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { if (!oldField.equals(match.getElement())) super.acceptSearchMatch(match); } };
public void acceptSearchMatch(SearchMatch match) throws CoreException { if(match.getAccuracy() == SearchMatch.A_ACCURATE && !(match.isInsideDocComment() || isBeanType((IType) match.getElement()))) results.add(match.getElement()); } /**
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { Object method= match.getElement(); if (method instanceof IMethod) { results.add((IMethod) method); } else { JavaLanguageServerPlugin.logError("Unexpected element in search match: " + match.toString()); //$NON-NLS-1$ } } };
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { Object o= match.getElement(); if (o instanceof IJavaElement) { IJavaElement e= (IJavaElement)o; if (e.getAncestor(IJavaElement.COMPILATION_UNIT) != null || e.getAncestor(IJavaElement.CLASS_FILE) != null) { count.incrementAndGet(); } } } }, monitor);
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { Object method= match.getElement(); if (method instanceof IMethod) // check for bug 90138: [refactoring] [rename] Renaming method throws internal exception results.add((IMethod) method); else JavaPlugin.logErrorMessage("Unexpected element in search match: " + match.toString()); //$NON-NLS-1$ } };
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { Object element= match.getElement(); if (element instanceof IModuleDescription) { IModuleDescription moduleDesc= (IModuleDescription) element; if (moduleDesc.exists() || moduleDesc.isAutoModule()) { res.add(moduleDesc); } } } };
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { Object method= match.getElement(); if (method instanceof IMethod) // check for bug 90138: [refactoring] [rename] Renaming method throws internal exception results.add((IMethod) method); else JavaPlugin.logErrorMessage("Unexpected element in search match: " + match.toString()); //$NON-NLS-1$ } };
@Override public void acceptSearchMatch(SearchMatch match) throws CoreException { Object element= match.getElement(); if (element instanceof IModuleDescription) { IModuleDescription moduleDesc= (IModuleDescription) element; if (moduleDesc.exists() || moduleDesc.isAutoModule()) { moduleDescriptions.add(moduleDesc); } } } };
public void acceptSearchMatch(SearchMatch match) throws CoreException { if (match.getAccuracy() == SearchMatch.A_ACCURATE && !match.isInsideDocComment()) { Object element= match.getElement(); if (element instanceof IType || element instanceof IMethod) { IMember member= (IMember) element; IType type= member.getElementType() == IJavaElement.TYPE ? (IType) member : member.getDeclaringType(); addTypeAndSubtypes(type); } } }
public void acceptSearchMatch(SearchMatch match) throws CoreException { if (match.getAccuracy() == SearchMatch.A_ACCURATE && !match.isInsideDocComment()) { Object element= match.getElement(); if (element instanceof IType || element instanceof IMethod) { IMember member= (IMember) element; IType type= member.getElementType() == IJavaElement.TYPE ? (IType) member : member.getDeclaringType(); addTypeAndSubtypes(type); } } }