Share

Eclipse SQL Explorer [RCP/Plugin]

Tracker: Bugs

5 ClassCastException in history view - ID: 1557955
Last Update: Comment added ( dvanherbergen )

If you click an entry in the "SQL History" view and
the current editor isn't a SQLEditor, you get a
ClassCastException. I'd submit a patch but it's a
trivial fix:

In
net.sourceforge.sqlexplorer.history.actions.AppendToEd
itorAction before line 42 just add

if (!(page.getActiveEditor() instanceof SQLEditor)) {
return false;
}

Here's the stack trace:
java.lang.ClassCastException:
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnit
Editor
at
net.sourceforge.sqlexplorer.history.actions.AppendToEd
itorAction.isEnabled(AppendToEditorAction.java:42)
at
net.sourceforge.sqlexplorer.history.actions.SQLHistory
ActionGroup.refresh(SQLHistoryActionGroup.java:128)
at
net.sourceforge.sqlexplorer.plugin.views.SQLHistoryVie
w$6.selectionChanged(SQLHistoryView.java:282)
at org.eclipse.jface.viewers.Viewer$2.run
(Viewer.java:162)
at org.eclipse.core.runtime.SafeRunner.run
(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run
(Platform.java:843)
at org.eclipse.ui.internal.JFaceUtil$1.run
(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run
(SafeRunnable.java:149)
at
org.eclipse.jface.viewers.Viewer.fireSelectionChanged
(Viewer.java:160)
at
org.eclipse.jface.viewers.StructuredViewer.updateSelec
tion(StructuredViewer.java:1976)
at
org.eclipse.jface.viewers.StructuredViewer.handleSelec
t(StructuredViewer.java:1128)
at
org.eclipse.jface.viewers.StructuredViewer$4.widgetSel
ected(StructuredViewer.java:1154)
at
org.eclipse.jface.util.OpenStrategy.fireSelectionEvent
(OpenStrategy.java:213)
at
org.eclipse.jface.util.OpenStrategy.access$3
(OpenStrategy.java:207)
at
org.eclipse.jface.util.OpenStrategy$1.handleEvent
(OpenStrategy.java:374)
at
org.eclipse.swt.widgets.EventTable.sendEvent
(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent
(Widget.java:928)
at
org.eclipse.swt.widgets.Display.runDeferredEvents
(Display.java:3348)
at
org.eclipse.swt.widgets.Display.readAndDispatch
(Display.java:2968)
at
org.eclipse.ui.internal.Workbench.runEventLoop
(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI
(Workbench.java:1878)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbenc
h(Workbench.java:419)
at
org.eclipse.ui.PlatformUI.createAndRunWorkbench
(PlatformUI.java:149)
at
org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:95)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.
run(PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLa
uncher.runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLa
uncher.start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:177)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke
(Method.java:585)
at
org.eclipse.core.launcher.Main.invokeFramework
(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun
(Main.java:280)
at org.eclipse.core.launcher.Main.run
(Main.java:977)
at org.eclipse.core.launcher.Main.main
(Main.java:952)


Burt Beckwith ( bbeckwith ) - 2006-09-13 14:45

5

Closed

Fixed

Nobody/Anonymous

None

None

Public


Comment ( 1 )

Date: 2006-09-13 20:08
Sender: dvanherbergenProject Admin

Logged In: YES
user_id=1008644

Thanks! I've corrected this in CVS.


Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2006-09-13 20:08 dvanherbergen
resolution_id None 2006-09-13 20:08 dvanherbergen
close_date - 2006-09-13 20:08 dvanherbergen