aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Berger2014-02-25 06:23:06 (EST)
committerGerrit Code Review @ Eclipse.org2014-02-25 09:18:45 (EST)
commit1c25a598d57451ba38cb67edc531fa891188eb1d (patch)
treef861c4bf18534ab283ea06a2f4a100097e154603
parent416e5203747845a5938c2c195941f3e2c19b94ac (diff)
downloadeclipse.platform.ui-1c25a598d57451ba38cb67edc531fa891188eb1d.zip
eclipse.platform.ui-1c25a598d57451ba38cb67edc531fa891188eb1d.tar.gz
eclipse.platform.ui-1c25a598d57451ba38cb67edc531fa891188eb1d.tar.bz2
Bug 428652 - [EditorMgmt] SplitEditor throws NPE after second openingI20140225-1430refs/changes/01/22501/2
Signed-off-by: David Berger <david.berger@logicals.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java39
1 files changed, 10 insertions, 29 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
index ab3234f..0bef83a 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
@@ -361,14 +361,16 @@ public class WorkbenchPage extends CompatibleWorkbenchPage implements
}
ViewReference viewReference = getViewReference(part);
- E4PartWrapper legacyPart = new E4PartWrapper(part);
- try {
- viewReference.initialize(legacyPart);
- } catch (PartInitException e) {
- WorkbenchPlugin.log(e);
+ if (viewReference != null) {
+ E4PartWrapper legacyPart = new E4PartWrapper(part);
+ try {
+ viewReference.initialize(legacyPart);
+ } catch (PartInitException e) {
+ WorkbenchPlugin.log(e);
+ }
+ part.getTransientData().put(E4PartWrapper.E4_WRAPPER_KEY, legacyPart);
+ return legacyPart;
}
- part.getTransientData().put(E4PartWrapper.E4_WRAPPER_KEY, legacyPart);
- return legacyPart;
}
}
return null;
@@ -2142,28 +2144,7 @@ public class WorkbenchPage extends CompatibleWorkbenchPage implements
public IWorkbenchPart getActivePart() {
MPart part = partService.getActivePart();
- if (part != null) {
- Object object = part.getObject();
- if (object instanceof CompatibilityPart) {
- return ((CompatibilityPart) object).getPart();
- } else if (object != null) {
- if (part.getTransientData().get(E4PartWrapper.E4_WRAPPER_KEY) instanceof E4PartWrapper) {
- return (IWorkbenchPart) part.getTransientData().get(
- E4PartWrapper.E4_WRAPPER_KEY);
- }
-
- ViewReference viewReference = getViewReference(part);
- E4PartWrapper legacyPart = new E4PartWrapper(part);
- try {
- viewReference.initialize(legacyPart);
- } catch (PartInitException e) {
- WorkbenchPlugin.log(e);
- }
- part.getTransientData().put(E4PartWrapper.E4_WRAPPER_KEY, legacyPart);
- return legacyPart;
- }
- }
- return null;
+ return getWorkbenchPart(part);
}
/*