Buggy code:
public class SelectRenderers extends JPanel { private static final long serialVersionUID = - 2724796596060834064L ; private static PmsConfiguration configuration = PMS . getConfiguration ( ) ; private static ArrayList < String > allRenderersNames = RendererConfiguration . getAllRenderersNames ( ) ; private static List < String > selectedRenderers = SelectRenderers . configuration . getSelectedRenderers ( ) ; private static final Logger LOGGER = LoggerFactory . getLogger ( SelectRenderers . class ) ; private CheckTreeManager checkTreeManager ; private final JTree SrvTree ; private final DefaultMutableTreeNode allRenderers ; private String rootName = Messages . getString ( "GeneralTab.13" ) ; public SelectRenderers ( ) { } public void showDialog ( ) { SelectRenderers . selectedRenderers = SelectRenderers . configuration . getSelectedRenderers ( ) ; TreePath [ ] renderersPath = new TreePath [ SelectRenderers . selectedRenderers . size ( ) ] ; TreePath root = new TreePath ( allRenderers ) ; int i = 0 ; for ( String renderer : SelectRenderers . selectedRenderers ) { <START_BUG> if ( ( SelectRenderers . selectedRenderers . size ( ) ) == 1 ) { <END_BUG> renderersPath [ i ] = root ; } else { int childNumber = allRenderers . getChildCount ( ) ; for ( int j = 0 ; j < childNumber ; j ++ ) { TreeNode node = allRenderers . getChildAt ( j ) ; int nodeChildren = node . getChildCount ( ) ; int endIndex = renderer . indexOf ( "<seq2seq4repair_space>" ) ; if ( node . toString ( ) . equals ( renderer ) ) { renderersPath [ i ] = root . pathByAddingChild ( node ) ; i ++ ; break ; } else { if ( ( endIndex > 0 ) && ( nodeChildren > 0 ) ) { if ( node . toString ( ) . equals ( renderer . substring ( 0 , endIndex ) ) ) { for ( int jj = 0 ; jj < nodeChildren ; jj ++ ) { if ( node . getChildAt ( jj ) . toString ( ) . equals ( renderer . substring ( renderer . indexOf ( "<seq2seq4repair_space>" ) ) ) ) { renderersPath [ i ] = root . pathByAddingChild ( node ) . pathByAddingChild ( node . getChildAt ( jj ) ) ; i ++ ; break ; } } break ; } } } } } } SrvTree . validate ( ) ; checkTreeManager . getSelectionModel ( ) . setSelectionPaths ( renderersPath ) ; int selectRenderers = JOptionPane . showOptionDialog ( ( ( Component ) ( PMS . get ( ) . getFrame ( ) ) ) , this , Messages . getString ( "GeneralTab.5" ) , JOptionPane . OK_CANCEL_OPTION , JOptionPane . PLAIN_MESSAGE , null , null , null ) ; if ( selectRenderers == ( JOptionPane . OK_OPTION ) ) { StringBuilder buildSelectedRenders = new StringBuilder ( ) ; TreePath [ ] selected = checkTreeManager . getSelectionModel ( ) . getSelectionPaths ( ) ; for ( TreePath path : selected ) { String [ ] treePathString = path . toString ( ) . split ( "," ) ; StringBuilder nameStr = new StringBuilder ( ) ; int beginIndex ; int endIndex ; if ( ( treePathString . length ) > 1 ) { if ( treePathString [ 0 ] . contains ( allRenderers . toString ( ) ) ) { for ( i = 1 ; i < ( treePathString . length ) ; i ++ ) { beginIndex = ( treePathString [ i ] . lastIndexOf ( "[" ) ) + 1 ; endIndex = treePathString [ i ] . indexOf ( "]" ) ; if ( endIndex > beginIndex ) { nameStr . append ( treePathString [ i ] . substring ( beginIndex , endIndex ) . trim ( ) ) ; } else { nameStr . append ( treePathString [ i ] . trim ( ) ) . append ( "<seq2seq4repair_space>" ) ; } } } } else { if ( ( selected . length ) == 1 ) { nameStr . append ( SelectRenderers . configuration . ALL_RENDERERS ) ; } } buildSelectedRenders . append ( nameStr ) . append ( "," ) ; } SelectRenderers . configuration . setSelectedRenderers ( buildSelectedRenders . toString ( ) ) ; } } }

Fix:
if ( SelectRenderers . configuration . ALL_RENDERERS . equals ( renderer ) ) {