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 80822 - IllegalArgumentException when jumping to source from Navigator
Summary: IllegalArgumentException when jumping to source from Navigator
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Schema Tools (show other bugs)
Version: 5.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-21 14:13 UTC by Andrei Chistiakov
Modified: 2006-07-26 12:53 UTC (History)
4 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 Andrei Chistiakov 2006-07-21 14:13:38 UTC
Reproduced in build 060720.

To reproduce the bug:

- create PO schema;
- create a new schema;
- include PO into the new schema;
- in the new schema create new global element of PurchaseOrderType type;
- in Navigator's Design View expand 'newElement|sequence|shipTo' and invoke 'Go
To|Source'.

java.lang.IllegalArgumentException: bad position: 485
	at javax.swing.text.JTextComponent.setCaretPosition(JTextComponent.java:1650)
	at
org.netbeans.modules.xml.schema.core.multiview.SchemaSourceMultiViewElement$1.showComponent(SchemaSourceMultiViewElement.java:116)
	at
org.netbeans.modules.xml.schema.core.multiview.SchemaMultiViewSupport.viewInSwingThread(SchemaMultiViewSupport.java:237)
	at
org.netbeans.modules.xml.schema.core.multiview.SchemaMultiViewSupport.view(SchemaMultiViewSupport.java:188)
	at
org.netbeans.modules.xml.xam.ui.actions.AbstractShowComponentAction.performAction(AbstractShowComponentAction.java:69)
	at org.openide.util.actions.NodeAction.performAction(NodeAction.java:261)
	at
org.netbeans.modules.xml.xam.ui.actions.GoToAction$ActSubMenuModel.performActionAt(GoToAction.java:194)
	at org.openide.awt.Actions$ISubActionListener.actionPerformed(Actions.java:969)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:377)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:232)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1157)
	at
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1198)
	at java.awt.Component.processMouseEvent(Component.java:5999)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3240)
	at java.awt.Component.processEvent(Component.java:5764)
	at java.awt.Container.processEvent(Container.java:1984)
	at java.awt.Component.dispatchEventImpl(Component.java:4407)
	at java.awt.Container.dispatchEventImpl(Container.java:2042)
	at java.awt.Component.dispatchEvent(Component.java:4237)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4248)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3912)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3842)
	at java.awt.Container.dispatchEventImpl(Container.java:2028)
	at java.awt.Window.dispatchEventImpl(Window.java:2405)
	at java.awt.Component.dispatchEvent(Component.java:4237)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:600)
	at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Comment 1 bhate 2006-07-22 00:58:50 UTC
gotoaction is made context aware. the context aware instance will work on nodes
in lookup rather than activated nodes
Comment 2 Andrei Chistiakov 2006-07-25 13:49:37 UTC
Reproducible in build 060724.
Comment 3 bhate 2006-07-25 19:21:47 UTC
This bug is in axi model.
if an axi component proxies schema component from different file,
the axi component's model should have other file's fobj in lookup. but thats not
the case.
//
Model model = c.getModel();
FileObject fobj = (FileObject)
model.getModelSource().getLookup().lookup(FileObject.class);
//should give referenced schema's fobj.

-- sam
Comment 4 Samaresh Panda 2006-07-25 23:27:36 UTC
Node lookup, which is used for go-to-source, blindly keeps the axi component in
its lookup, even if the component is a proxy for an original that comes from a
different source file.

So for proxies, we have to make sure that we keep the original in the lookup.
Comment 5 Samaresh Panda 2006-07-25 23:52:44 UTC
ABEAbstractNode.java, 1.1.2.23
Comment 6 Andrei Chistiakov 2006-07-26 12:53:10 UTC
Verified in build 060725.