Bug 532456 - [ELK] NPE in PaletteManagerImpl
Summary: [ELK] NPE in PaletteManagerImpl
Status: CLOSED WORKSFORME
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 5.1.1   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 6.3.1   Edit
Assignee: Project Inbox CLA
QA Contact: Julien Dupont CLA
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-03-14 11:59 EDT by Pierre Guilet CLA
Modified: 2020-06-19 10:22 EDT (History)
3 users (show)

See Also:


Attachments
projects to reproduce (474.16 KB, application/x-zip-compressed)
2018-03-14 11:59 EDT, Pierre Guilet CLA
no flags Details
Different NPE (6.62 KB, text/plain)
2018-03-30 07:29 EDT, Steve Monnier CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Guilet CLA 2018-03-14 11:59:38 EDT
Created attachment 273125 [details]
projects to reproduce

The following NPE can occur mysteriously:

Thread [main] (Suspended (exception NullPointerException))	
	owns: RunnableLock  (id=2342)	
	PaletteManagerImpl.setLayerVisibility(Layer, boolean) line: 510	
	PaletteManagerImpl.updatePaletteForDiagramWithLayer(DiagramDescription, Session, DDiagram) line: 361	
	PaletteManagerImpl.updatePalette(DiagramDescription, Session, DDiagram) line: 295	
	PaletteManagerImpl.updatePalette(Diagram) line: 263	
	PaletteManagerImpl.updatePalette(Diagram, boolean) line: 222	
	PaletteManagerImpl.update(Diagram, boolean) line: 184	
	DDiagramEditorSessionListenerDelegate.reloadPalette(PaletteManager, Diagram, boolean) line: 220	
	DDiagramEditorSessionListenerDelegate.run() line: 117	
	RunnableLock.run(Display) line: 37	
	UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 182	
	Display.runAsyncMessages(boolean) line: 4213	
	Display.readAndDispatch() line: 3820	
	ModalContext$ModalContextThread.block() line: 165	
	ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) line: 369	
	ProgressMonitorDialog.run(boolean, boolean, IRunnableWithProgress) line: 483	
	CustomSiriusEditor.doSave(IProgressMonitor) line: 445	
	SaveableHelper.lambda$0(ISaveablePart, IProgressMonitor) line: 154	
	520693151.run(IProgressMonitor) line: not available	
	SaveableHelper.lambda$3(IRunnableWithProgress, boolean[], IProgressMonitor) line: 271	
	937656362.run(IProgressMonitor) line: not available	
	ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor) line: 437	
	ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) line: 353	
	WorkbenchWindow$14.run() line: 2195	
	BusyIndicator.showWhile(Display, Runnable) line: 70	
	WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) line: 2191	
	SaveableHelper.runProgressMonitorOperation(String, IRunnableWithProgress, IRunnableContext, IShellProvider) line: 278	
	SaveableHelper.runProgressMonitorOperation(String, IRunnableWithProgress, IWorkbenchWindow) line: 259	
	SaveableHelper.savePart(ISaveablePart, IWorkbenchPart, IWorkbenchWindow, boolean) line: 158	
	WorkbenchPage.saveSaveable(ISaveablePart, IWorkbenchPart, boolean, boolean) line: 3917	
	WorkbenchPage.saveEditor(IEditorPart, boolean) line: 3931	
	SaveHandler.execute(ExecutionEvent) line: 54	
	HandlerProxy.execute(ExecutionEvent) line: 291	
	E4HandlerProxy.execute(IEclipseContext, Map, Event, IEvaluationContext) line: 92	
	GeneratedMethodAccessor58.invoke(Object, Object[]) line: not available	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
	Method.invoke(Object, Object...) line: 498	
	MethodRequestor.execute() line: 55	
	InjectorImpl.invokeUsingClass(Object, Class<?>, Class<Annotation>, Object, PrimaryObjectSupplier, PrimaryObjectSupplier, boolean, boolean, boolean) line: 305	
	InjectorImpl.invoke(Object, Class<Annotation>, Object, PrimaryObjectSupplier, PrimaryObjectSupplier) line: 239	
	ContextInjectionFactory.invoke(Object, Class<Annotation>, IEclipseContext, IEclipseContext, Object) line: 132	
	WorkbenchHandlerServiceHandler(HandlerServiceHandler).execute(ExecutionEvent) line: 152	
	Command.executeWithChecks(ExecutionEvent) line: 494	
	ParameterizedCommand.executeWithChecks(Object, Object) line: 487	
	HandlerServiceImpl.executeHandler(ParameterizedCommand, IEclipseContext) line: 210	
	KeyBindingDispatcher.executeCommand(ParameterizedCommand, Event) line: 287	
	KeyBindingDispatcher.press(List<KeyStroke>, Event) line: 527	
	KeyBindingDispatcher.processKeyEvent(List<KeyStroke>, Event) line: 577	
	KeyBindingDispatcher.filterKeySequenceBindings(Event) line: 385	
	KeyBindingDispatcher.access$0(KeyBindingDispatcher, Event) line: 331	
	KeyBindingDispatcher$KeyDownFilter.handleEvent(Event) line: 88	
	EventTable.sendEvent(Event) line: 86	
	Display.filterEvent(Event) line: 1271	
	Tree(Widget).sendEvent(Event) line: 1078	
	Tree(Widget).sendEvent(int, Event, boolean) line: 1103	
	Tree(Widget).sendEvent(int, Event) line: 1088	
	Tree(Widget).sendKeyEvent(int, int, long, long, Event) line: 1130	
	Tree(Widget).sendKeyEvent(int, int, long, long) line: 1126	
	Tree(Widget).wmChar(long, long, long) line: 1547	
	Tree(Control).WM_CHAR(long, long) line: 4962	
	Tree.WM_CHAR(long, long) line: 6193	
	Tree(Control).windowProc(long, int, long, long) line: 4843	
	Tree.windowProc(long, int, long, long) line: 6188	
	Display.windowProc(long, long, long, long) line: 5178	
	OS.DispatchMessageW(MSG) line: not available [native method]	
	OS.DispatchMessage(MSG) line: 2560	
	Display.readAndDispatch() line: 3815	
	PartRenderingEngine$5.run() line: 1150	
	Realm.runWithDefault(Realm, Runnable) line: 336	
	PartRenderingEngine.run(MApplicationElement, IEclipseContext) line: 1039	
	E4Workbench.createAndRunUI(MApplicationElement) line: 153	
	Workbench.lambda$3(Display, WorkbenchAdvisor, int[]) line: 680	
	1663271865.run() line: not available	
	Realm.runWithDefault(Realm, Runnable) line: 336	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 594	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 148	
	IDEApplication.start(IApplicationContext) line: 151	
	EclipseAppHandle.run(Object) line: 196	
	EclipseAppLauncher.runApplication(Object) line: 134	
	EclipseAppLauncher.start(Object) line: 104	
	EclipseStarter.run(Object) line: 388	
	EclipseStarter.run(String[], Runnable) line: 243	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
	Method.invoke(Object, Object...) line: 498	
	Main.invokeFramework(String[], URL[]) line: 653	
	Main.basicRun(String[]) line: 590	
	Main.run(String[]) line: 1499	
	Main.main(String[]) line: 1472	

The paletteRoot is set to null between org.eclipse.sirius.diagram.ui.tools.internal.palette.PaletteManagerImpl.updatePalette(Diagram, boolean) and org.eclipse.sirius.diagram.ui.tools.internal.palette.PaletteManagerImpl.setLayerVisibility(Layer, boolean)

The reproduction seems random and happened sometime when doing odesign modification, save  and arrange-all.

Steps to reproduce:
-Import basic family projects excepted sample and design
- Launch a runtime
- Import design and sample
- Open the odesign and a new person diagram. Put the view next to the other.
- Add an ELK layered layout configuration, save, do an arrange-all.
- Add Direction option with left value and save and do an arrange-all.
- Do that for other direction.
- Add a node spacing option with value 100, save and do arrange-all.
- Repeat these kind of changes and sometime you may have the NPE.
Comment 1 Steve Monnier CLA 2018-03-30 07:29:54 EDT
Created attachment 273380 [details]
Different NPE

I was not able to reproduce your exception. However, I had the following NPE in attachment if I remove the direction submodel element (DOWN, UP, LEFT or RIGHT) and launch an arrange all
Comment 2 Laurent Redor CLA 2019-11-13 10:22:23 EST
This problem seems fixed with bug 531919. Indeed, the code of the stack has been changed with this bugzilla and I not reproduced the problem in Sirius 6.3.1.
Comment 3 Pierre-Charles David CLA 2020-06-19 10:22:18 EDT
Available in Sirius 6.3.1 (part of Eclipse 2020-06). See https://wiki.eclipse.org/Sirius/6.3.1 for details on the release.