Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 346415 - [1.7][assist] No proposal inside catch statement from 3rd catch block onwards
Summary: [1.7][assist] No proposal inside catch statement from 3rd catch block onwards
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-19 07:10 EDT by Ayushman Jain CLA
Modified: 2011-08-05 02:54 EDT (History)
3 users (show)

See Also:


Attachments
proposed fix v1.0 + regression tests (10.69 KB, patch)
2011-06-03 04:14 EDT, Ayushman Jain CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ayushman Jain CLA 2011-05-19 07:10:16 EDT
BETA_JAVA7 branch.
Content assist is broken when there are more than 2 catch blocks and proposal is asked inside the catch statement

public class Abc {
	
	static void foo() throws IOException, IllegalArgumentException, OperationNotSupportedException, IndexOutOfBoundsException {
		
	}

	void bar() {		
		try {
		    Abc.foo();
		} catch (IOException e) {
			
		} catch (OperationNotSupportedException e) {
			
		} catch ([CTRL-SPACE]) {      // No proposal here
                } 
	}
}
Comment 1 Ayushman Jain CLA 2011-06-03 04:14:04 EDT
Created attachment 197291 [details]
proposed fix v1.0 + regression tests

The problem is that now the astLengthPtr points to the no. of arguments in a union type ref rather than pointing to how many catch blocks have been encountered till now, as was the case earlier. That info is captured in astLengthPtr - 1 when the CompletionParser is in buildMoreTryStatementCompletionContext(..). The above patch captures the relevant change.
Comment 2 Ayushman Jain CLA 2011-06-03 04:31:34 EDT
Released in BETA_JAVA7.
Comment 3 Srikanth Sankaran CLA 2011-06-29 02:37:34 EDT
Verified using "Eclipse Java Development Tools Patch for Java 7 Support (BETA)	1.0.0.v20110623-0900	org.eclipse.jdt.patch.feature.group	Eclipse.org"