| Summary: | [1.8][quick fix] "Add unimplemented methods" should not create stubs for default methods | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||
| Component: | UI | Assignee: | Martin Mathew <manju656> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | daniel_megert, manju656, noopur_gupta | ||||
| Version: | 4.3 | Flags: | daniel_megert:
review+
|
||||
| Target Milestone: | 4.3.1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 403924 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
Tentatively targeting 4.3.1. Created attachment 232274 [details]
Patch with testcases.
With this patch only abstract method stubs will be created during the "Add unimplemented methods" quick fix. Added 2 testcases for this scenario.
Marking it as dependent on bug 403924 as StubUtility2 has 2 instances where it uses #thrownExceptions. @Noopur, can you review the patch and give an initial feedback? *** Bug 406277 has been marked as a duplicate of this bug. *** (In reply to comment #3) > @Noopur, can you review the patch and give an initial feedback? The patch looks good. It covers both default and static methods of interface, by allowing only abstract methods to be added for implementation. In the tests, JavaProjectHelper#addRTJar18 should call set18CompilerOptions(IJavaProject) instead of #set17CompilerOptions. Fixed in 'master' with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=100ddaa5694f03a7e942ff937ac9ff1e157c43b3 (without the 1.8 tests). Fixed in 'R4_3_maintenance' with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=98840432b7dc09315cd0db1bfa67b184698b24a3 (without the 1.8 tests). Fixed in 'BETA_JAVA8' with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=74903cbca471e4ba0e503ada3a029c76046b5fcf (with tests). Verified in 4.4 using Build id: I20130804-2300 and verified for 4.3.1 using Build id: M20130731-0800. |
BETA_JAVA8 and master The "Add unimplemented methods" quick fix should not create stubs for default methods. public class MyString implements CharSequence { } => When compiling against a 1.8 JRE, the quick fix also adds stubs for chars() and codePoints(), which are new default methods in CharSequence. "Source > Override/Implement Methods" already looks good (only selects abstract methods).