Bug 57121

Summary: [Search] Searching when all of the "Search For" checkboxes are unchecked causes an exception
Product: [Tools] CDT Reporter: James Ciesielski <jciesiel>
Component: cdt-coreAssignee: Bogdan Gheorghe <gheorghe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description James Ciesielski CLA 2004-04-01 16:32:14 EST
Eclipse M8
CDT 2.0.0.200404011349

Test case:
1. Open the Search dialog (Search->C/C++ ...)
2. Enter some text into the Search String field.
3. Uncheck all of the Search For checkboxes.
4. Set the scope to be Workspace.
5. Limit the search to All Occurrences.
3. Click the Search button.

Result:
The following error is displayed:
An internal error occurred during: "Search for All Occurrences"

The following is dumped to the .log file:
!ENTRY org.eclipse.core.runtime 4 2 Apr 01, 2004 15:40:22.359
!MESSAGE An internal error occurred during: "Search for All Occurrences".
!STACK 0
java.util.NoSuchElementException
	at java.util.LinkedList$ListItr.next(Unknown Source)
	at org.eclipse.cdt.internal.ui.search.CSearchQuery.run(Unknown Source)
	at
org.eclipse.search2.internal.ui.InternalSearchUI$InternalSearchJob.run(InternalSearchUI.java:68)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:62)

Expected:
CDT should handle this error case more gracefully.
Comment 1 James Ciesielski CLA 2004-05-21 14:34:16 EDT
QE_TestCase_P2_SE55
Comment 2 Andrew Niefer CLA 2004-06-10 11:43:20 EDT
fixed

If no Search For is selected, no search is performed and 0 matches are reported.

Comment 3 Andrew Niefer CLA 2004-06-10 15:10:52 EDT
made the additional change that if no search for is selected then the search 
button is greyed out.  This makes the original fix redundant.
Comment 4 Pixy CLA 2004-07-06 12:29:20 EDT
Hi,

I just verified this testcase and found that it does not give an error on 
search, but the Search button is not greyed out if no Search For box is 
checked. So this bug should be reopened.

Pixy.
Comment 5 Kleo Hapitas CLA 2004-07-06 15:49:28 EDT
Re-opening based on Pixy's comments - Andrew, can you have another look?
Comment 6 Kleo Hapitas CLA 2004-07-07 16:54:28 EDT
PR was not targeted to any particular release. Changing target milestone to 2.1
Comment 7 Bogdan Gheorghe CLA 2004-07-08 15:47:45 EDT
Fixed in head and 2.0 stream ... for the final time! ;)

- BG