Community
Participate
Working Groups
Build id: I20070621-1340 GREEN WARNING: A critical error has occurred. You should copy this message along with the stack trace below and send it to the contact address provided with this software. java.lang.NullPointerException at org.eclipse.draw2d.DeferredUpdateManager.sendUpdateRequest(DeferredUpdateManager.java:239) at org.eclipse.draw2d.DeferredUpdateManager.queueWork(DeferredUpdateManager.java:229) at org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(DeferredUpdateManager.java:124) at org.eclipse.draw2d.Figure.revalidate(Figure.java:1349) at org.eclipse.draw2d.Figure.revalidate(Figure.java:1351) at org.eclipse.draw2d.Figure.revalidate(Figure.java:1351) at org.eclipse.draw2d.Figure.revalidate(Figure.java:1351) at org.eclipse.draw2d.Figure.revalidate(Figure.java:1351) at org.eclipse.draw2d.Figure.revalidate(Figure.java:1351) at org.eclipse.draw2d.Figure.revalidate(Figure.java:1351) at org.eclipse.draw2d.Figure.revalidate(Figure.java:1351) at org.eclipse.draw2d.PolylineConnection.revalidate(PolylineConnection.java:215) at org.eclipse.draw2d.Figure.revalidate(Figure.java:1351) at org.eclipse.draw2d.Label.setText(Label.java:609) at edu.buffalo.cse.green.editor.controller.RelationshipPart.updateCardinalityLabel(RelationshipPart.java:371) at edu.buffalo.cse.green.editor.controller.RelationshipPart.access$0(RelationshipPart.java:363) at edu.buffalo.cse.green.editor.controller.RelationshipPart$RelationshipCardinalityHandler.notify(RelationshipPart.java:488) at edu.buffalo.cse.green.editor.model.AbstractModel.firePropertyChange(AbstractModel.java:269) at edu.buffalo.cse.green.editor.model.RelationshipModel.updateCardinality(RelationshipModel.java:540) at edu.buffalo.cse.green.editor.DiagramEditor.refreshRelationships(DiagramEditor.java:1396) at edu.buffalo.cse.green.editor.DiagramEditor.forceRefreshRelationships(DiagramEditor.java:1333) at edu.buffalo.cse.green.JavaModelListener.elementChanged(JavaModelListener.java:158) at org.eclipse.jdt.internal.core.DeltaProcessor$3.run(DeltaProcessor.java:1552) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.jdt.internal.core.DeltaProcessor.notifyListeners(DeltaProcessor.java:1542) at org.eclipse.jdt.internal.core.DeltaProcessor.fireReconcileDelta(DeltaProcessor.java:1395) at org.eclipse.jdt.internal.core.DeltaProcessor.fire(DeltaProcessor.java:1350) at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:761) at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:780) at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1169) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:101) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:82) at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:149) at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.reconcile(CompositeReconcilingStrategy.java:86) at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.reconcile(JavaCompositeReconcilingStrategy.java:96) at org.eclipse.jface.text.reconciler.MonoReconciler.process(MonoReconciler.java:75) at org.eclipse.jdt.internal.ui.text.JavaReconciler.process(JavaReconciler.java:378) at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:204)
The NPE is in Display.getCurrent().asyncExec(new UpdateRequest()); Almost definitely the Display.getCurrent() in null as you are trying to run on a non UI thread. You need to fix your notification listener to run the UI updates on the UI thread. In theory we could add some protection code so that the NPE is not thrown.
Making changes outside the UI thread can cause several problems. This is a good way to bring to the client's attention that they're doing something unintended.
(In reply to comment #2) > Making changes outside the UI thread can cause several problems. This is a > good way to bring to the client's attention that they're doing something > unintended. > Gee ... wouldn't an "invalid thread access" exception be better? :)
Yeah, you're right, that would be better. At least that will stop clients from opening such invalid defects.
We should fix to throw an "invalid thread access" exception when this issue occurs.
Created attachment 84150 [details] Patch trhowing SWTException
Hi all, Please Find attached a patch throwing an SWTException with the INVALID_THREAD_ACCESS code when trying to get the current display from a non UI thread. I am not sure this the good exception to throw ... maybe we have to create a new "Exception" or use an existing draw2d's one ... ??? Manuel
Any news about the submitted patch ?? Manuel
OK, we will get this one into 3.4.
Cool ;o) I also ran into the same problem than David and really think that if would prevent clients from doing wrong as said above. Thanks
I think throwing an SWTException might act as a red herring, and cause requests/bugs to be reported against SWT. Perhaps we should throw a java.lang.IllegalAccessException (or something similar) instead.
(In reply to comment #11) > I think throwing an SWTException might act as a red herring, and cause > requests/bugs to be reported against SWT. Perhaps we should throw a > java.lang.IllegalAccessException (or something similar) instead. > Upon review, SWTException(SWT.ERROR_THREAD_INVALID_ACCESS) would be the correct exception. There are no others exceptions that I can find that are more appropriate. IllegalAccessException refers to illegal accessing fields and methods.