Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360232 - Eclipse gets into an infinite error loop after saving a perspective with a view in it
Summary: Eclipse gets into an infinite error loop after saving a perspective with a vi...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 4.2 M3   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 09:40 EDT by Remy Suen CLA
Modified: 2011-10-26 14:04 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2011-10-07 09:40:13 EDT
1. DND a view into the shared area.
2. Save the perspective.
3. Try to activate the view in the shared area. You're not in an infinite error loop.

Caused by: java.lang.NullPointerException
	at org.eclipse.e4.ui.model.internal.ModelUtils.getContainingContext(ModelUtils.java:148)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.getContainingContext(ModelServiceImpl.java:234)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.getContextForParent(AbstractPartRenderer.java:76)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.getContext(AbstractPartRenderer.java:90)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:100)
	at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$ActivationJob.run(StackRenderer.java:168)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 24 more
Comment 1 Eric Moffatt CLA 2011-10-07 10:53:41 EDT
Pushed in >20111007.

The problem was that the 'copy' maintains the references (MPlaceholder's 'ref' is copied). This meant that the clone has a reference into the MArea so my code to gather up the placeholders to null the refs was finding the 'shared' view.

This fix explicitly tests the placeholder to ensure that it skips any 'shared' ones...

commit 3df401f84bbd3c169e383e26c7a415696ce91bd0

I'd be much happier if we could find a way to have EcoreUtil.copy(eObj) *not* copy through the references. I've tried setting the 'ref' feature to derived but that didn't seem to do the trick and I'm not sure why. This would eliminate the need for us to 'null' them when constructing the clone as well...
Comment 2 Eric Moffatt CLA 2011-10-11 13:49:31 EDT
I'll resolve this as fixed. We can re-open if we decide there's a better solution...
Comment 3 Eric Moffatt CLA 2011-10-26 14:04:27 EDT
Verified in I20111025-2000.