Author: dgolovin
Date: 2011-08-29 20:21:16 -0400 (Mon, 29 Aug 2011)
New Revision: 34373
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/ELReferencesQueryParticipant.java
Log:
https://issues.jboss.org/browse/JBIDE-1636 Code Review
code cleanup. seam.ui, jsf.core and cdi.ui tests are passed without errors
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/ELReferencesQueryParticipant.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/ELReferencesQueryParticipant.java 2011-08-29
20:29:02 UTC (rev 34372)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/ELReferencesQueryParticipant.java 2011-08-30
00:21:16 UTC (rev 34373)
@@ -47,35 +47,27 @@
QuerySpecification querySpecification, IProgressMonitor monitor)
throws CoreException {
- if(querySpecification instanceof ElementQuerySpecification){
- if (!isSearchForReferences(querySpecification.getLimitTo()))
- return;
-
- ElementQuerySpecification qs = (ElementQuerySpecification)querySpecification;
- if(qs.getElement() instanceof IField || qs.getElement() instanceof IMethod ||
qs.getElement() instanceof IType){
- IFile file = (IFile)qs.getElement().getResource();
- if(file == null)
- return;
-
- String name = qs.getElement().getElementName();
-
- searcher = new ELSearcher(requestor, qs.getElement(), file, name);
- searcher.setSearchScope(qs.getScope());
-
- searcher.findELReferences();
+ if(querySpecification instanceof ElementQuerySpecification &&
isSearchForReferences(querySpecification.getLimitTo())){
+
+ IJavaElement element = ((ElementQuerySpecification)querySpecification).getElement();
+ if(element instanceof IField || element instanceof IMethod || element instanceof
IType){
+ IFile file = (IFile)element.getResource();
+ if(file != null) {
+ String name = element.getElementName();
+ searcher = new ELSearcher(requestor, element, file, name);
+ searcher.setSearchScope(querySpecification.getScope());
+ searcher.findELReferences();
+ }
}
}
}
public boolean isSearchForReferences(int limitTo) {
- int maskedLimitTo = limitTo &
~(IJavaSearchConstants.IGNORE_DECLARING_TYPE+IJavaSearchConstants.IGNORE_RETURN_TYPE);
- if (maskedLimitTo == IJavaSearchConstants.REFERENCES || maskedLimitTo ==
IJavaSearchConstants.ALL_OCCURRENCES) {
- return true;
- }
-
- return false;
- }
-
+ int maskedLimitTo = limitTo
+ & ~(IJavaSearchConstants.IGNORE_DECLARING_TYPE +
IJavaSearchConstants.IGNORE_RETURN_TYPE);
+ return maskedLimitTo == IJavaSearchConstants.REFERENCES || maskedLimitTo ==
IJavaSearchConstants.ALL_OCCURRENCES;
+ }
+
class ELSearcher extends RefactorSearcher{
ISearchRequestor requestor;
IProjectsSet projectSet=null;
@@ -89,7 +81,6 @@
if(projectSet != null)
projectSet.init(file.getProject());
}
-
}
protected void outOfSynch(IProject file){