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 78562 - Renaming generic through template parameters adds superfluous generic
Summary: Renaming generic through template parameters adds superfluous generic
Status: RESOLVED WORKSFORME
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: issues@uml
URL:
Keywords:
Depends on: 78452
Blocks:
  Show dependency tree
 
Reported: 2006-06-20 12:58 UTC by bugbridge
Modified: 2007-07-03 09:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bugbridge 2006-06-20 12:58:16 UTC
Coke build 200604050200

Step to reproduce:

- Create a java project
- Create a uml project and associate it to the java project
- Create a class diagram
- Add Template class to the diagram and name it 'MyClass'
- Go to 'MyClass' property window and press 'Template Parameters'
- Add new template parameter and name it 'Template1'
- Press 'OK' button.
  Java source code is generated:
  -----------------------------------------------------------
  public class MyClass<Template1> {
    public MyClass() {
    }
  }
  -----------------------------------------------------------
- Go to 'MyClass' property window and press 'Template Parameters'
- Rename the 'Template1' parameter to 'Template2'
- Press 'OK' button.

  Java source code is generated:

  -----------------------------------------------------------
  public class MyClass<Template1, Template2> {
    public MyClass() {
    }
  }
  -----------------------------------------------------------

  'Template1' was not renamed to 'Template2'

Description (Entry 2):
This is an exception from messages.log file:

java.lang.IllegalArgumentException: argument type mismatch
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.netbeans.modules.uml.core.support.umlutils.PropertyElementManager.setData(PropertyElementManager.java:281)
	at
org.netbeans.modules.uml.core.support.umlutils.PropertyElement.save(PropertyElement.java:234)
	at
org.netbeans.modules.uml.propertysupport.customizers.PropertyElementCustomizer$PropertyElementTabelModel$PropertyData.save(PropertyElementCustomizer.java:664)
	at
org.netbeans.modules.uml.propertysupport.customizers.PropertyElementCustomizer$PropertyElementTabelModel$PropertyData.save(PropertyElementCustomizer.java:668)
	at
org.netbeans.modules.uml.propertysupport.customizers.PropertyElementCustomizer$PropertyElementTabelModel$PropertyData.save(PropertyElementCustomizer.java:656)
	at
org.netbeans.modules.uml.propertysupport.customizers.PropertyElementCustomizer$PropertyElementTabelModel.saveModel(PropertyElementCustomizer.java:400)
	at
org.netbeans.modules.uml.propertysupport.customizers.PropertyElementCustomizer.getPropertyValue(PropertyElementCustomizer.java:317)
	at
org.openide.explorer.propertysheet.PropertyDialogManager.doButtonPressed(PropertyDialogManager.java:491)
	at
org.openide.explorer.propertysheet.PropertyDialogManager.access$000(PropertyDialogManager.java:40)
	at
org.openide.explorer.propertysheet.PropertyDialogManager$1.actionPerformed(PropertyDialogManager.java:121)
	at
org.netbeans.core.windows.services.NbPresenter$ButtonListener.actionPerformed(NbPresenter.java:1074)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
	at java.awt.Component.processMouseEvent(Component.java:5488)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
	at java.awt.Component.processEvent(Component.java:5253)
	at java.awt.Container.processEvent(Container.java:1966)
	at java.awt.Component.dispatchEventImpl(Component.java:3955)
	at java.awt.Container.dispatchEventImpl(Container.java:2024)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
	at java.awt.Dialog$1.run(Dialog.java:515)
	at java.awt.Dialog.show(Dialog.java:536)
	at org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.java:810)
	at org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.java:853)
	at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:841)
	at org.openide.util.Mutex.doEventAccess(Mutex.java:1172)
	at org.openide.util.Mutex.readAccess(Mutex.java:209)
	at org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:826)
	at
org.openide.explorer.propertysheet.CustomEditorAction.actionPerformed(CustomEditorAction.java:301)
	at org.openide.explorer.propertysheet.SheetTable.editCellAt(SheetTable.java:951)
	at
javax.swing.plaf.basic.BasicTableUI$Handler.adjustFocusAndSelection(BasicTableUI.java:922)
	at javax.swing.plaf.basic.BasicTableUI$Handler.mousePressed(BasicTableUI.java:889)
	at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
	at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
	at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:221)
	at java.awt.Component.processMouseEvent(Component.java:5485)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
	at
org.openide.explorer.propertysheet.SheetTable.processMouseEvent(SheetTable.java:688)
	at java.awt.Component.processEvent(Component.java:5253)
	at java.awt.Container.processEvent(Container.java:1966)
	at java.awt.Component.dispatchEventImpl(Component.java:3955)
	at java.awt.Container.dispatchEventImpl(Container.java:2024)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
	at java.awt.Container.dispatchEventImpl(Container.java:2010)
	at java.awt.Window.dispatchEventImpl(Window.java:1774)
	at java.awt.Component.dispatchEvent(Component.java:3803)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
	at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Comment 1 Craig Conover 2006-10-12 00:28:01 UTC
This scenario is obsolete because of the Roundtrip Redisgn: issue 84855
Comment 2 Andrew Korostelev 2006-10-13 12:15:34 UTC
verified in all-nbms-griffin-061012_6 on nb55rc2
problem shouldn't be reproducible in new CodeGeneration. 
But can't check because of blocking issue 78452.
reopen it and mark as blocked to check in the future.
Comment 3 Peter Lam 2006-10-17 22:56:38 UTC
This problem exists in JSE 8.1 UML version. However, this bug can not be
reproduced until issue 78452 is fixed. So, verification of this bug depends on
the fix for issue 78452.

New step to reproduce:

- Create a uml project 
- Create a Class diagram
- Put a Template class on the diagram and name it 'MyClass'
- Add 'Template1' template parameter to the template class through Properties
Result: "Template1" is displayed as template parameter on "MyClass"
- Right-click on "Class1" and select "Generate Code..."
- Open and view the source file for "MyClass" 
The generate code should be 
public class MyClass<Template1> {
    public MyClass() {
    }
}
- Go to 'MyClass' property window and press 'Template Parameters'
- Rename the 'Template1' parameter to 'Template2'
- Press 'OK' button.
- Right-click on "Class1" and select "Generate Code..."
- Open and view the source file for "MyClass" 
Result: The generated Java source code would be like the following:
  public class MyClass<Template1, Template2> {
    public MyClass() {
    }
  }
But should be like the following with 'Template1' renamed to 'Template2'
  public class MyClass<Template2> {
    public MyClass() {
    }
  }
Comment 4 Peter Lam 2007-03-20 23:26:20 UTC
low use case not currently impacting our installed user base.
Comment 5 Viktor Lapitski 2007-07-03 09:37:15 UTC
works for me in NB 60 trunk current build.