Skip to content

Commit 85ab042

Browse files
committed
Do not fetch input eagerly if not required
Currently CompatibilityEditor.createPart(WorkbenchPartReference) eagerly fetches the input just to then check if it is actually needed. This now pulls out the check for MultiEditor out to only fetch the input if there is a demand for it.
1 parent 789b373 commit 85ab042

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/e4/compatibility/CompatibilityEditor.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ public class CompatibilityEditor extends CompatibilityPart {
5959
@Override
6060
IWorkbenchPart createPart(WorkbenchPartReference reference) throws PartInitException {
6161
IWorkbenchPart part = super.createPart(reference);
62-
IEditorInput input = ((EditorReference) reference).getEditorInput();
63-
if (input instanceof MultiEditorInput && part instanceof MultiEditor) {
64-
createMultiEditorChildren(part, input);
62+
if (part instanceof MultiEditor) {
63+
IEditorInput input = ((EditorReference) reference).getEditorInput();
64+
if (input instanceof MultiEditorInput) {
65+
createMultiEditorChildren(part, input);
66+
}
6567
}
6668
return part;
6769
}

0 commit comments

Comments
 (0)