| Summary: | Zest incubator: NullpointerException because of missing Scrollbars on Scrollable | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Arnaud MERGEY <a_mergey> | ||||||||||
| Component: | Incubator | Assignee: | Project Inbox <rap.incubator-inbox> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | austin.riddle | ||||||||||
| Version: | 1.4 | ||||||||||||
| Target Milestone: | --- | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows 7 | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Arnaud MERGEY
Created attachment 196381 [details]
To reproduce the issue, just launch snippet.zest.launch
Created attachment 196384 [details]
patch variant1
Add scrollbar to avoid nullpointerException
Created attachment 196385 [details]
patch variant2
According to code comments and some FIXME comments in ScrolledComposite,
it is probably better to instantiate scrollbar in Scrollable class
After fixing the scrollbar issue, there is still somthing wrong with a Color widget disposed (see stack trace above) To reproduce, launch the attached snippet, with one of the given attached patch 2011-05-24 00:56:42.687:WARN::ERROR: /view org.eclipse.swt.SWTException: Graphic is disposed at org.eclipse.swt.SWT.error(SWT.java:3538) at org.eclipse.swt.SWT.error(SWT.java:3458) at org.eclipse.swt.SWT.error(SWT.java:3429) at org.eclipse.swt.graphics.Color.getRed(Color.java:174) at org.eclipse.rwt.lifecycle.JSWriter.getColorValue(JSWriter.java:904) at org.eclipse.rwt.lifecycle.JSWriter.createParamList(JSWriter.java:839) at org.eclipse.rwt.lifecycle.JSWriter.createParamList(JSWriter.java:807) at org.eclipse.rwt.lifecycle.JSWriter.call(JSWriter.java:597) at org.eclipse.swt.internal.widgets.canvaskit.GCOperationWriter.setProperty(GCOperationWriter.java:233) at org.eclipse.swt.internal.widgets.canvaskit.GCOperationWriter.write(GCOperationWriter.java:72) at org.eclipse.swt.internal.widgets.canvaskit.CanvasLCA.writeGCOperations(CanvasLCA.java:62) at org.eclipse.swt.internal.widgets.canvaskit.CanvasLCA.renderChanges(CanvasLCA.java:45) at org.eclipse.rwt.lifecycle.AbstractWidgetLCA.render(AbstractWidgetLCA.java:36) at org.eclipse.swt.internal.widgets.displaykit.DisplayLCA$RenderVisitor.render(DisplayLCA.java:72) at org.eclipse.swt.internal.widgets.displaykit.DisplayLCA$RenderVisitor.doVisit(DisplayLCA.java:56) at org.eclipse.swt.internal.widgets.WidgetTreeVisitor$AllWidgetTreeVisitor.visit(WidgetTreeVisitor.java:36) at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:50) at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:57) at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:57) at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:57) at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:57) at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:57) at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:57) at org.eclipse.swt.internal.widgets.displaykit.DisplayLCA.renderShells(DisplayLCA.java:175) at org.eclipse.swt.internal.widgets.displaykit.DisplayLCA.render(DisplayLCA.java:147) at org.eclipse.rwt.internal.lifecycle.Render.execute(Render.java:29) at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.continueLifeCycle(RWTLifeCycle.java:190) at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLifeCycle.java:260) at org.eclipse.swt.widgets.Display.sleep(Display.java:1165) at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:361) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2734) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694) at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:702) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:685) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157) at snippet.zest.Application.start(Application.java:18) at org.eclipse.rap.ui.internal.application.EntrypointApplicationWrapper.createUI(EntrypointApplicationWrapper.java:27) at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:73) at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:211) at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:88) at java.lang.Thread.run(Thread.java:662) at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:102) Created attachment 196387 [details]
ugly workaround to check zest in RAP
I did not manage yet to find the cause of the "color disposed" issue, so in order
to check if zest could work in RAP, I did something ugly, (commented the dispose check in Color), just to see if zest can work in RAP
Even I am ashamed of it, I provide this ugly patch, if someone wants to see zest working in RAP :)
Arnaud, the missing scroll bars are a problem in RWT. Please open a sepate bug regarding the missing scroll bars on Scrolllable. Though I haven't been able to entirely track it down, the color-disposed-exception looks rather like a bug in Zest. Disposing of a color that is still in use is not permitted in SWT. However, the behavior differs from platform to platform. E.g. on Windows this case is motly silently ignored, whereas in RWT it inevitably leads to an exception. Code like the one below might be silently ignored on some platforms, but throw an exception on others: Color color = new Color( display, 255, 255, 255 ); widget.sertBackground( color ); color.dispose(); Are you able to narrow the source of the problem? HTH Rüdiger Hi Arnaud, I have Oops. The last post was incomplete. Hi Arnaud, I have fixed the null pointer issue by porting the Graph class to use a Slider implementation for scrollbars. IT is committed to CVS head. This had already been done for the GEF port, but Zest was overlooked. Sorry for the confusion. The Zest issue about the disposed colors I have seen as well. But I can seem to work around it in most cases by avoiding certain Graph connection types. Hope this helps. Please re-open if you experience the null pointer again. Thanks. Thanks for the fix, the NullpointerException is gone now. Could you provide more information about how you workaround the disposed color issue ? what do you mean by avoiding certain graph connection types ? Sorry, I am quite new to Zest. Thanks again. The actual problem seems to be in RWT (see bug bug 351216). |