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 - @Override has to be automatically added
Summary: @Override has to be automatically added
Status: RESOLVED DUPLICATE of bug 231148
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-03 03:50 UTC by gokumar
Modified: 2015-09-03 10:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (238.81 KB, text/plain)
2015-09-03 03:50 UTC, gokumar
Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***