Source:
public IViewPart[] getViewStack(IViewPart part) { String compoundId = part.getViewSite().getId(); String secondaryId = part.getViewSite().getSecondaryId(); if (secondaryId != null && secondaryId.length() > 0) compoundId += ":" + secondaryId; MPart mpart = partService.findPart(compoundId); if (mpart != null) { MElementContainer<?> parent = mpart.getParent(); if (parent == null) { MPlaceholder placeholder = mpart.getCurSharedRef(); if (placeholder != null) { parent = placeholder.getParent(); } } if (parent instanceof MPartStack) { MStackElement selectedElement = ((MPartStack) parent).getSelectedElement(); final MUIElement topPart = selectedElement instanceof MPlaceholder ? ((MPlaceholder) selectedElement) .getRef() : null; List<CompatibilityView> stack = new ArrayList<>(); for (Object child : parent.getChildren()) { MPart siblingPart = child instanceof MPart ? (MPart) child : (MPart) ((MPlaceholder) child).getRef(); Object siblingObject = siblingPart != null ? siblingPart.getObject() : null; if (siblingObject instanceof CompatibilityView) { stack.add((CompatibilityView) siblingObject); } } Collections.sort(stack, new Comparator<CompatibilityView>() { @Override public int compare(CompatibilityView o1, CompatibilityView o2) { MPart model1 = o1.getModel(); MPart model2 = o2.getModel(); if (model1 == topPart) return Integer.MIN_VALUE; if (model2 == topPart) return Integer.MAX_VALUE; int pos1 = activationList.indexOf(model1); int pos2 = activationList.indexOf(model2); if (pos1 == -1) pos1 = Integer.MAX_VALUE; if (pos2 == -1) pos2 = Integer.MAX_VALUE; return pos1 - pos2; } }); IViewPart[] result = new IViewPart[stack.size()]; for (int i = 0; i < result.length; i++) { result[i] = stack.get(i).getView(); } return result; } return new IViewPart[] { part }; } return null; }

Target:
public IViewPart[] getViewStack(IViewPart part) { IViewSite viewSite = part.getViewSite(); if (viewSite == null) return null; String compoundId = viewSite.getId(); String secondaryId = viewSite.getSecondaryId(); if (secondaryId != null && !secondaryId.isEmpty()) compoundId += ":" + secondaryId; MPart mpart = partService.findPart(compoundId); if (mpart != null) { MElementContainer<?> parent = mpart.getParent(); if (parent == null) { MPlaceholder placeholder = mpart.getCurSharedRef(); if (placeholder != null) { parent = placeholder.getParent(); } } if (parent instanceof MPartStack) { MStackElement selectedElement = ((MPartStack) parent).getSelectedElement(); final MUIElement topPart = selectedElement instanceof MPlaceholder ? ((MPlaceholder) selectedElement) .getRef() : null; List<CompatibilityView> stack = new ArrayList<>(); for (Object child : parent.getChildren()) { MPart siblingPart = child instanceof MPart ? (MPart) child : (MPart) ((MPlaceholder) child).getRef(); Object siblingObject = siblingPart != null ? siblingPart.getObject() : null; if (siblingObject instanceof CompatibilityView) { stack.add((CompatibilityView) siblingObject); } } Collections.sort(stack, new Comparator<CompatibilityView>() { @Override public int compare(CompatibilityView o1, CompatibilityView o2) { MPart model1 = o1.getModel(); MPart model2 = o2.getModel(); if (model1 == topPart) return Integer.MIN_VALUE; if (model2 == topPart) return Integer.MAX_VALUE; int pos1 = activationList.indexOf(model1); int pos2 = activationList.indexOf(model2); if (pos1 == -1) pos1 = Integer.MAX_VALUE; if (pos2 == -1) pos2 = Integer.MAX_VALUE; return pos1 - pos2; } }); IViewPart[] result = new IViewPart[stack.size()]; for (int i = 0; i < result.length; i++) { result[i] = stack.get(i).getView(); } return result; } return new IViewPart[] { part }; } return null; }