Bug 287306 - ClassCastException when trying to Open Declaration
Summary: ClassCastException when trying to Open Declaration
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-21 10:52 EDT by Santi de Ledesma CLA
Modified: 2009-08-28 15:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Santi de Ledesma CLA 2009-08-21 10:52:08 EDT
After upgrading to Galileo, when I try to open an object's declaration I (sometimes) get the following pop up error:

Problems opening an editor

org.eclipse.jdt.internal.core.CompilationUnit cannot be cast to org.eclipse.ajdt.core.javaelements.AJCompilationUnit

the problem log shows this:

eclipse.buildId=I20090611-1540
java.version=1.6.0_14
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product


Error
Thu Aug 20 16:34:34 CDT 2009
Internal Error

java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
at org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
at org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
at org.eclipse.jdt.internal.ui.actions.SelectionConverter.perfo rmForkedCodeResolve(SelectionConverter.java:247)
at org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeR esolveForked(SelectionConverter.java:163)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:14 2)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchR un(SelectionDispatchAction.java:278)
at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(Selec tionDispatchAction.java:250)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler. java:185)
at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execut e(LegacyHandlerWrapper.java:109)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequ enceBindings(WorkbenchKeyboard.java:569)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(Work benchKeyboard.java:510)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter .handleEvent(WorkbenchKeyboard.java:125)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:146 7)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1175)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1200)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1185)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1212 )
at org.eclipse.swt.widgets.Widget.gtk_key_press_event(Widget.ja va:706)
at org.eclipse.swt.widgets.Control.gtk_key_press_event(Control. java:2837)
at org.eclipse.swt.widgets.Composite.gtk_key_press_event(Compos ite.java:703)
at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1570)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4586 )
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4191 )
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:75 86)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1185)
at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Na tive Method)
at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS. java:1858)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3110)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Caused by: java.lang.ClassCastException: org.eclipse.jdt.internal.core.CompilationUnit cannot be cast to org.eclipse.ajdt.core.javaelements.AJCompilationUnit
at org.eclipse.ajdt.core.codeconversion.ITDAwareNameEnvironment .find(ITDAwareNameEnvironment.java:84)
at org.eclipse.jdt.internal.core.SearchableEnvironment.findType (SearchableEnvironment.java:286)
at org.eclipse.jdt.internal.core.CancelableNameEnvironment.find Type(CancelableNameEnvironment.java:45)
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.a skForType(LookupEnvironment.java:127)
at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getT ype(PackageBinding.java:127)
at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.isVi ewedAsDeprecated(PackageBinding.java:211)
at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.is ViewedAsDeprecated(ReferenceBinding.java:1199)
at org.eclipse.jdt.internal.compiler.ast.ASTNode.isTypeUseDepre cated(ASTNode.java:467)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScop e.faultInImports(CompilationUnitScope.java:393)
at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScop e.faultInTypes(CompilationUnitScope.java:444)
at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(S electionEngine.java:909)
at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.j ava:162)
at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(Com pilationUnit.java:375)
at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect_aro undBody0(CompilationUnit.java:369)
at org.eclipse.jdt.internal.core.CompilationUnit$AjcClosure1.ru n(CompilationUnit.java:1)
at org.eclipse.contribution.jdt.itdawareness.ITDAwarenessAspect .ajc$around$org_eclipse_contribution_jdt_itdawareness_ITDAwa renessAspect$6$3f3ffce8proceed(ITDAwarenessAspect.aj:1)
at org.eclipse.contribution.jdt.itdawareness.ITDAwarenessAspect .ajc$around$org_eclipse_contribution_jdt_itdawareness_ITDAwa renessAspect$6$3f3ffce8(ITDAwarenessAspect.aj:296)
at org.eclipse.jdt.internal.core.CompilationUnit.codeSelect(Com pilationUnit.java:369)
at org.eclipse.jdt.internal.ui.actions.SelectionConverter.codeR esolve(SelectionConverter.java:256)
at org.eclipse.jdt.internal.ui.actions.SelectionConverter$1$Cod eResolveRunnable.run(SelectionConverter.java:240)
at org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)



The project uses AspectJ and Maven.

Here are the plugins versions:

Maven integration for eclipse: 0.9.8.200905041414
AspectJ Development tools: 2.0.0.e35x-20090624-1600
AspectJ version: 1.6.5.20090618034232

I'm running ubuntu 9.04

There are other errors on the log that may be related (different message, similar stacktrace), I will post them if you think they are needed.

The error seems to be associated with the origin point (if Class A is 'cursed' and Class B isn't, then I can open Class C's declaration from B, but I can't from A)

One reason I'm hesitant to post this as a bug is that Other coworkers have the same project and a similar setup and they can't reproduce the problem.
Comment 1 Andrew Eisenberg CLA 2009-08-24 12:23:09 EDT
It sounds like this is a different error than that described in Bug 283468, but the fix for that code touched the same code that is giving you the exception.

Please upgrade to the latest dev version and see if this fixes your problem.  If not, then there are a few other things we can try.
Comment 2 Santi de Ledesma CLA 2009-08-24 15:44:13 EDT
That seemed to fix it, Thanks for the help. I guess you can close it now


Comment 3 Andrew Eisenberg CLA 2009-08-28 14:44:47 EDT
Fixed.
Comment 4 Andrew Eisenberg CLA 2009-08-28 14:45:47 EDT
btw- I'd recommend that you upgrade again because I just put out a build that fixes a content assist bug from the previous dev build.
Comment 5 Santi de Ledesma CLA 2009-08-28 15:05:55 EDT
(In reply to comment #4)
> btw- I'd recommend that you upgrade again because I just put out a build that
> fixes a content assist bug from the previous dev build.
> 
thanks for the heads up. I actually noticed the problems with the content assist and was considering filling a bug report about it :)

Santi.