Lines 25-30
Link Here
|
25 |
import org.eclipse.jdt.internal.core.search.BasicSearchEngine; |
25 |
import org.eclipse.jdt.internal.core.search.BasicSearchEngine; |
26 |
import org.eclipse.jdt.internal.core.search.IRestrictedAccessConstructorRequestor; |
26 |
import org.eclipse.jdt.internal.core.search.IRestrictedAccessConstructorRequestor; |
27 |
import org.eclipse.jdt.internal.core.search.IRestrictedAccessTypeRequestor; |
27 |
import org.eclipse.jdt.internal.core.search.IRestrictedAccessTypeRequestor; |
|
|
28 |
import org.eclipse.jdt.internal.core.search.indexing.IndexManager; |
28 |
import org.eclipse.jdt.internal.core.util.Util; |
29 |
import org.eclipse.jdt.internal.core.util.Util; |
29 |
|
30 |
|
30 |
/** |
31 |
/** |
Lines 407-437
Link Here
|
407 |
int matchRule = SearchPattern.R_PREFIX_MATCH; |
408 |
int matchRule = SearchPattern.R_PREFIX_MATCH; |
408 |
if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH; |
409 |
if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH; |
409 |
if (monitor != null) { |
410 |
if (monitor != null) { |
410 |
found : while (true) { //the loop will finish if the search request ends or is cancelled |
411 |
IndexManager indexManager = JavaModelManager.getIndexManager(); |
|
|
412 |
while (indexManager.awaitingJobsCount() > 0) { |
411 |
try { |
413 |
try { |
412 |
new BasicSearchEngine(this.workingCopies).searchAllTypeNames( |
414 |
Thread.sleep(50); // indexes are not ready, sleep 50ms... |
413 |
qualification, |
415 |
} catch (InterruptedException e) { |
414 |
SearchPattern.R_EXACT_MATCH, |
416 |
// Do nothing |
415 |
simpleName, |
417 |
} |
416 |
matchRule, // not case sensitive |
418 |
if (monitor.isCanceled()) { |
417 |
searchFor, |
419 |
throw new OperationCanceledException(); |
418 |
getSearchScope(), |
|
|
419 |
typeRequestor, |
420 |
CANCEL_IF_NOT_READY_TO_SEARCH, |
421 |
progressMonitor); |
422 |
break found; |
423 |
} catch (OperationCanceledException e) { |
424 |
if (monitor.isCanceled()) { |
425 |
throw e; |
426 |
} else { |
427 |
try { |
428 |
Thread.sleep(50); // indexes are not ready. sleep 50ms and retry the search request |
429 |
} catch (InterruptedException e1) { |
430 |
// Do nothing |
431 |
} |
432 |
} |
433 |
} |
420 |
} |
434 |
} |
421 |
} |
|
|
422 |
new BasicSearchEngine(this.workingCopies).searchAllTypeNames( |
423 |
qualification, |
424 |
SearchPattern.R_EXACT_MATCH, |
425 |
simpleName, |
426 |
matchRule, // not case sensitive |
427 |
searchFor, |
428 |
getSearchScope(), |
429 |
typeRequestor, |
430 |
FORCE_IMMEDIATE_SEARCH, |
431 |
progressMonitor); |
435 |
} else { |
432 |
} else { |
436 |
try { |
433 |
try { |
437 |
new BasicSearchEngine(this.workingCopies).searchAllTypeNames( |
434 |
new BasicSearchEngine(this.workingCopies).searchAllTypeNames( |
Lines 562-590
Link Here
|
562 |
int matchRule = SearchPattern.R_PREFIX_MATCH; |
559 |
int matchRule = SearchPattern.R_PREFIX_MATCH; |
563 |
if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH; |
560 |
if (camelCaseMatch) matchRule |= SearchPattern.R_CAMELCASE_MATCH; |
564 |
if (monitor != null) { |
561 |
if (monitor != null) { |
565 |
found : while (true) { //the loop will finish if the search request ends or is cancelled |
562 |
IndexManager indexManager = JavaModelManager.getIndexManager(); |
|
|
563 |
while (indexManager.awaitingJobsCount() > 0) { |
566 |
try { |
564 |
try { |
567 |
new BasicSearchEngine(this.workingCopies).searchAllConstructorDeclarations( |
565 |
Thread.sleep(50); // indexes are not ready, sleep 50ms... |
568 |
qualification, |
566 |
} catch (InterruptedException e) { |
569 |
simpleName, |
567 |
// Do nothing |
570 |
matchRule, |
568 |
} |
571 |
getSearchScope(), |
569 |
if (monitor.isCanceled()) { |
572 |
constructorRequestor, |
570 |
throw new OperationCanceledException(); |
573 |
CANCEL_IF_NOT_READY_TO_SEARCH, |
|
|
574 |
progressMonitor); |
575 |
break found; |
576 |
} catch (OperationCanceledException e) { |
577 |
if (monitor.isCanceled()) { |
578 |
throw e; |
579 |
} else { |
580 |
try { |
581 |
Thread.sleep(50); // indexes are not ready. sleep 50ms and retry the search request |
582 |
} catch (InterruptedException e1) { |
583 |
// Do nothing |
584 |
} |
585 |
} |
586 |
} |
571 |
} |
587 |
} |
572 |
} |
|
|
573 |
new BasicSearchEngine(this.workingCopies).searchAllConstructorDeclarations( |
574 |
qualification, |
575 |
simpleName, |
576 |
matchRule, |
577 |
getSearchScope(), |
578 |
constructorRequestor, |
579 |
FORCE_IMMEDIATE_SEARCH, |
580 |
progressMonitor); |
588 |
} else { |
581 |
} else { |
589 |
try { |
582 |
try { |
590 |
new BasicSearchEngine(this.workingCopies).searchAllConstructorDeclarations( |
583 |
new BasicSearchEngine(this.workingCopies).searchAllConstructorDeclarations( |