View | Details | Raw Unified | Return to bug 82208
Collapse All | Expand All

(-)search/org/eclipse/jdt/core/search/SearchEngine.java (-66 / +70 lines)
Lines 19-30 Link Here
19
import org.eclipse.jdt.internal.core.search.matching.*;
19
import org.eclipse.jdt.internal.core.search.matching.*;
20
20
21
/**
21
/**
22
 * A <code>SearchEngine</code> searches for Java elements following a search pattern.
22
 * A {@link SearchEngine} searches for Java elements following a search pattern.
23
 * The search can be limited to a search scope.
23
 * The search can be limited to a search scope.
24
 * <p>
24
 * <p>
25
 * Various search patterns can be created using the factory methods 
25
 * Various search patterns can be created using the factory methods 
26
 * <code>createSearchPattern(String, int, int, boolean)</code>, <code>createSearchPattern(IJavaElement, int)</code>,
26
 * {@link SearchPattern#createPattern(String, int, int, int)}, {@link SearchPattern#createPattern(IJavaElement, int)},
27
 * <code>createOrSearchPattern(ISearchPattern, ISearchPattern)</code>.
27
 * {@link SearchPattern#createOrPattern(SearchPattern, SearchPattern)}.
28
 * </p>
28
 * </p>
29
 * <p>For example, one can search for references to a method in the hierarchy of a type, 
29
 * <p>For example, one can search for references to a method in the hierarchy of a type, 
30
 * or one can search for the declarations of types starting with "Abstract" in a project.
30
 * or one can search for the declarations of types starting with "Abstract" in a project.
Lines 324-349 Link Here
324
	 * @param stringPattern the given pattern
324
	 * @param stringPattern the given pattern
325
	 * @param searchFor determines the nature of the searched elements
325
	 * @param searchFor determines the nature of the searched elements
326
	 *	<ul>
326
	 *	<ul>
327
	 * 	<li><code>IJavaSearchConstants.CLASS</code>: only look for classes</li>
327
	 * 	<li>{@link IJavaSearchConstants#CLASS}: only look for classes</li>
328
	 *		<li><code>IJavaSearchConstants.INTERFACE</code>: only look for interfaces</li>
328
	 *		<li>{@link IJavaSearchConstants#INTERFACE}: only look for interfaces</li>
329
	 * 	<li><code>IJavaSearchConstants.TYPE</code>: look for both classes and interfaces</li>
329
	 * 	<li>{@link IJavaSearchConstants#TYPE}: look for both classes and interfaces</li>
330
	 *		<li><code>IJavaSearchConstants.FIELD</code>: look for fields</li>
330
	 *		<li>{@link IJavaSearchConstants#FIELD}: look for fields</li>
331
	 *		<li><code>IJavaSearchConstants.METHOD</code>: look for methods</li>
331
	 *		<li>{@link IJavaSearchConstants#METHOD}: look for methods</li>
332
	 *		<li><code>IJavaSearchConstants.CONSTRUCTOR</code>: look for constructors</li>
332
	 *		<li>{@link IJavaSearchConstants#CONSTRUCTOR}: look for constructors</li>
333
	 *		<li><code>IJavaSearchConstants.PACKAGE</code>: look for packages</li>
333
	 *		<li>{@link IJavaSearchConstants#PACKAGE}: look for packages</li>
334
	 *	</ul>
334
	 *	</ul>
335
	 * @param limitTo determines the nature of the expected matches
335
	 * @param limitTo determines the nature of the expected matches
336
	 *	<ul>
336
	 *	<ul>
337
	 * 		<li><code>IJavaSearchConstants.DECLARATIONS</code>: will search declarations matching with the corresponding
337
	 * 		<li>{@link IJavaSearchConstants#DECLARATIONS}: will search declarations matching with the corresponding
338
	 * 			element. In case the element is a method, declarations of matching methods in subtypes will also
338
	 * 			element. In case the element is a method, declarations of matching methods in subtypes will also
339
	 *  		be found, allowing to find declarations of abstract methods, etc.</li>
339
	 *  		be found, allowing to find declarations of abstract methods, etc.</li>
340
	 *
340
	 *
341
	 *		 <li><code>IJavaSearchConstants.REFERENCES</code>: will search references to the given element.</li>
341
	 *		 <li>{@link IJavaSearchConstants#REFERENCES}: will search references to the given element.</li>
342
	 *
342
	 *
343
	 *		 <li><code>IJavaSearchConstants.ALL_OCCURRENCES</code>: will search for either declarations or references as specified
343
	 *		 <li>{@link IJavaSearchConstants#ALL_OCCURRENCES}: will search for either declarations or references as specified
344
	 *  		above.</li>
344
	 *  		above.</li>
345
	 *
345
	 *
346
	 *		 <li><code>IJavaSearchConstants.IMPLEMENTORS</code>: for interface, will find all types which implements a given interface.</li>
346
	 *		 <li>{@link IJavaSearchConstants#IMPLEMENTORS}: for interface, will find all types which implements a given interface.</li>
347
	 *	</ul>
347
	 *	</ul>
348
	 *
348
	 *
349
	 * @param isCaseSensitive indicates whether the search is case sensitive or not.
349
	 * @param isCaseSensitive indicates whether the search is case sensitive or not.
Lines 365-380 Link Here
365
	 * @param element the Java element the search pattern is based on
365
	 * @param element the Java element the search pattern is based on
366
	 * @param limitTo determines the nature of the expected matches
366
	 * @param limitTo determines the nature of the expected matches
367
	 * 	<ul>
367
	 * 	<ul>
368
	 * 		<li><code>IJavaSearchConstants.DECLARATIONS</code>: will search declarations matching with the corresponding
368
	 * 		<li>{@link IJavaSearchConstants#DECLARATIONS}: will search declarations matching with the corresponding
369
	 * 			element. In case the element is a method, declarations of matching methods in subtypes will also
369
	 * 			element. In case the element is a method, declarations of matching methods in subtypes will also
370
	 *  		be found, allowing to find declarations of abstract methods, etc.</li>
370
	 *  		be found, allowing to find declarations of abstract methods, etc.</li>
371
	 *
371
	 *
372
	 *		 <li><code>IJavaSearchConstants.REFERENCES</code>: will search references to the given element.</li>
372
	 *		 <li>{@link IJavaSearchConstants#REFERENCES}: will search references to the given element.</li>
373
	 *
373
	 *
374
	 *		 <li><code>IJavaSearchConstants.ALL_OCCURRENCES</code>: will search for either declarations or references as specified
374
	 *		 <li>{@link IJavaSearchConstants#ALL_OCCURRENCES}: will search for either declarations or references as specified
375
	 *  		above.</li>
375
	 *  		above.</li>
376
	 *
376
	 *
377
	 *		 <li><code>IJavaSearchConstants.IMPLEMENTORS</code>: for interface, will find all types which implements a given interface.</li>
377
	 *		 <li>{@link IJavaSearchConstants#IMPLEMENTORS}: for interface, will find all types which implements a given interface.</li>
378
	 *	</ul>
378
	 *	</ul>
379
	 * @return a search pattern for a Java element or <code>null</code> if the given element is ill-formed
379
	 * @return a search pattern for a Java element or <code>null</code> if the given element is ill-formed
380
	 * @deprecated Use {@link SearchPattern#createPattern(IJavaElement, int)} instead.
380
	 * @deprecated Use {@link SearchPattern#createPattern(IJavaElement, int)} instead.
Lines 413-428 Link Here
413
	 * @param workspace the workspace
413
	 * @param workspace the workspace
414
	 * @param patternString the pattern to be searched for
414
	 * @param patternString the pattern to be searched for
415
	 * @param searchFor a hint what kind of Java element the string pattern represents.
415
	 * @param searchFor a hint what kind of Java element the string pattern represents.
416
	 *  Look into <code>IJavaSearchConstants</code> for valid values
416
	 *  Look into {@link IJavaSearchConstants} for valid values
417
	 * @param limitTo one of the following values:
417
	 * @param limitTo one of the following values:
418
	 *	<ul>
418
	 *	<ul>
419
	 *	  <li><code>IJavaSearchConstants.DECLARATIONS</code>: search 
419
	 *	  <li>{@link IJavaSearchConstants#DECLARATIONS}: search 
420
	 *		  for declarations only </li>
420
	 *		  for declarations only </li>
421
	 *	  <li><code>IJavaSearchConstants.REFERENCES</code>: search 
421
	 *	  <li>{@link IJavaSearchConstants#REFERENCES}: search 
422
	 *		  for all references </li>
422
	 *		  for all references </li>
423
	 *	  <li><code>IJavaSearchConstants.ALL_OCCURENCES</code>: search 
423
	 *	  <li>{@link IJavaSearchConstants#ALL_OCCURRENCES}: search 
424
	 *		  for both declarations and all references </li>
424
	 *		  for both declarations and all references </li>
425
	 *	  <li><code>IJavaSearchConstants.IMPLEMENTORS</code>: search for
425
	 *	  <li>{@link IJavaSearchConstants#IMPLEMENTORS}: search for
426
	 *		  all implementors of an interface; the value is only valid if
426
	 *		  all implementors of an interface; the value is only valid if
427
	 *		  the Java element represents an interface</li>
427
	 *		  the Java element represents an interface</li>
428
	 * 	</ul>
428
	 * 	</ul>
Lines 459-471 Link Here
459
	 * @param element the Java element to be searched for
459
	 * @param element the Java element to be searched for
460
	 * @param limitTo one of the following values:
460
	 * @param limitTo one of the following values:
461
	 *	<ul>
461
	 *	<ul>
462
	 *	  <li><code>IJavaSearchConstants.DECLARATIONS</code>: search 
462
	 *	  <li>{@link IJavaSearchConstants#DECLARATIONS}: search 
463
	 *		  for declarations only </li>
463
	 *		  for declarations only </li>
464
	 *	  <li><code>IJavaSearchConstants.REFERENCES</code>: search 
464
	 *	  <li>{@link IJavaSearchConstants#REFERENCES}: search 
465
	 *		  for all references </li>
465
	 *		  for all references </li>
466
	 *	  <li><code>IJavaSearchConstants.ALL_OCCURENCES</code>: search 
466
	 *	  <li>{@link IJavaSearchConstants#ALL_OCCURRENCES}: search 
467
	 *		  for both declarations and all references </li>
467
	 *		  for both declarations and all references </li>
468
	 *	  <li><code>IJavaSearchConstants.IMPLEMENTORS</code>: search for
468
	 *	  <li>{@link IJavaSearchConstants#IMPLEMENTORS}: search for
469
	 *		  all implementors of an interface; the value is only valid if
469
	 *		  all implementors of an interface; the value is only valid if
470
	 *		  the Java element represents an interface</li>
470
	 *		  the Java element represents an interface</li>
471
	 * 	</ul>
471
	 * 	</ul>
Lines 544-572 Link Here
544
	 *					for this type, or a wild-carded string for this type.
544
	 *					for this type, or a wild-carded string for this type.
545
	 * @param matchRule one of
545
	 * @param matchRule one of
546
	 * <ul>
546
	 * <ul>
547
	 *		<li><code>SearchPattern.R_EXACT_MATCH</code> if the package name and type name are the full names
547
	 *		<li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type name are the full names
548
	 *			of the searched types.</li>
548
	 *			of the searched types.</li>
549
	 *		<li><code>SearchPattern.R_PREFIX_MATCH</code> if the package name and type name are prefixes of the names
549
	 *		<li>{@link SearchPattern#R_PREFIX_MATCH} if the package name and type name are prefixes of the names
550
	 *			of the searched types.</li>
550
	 *			of the searched types.</li>
551
	 *		<li><code>SearchPattern.R_PATTERN_MATCH</code> if the package name and type name contain wild-cards.</li>
551
	 *		<li>{@link SearchPattern#R_PATTERN_MATCH} if the package name and type name contain wild-cards.</li>
552
	 * </ul>
553
	 * combined with <code>SearchPattern.R_CASE_SENSITIVE</code>,
554
	 *   e.g. <code>R_EXACT_MATCH | R_CASE_SENSITIVE</code> if an exact and case sensitive match is requested, 
555
	 *   or <code>R_PREFIX_MATCH</code> if a prefix non case sensitive match is requested.
556
	 * @param searchFor one of
557
	 * <ul>
558
	 * 		<li><code>IJavaSearchConstants.CLASS</code> if searching for classes only</li>
559
	 * 		<li><code>IJavaSearchConstants.INTERFACE</code> if searching for interfaces only</li>
560
	 * 		<li><code>IJavaSearchConstants.TYPE</code> if searching for both classes and interfaces</li>
561
	 * </ul>
552
	 * </ul>
553
	 * combined with {@link SearchPattern#R_CASE_SENSITIVE},
554
	 *   e.g. {@link SearchPattern#R_EXACT_MATCH} | {@link SearchPattern#R_CASE_SENSITIVE} if an exact and case sensitive match is requested, 
555
	 *   or {@link SearchPattern#R_PREFIX_MATCH} if a prefix non case sensitive match is requested.
556
	 * @param searchFor determines the nature of the searched elements
557
	 *	<ul>
558
	 * 	<li>{@link IJavaSearchConstants#CLASS}: only look for classes</li>
559
	 *		<li>{@link IJavaSearchConstants#INTERFACE}: only look for interfaces</li>
560
	 * 	<li>{@link IJavaSearchConstants#ENUM}: only look for enumeration</li>
561
	 *		<li>{@link IJavaSearchConstants#ANNOTATION_TYPE}: only look for annotation type</li>
562
	 * 	<li>{@link IJavaSearchConstants#CLASS_AND_ENUM}: only look for classes and enumerations</li>
563
	 *		<li>{@link IJavaSearchConstants#CLASS_AND_INTERFACE}: only look for classes and interfaces</li>
564
	 * 	<li>{@link IJavaSearchConstants#TYPE}: look for all types (ie. classes, interfaces, enum and annotation types)</li>
565
	 *	</ul>
562
	 * @param scope the scope to search in
566
	 * @param scope the scope to search in
563
	 * @param nameRequestor the requestor that collects the results of the search
567
	 * @param nameRequestor the requestor that collects the results of the search
564
	 * @param waitingPolicy one of
568
	 * @param waitingPolicy one of
565
	 * <ul>
569
	 * <ul>
566
	 *		<li><code>IJavaSearchConstants.FORCE_IMMEDIATE_SEARCH</code> if the search should start immediately</li>
570
	 *		<li>{@link IJavaSearchConstants#FORCE_IMMEDIATE_SEARCH} if the search should start immediately</li>
567
	 *		<li><code>IJavaSearchConstants.CANCEL_IF_NOT_READY_TO_SEARCH</code> if the search should be cancelled if the
571
	 *		<li>{@link IJavaSearchConstants#CANCEL_IF_NOT_READY_TO_SEARCH} if the search should be cancelled if the
568
	 *			underlying indexer has not finished indexing the workspace</li>
572
	 *			underlying indexer has not finished indexing the workspace</li>
569
	 *		<li><code>IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH</code> if the search should wait for the
573
	 *		<li>{@link IJavaSearchConstants#WAIT_UNTIL_READY_TO_SEARCH} if the search should wait for the
570
	 *			underlying indexer to finish indexing the workspace</li>
574
	 *			underlying indexer to finish indexing the workspace</li>
571
	 * </ul>
575
	 * </ul>
572
	 * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
576
	 * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
Lines 601-610 Link Here
601
	 * @param nameRequestor the requestor that collects the results of the search
605
	 * @param nameRequestor the requestor that collects the results of the search
602
	 * @param waitingPolicy one of
606
	 * @param waitingPolicy one of
603
	 * <ul>
607
	 * <ul>
604
	 *		<li><code>IJavaSearchConstants.FORCE_IMMEDIATE_SEARCH</code> if the search should start immediately</li>
608
	 *		<li>{@link IJavaSearchConstants#FORCE_IMMEDIATE_SEARCH} if the search should start immediately</li>
605
	 *		<li><code>IJavaSearchConstants.CANCEL_IF_NOT_READY_TO_SEARCH</code> if the search should be cancelled if the
609
	 *		<li>{@link IJavaSearchConstants#CANCEL_IF_NOT_READY_TO_SEARCH} if the search should be cancelled if the
606
	 *			underlying indexer has not finished indexing the workspace</li>
610
	 *			underlying indexer has not finished indexing the workspace</li>
607
	 *		<li><code>IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH</code> if the search should wait for the
611
	 *		<li>{@link IJavaSearchConstants#WAIT_UNTIL_READY_TO_SEARCH} if the search should wait for the
608
	 *			underlying indexer to finish indexing the workspace</li>
612
	 *			underlying indexer to finish indexing the workspace</li>
609
	 * </ul>
613
	 * </ul>
610
	 * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
614
	 * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
Lines 647-675 Link Here
647
	 *					for this type, or a wild-carded string for this type.
651
	 *					for this type, or a wild-carded string for this type.
648
	 * @param matchRule one of
652
	 * @param matchRule one of
649
	 * <ul>
653
	 * <ul>
650
	 *		<li><code>SearchPattern.R_EXACT_MATCH</code> if the package name and type name are the full names
654
	 *		<li>{@link SearchPattern#R_EXACT_MATCH} if the package name and type name are the full names
651
	 *			of the searched types.</li>
655
	 *			of the searched types.</li>
652
	 *		<li><code>SearchPattern.R_PREFIX_MATCH</code> if the package name and type name are prefixes of the names
656
	 *		<li>{@link SearchPattern#R_PREFIX_MATCH} if the package name and type name are prefixes of the names
653
	 *			of the searched types.</li>
657
	 *			of the searched types.</li>
654
	 *		<li><code>SearchPattern.R_PATTERN_MATCH</code> if the package name and type name contain wild-cards.</li>
658
	 *		<li>{@link SearchPattern#R_PATTERN_MATCH} if the package name and type name contain wild-cards.</li>
655
	 * </ul>
659
	 * </ul>
656
	 * combined with <code>SearchPattern.R_CASE_SENSITIVE</code>,
660
	 * combined with {@link SearchPattern#R_CASE_SENSITIVE},
657
	 *   e.g. <code>R_EXACT_MATCH | R_CASE_SENSITIVE</code> if an exact and case sensitive match is requested, 
661
	 *   e.g. {@link SearchPattern#R_EXACT_MATCH} | {@link SearchPattern#R_CASE_SENSITIVE} if an exact and case sensitive match is requested, 
658
	 *   or <code>R_PREFIX_MATCH</code> if a prefix non case sensitive match is requested.
662
	 *   or {@link SearchPattern#R_PREFIX_MATCH} if a prefix non case sensitive match is requested.
659
	 * @param searchFor one of
663
	 * @param searchFor one of
660
	 * <ul>
664
	 * <ul>
661
	 * 		<li><code>IJavaSearchConstants.CLASS</code> if searching for classes only</li>
665
	 * 		<li>{@link IJavaSearchConstants#CLASS} if searching for classes only</li>
662
	 * 		<li><code>IJavaSearchConstants.INTERFACE</code> if searching for interfaces only</li>
666
	 * 		<li>{@link IJavaSearchConstants#INTERFACE} if searching for interfaces only</li>
663
	 * 		<li><code>IJavaSearchConstants.TYPE</code> if searching for both classes and interfaces</li>
667
	 * 		<li>{@link IJavaSearchConstants#TYPE} if searching for both classes and interfaces</li>
664
	 * </ul>
668
	 * </ul>
665
	 * @param scope the scope to search in
669
	 * @param scope the scope to search in
666
	 * @param nameRequestor the requestor that collects the results of the search
670
	 * @param nameRequestor the requestor that collects the results of the search
667
	 * @param waitingPolicy one of
671
	 * @param waitingPolicy one of
668
	 * <ul>
672
	 * <ul>
669
	 *		<li><code>IJavaSearchConstants.FORCE_IMMEDIATE_SEARCH</code> if the search should start immediately</li>
673
	 *		<li>{@link IJavaSearchConstants#FORCE_IMMEDIATE_SEARCH} if the search should start immediately</li>
670
	 *		<li><code>IJavaSearchConstants.CANCEL_IF_NOT_READY_TO_SEARCH</code> if the search should be cancelled if the
674
	 *		<li>{@link IJavaSearchConstants#CANCEL_IF_NOT_READY_TO_SEARCH} if the search should be cancelled if the
671
	 *			underlying indexer has not finished indexing the workspace</li>
675
	 *			underlying indexer has not finished indexing the workspace</li>
672
	 *		<li><code>IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH</code> if the search should wait for the
676
	 *		<li>{@link IJavaSearchConstants#WAIT_UNTIL_READY_TO_SEARCH} if the search should wait for the
673
	 *			underlying indexer to finish indexing the workspace</li>
677
	 *			underlying indexer to finish indexing the workspace</li>
674
	 * </ul>
678
	 * </ul>
675
	 * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
679
	 * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
Lines 707-733 Link Here
707
	 *					for this type, or a wild-carded string for this type.
711
	 *					for this type, or a wild-carded string for this type.
708
	 * @param matchMode one of
712
	 * @param matchMode one of
709
	 * <ul>
713
	 * <ul>
710
	 *		<li><code>IJavaSearchConstants.EXACT_MATCH</code> if the package name and type name are the full names
714
	 *		<li>{@link IJavaSearchConstants#EXACT_MATCH} if the package name and type name are the full names
711
	 *			of the searched types.</li>
715
	 *			of the searched types.</li>
712
	 *		<li><code>IJavaSearchConstants.PREFIX_MATCH</code> if the package name and type name are prefixes of the names
716
	 *		<li>{@link IJavaSearchConstants#PREFIX_MATCH} if the package name and type name are prefixes of the names
713
	 *			of the searched types.</li>
717
	 *			of the searched types.</li>
714
	 *		<li><code>IJavaSearchConstants.PATTERN_MATCH</code> if the package name and type name contain wild-cards.</li>
718
	 *		<li>{@link IJavaSearchConstants#PATTERN_MATCH} if the package name and type name contain wild-cards.</li>
715
	 * </ul>
719
	 * </ul>
716
	 * @param isCaseSensitive whether the search should be case sensitive
720
	 * @param isCaseSensitive whether the search should be case sensitive
717
	 * @param searchFor one of
721
	 * @param searchFor one of
718
	 * <ul>
722
	 * <ul>
719
	 * 		<li><code>IJavaSearchConstants.CLASS</code> if searching for classes only</li>
723
	 * 		<li>{@link IJavaSearchConstants#CLASS} if searching for classes only</li>
720
	 * 		<li><code>IJavaSearchConstants.INTERFACE</code> if searching for interfaces only</li>
724
	 * 		<li>{@link IJavaSearchConstants#INTERFACE} if searching for interfaces only</li>
721
	 * 		<li><code>IJavaSearchConstants.TYPE</code> if searching for both classes and interfaces</li>
725
	 * 		<li>{@link IJavaSearchConstants#TYPE} if searching for both classes and interfaces</li>
722
	 * </ul>
726
	 * </ul>
723
	 * @param scope the scope to search in
727
	 * @param scope the scope to search in
724
	 * @param nameRequestor the requestor that collects the results of the search
728
	 * @param nameRequestor the requestor that collects the results of the search
725
	 * @param waitingPolicy one of
729
	 * @param waitingPolicy one of
726
	 * <ul>
730
	 * <ul>
727
	 *		<li><code>IJavaSearchConstants.FORCE_IMMEDIATE_SEARCH</code> if the search should start immediately</li>
731
	 *		<li>{@link IJavaSearchConstants#FORCE_IMMEDIATE_SEARCH} if the search should start immediately</li>
728
	 *		<li><code>IJavaSearchConstants.CANCEL_IF_NOT_READY_TO_SEARCH</code> if the search should be cancelled if the
732
	 *		<li>{@link IJavaSearchConstants#CANCEL_IF_NOT_READY_TO_SEARCH} if the search should be cancelled if the
729
	 *			underlying indexer has not finished indexing the workspace</li>
733
	 *			underlying indexer has not finished indexing the workspace</li>
730
	 *		<li><code>IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH</code> if the search should wait for the
734
	 *		<li>{@link IJavaSearchConstants#WAIT_UNTIL_READY_TO_SEARCH} if the search should wait for the
731
	 *			underlying indexer to finish indexing the workspace</li>
735
	 *			underlying indexer to finish indexing the workspace</li>
732
	 * </ul>
736
	 * </ul>
733
	 * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
737
	 * @param progressMonitor the progress monitor to report progress to, or <code>null</code> if no progress
(-)search/org/eclipse/jdt/core/search/SearchPattern.java (-6 / +22 lines)
Lines 339-345 Link Here
339
	 *			<li>&lt;Exception&gt;Sample(Exception)</li>
339
	 *			<li>&lt;Exception&gt;Sample(Exception)</li>
340
	 *		</ul>
340
	 *		</ul>
341
	 * Type arguments have the same pattern that for type patterns
341
	 * Type arguments have the same pattern that for type patterns
342
	 * @see #createTypePattern(String,int,int)
342
	 * @see #createTypePattern(String,int,int,char)
343
	 */
343
	 */
344
	private static SearchPattern createMethodOrConstructorPattern(String patternString, int limitTo, int matchRule, boolean isConstructor) {
344
	private static SearchPattern createMethodOrConstructorPattern(String patternString, int limitTo, int matchRule, boolean isConstructor) {
345
		
345
		
Lines 767-773 Link Here
767
	 *	<ul>
767
	 *	<ul>
768
	 * 	<li>{@link IJavaSearchConstants#CLASS}: only look for classes</li>
768
	 * 	<li>{@link IJavaSearchConstants#CLASS}: only look for classes</li>
769
	 *		<li>{@link IJavaSearchConstants#INTERFACE}: only look for interfaces</li>
769
	 *		<li>{@link IJavaSearchConstants#INTERFACE}: only look for interfaces</li>
770
	 * 	<li>{@link IJavaSearchConstants#TYPE}: look for both classes and interfaces</li>
770
	 * 	<li>{@link IJavaSearchConstants#ENUM}: only look for enumeration</li>
771
	 *		<li>{@link IJavaSearchConstants#ANNOTATION_TYPE}: only look for annotation type</li>
772
	 * 	<li>{@link IJavaSearchConstants#CLASS_AND_ENUM}: only look for classes and enumerations</li>
773
	 *		<li>{@link IJavaSearchConstants#CLASS_AND_INTERFACE}: only look for classes and interfaces</li>
774
	 * 	<li>{@link IJavaSearchConstants#TYPE}: look for all types (ie. classes, interfaces, enum and annotation types)</li>
771
	 *		<li>{@link IJavaSearchConstants#FIELD}: look for fields</li>
775
	 *		<li>{@link IJavaSearchConstants#FIELD}: look for fields</li>
772
	 *		<li>{@link IJavaSearchConstants#METHOD}: look for methods</li>
776
	 *		<li>{@link IJavaSearchConstants#METHOD}: look for methods</li>
773
	 *		<li>{@link IJavaSearchConstants#CONSTRUCTOR}: look for constructors</li>
777
	 *		<li>{@link IJavaSearchConstants#CONSTRUCTOR}: look for constructors</li>
Lines 808-815 Link Here
808
		limitTo &= ~(IJavaSearchConstants.IGNORE_DECLARING_TYPE+IJavaSearchConstants.IGNORE_RETURN_TYPE);
812
		limitTo &= ~(IJavaSearchConstants.IGNORE_DECLARING_TYPE+IJavaSearchConstants.IGNORE_RETURN_TYPE);
809
	
813
	
810
		switch (searchFor) {
814
		switch (searchFor) {
815
			case IJavaSearchConstants.CLASS:
816
				return createTypePattern(stringPattern, limitTo, matchRule, IIndexConstants.CLASS_SUFFIX);
817
			case IJavaSearchConstants.CLASS_AND_INTERFACE:
818
				return createTypePattern(stringPattern, limitTo, matchRule, IIndexConstants.CLASS_AND_INTERFACE_SUFFIX);
819
			case IJavaSearchConstants.CLASS_AND_ENUM:
820
				return createTypePattern(stringPattern, limitTo, matchRule, IIndexConstants.CLASS_AND_ENUM_SUFFIX);
821
			case IJavaSearchConstants.INTERFACE:
822
				return createTypePattern(stringPattern, limitTo, matchRule, IIndexConstants.INTERFACE_SUFFIX);
823
			case IJavaSearchConstants.ENUM:
824
				return createTypePattern(stringPattern, limitTo, matchRule, IIndexConstants.ENUM_SUFFIX);
825
			case IJavaSearchConstants.ANNOTATION_TYPE:
826
				return createTypePattern(stringPattern, limitTo, matchRule, IIndexConstants.ANNOTATION_TYPE_SUFFIX);
811
			case IJavaSearchConstants.TYPE:
827
			case IJavaSearchConstants.TYPE:
812
				return createTypePattern(stringPattern, limitTo, matchRule);
828
				return createTypePattern(stringPattern, limitTo, matchRule, IIndexConstants.TYPE_SUFFIX);
813
			case IJavaSearchConstants.METHOD:
829
			case IJavaSearchConstants.METHOD:
814
				return createMethodOrConstructorPattern(stringPattern, limitTo, matchRule, false/*not a constructor*/);
830
				return createMethodOrConstructorPattern(stringPattern, limitTo, matchRule, false/*not a constructor*/);
815
			case IJavaSearchConstants.CONSTRUCTOR:
831
			case IJavaSearchConstants.CONSTRUCTOR:
Lines 1274-1280 Link Here
1274
	 * 		- '*' is not valid inside type arguments definition <>
1290
	 * 		- '*' is not valid inside type arguments definition <>
1275
	 * 		- '?' is treated as a wildcard when it is inside <> (ie. it must be put on first position of the type argument)
1291
	 * 		- '?' is treated as a wildcard when it is inside <> (ie. it must be put on first position of the type argument)
1276
	 */
1292
	 */
1277
	private static SearchPattern createTypePattern(String patternString, int limitTo, int matchRule) {
1293
	private static SearchPattern createTypePattern(String patternString, int limitTo, int matchRule, char indexSuffix) {
1278
		
1294
		
1279
		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); 
1295
		Scanner scanner = new Scanner(false /*comment*/, true /*whitespace*/, false /*nls*/, ClassFileConstants.JDK1_3/*sourceLevel*/, null /*taskTags*/, null/*taskPriorities*/, true/*taskCaseSensitive*/); 
1280
		scanner.setSource(patternString.toCharArray());
1296
		scanner.setSource(patternString.toCharArray());
Lines 1356-1369 Link Here
1356
		}
1372
		}
1357
		switch (limitTo) {
1373
		switch (limitTo) {
1358
			case IJavaSearchConstants.DECLARATIONS : // cannot search for explicit member types
1374
			case IJavaSearchConstants.DECLARATIONS : // cannot search for explicit member types
1359
				return new QualifiedTypeDeclarationPattern(qualificationChars, typeChars, IIndexConstants.TYPE_SUFFIX, matchRule);
1375
				return new QualifiedTypeDeclarationPattern(qualificationChars, typeChars, indexSuffix, matchRule);
1360
			case IJavaSearchConstants.REFERENCES :
1376
			case IJavaSearchConstants.REFERENCES :
1361
				return new TypeReferencePattern(qualificationChars, typeChars, typeSignature, matchRule);
1377
				return new TypeReferencePattern(qualificationChars, typeChars, typeSignature, matchRule);
1362
			case IJavaSearchConstants.IMPLEMENTORS : 
1378
			case IJavaSearchConstants.IMPLEMENTORS : 
1363
				return new SuperTypeReferencePattern(qualificationChars, typeChars, true, matchRule);
1379
				return new SuperTypeReferencePattern(qualificationChars, typeChars, true, matchRule);
1364
			case IJavaSearchConstants.ALL_OCCURRENCES :
1380
			case IJavaSearchConstants.ALL_OCCURRENCES :
1365
				return new OrPattern(
1381
				return new OrPattern(
1366
					new QualifiedTypeDeclarationPattern(qualificationChars, typeChars, IIndexConstants.TYPE_SUFFIX, matchRule),// cannot search for explicit member types
1382
					new QualifiedTypeDeclarationPattern(qualificationChars, typeChars, indexSuffix, matchRule),// cannot search for explicit member types
1367
					new TypeReferencePattern(qualificationChars, typeChars, matchRule));
1383
					new TypeReferencePattern(qualificationChars, typeChars, matchRule));
1368
		}
1384
		}
1369
		return null;
1385
		return null;
(-)search/org/eclipse/jdt/internal/core/search/BasicSearchEngine.java (-6 / +28 lines)
Lines 343-348 Link Here
343
			case IIndexConstants.CLASS_SUFFIX :
343
			case IIndexConstants.CLASS_SUFFIX :
344
				if (typeKind != IGenericType.CLASS_DECL) return false;
344
				if (typeKind != IGenericType.CLASS_DECL) return false;
345
				break;
345
				break;
346
			case IIndexConstants.CLASS_AND_INTERFACE_SUFFIX:
347
				if (typeKind != IGenericType.CLASS_DECL && typeKind != IGenericType.INTERFACE_DECL) return false;
348
				break;
349
			case IIndexConstants.CLASS_AND_ENUM_SUFFIX:
350
				if (typeKind != IGenericType.CLASS_DECL && typeKind != IGenericType.ENUM_DECL) return false;
351
				break;
346
			case IIndexConstants.INTERFACE_SUFFIX :
352
			case IIndexConstants.INTERFACE_SUFFIX :
347
				if (typeKind != IGenericType.INTERFACE_DECL) return false;
353
				if (typeKind != IGenericType.INTERFACE_DECL) return false;
348
				break;
354
				break;
Lines 415-426 Link Here
415
	 * combined with <code>SearchPattern.R_CASE_SENSITIVE</code>,
421
	 * combined with <code>SearchPattern.R_CASE_SENSITIVE</code>,
416
	 *   e.g. <code>R_EXACT_MATCH | R_CASE_SENSITIVE</code> if an exact and case sensitive match is requested, 
422
	 *   e.g. <code>R_EXACT_MATCH | R_CASE_SENSITIVE</code> if an exact and case sensitive match is requested, 
417
	 *   or <code>R_PREFIX_MATCH</code> if a prefix non case sensitive match is requested.
423
	 *   or <code>R_PREFIX_MATCH</code> if a prefix non case sensitive match is requested.
418
	 * @param searchFor one of
424
	 * @param searchFor determines the nature of the searched elements
419
	 * <ul>
425
	 *	<ul>
420
	 * 		<li><code>IJavaSearchConstants.CLASS</code> if searching for classes only</li>
426
	 * 	<li>{@link IJavaSearchConstants#CLASS}: only look for classes</li>
421
	 * 		<li><code>IJavaSearchConstants.INTERFACE</code> if searching for interfaces only</li>
427
	 *		<li>{@link IJavaSearchConstants#INTERFACE}: only look for interfaces</li>
422
	 * 		<li><code>IJavaSearchConstants.TYPE</code> if searching for both classes and interfaces</li>
428
	 * 	<li>{@link IJavaSearchConstants#ENUM}: only look for enumeration</li>
423
	 * </ul>
429
	 *		<li>{@link IJavaSearchConstants#ANNOTATION_TYPE}: only look for annotation type</li>
430
	 * 	<li>{@link IJavaSearchConstants#CLASS_AND_ENUM}: only look for classes and enumerations</li>
431
	 *		<li>{@link IJavaSearchConstants#CLASS_AND_INTERFACE}: only look for classes and interfaces</li>
432
	 * 	<li>{@link IJavaSearchConstants#TYPE}: look for all types (ie. classes, interfaces, enum and annotation types)</li>
433
	 *	</ul>
424
	 * @param scope the scope to search in
434
	 * @param scope the scope to search in
425
	 * @param nameRequestor the requestor that collects the results of the search
435
	 * @param nameRequestor the requestor that collects the results of the search
426
	 * @param waitingPolicy one of
436
	 * @param waitingPolicy one of
Lines 456-461 Link Here
456
			case IJavaSearchConstants.CLASS :
466
			case IJavaSearchConstants.CLASS :
457
				typeSuffix = IIndexConstants.CLASS_SUFFIX;
467
				typeSuffix = IIndexConstants.CLASS_SUFFIX;
458
				break;
468
				break;
469
			case IJavaSearchConstants.CLASS_AND_INTERFACE :
470
				typeSuffix = IIndexConstants.CLASS_AND_INTERFACE_SUFFIX;
471
				break;
472
			case IJavaSearchConstants.CLASS_AND_ENUM :
473
				typeSuffix = IIndexConstants.CLASS_AND_ENUM_SUFFIX;
474
				break;
459
			case IJavaSearchConstants.INTERFACE :
475
			case IJavaSearchConstants.INTERFACE :
460
				typeSuffix = IIndexConstants.INTERFACE_SUFFIX;
476
				typeSuffix = IIndexConstants.INTERFACE_SUFFIX;
461
				break;
477
				break;
Lines 678-683 Link Here
678
			case IJavaSearchConstants.CLASS :
694
			case IJavaSearchConstants.CLASS :
679
				typeSuffix = IIndexConstants.CLASS_SUFFIX;
695
				typeSuffix = IIndexConstants.CLASS_SUFFIX;
680
				break;
696
				break;
697
			case IJavaSearchConstants.CLASS_AND_INTERFACE :
698
				typeSuffix = IIndexConstants.CLASS_AND_INTERFACE_SUFFIX;
699
				break;
700
			case IJavaSearchConstants.CLASS_AND_ENUM :
701
				typeSuffix = IIndexConstants.CLASS_AND_ENUM_SUFFIX;
702
				break;
681
			case IJavaSearchConstants.INTERFACE :
703
			case IJavaSearchConstants.INTERFACE :
682
				typeSuffix = IIndexConstants.INTERFACE_SUFFIX;
704
				typeSuffix = IIndexConstants.INTERFACE_SUFFIX;
683
				break;
705
				break;
(-)search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java (+4 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.core.search.indexing;
11
package org.eclipse.jdt.internal.core.search.indexing;
12
12
13
import org.eclipse.jdt.core.search.IJavaSearchConstants;
14
13
public interface IIndexConstants {
15
public interface IIndexConstants {
14
16
15
	/* index encoding */
17
	/* index encoding */
Lines 31-36 Link Here
31
	char ENUM_SUFFIX = 'E';
33
	char ENUM_SUFFIX = 'E';
32
	char ANNOTATION_TYPE_SUFFIX = 'A';
34
	char ANNOTATION_TYPE_SUFFIX = 'A';
33
	char TYPE_SUFFIX = 0;
35
	char TYPE_SUFFIX = 0;
36
	char CLASS_AND_ENUM_SUFFIX = IJavaSearchConstants.CLASS_AND_ENUM;
37
	char CLASS_AND_INTERFACE_SUFFIX = IJavaSearchConstants.CLASS_AND_INTERFACE;
34
	char SEPARATOR= '/';
38
	char SEPARATOR= '/';
35
39
36
	char[] ONE_STAR = new char[] {'*'};
40
	char[] ONE_STAR = new char[] {'*'};
(-)search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java (-4 / +9 lines)
Lines 246-260 Link Here
246
		if (!checkTypeName(pattern.simpleName, patternString, fullyQualifiedTypeName, pattern.isCaseSensitive())) return false;
246
		if (!checkTypeName(pattern.simpleName, patternString, fullyQualifiedTypeName, pattern.isCaseSensitive())) return false;
247
	}
247
	}
248
248
249
	int kind  = type.getKind();
249
	switch (pattern.typeSuffix) {
250
	switch (pattern.typeSuffix) {
250
		case CLASS_SUFFIX:
251
		case CLASS_SUFFIX:
251
			return type.getKind() == IGenericType.CLASS_DECL;
252
			return kind == IGenericType.CLASS_DECL;
252
		case INTERFACE_SUFFIX:
253
		case INTERFACE_SUFFIX:
253
			return type.getKind() == IGenericType.INTERFACE_DECL;
254
			return kind == IGenericType.INTERFACE_DECL;
254
		case ENUM_SUFFIX:
255
		case ENUM_SUFFIX:
255
			return type.getKind() == IGenericType.ENUM_DECL;
256
			return kind == IGenericType.ENUM_DECL;
256
		case ANNOTATION_TYPE_SUFFIX:
257
		case ANNOTATION_TYPE_SUFFIX:
257
			return type.getKind() == IGenericType.ANNOTATION_TYPE_DECL;
258
			return kind == IGenericType.ANNOTATION_TYPE_DECL;
259
		case CLASS_AND_INTERFACE_SUFFIX:
260
			return kind == IGenericType.CLASS_DECL || kind == IGenericType.INTERFACE_DECL;
261
		case CLASS_AND_ENUM_SUFFIX:
262
			return kind == IGenericType.CLASS_DECL || kind == IGenericType.ENUM_DECL;
258
		case TYPE_SUFFIX: // nothing
263
		case TYPE_SUFFIX: // nothing
259
	}
264
	}
260
	return true;
265
	return true;
(-)search/org/eclipse/jdt/internal/core/search/matching/MultiTypeDeclarationPattern.java (-1 / +9 lines)
Lines 59-65 Link Here
59
	}
59
	}
60
	this.typeSuffix = typeSuffix;
60
	this.typeSuffix = typeSuffix;
61
61
62
	((InternalSearchPattern)this).mustResolve = false; // only used to report type declarations, not their positions
62
	((InternalSearchPattern)this).mustResolve = typeSuffix != TYPE_SUFFIX; // only used to report type declarations, not their positions
63
}
63
}
64
MultiTypeDeclarationPattern(int matchRule) {
64
MultiTypeDeclarationPattern(int matchRule) {
65
	super(TYPE_DECL_PATTERN, matchRule);
65
	super(TYPE_DECL_PATTERN, matchRule);
Lines 74-79 Link Here
74
	QualifiedTypeDeclarationPattern pattern = (QualifiedTypeDeclarationPattern) decodedPattern;
74
	QualifiedTypeDeclarationPattern pattern = (QualifiedTypeDeclarationPattern) decodedPattern;
75
	switch(this.typeSuffix) {
75
	switch(this.typeSuffix) {
76
		case CLASS_SUFFIX :
76
		case CLASS_SUFFIX :
77
		case CLASS_AND_INTERFACE_SUFFIX:
78
		case CLASS_AND_ENUM_SUFFIX:
77
		case INTERFACE_SUFFIX :
79
		case INTERFACE_SUFFIX :
78
		case ENUM_SUFFIX :
80
		case ENUM_SUFFIX :
79
		case ANNOTATION_TYPE_SUFFIX :
81
		case ANNOTATION_TYPE_SUFFIX :
Lines 143-148 Link Here
143
		case CLASS_SUFFIX :
145
		case CLASS_SUFFIX :
144
			output.append("MultiClassDeclarationPattern: "); //$NON-NLS-1$
146
			output.append("MultiClassDeclarationPattern: "); //$NON-NLS-1$
145
			break;
147
			break;
148
		case CLASS_AND_INTERFACE_SUFFIX :
149
			output.append("MultiClassAndInterfaceDeclarationPattern: "); //$NON-NLS-1$
150
			break;
151
		case CLASS_AND_ENUM_SUFFIX :
152
			output.append("MultiClassAndEnumDeclarationPattern: "); //$NON-NLS-1$
153
			break;
146
		case INTERFACE_SUFFIX :
154
		case INTERFACE_SUFFIX :
147
			output.append("MultiInterfaceDeclarationPattern: "); //$NON-NLS-1$
155
			output.append("MultiInterfaceDeclarationPattern: "); //$NON-NLS-1$
148
			break;
156
			break;
(-)search/org/eclipse/jdt/internal/core/search/matching/QualifiedTypeDeclarationPattern.java (-1 / +9 lines)
Lines 26-32 Link Here
26
	this.simpleName = isCaseSensitive() ? simpleName : CharOperation.toLowerCase(simpleName);
26
	this.simpleName = isCaseSensitive() ? simpleName : CharOperation.toLowerCase(simpleName);
27
	this.typeSuffix = typeSuffix;
27
	this.typeSuffix = typeSuffix;
28
28
29
	((InternalSearchPattern)this).mustResolve = this.qualification != null;
29
	((InternalSearchPattern)this).mustResolve = this.qualification != null || typeSuffix != TYPE_SUFFIX;
30
}
30
}
31
QualifiedTypeDeclarationPattern(int matchRule) {
31
QualifiedTypeDeclarationPattern(int matchRule) {
32
	super(matchRule);
32
	super(matchRule);
Lines 75-80 Link Here
75
	QualifiedTypeDeclarationPattern pattern = (QualifiedTypeDeclarationPattern) decodedPattern;
75
	QualifiedTypeDeclarationPattern pattern = (QualifiedTypeDeclarationPattern) decodedPattern;
76
	switch(this.typeSuffix) {
76
	switch(this.typeSuffix) {
77
		case CLASS_SUFFIX :
77
		case CLASS_SUFFIX :
78
		case CLASS_AND_INTERFACE_SUFFIX :
79
		case CLASS_AND_ENUM_SUFFIX :
78
		case INTERFACE_SUFFIX :
80
		case INTERFACE_SUFFIX :
79
		case ENUM_SUFFIX :
81
		case ENUM_SUFFIX :
80
		case ANNOTATION_TYPE_SUFFIX :
82
		case ANNOTATION_TYPE_SUFFIX :
Lines 88-93 Link Here
88
		case CLASS_SUFFIX :
90
		case CLASS_SUFFIX :
89
			output.append("ClassDeclarationPattern: qualification<"); //$NON-NLS-1$
91
			output.append("ClassDeclarationPattern: qualification<"); //$NON-NLS-1$
90
			break;
92
			break;
93
		case CLASS_AND_INTERFACE_SUFFIX:
94
			output.append("ClassAndInterfaceDeclarationPattern: qualification<"); //$NON-NLS-1$
95
			break;
96
		case CLASS_AND_ENUM_SUFFIX :
97
			output.append("ClassAndEnumDeclarationPattern: qualification<"); //$NON-NLS-1$
98
			break;
91
		case INTERFACE_SUFFIX :
99
		case INTERFACE_SUFFIX :
92
			output.append("InterfaceDeclarationPattern: qualification<"); //$NON-NLS-1$
100
			output.append("InterfaceDeclarationPattern: qualification<"); //$NON-NLS-1$
93
			break;
101
			break;
(-)search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationLocator.java (-2 / +14 lines)
Lines 52-61 Link Here
52
52
53
	switch (this.pattern.typeSuffix) {
53
	switch (this.pattern.typeSuffix) {
54
		case CLASS_SUFFIX:
54
		case CLASS_SUFFIX:
55
			if (type.isInterface()) return IMPOSSIBLE_MATCH;
55
			if (!type.isClass()) return IMPOSSIBLE_MATCH;
56
			break;
57
		case CLASS_AND_INTERFACE_SUFFIX:
58
			if (!(type.isClass() || (type.isInterface() && !type.isAnnotationType()))) return IMPOSSIBLE_MATCH;
59
			break;
60
		case CLASS_AND_ENUM_SUFFIX:
61
			if (!(type.isClass() || type.isEnum())) return IMPOSSIBLE_MATCH;
56
			break;
62
			break;
57
		case INTERFACE_SUFFIX:
63
		case INTERFACE_SUFFIX:
58
			if (!type.isInterface()) return IMPOSSIBLE_MATCH;
64
			if (!type.isInterface() || type.isAnnotationType()) return IMPOSSIBLE_MATCH;
65
			break;
66
		case ENUM_SUFFIX:
67
			if (!type.isEnum()) return IMPOSSIBLE_MATCH;
68
			break;
69
		case ANNOTATION_TYPE_SUFFIX:
70
			if (!type.isAnnotationType()) return IMPOSSIBLE_MATCH;
59
			break;
71
			break;
60
		case TYPE_SUFFIX : // nothing
72
		case TYPE_SUFFIX : // nothing
61
	}
73
	}
(-)search/org/eclipse/jdt/internal/core/search/matching/TypeDeclarationPattern.java (-1 / +11 lines)
Lines 143-149 Link Here
143
	this.simpleName = isCaseSensitive() ? simpleName : CharOperation.toLowerCase(simpleName);
143
	this.simpleName = isCaseSensitive() ? simpleName : CharOperation.toLowerCase(simpleName);
144
	this.typeSuffix = typeSuffix;
144
	this.typeSuffix = typeSuffix;
145
145
146
	((InternalSearchPattern)this).mustResolve = this.pkg != null && this.enclosingTypeNames != null;
146
	((InternalSearchPattern)this).mustResolve = (this.pkg != null && this.enclosingTypeNames != null) || typeSuffix != TYPE_SUFFIX;
147
}
147
}
148
TypeDeclarationPattern(int matchRule) {
148
TypeDeclarationPattern(int matchRule) {
149
	super(TYPE_DECL_PATTERN, matchRule);
149
	super(TYPE_DECL_PATTERN, matchRule);
Lines 203-208 Link Here
203
	TypeDeclarationPattern pattern = (TypeDeclarationPattern) decodedPattern;
203
	TypeDeclarationPattern pattern = (TypeDeclarationPattern) decodedPattern;
204
	switch(this.typeSuffix) {
204
	switch(this.typeSuffix) {
205
		case CLASS_SUFFIX :
205
		case CLASS_SUFFIX :
206
		case CLASS_AND_INTERFACE_SUFFIX :
207
		case CLASS_AND_ENUM_SUFFIX :
206
		case INTERFACE_SUFFIX :
208
		case INTERFACE_SUFFIX :
207
		case ENUM_SUFFIX :
209
		case ENUM_SUFFIX :
208
		case ANNOTATION_TYPE_SUFFIX :
210
		case ANNOTATION_TYPE_SUFFIX :
Lines 251-256 Link Here
251
				if (this.simpleName == null) {
253
				if (this.simpleName == null) {
252
					switch(this.typeSuffix) {
254
					switch(this.typeSuffix) {
253
						case CLASS_SUFFIX :
255
						case CLASS_SUFFIX :
256
						case CLASS_AND_INTERFACE_SUFFIX :
257
						case CLASS_AND_ENUM_SUFFIX :
254
						case INTERFACE_SUFFIX :
258
						case INTERFACE_SUFFIX :
255
						case ENUM_SUFFIX :
259
						case ENUM_SUFFIX :
256
						case ANNOTATION_TYPE_SUFFIX :
260
						case ANNOTATION_TYPE_SUFFIX :
Lines 276-281 Link Here
276
		case CLASS_SUFFIX :
280
		case CLASS_SUFFIX :
277
			output.append("ClassDeclarationPattern: pkg<"); //$NON-NLS-1$
281
			output.append("ClassDeclarationPattern: pkg<"); //$NON-NLS-1$
278
			break;
282
			break;
283
		case CLASS_AND_INTERFACE_SUFFIX:
284
			output.append("ClassAndInterfaceDeclarationPattern: pkg<"); //$NON-NLS-1$
285
			break;
286
		case CLASS_AND_ENUM_SUFFIX :
287
			output.append("ClassAndEnumDeclarationPattern: pkg<"); //$NON-NLS-1$
288
			break;
279
		case INTERFACE_SUFFIX :
289
		case INTERFACE_SUFFIX :
280
			output.append("InterfaceDeclarationPattern: pkg<"); //$NON-NLS-1$
290
			output.append("InterfaceDeclarationPattern: pkg<"); //$NON-NLS-1$
281
			break;
291
			break;

Return to bug 82208