Buggy code:
public class Core extends ASingelton implements ICoreServer { private View view ; private CreateXML createxml ; private String projectPath ; private IServerService server ; private Registry rmiRegistry ; private int serverPort ; private String rmiUrl ; private Project project ; Hashtable < String , Integer > phasesdays = new Hashtable ( ) ; private Result resultProject ; float _totalCostProject = 0 ; int _totalmandaysProject = 0 ; int _totalmandaysIntProject = 0 ; int _totalmandaysShouldProject = 0 ; int _totalmandaysShouldProjectRisk = 0 ; int _totalmandaysExtProject = 0 ; float _totalCostIntProject = 0 ; float _totalCostExtProject = 0 ; private File projectFilesDir ; private File configFile ; public Core ( ) { } @ Override public String getProjectDirectory ( ) { } @ Override public void setProjectDirectory ( String path ) { } @ Override public int getServerPort ( ) { } @ Override public void setServerPort ( int portNumber ) { } @ Override public boolean isServerRunning ( ) { } private void loadSettings ( ) { } @ Override public void saveSettings ( String projectDir , int serverPort ) { } @ Override public void startGui ( ) { } @ Override public void startServer ( ) { } @ Override public void stopServer ( ) { } @ Override public Project calculateProject ( Project project ) { } public void clearVariables ( ) { } public void calculateLenght ( Project project ) { } public void calculateYearsQuarters ( Project project , Result result ) { } public void testPhaseavailable ( Phase phase , int SkillID ) { } public void calculateResultSkill ( Project project ) { } public void calculateQuarterResults ( Project project ) { } public int calculateIndexOfStartYear ( int year , Result result ) { } public void createQ1 ( int daysInQ1 , int year , float dayfactorintern , float dayfactorextern , Skill skill , float intDaysPerPhaseAndSkill , float extDaysPerPhaseAndSkill , Result result ) { } public void createQ2 ( int daysInQ2 , int year , float dayfactorintern , float dayfactorextern , Skill skill , float intDaysPerPhaseAndSkill , float extDaysPerPhaseAndSkill , Result result ) { } public void createQ3 ( int daysInQ3 , int year , float dayfactorintern , float dayfactorextern , Skill skill , float intDaysPerPhaseAndSkill , float extDaysPerPhaseAndSkill , Result result ) { } public void createQ4 ( int daysInQ4 , int year , float dayfactorintern , float dayfactorextern , Skill skill , float intDaysPerPhaseAndSkill , float extDaysPerPhaseAndSkill , Result result ) { } public int calculateProjectDays ( Project project ) { } public void writeProject ( Project project ) throws FileNotFoundException , NullPointerException , XMLStreamException { } @ Override public ArrayList < String > getAllProjectNames ( ) throws RemoteException { } @ Override public void saveProject ( Project project ) throws RemoteException { } @ Override public Project loadProject ( String projectName ) throws RemoteException { } @ Override public void deleteProject ( String projectName ) throws RemoteException { } @ Override public StringBuilder getProjectCSV ( Project project ) throws RemoteException { <START_BUG> ExportCSV csv = new ExportCSV ( project ) ; <END_BUG> csv . ExportFile ( ) ; return csv . ExportFile ( ) ; } }

Fix:
ExportCSV csv = new ExportCSV ( calculateProject ( project ) ) ;