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 10781 - ArrayIndexOutOfBoundsException after using fast import (import line exists)
Summary: ArrayIndexOutOfBoundsException after using fast import (import line exists)
Status: CLOSED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
: 10782 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-03-28 16:16 UTC by onivy
Modified: 2007-09-26 09:14 UTC (History)
0 users

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 onivy 2001-03-28 16:16:57 UTC
to reconstruct: (using an example)
1. open a java file in the editor.
2. write the following import line:
  import java.util.HashMap;
3. click on "HashMap" (put the cursor in the word).
4. press Alt+Shift+I.
5. click on the "Import Class" button.

results: the following exception occurs:
--------------------------------------------------------------------------------
Wed Mar 28 18:15:22 IST 2001java.lang.ArrayIndexOutOfBoundsException: null
java.lang.ArrayIndexOutOfBoundsException
        at org.netbeans.modules.java.model.ImportCollection.findPositions
(ImportCollection.java:170)
        at org.netbeans.modules.java.model.ObjectCollection.addMembers
(ObjectCollection.java:102)
        at org.netbeans.modules.java.model.ImportCollection.addImports
(ImportCollection.java:91)
        at org.netbeans.modules.java.model.ImportCollection.changeMembers
(ImportCollection.java:151)
        at org.netbeans.modules.java.model.SourceElementImpl.changeImports
(SourceElementImpl.java:171)
        at org.netbeans.modules.java.parser.SourceImplProxy.changeImports
(SourceImplProxy.java:132)
        at org.openide.src.SourceElement.addImport(SourceElement.java:127)
        at org.netbeans.modules.editor.java.NbJavaFastImport.updateImport
(NbJavaFastImport.java:52)
        at org.netbeans.editor.ext.java.JavaFastImport.actionPerformed
(JavaFastImport.java:191)
        at org.netbeans.core.NbPresenter$ButtonListener.actionPerformed
(NbPresenter.java:711)
        at javax.swing.AbstractButton.fireActionPerformed
(AbstractButton.java:1450)
        at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed
(AbstractButton.java:1504)
        at javax.swing.DefaultButtonModel.fireActionPerformed
(DefaultButtonModel.java:378)
        at javax.swing.DefaultButtonModel.setPressed
(DefaultButtonModel.java:250)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased
(BasicButtonListener.java:216)
        at java.awt.Component.processMouseEvent(Component.java:3717)
        at java.awt.Component.processEvent(Component.java:3546)
        at java.awt.Container.processEvent(Container.java:1164)
        at java.awt.Component.dispatchEventImpl(Component.java:2595)
        at java.awt.Container.dispatchEventImpl(Container.java:1213)
        at java.awt.Component.dispatchEvent(Component.java:2499)
        at java.awt.LightweightDispatcher.retargetMouseEvent
(Container.java:2451)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125)
        at java.awt.Container.dispatchEventImpl(Container.java:1200)
        at java.awt.Window.dispatchEventImpl(Window.java:912)
        at java.awt.Component.dispatchEvent(Component.java:2499)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
        at java.awt.EventDispatchThread.pumpOneEvent
(EventDispatchThread.java:103)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.Dialog.show(Dialog.java:370)
        at org.netbeans.core.NbPresenter.superShow(NbPresenter.java:477)
        at org.netbeans.core.NbPresenter.run(NbPresenter.java:500)
        at org.openide.util.Mutex.doEventAccess(Mutex.java:855)
        at org.openide.util.Mutex.readAccess(Mutex.java:145)
        at org.netbeans.core.NbPresenter.show(NbPresenter.java:481)
        at java.awt.Component.show(Component.java:946)
        at java.awt.Component.setVisible(Component.java:903)
        at org.netbeans.editor.ext.java.JavaFastImport.setDialogVisible
(JavaFastImport.java:76)
        at 
org.netbeans.modules.editor.java.JavaKit$FastImportAction.actionPerformed
(JavaKit.java:543)
        at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:133)
        at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1702)
        at javax.swing.JComponent.processKeyBinding(JComponent.java:2156)
        at javax.swing.JComponent.processKeyBindings(JComponent.java:2182)
        at javax.swing.JComponent.processKeyEvent(JComponent.java:2119)
        at javax.swing.JEditorPane.processKeyEvent(JEditorPane.java:1159)
        at java.awt.Component.processEvent(Component.java:3555)
        at java.awt.Container.processEvent(Container.java:1164)
        at java.awt.Component.dispatchEventImpl(Component.java:2595)
        at java.awt.Container.dispatchEventImpl(Container.java:1213)
        at java.awt.Component.dispatchEvent(Component.java:2499)
        at java.awt.LightweightDispatcher.processKeyEvent(Container.java:2155)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2135)
        at java.awt.Container.dispatchEventImpl(Container.java:1200)
        at java.awt.Window.dispatchEventImpl(Window.java:912)
        at java.awt.Component.dispatchEvent(Component.java:2499)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:319)
        at java.awt.EventDispatchThread.pumpOneEvent
(EventDispatchThread.java:103)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:84)
Comment 1 Jan Lahoda 2001-03-29 08:01:28 UTC
*** Issue 10782 has been marked as a duplicate of this issue. ***
Comment 2 Miloslav Metelka 2001-03-30 11:47:02 UTC
seems related to java module.
I think that the java module could also ignore adding of the import if there is
exactly the same import already present in the import section.
Comment 3 Svata Dedic 2001-04-02 16:41:31 UTC
Please, whenever you change the Product, DO "reassign to the owner of selected 
component". I was not notified about this one at all by Issuezilla. Thanks.
Comment 4 Svata Dedic 2001-04-02 16:44:01 UTC
Marking as fixed - I've removed similar bug about a week ago. In fact, this 
exception was caused by java module filtering out existing imports and passing 
on empty array.
Comment 5 Jan Chalupa 2001-05-05 23:24:50 UTC
Target milestone -> 3.2
Comment 6 Jan Becicka 2001-05-09 17:13:50 UTC
No Exception is thrown now
Comment 7 Quality Engineering 2003-07-01 13:15:18 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.