Buggy code:
public class MainFrame extends JFrame implements LakeObjectFocusListener { private static final long serialVersionUID = - 1231864224720584963L ; private static String frameTitle = "Lake<seq2seq4repair_space>Project" ; private static String playpauseButtonTitle = "Pauza" ; private static String forwardButtonTitle = "Przyspiesz" ; private static String saveLakeButtonTitle = "Zapisz" ; private static String openLakeButtonTitle = "Otworz" ; private static String recButtonTitle = "Nagrywaj" ; private static String newLakeObjectButtonTitle = "Nowy" ; private static String openLakeObjectButtonTitle = "Otworz" ; private static String openLibraryButtonTitle = "Wczytaj<seq2seq4repair_space>Biblioteke" ; private static String saveLakeObjectButtonTitle = "Zapisz" ; private static String removeLakeObjectButtonTitle = "Usun" ; private static String reportTitle = "Raport" ; private static String playpauseReportButtonTitle = "Start" ; private static String resetReportButtonTitle = "Reset" ; private static String saveReportButtonTitle = "Zapisz" ; private static Panel canvas ; JButton playpauseButton ; JButton forwardButton ; JButton saveLakeButton ; JButton openLakeButton ; JButton recButton ; JButton newLakeObjectButton ; JButton openLakeObjectButton ; JButton openLibraryButton ; JLabel classLabel ; JLabel ageLabel ; JLabel healthLabel ; JLabel energyLabel ; JButton saveLakeObjectButton ; JButton removeLakeObjectButton ; JLabel reportLabel ; JButton playpauseReportButton ; JButton resetReportButton ; JButton saveReportButton ; JPanel lakeWorldPanel ; static int fps = 60 ; private LakeWorld lakeWorld ; private LakeObject chosenObject ; private Label feederLabel ; private JSlider feederSlider ; public MainFrame ( ) { } public void init ( ) { } protected void removeLakeObjectButtonActionPerformed ( ) { } protected void saveReportButtonActionPerformed ( ) { } protected void playpauseButtonActionPerformed ( ) { } protected void saveLakeObjectButtonActionPerformed ( ) { } protected void openLakeObjectButtonActionPerformed ( ) { } protected void newLakeObjectButtonActionPerformed ( ) { } private String [ ] getLakeObjectClassList ( ) { try { <START_BUG> String filename = "availableLakeObjectsClassNames" ; <END_BUG> BufferedReader reader = new BufferedReader ( new FileReader ( filename ) ) ; ArrayList < String > lakeObjectClassList = new ArrayList < String > ( ) ; while ( reader . ready ( ) ) { String x = reader . readLine ( ) ; x = x . trim ( ) ; lakeObjectClassList . add ( x ) ; } reader . close ( ) ; return Arrays . copyOf ( lakeObjectClassList . toArray ( ) , lakeObjectClassList . size ( ) , String [ ] . class ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } String [ ] lakeObjectClassList = new String [ ] { "com.edu.agh.student.lakeproject.fish.veiltail.Veiltail" } ; return lakeObjectClassList ; } protected void recButtonButtonActionPerformed ( ) { } protected void saveLakeButtonActionPerformed ( ) { } protected void openLakeButtonActionPerformed ( ) { } protected void forwardButtonActionPerformed ( ) { } public void mainWindowClosing ( ) { } public static Panel getCanvas ( ) { } private void updateFishLabels ( ) { } @ Override public void setChosenLakeObject ( LakeObject chosen ) { } private void clearFishLabels ( ) { } }

Fix:
String filename = "availableLakeObjectsClassNames.conf" ;