Package level access to another plugin [message #295821] |
Thu, 08 December 2005 08:44  |
Eclipse User |
|
|
|
I'm in a bit of a bind and I'm hoping someone can help me out. I'll say up front that this is a hack but I really need it at the moment. I need to be able to call the function CCombo.dropDown(boolean) from a plugin that is not the SWT plugin. This method is declared as a package level method. I can write a method to do this and it works fine when running as a SWT application but once I put the Eclipse runtime in the mix I receive IllegalAccessErrors. I understand why this is discouraged and I wouldn't do this for a long term solution. I've also already logged an enhancement request (https://bugs.eclipse.org/bugs/show_bug.cgi?id=119057) to hopefully make this method public or protected. Is there any way to do this without building my own version of the SWT plugin?
Below is the exception that I'm receiving. I'm running this from an abbot JUnit.
java.lang.IllegalAccessError: tried to access method org.eclipse.swt.custom.CCombo.dropDown(Z)V from class org.eclipse.swt.custom.CComboUtil
at org.eclipse.swt.custom.CComboUtil.dropDown(CComboUtil.java:5 )
at CComboAbbotTest$1.widgetSelected(CComboAbbotTest.java:31)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2713)
at CComboAbbotTest.testRun(CComboAbbotTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:344)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:57)
at org.eclipse.pde.internal.junit.runtime.UITestApplication$1.r un(UITestApplication.java:99)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3057)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2716)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:103)
at org.eclipse.pde.internal.junit.runtime.UITestApplication.run (UITestApplication.java:39)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04065 seconds