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 8439

Summary: new->Constructor generate constructor with the same parameters
Product: java Reporter: pzajac <pzajac>
Component: UnsupportedAssignee: issues@java <issues>
Status: CLOSED FIXED    
Severity: trivial    
Priority: P4    
Version: 3.x   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description pzajac 2000-11-15 19:20:49 UTC
Steps to  reproduction:
1) Select Construktor node of java node
2) Perform action new->Construktor
3) Add parameters with the same names

It doesn't test if parameters are the same names.
Comment 1 Tomas Hurka 2001-01-12 13:26:59 UTC
I suggest to correct this bug with the following patch:

Index:
openide/src/org/openide/explorer/propertysheet/editors/MethodParameterArrayEditor.java
===================================================================
RCS file:
/cvs/openide/src/org/openide/explorer/propertysheet/editors/MethodParameterArrayEditor.java,v
retrieving revision 1.13
diff -r1.13 MethodParameterArrayEditor.java
225c225,236
<                             return new MethodParameter(name, type, isFinal);
---
>                           Enumeration methodEnum = model.elements();
>
>                           while(methodEnum.hasMoreElements())
>                           {   MethodParameter oldPar =
(MethodParameter)methodEnum.nextElement();
>
>                               if (name.equals(oldPar.getName()))
>                               {    errMsg = "MSG_DuplicateName"; // NOI18N
>                                   break;
>                               }
>                           }
>                           if (errMsg == null)
>                               return new MethodParameter(name, type, isFinal);
Index: openide/src/org/openide/explorer/propertysheet/editors/Bundle.properties
===================================================================
RCS file:
/cvs/openide/src/org/openide/explorer/propertysheet/editors/Bundle.properties,v
retrieving revision 1.12
diff -r1.12 Bundle.properties
76a77
> MSG_DuplicateName=Name of parameter is already used
Index:
openide/src/org/openide/explorer/propertysheet/editors/Bundle_ja.properties
===================================================================
RCS file:
/cvs/openide/src/org/openide/explorer/propertysheet/editors/Bundle_ja.properties,v
retrieving revision 1.11
diff -r1.11 Bundle_ja.properties
135a136
> MSG_DuplicateName=
Comment 2 Jan Becicka 2001-01-31 14:24:59 UTC
[010130_1] Verified
Comment 3 Quality Engineering 2003-07-01 13:18:26 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.