@SuppressWarnings("CallToThreadDumpStack")
    private void writeSourceToOut() {
        
        FileWriter fileWriter=null;
        BufferedWriter bufferedWriter=null;
        String fileName;
        
        String destDir=doGetCrossCompilingHexTargetDirectory();
        if (destDir==null) destDir=doGetCrossCompilingDirectory();
        if (destDir==null) return; 
        
        if (destDir.endsWith(File.separator)) fileName=destDir+AFTER_COMP_SRC_OUT; 
                else fileName=destDir+File.separator+AFTER_COMP_SRC_OUT;
        
        try {
            fileWriter=new FileWriter(fileName,false);
            bufferedWriter=new BufferedWriter(fileWriter);
            for (String s:programLines) {
                bufferedWriter.write(s);
                bufferedWriter.write("\n");
            }
            log("Write "+AFTER_COMP_SRC_OUT+" to output directory.");
        }
        catch(IOException e) {
            log("Unable to write "+AFTER_COMP_SRC_OUT+" to output directory. Ignoring error. "+e.getMessage());
        }
        finally {
            try { if (bufferedWriter!=null) bufferedWriter.close(); } catch(Exception e) { e.printStackTrace(); } 
            try { if (fileWriter!=null) fileWriter.close(); } catch(Exception e) { e.printStackTrace(); } 
        }
    }