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 49853 - CCE after Fix Imports
Summary: CCE after Fix Imports
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Matula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-03 13:20 UTC by _ tboudreau
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 _ tboudreau 2004-10-03 13:20:13 UTC
I used Fix Imports after adding a referenced class to an inner 
class.  The following exception occurred:


java.lang.ClassCastException
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.NewClassExpr
essionImpl.initChildren(NewClassExpressionImpl.java:111)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.NewClassExpr
essionImpl.getEnclosingClass(NewClassExpressionImpl.java:48)
	at 
org.netbeans.jmi.javamodel.NewClassExpression$Impl.getEnclos
ingClass(Unknown Source)
	at 
org.netbeans.modules.javacore.jmiimpl.javamodel.NewClassExpr
essionImpl.getChildren(NewClassExpressionImpl.java:98)
	at 
org.netbeans.jmi.javamodel.NewClassExpression$Impl.getChildr
en(Unknown Source)
	at 
org.netbeans.modules.editor.java.JavaFixAllImports.findPotential
ClassNames(JavaFixAllImports.java:463)
	at 
org.netbeans.modules.editor.java.JavaFixAllImports.findPotential
ClassNames(JavaFixAllImports.java:469)
	at 
org.netbeans.modules.editor.java.JavaFixAllImports.findPotential
ClassNames(JavaFixAllImports.java:469)
	at 
org.netbeans.modules.editor.java.JavaFixAllImports.findPotential
ClassNames(JavaFixAllImports.java:477)
	at 
org.netbeans.modules.editor.java.JavaFixAllImports.addAllNeede
dImports(JavaFixAllImports.java:98)
	at 
org.netbeans.modules.editor.java.JavaFixAllImports.actionPerfor
med(JavaFixAllImports.java:59)
	at 
org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java
:178)
	at 
javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1535)
	at 
javax.swing.JComponent.processKeyBinding(JComponent.java:
2438)
	at 
javax.swing.JComponent.processKeyBindings(JComponent.java:
2473)
	at 
javax.swing.JComponent.processKeyEvent(JComponent.java:
2401)
	at java.awt.Component.processEvent(Component.java:
4975)
	at java.awt.Container.processEvent(Container.java:1613)
	at java.awt.Component.dispatchEventImpl(Component.java:
3681)
	at java.awt.Container.dispatchEventImpl(Container.java:
1671)
	at java.awt.Component.dispatchEvent(Component.java:
3543)
	at 
java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocus
Manager.java:1713)
	at 
java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Defaul
tKeyboardFocusManager.java:627)
	at 
java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(De
faultKeyboardFocusManager.java:831)
	at 
java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(De
faultKeyboardFocusManager.java:741)
	at 
java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKe
yboardFocusManager.java:592)
	at java.awt.Component.dispatchEventImpl(Component.java:
3572)
	at java.awt.Container.dispatchEventImpl(Container.java:
1671)
	at java.awt.Window.dispatchEventImpl(Window.java:1606)
	at java.awt.Component.dispatchEvent(Component.java:
3543)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:
456)
	at 
java.awt.EventDispatchThread.pumpOneEventForHierarchy(Event
DispatchThread.java:234)
	at 
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis
patchThread.java:184)
	at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread
.java:178)
	at 
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread
.java:170)
	at 
java.awt.EventDispatchThread.run(EventDispatchThread.java:
100)
Comment 1 Martin Matula 2004-10-04 08:51:55 UTC
Do you have the source file where you tried to fix the imports when
this exception was thrown by any change?
Comment 2 _ tboudreau 2004-10-04 13:03:53 UTC
No idea what class it was at this point.  Maybe add some assertion to give more info about 
what was being cast?
Comment 3 Martin Matula 2004-10-04 15:51:35 UTC
I am not able to reproduce it. Please attach the source code when it
happens again. This is most likely a problem in the parser returing
wrong type of AST element.
Comment 4 Martin Matula 2004-10-25 17:44:00 UTC
Seems to be fixed - no additional info provided and nobody seems to
report a similar problem.
Comment 5 Quality Engineering 2007-09-20 10:27:12 UTC
Reorganization of java component