Bug 121772 [Viewers] ClassCastException opening file from Navigator
I get a class cast exception when I open a file from the navigator. The problem is that there is a cast to StructuredSelection instead of IStructuredSelection in the ResourceNavigator class (and the object being cast is a TreeSelection). Here are the interesting lines of the trace. Caused by: java.lang.ClassCastException: org/eclipse/jface/viewers/TreeSelection incompatible with org/eclipse/jface/viewers/StructuredSelection at org.eclipse.ui.views.navigator.ResourceNavigator$8.run(ResourceNavigator.java:726)
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/views/navigator/ResourceNavigator.java
&& !unSelectedFilters.contains(element))
                        selectedFilters.add(element);
                }
                
                String[] patternArray = new String[selectedFilters.size()];
                selectedFilters.toArray(patternArray);
                getPatternFilter().setPatterns(patternArray);
            } else { 
                String filters[] = new String[children.length];
                for (int i = 0; i < children.length; i++) {
                    filters[i] = children[i].getString(TAG_ELEMENT);
                }
                getPatternFilter().setPatterns(filters);
            }
        } else { 
            getPatternFilter().setPatterns(new String[0]);
        }
    }
    /**
     * Restores the state of the receiver to the state described in the specified memento.
     *
     * @param memento the memento
     * @since 2.0
     */
    protected void restoreState(IMemento memento) {
        TreeViewer viewer = getTreeViewer();
        IMemento frameMemento = memento.getChild(TAG_CURRENT_FRAME);
        if (frameMemento != null) {
            TreeFrame frame = new TreeFrame(viewer);
            frame.restoreState(frameMemento);