aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-04-12 16:20:10 (EDT)
committerOleg Besedin2012-04-12 16:20:10 (EDT)
commit0e62440540c9ff7a295e7a71918de5e81542df4c (patch)
tree7608d41f2333b45116c671f5208b03377b9e5a78
parentfdd96b07a40469e007918ea78eb540be0fba2389 (diff)
downloadeclipse.platform.ui-0e62440540c9ff7a295e7a71918de5e81542df4c.zip
eclipse.platform.ui-0e62440540c9ff7a295e7a71918de5e81542df4c.tar.gz
eclipse.platform.ui-0e62440540c9ff7a295e7a71918de5e81542df4c.tar.bz2
Bug 374483 - [Compatibility] NPE while Debug is trying to switch
perspectives with a dead perspective around
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java10
1 files changed, 6 insertions, 4 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 4e1aab6..e0e289c 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
@@ -3909,16 +3909,18 @@ UIEvents.UIElement.TOPIC_TOBERENDERED,
MPerspectiveStack.class, null).get(0);
IPerspectiveRegistry registry = PlatformUI.getWorkbench().getPerspectiveRegistry();
- IPerspectiveDescriptor[] descs = new IPerspectiveDescriptor[perspectiveStack.getChildren()
- .size()];
- int count = 0;
+ ArrayList<IPerspectiveDescriptor> tmp = new ArrayList<IPerspectiveDescriptor>(
+ perspectiveStack.getChildren().size());
for (MPerspective persp : perspectiveStack.getChildren()) {
String perspectiveId = persp.getElementId();
IPerspectiveDescriptor desc = registry.findPerspectiveWithId(perspectiveId);
if (desc != null) {
- descs[count++] = desc;
+ tmp.add(desc);
}
}
+ IPerspectiveDescriptor[] descs = new IPerspectiveDescriptor[tmp.size()];
+ tmp.toArray(descs);
+
return descs;
}