Buggy code:
public class WindowPositionSaver { private static final int DESKTOP_MARGIN = 100 ; private static final String ID_EXTERN = "Extern" ; private static final String ID_XI = "XI" ; private static final String ID_YI = "YI" ; private static final String ID_WI = "WidthI" ; private static final String ID_HI = "HeightI" ; private static final String ID_MAXIMIZEDI = "MaximizedI" ; private static final String ID_XE = "XE" ; private static final String ID_YE = "YE" ; private static final String ID_WE = "WidthE" ; private static final String ID_HE = "HeightE" ; private static final String ID_MAXIMIZEDE = "MaximizedE" ; private final MainFrame mainFrame ; private final IcyFrame icyFrame ; private final ExternalizablePanel extPanel ; private final JFrame jFrame ; private final JComponent component ; final WindowAdapter windowAdapter ; final IcyFrameAdapter icyFrameAdapter ; final ComponentAdapter componentAdapter ; private WindowPositionSaver ( final MainFrame mainFrame , final IcyFrame icyFrame , final ExternalizablePanel extPanel , final JFrame jFrame , final JComponent component , final String key , final Point defLoc , final Dimension defDim ) { } public WindowPositionSaver ( MainFrame frame , String key , Point defLoc , Dimension defDim ) { } public WindowPositionSaver ( MainFrame frame , String key , Point defLoc ) { } public WindowPositionSaver ( MainFrame frame , String key , Dimension defDim ) { } public WindowPositionSaver ( IcyFrame frame , String key , Point defLoc , Dimension defDim ) { } public WindowPositionSaver ( IcyFrame frame , String key , Point defLoc ) { } public WindowPositionSaver ( IcyFrame frame , String key , Dimension defDim ) { } public WindowPositionSaver ( ExternalizablePanel extPanel , String key , Point defLoc , Dimension defDim ) { } public WindowPositionSaver ( ExternalizablePanel extPanel , String key , Point defLoc ) { } public WindowPositionSaver ( ExternalizablePanel extPanel , String key , Dimension defDim ) { } public WindowPositionSaver ( JFrame frame , String key , Point defLoc , Dimension defDim ) { } public WindowPositionSaver ( JFrame frame , String key , Point defLoc ) { } public WindowPositionSaver ( JFrame frame , String key , Dimension defDim ) { } public WindowPositionSaver ( JComponent component , String key , Point defLoc , Dimension defDim ) { } public WindowPositionSaver ( JComponent component , String key , Point defLoc ) { } public WindowPositionSaver ( JComponent component , String key , Dimension defDim ) { } void checkPosition ( ) { } boolean fixPosition ( Rectangle rect ) { } public void loadLocation ( XMLPreferences preferences , Point defLoc ) { } public void loadDimension ( XMLPreferences preferences , Dimension defDim ) { } public void loadState ( XMLPreferences preferences ) { final boolean externalized = preferences . getBoolean ( WindowPositionSaver . ID_EXTERN , false ) ; final boolean maximizedE = preferences . getBoolean ( WindowPositionSaver . ID_MAXIMIZEDE , false ) ; final boolean maximizedI = preferences . getBoolean ( WindowPositionSaver . ID_MAXIMIZEDI , false ) ; if ( ( mainFrame ) != null ) { if ( maximizedE ) <START_BUG> jFrame . setExtendedState ( Frame . MAXIMIZED_BOTH ) ; <END_BUG> } else if ( ( icyFrame ) != null ) { if ( externalized ) icyFrame . externalize ( ) ; else icyFrame . internalize ( ) ; icyFrame . setMaximizedExternal ( maximizedE ) ; icyFrame . setMaximizedInternal ( maximizedI ) ; } else if ( ( extPanel ) != null ) { if ( externalized ) extPanel . externalize ( ) ; else extPanel . internalize ( ) ; if ( maximizedE ) extPanel . getFrame ( ) . setExtendedState ( Frame . MAXIMIZED_BOTH ) ; } else if ( ( jFrame ) != null ) { if ( maximizedE ) jFrame . setExtendedState ( Frame . MAXIMIZED_BOTH ) ; } } public void saveLocation ( XMLPreferences preferences ) { } public void saveDimension ( XMLPreferences preferences ) { } public void saveState ( XMLPreferences preferences ) { } }

Fix:
mainFrame . setExtendedState ( Frame . MAXIMIZED_BOTH ) ;