,我提交了代碼Veraocode安全測試工具,我得到這個資源不正確關機或在下面的代碼發佈:如何解決資源不正確關閉或釋放問題
//This function is used to print trace in the in the LogFile for debugging purpose
PrintWriter f;
try {
f = new PrintWriter(new BufferedWriter(new FileWriter(fileName,true)));//issue at this line
synchronized(this) {
f.println(new StringBuffer(dateString).append("<").append(Thread.currentThread().getName()).append(">").append(traceLog).toString());
}
f.close();
checkFileSize();
}catch(IOException e){
e.printStackTrace();
}
有人請幫助我在這..