This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 254950

Summary: @Override has to be automatically added
Product: java Reporter: gokumar
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log

Description gokumar 2015-09-03 03:50:43 UTC
Link: http://services.netbeans.org/synergy/client/app/#/case/5139/suite/2025

Product Version = NetBeans IDE Dev (Build 201508310002)
Operating System = Linux version 3.16.0-40-generic running on amd64 (Ubuntu)
Java; VM; Vendor = 1.8.0_45
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.45-b02

Reproducibility: Happens every time

STEPS:
1. Open extract.ClassB.java class
2. Right click in the body of class and from pop-up menu select Refactor > Extract Superclass...
3. In "Extract Superclass" dialog type new name (e.g. MyClass), check two methods m1(), m3() and mark m1() as abstract then press Preview
4. Inspect changes and press Do Refactoring
5. Press undo and confirm dialog
6. Press redo and confirm
7. Press undo again and confirm

ACTUAL:
- Preview correctly shows all changes
- MyClass is created as abstract and it contains two methods m1() (declared as abstract) and m3() (not abstract), MyClass extends from ClassA
- Method m3() is moved from ClassB to MyClass but method m1() still remains in ClassB (it overrides public abstract void m1(); of MyClass)
- Code is every time compilable
- Undo/Redo works properly as expected except for the case if the superclass name is provided as "SuperClass" Ref. 254694
- Automatically @Override annotation should be added to m1() in ClassB, which is not the case

EXPECTED:
- Preview correctly shows all changes
- MyClass is created as abstract and it contains two methods m1() (declared as abstract) and m3() (not abstract), MyClass extends from ClassA
- Method m3() is moved from ClassB to MyClass but method m1() still remains in ClassB (it overrides public abstract void m1(); of MyClass)
- Code is every time compilable
- Undo/Redo works properly as expected
- Automatically @Override annotation should be added to m1() in Class
Comment 1 gokumar 2015-09-03 03:50:51 UTC
Created attachment 155843 [details]
IDE log
Comment 2 Jiri Kovalsky 2015-09-03 09:34:21 UTC
Reassigning for further evaluation.
Comment 3 Jiri Prox 2015-09-03 10:12:30 UTC

*** This bug has been marked as a duplicate of bug 231148 ***