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 267288

Summary: org.netbeans.modules.java.editor.codegen.GeneratorUtils$DuplicateMemberException: Class member already exists
Product: java Reporter: jockel <jockel>
Component: EditorAssignee: Dusan Balek <dbalek>
Status: NEW ---    
Severity: normal CC: helderneres, Leperous
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 223815
Attachments: stacktrace
stacktrace
stacktrace

Description jockel 2016-07-25 08:49:23 UTC
This issue was reported manually by jockel.
It already has 3 duplicates 


Build: NetBeans IDE Dev (Build 201607250002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.31-b07, Java(TM) SE Runtime Environment, 1.8.0_31-b13
OS: Linux

User Comments:
helderneres: Using refactoring to implement a abstract method from a interface that is already implemented with same signature except return type. The @Override annotation were present in the refered method.

jockel: While refactoring: pressed alt+insert to implement an abstract method (where another method with same name but another return type was still there and not deleted before)

GUEST: I didn't remember. :(




Stacktrace: 
org.netbeans.modules.java.editor.codegen.GeneratorUtils$DuplicateMemberException: Class member already exists
   at org.netbeans.modules.java.editor.codegen.GeneratorUtils.insertClassMembers(GeneratorUtils.java:198)
   at org.netbeans.modules.java.editor.codegen.GeneratorUtils.generateAbstractMethodImplementations(GeneratorUtils.java:119)
   at org.netbeans.modules.java.editor.codegen.ImplementOverrideMethodGenerator$3.run(ImplementOverrideMethodGenerator.java:324)
   at org.netbeans.modules.java.editor.codegen.ImplementOverrideMethodGenerator$3.run(ImplementOverrideMethodGenerator.java:304)
   at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:636)
   at org.netbeans.api.java.source.JavaSource$1.run(JavaSource.java:626)
Comment 1 jockel 2016-07-25 08:49:25 UTC
Created attachment 161415 [details]
stacktrace
Comment 2 Exceptions Reporter 2017-05-08 08:16:16 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=223815
Comment 3 Leperous 2017-09-30 17:53:39 UTC
Created attachment 165214 [details]
stacktrace

Not sure
Comment 4 helderneres 2017-11-27 00:05:16 UTC
Created attachment 165497 [details]
stacktrace

01. Pre Conditions:
01.01. Class implements erroneously a interface method. (Same name, same input argumentos, different return type).

02. Actions taked:
02.01. Into class editor: (Alt + Ins) + Implement Method + Select method that class erroneously implements and another.

03. Errors:
03.01. Netbeans throws an exception and don't implements the other interface method.