Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 348574

Summary: [quickfix] implement abstract methods from tsuper
Product: [Tools] Objectteams Reporter: Stephan Herrmann <stephan.herrmann>
Component: OTDTAssignee: Project Teams <objectteams.otdt-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M3   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
tests & fix none

Description Stephan Herrmann CLA 2011-06-07 10:24:42 EDT
If a non-abstract role overrides an abstract role from the super team,
missing implementations for abstract methods (incl. abstract static)
are not reported well:
- error has no valid location (shown at position 0)
- error differs between building and reconciling
- error has no quickfix.
Comment 1 Stephan Herrmann CLA 2011-08-27 10:32:54 EDT
Shouldn't be too hard to fix.
Comment 2 Stephan Herrmann CLA 2011-10-04 14:42:50 EDT
(In reply to comment #0)
> If a non-abstract role overrides an abstract role from the super team,
> missing implementations for abstract methods (incl. abstract static)
> are not reported well:
> - error has no valid location (shown at position 0)
> - error differs between building and reconciling

This was resolved in duplicate bug 355311.

> - error has no quickfix.

This will be fixed here (changing the bug title accordingly).
Comment 3 Stephan Herrmann CLA 2011-10-04 16:47:56 EDT
Created attachment 204551 [details]
tests & fix

Fix comes in two steps:

Must report AbstractMethodMustBeImplemented also for copy-inherited
abstract methods. -> This will trigger the desired quickfixes

Must catch CCE in ModifierCorrectionSubProcessor.addAbstractMethodProposals:
it is expected that the error location is a method declaration,
but copy-inherited method has no local AST, so we find the type decl instead.

Tests:
+ new OTReconcilerTests.testBug348574a()
  Check that problem reported in comment 0 is really resolved
+ Adjust expected result in ImplicitInheritance
+ JavaQuickFixTests for the actual quickfixes
Comment 4 Stephan Herrmann CLA 2011-10-04 16:52:46 EDT
Released for 2.1 M3 (r2034-38)
Comment 5 Stephan Herrmann CLA 2012-09-22 11:27:18 EDT
Verified using build 2.2.1.201209182002