Buggy code:
public class TreeViewBuildConfigEditor extends JPanel implements BuildConfigEditor { private TreeViewBuildConfigEditor . ConfigTreeNode root ; private TreeViewBuildConfigEditor . ConfigTreeNode currNode ; private BuildConfigModel model = null ; private static List selectedEntries = new ArrayList ( ) ; private String configFile = null ; private File sourcePath = null ; BorderLayout borderLayout1 = new BorderLayout ( ) ; JPanel jPanel1 = new JPanel ( ) ; JLabel jLabel1 = new JLabel ( ) ; JPanel jPanel2 = new JPanel ( ) ; JButton cancel_button = new JButton ( ) ; BorderLayout borderLayout2 = new BorderLayout ( ) ; JButton save_button = new JButton ( ) ; JScrollPane jScrollPane = new JScrollPane ( ) ; JTree buildConfig_tree = new JTree ( ) ; public void openFile ( String configFile ) throws IOException , InvalidResourceException { } private TreeViewBuildConfigEditor . ConfigTreeNode buildTree ( BuildConfigNode node ) { } private void saveModel ( ) { } private void jbInit ( ) throws Exception { } private class ConfigTreeNode extends DefaultMutableTreeNode { public JCheckBox checkBox = null ; public BuildConfigNode modelNode ; public ConfigTreeNode ( BuildConfigNode modelNode ) { } public BuildConfigNode getModelNode ( ) { } public void setModelNode ( BuildConfigNode modelNode ) { } } private class ConfigFileMouseAdapter extends MouseAdapter { private JTree tree = null ; final JCheckBox checkBoxProto = new JCheckBox ( ) ; final int width = checkBoxProto . getPreferredSize ( ) . width ; public ConfigFileMouseAdapter ( JTree tree ) { } public void mousePressed ( MouseEvent e ) { } boolean isCheckBox ( int x , int x_ ) { } } static class ConfigTreeCellRenderer extends DefaultTreeCellRenderer { public Component getTreeCellRendererComponent ( JTree tree , Object value , boolean sel , boolean expanded , boolean leaf , int row , boolean hasFocus ) { super . getTreeCellRendererComponent ( tree , value , sel , expanded , leaf , row , hasFocus ) ; JPanel p = new JPanel ( ) ; p . setLayout ( new BoxLayout ( p , BoxLayout . X_AXIS ) ) ; p . setBackground ( Color . white ) ; setFont ( new Font ( "Dialog" , Font . PLAIN , 11 ) ) ; final JCheckBox cbox = ( ( TreeViewBuildConfigEditor . ConfigTreeNode ) ( value ) ) . checkBox ; cbox . setBackground ( Color . white ) ; if ( row != 0 ) { p . add ( cbox ) ; } TreeViewBuildConfigEditor . ConfigTreeNode ctn = ( ( TreeViewBuildConfigEditor . ConfigTreeNode ) ( value ) ) ; if ( ctn . getModelNode ( ) . isActive ( ) ) { cbox . setSelected ( true ) ; } if ( ! ( ctn . getModelNode ( ) . isValidResource ( ) ) ) { ctn . checkBox . setEnabled ( false ) ; } BuildConfigNode . Kind kind = ctn . getModelNode ( ) . getBuildConfigNodeKind ( ) ; if ( kind . equals ( FILE_ASPECTJ ) ) { setIcon ( AjdeUIManager . getDefault ( ) . getIconRegistry ( ) . getStructureSwingIcon ( IProgramElement . Kind . FILE_ASPECTJ ) ) ; } else if ( kind . equals ( FILE_JAVA ) ) { setIcon ( AjdeUIManager . getDefault ( ) . getIconRegistry ( ) . getStructureSwingIcon ( IProgramElement . Kind . FILE_JAVA ) ) ; } else if ( kind . equals ( FILE_LST ) ) { setIcon ( AjdeUIManager . getDefault ( ) . getIconRegistry ( ) . getStructureSwingIcon ( IProgramElement . Kind . FILE_LST ) ) ; } else if ( kind . equals ( DIRECTORY ) ) { setIcon ( AjdeUIManager . getDefault ( ) . getIconRegistry ( ) . getStructureSwingIcon ( PACKAGE ) ) ; } else { <START_BUG> setIcon ( ( ( Icon ) ( AjdeUIManager . getDefault ( ) . getIconRegistry ( ) . getStructureIcon ( IProgramElement . Kind . ERROR ) . getIconResource ( ) ) ) ) ; <END_BUG> p . remove ( cbox ) ; } p . add ( this ) ; return p ; } } void cancel_button_actionPerformed ( ActionEvent e ) { } void save_button_actionPerformed ( ActionEvent e ) { } }

Fix:
setIcon ( ( ( Icon ) ( AjdeUIManager . getDefault ( ) . getIconRegistry ( ) . getIcon ( IProgramElement . Kind . ERROR ) . getIconResource ( ) ) ) ) ;