while (this.wl.hasNext()) {
final IJavaElement je = (IJavaElement) this.wl.next();
final SearchPattern pattern = SearchPattern.createPattern(je,
IJavaSearchConstants.ALL_OCCURRENCES,
SearchPattern.R_EXACT_MATCH);
final SearchRequestor requestor = new SearchRequestor() {
public void acceptSearchMatch(SearchMatch match)
throws CoreException {
if (match.getAccuracy() == SearchMatch.A_ACCURATE
&& !match.isInsideDocComment()) {
ASTNode node = Util.getExactASTNode(match,
EnumerizationComputer.this.monitor);
ASTNodeProcessor processor = new ASTNodeProcessor(node,
EnumerizationComputer.this.constFields,
EnumerizationComputer.this.scope,
EnumerizationComputer.this.monitor);
processor.process();
EnumerizationComputer.this.wl.addAll(processor
.getFound());
Collection infixCol = (Collection) EnumerizationComputer.this.elemToLegalInfixExpressionSourceRangeMap
.get(je);
if (infixCol == null)
EnumerizationComputer.this.elemToLegalInfixExpressionSourceRangeMap
.put(
je,
processor
.getLegalEncounteredInfixExpressionSourceLocations());
else
infixCol
.addAll(processor
.getLegalEncounteredInfixExpressionSourceLocations());
}
}
};
try {
this.searchEngine.search(pattern,
new SearchParticipant[] { SearchEngine
.getDefaultSearchParticipant() }, this.scope,
requestor, new SubProgressMonitor(this.monitor, 1,
SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
// Work around for bug 164121. Force match for formal
// parameters.
if (je.getElementType() == IJavaElement.LOCAL_VARIABLE) {
final ISourceRange isr = ((ILocalVariable) je)
.getNameRange();
final SearchMatch match = new SearchMatch(je,
SearchMatch.A_ACCURATE, isr.getOffset(), isr
.getLength(), SearchEngine
.getDefaultSearchParticipant(), je
.getResource());
requestor.acceptSearchMatch(match);
}
} catch (final DefinitelyNotEnumerizableException E) {
this.defNotEnumConstants.addAll(this.wl
.getCurrentComputationTreeElements());
this.nonEnumerizableList.addAll(this.wl