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 184377 - [69cat] java.lang.IllegalArgumentException: more than one element with same name found
Summary: [69cat] java.lang.IllegalArgumentException: more than one element with same n...
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: REGRESSION
: 184066 184444 (view as bug list)
Depends on:
Blocks: 136595
  Show dependency tree
 
Reported: 2010-04-16 19:45 UTC by javydreamercsw
Modified: 2010-10-01 13:48 UTC (History)
3 users (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 javydreamercsw 2010-04-16 19:45:15 UTC
[ BUILD # : 201004160201 ]
[ JDK VERSION : 1.6.* ]

When selecting packages to make public after wrapping the joda-time library.
(http://joda-time.sourceforge.net/)

java.lang.IllegalArgumentException: more than one element with same name found
	at org.openide.xml.XMLUtil.findElement(XMLUtil.java:948)
	at
org.netbeans.modules.apisupport.project.ProjectXMLManager.findElement(ProjectXML
Manager.java:907)
	at
org.netbeans.modules.apisupport.project.ProjectXMLManager.insertPublicOrFriend(P
rojectXMLManager.java:760)
	at
org.netbeans.modules.apisupport.project.ProjectXMLManager.replacePublicPackages(
ProjectXMLManager.java:748)
	at
org.netbeans.modules.apisupport.project.ui.customizer.SingleModuleProperties.sto
reProperties(SingleModuleProperties.java:924)
	at
org.netbeans.modules.apisupport.project.ui.customizer.CustomizerProviderImpl.sto
reProperties(CustomizerProviderImpl.java:87)
	at
org.netbeans.modules.apisupport.project.ui.customizer.BasicCustomizer$1.run(Basi
cCustomizer.java:159)
	at
org.netbeans.modules.apisupport.project.ui.customizer.BasicCustomizer$1.run(Basi
cCustomizer.java:157)
	at org.openide.util.Mutex.writeAccess(Mutex.java:433)
	at
org.netbeans.modules.apisupport.project.ui.customizer.BasicCustomizer.save(Basic
Customizer.java:157)
	at
org.netbeans.modules.apisupport.project.ui.customizer.BasicCustomizer$OptionList
ener.actionPerformed(BasicCustomizer.java:180)
	at
org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener$1.run(Customi
zerDialog.java:246)
	at org.openide.util.Mutex.writeAccess(Mutex.java:394)
	at
org.netbeans.modules.project.uiapi.CustomizerDialog$OptionListener.actionPerform
ed(CustomizerDialog.java:244)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.jav
a:236)
	at java.awt.Component.processMouseEvent(Component.java:6263)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6028)
	at java.awt.Container.processEvent(Container.java:2041)
	at java.awt.Component.dispatchEventImpl(Component.java:4630)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4460)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4460)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:133)
	at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269
)
	at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174
)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Comment 1 Jesse Glick 2010-04-17 19:05:09 UTC
Regression from a refactoring. The ProjectXMLManager code should be updated anyway.
Comment 2 mvfranz 2010-04-19 00:20:13 UTC
I tried to reproduce this using the latest golden and cannot make it happen.  

Let me know if these steps are incorrect.
1. created a suite
2. created a wrapped module using joda-time
3. edited the public API 
3.1 properties -> API Versioning
3.2 Removed packages as they are all checked
3.3 clicked ok
4. tried to add back in different combinations

No exception was generated

Added friend modules as well.  No exception.  The project.xml file has the correct entries and survives NetBeans restart.
Comment 3 Jesse Glick 2010-04-19 17:01:24 UTC
Reproducible but you have to add another wrapped JAR (<class-path-extension>), then change public packages.

Workaround is to edit public packages directly in project.xml.
Comment 4 Jesse Glick 2010-04-19 18:30:09 UTC
core-main #3d2a0b58b521
Comment 5 Quality Engineering 2010-04-20 05:13:10 UTC
Integrated into 'main-golden', will be available in build *201004200200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3d2a0b58b521
User: Jesse Glick <jglick@netbeans.org>
Log: #184377: need to use appendChildElement, since findElement now throws IAE if there are >1 matches. Simpler anyway.
Comment 6 Jesse Glick 2010-04-20 14:14:43 UTC
*** Bug 184444 has been marked as a duplicate of this bug. ***
Comment 7 Jesse Glick 2010-10-01 13:48:11 UTC
*** Bug 184066 has been marked as a duplicate of this bug. ***