Bug 87662 [PropertiesView] NPE in PropertySheetViewer.updateChildrenOf
3.1 M5 An NPE can occur in PropertySheetViewer.updateChildrenOf if one of the top level items has null data. Although this should never happen, apparently it can (not sure how). Caused by: java.lang.NullPointerException at org.eclipse.ui.views.properties.PropertySheetViewer.updateChildrenOf(PropertySheetViewer.java:1117) at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:850) at org.eclipse.ui.views.properties.PropertySheetPage.refresh(PropertySheetPage.java:397) at com.rational.clearcase.RSCMService$19.run(RSCMService.java:4459) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:118) In this last exception, at line 1117, this line in the code reads: item.dispose(); In the code from updateChildrenOf containing 1117 we have: Set set = new HashSet(childItems.length * 2 + 1); for (int i = 0; i < childItems.length; i++) { Object data = childItems[i].getData(); if (data != null) { Object e = data; int ix = children.indexOf(e); if (ix < 0) { // not found removeItem(childItems[i]); } else { // found set.add(e); } } else if (data == null) { // the dummy item.dispose(); <----------------line 1117 } }
bundles/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetViewer.java
private PropertySheetCategory[] categories;
    
    private Tree tree;
    private TreeEditor treeEditor;
    private static String[] columnLabels = {
            PropertiesMessages.PropertyViewer_property, PropertiesMessages.PropertyViewer_value };
    private static String MISCELLANEOUS_CATEGORY_NAME = PropertiesMessages.PropertyViewer_misc;
    
    private int columnToEdit = 1;
    private CellEditor cellEditor;
    private IPropertySheetEntryListener entryListener;
    private ICellEditorListener editorListener;
    
    private boolean isShowingCategories = true;
    
    private boolean isShowingExpertProperties = false;
    
    private IStatusLineManager statusLineManager;
    
    private ListenerList activationListeners = new ListenerList(3);
    /**
     * Creates a property sheet viewer on a newly-created tree control
     * under the given parent. The viewer has no input, and no root entry.
     * 
     * @param parent
     *            the parent control
     */
    public PropertySheetViewer(Composite parent) {
        tree = new Tree(parent, SWT.FULL_SELECTION | SWT.SINGLE
                | SWT.HIDE_SELECTION);