diff options
author | aclement <aclement> | 2004-08-23 15:09:26 +0000 |
---|---|---|
committer | aclement <aclement> | 2004-08-23 15:09:26 +0000 |
commit | 197afeadcb72402b3262c795ede32a7c5a6c7def (patch) | |
tree | 5267d180b65fb862c06910006d5813268dcd9531 /ajbrowser | |
parent | f5035234ee878003515413fee5e7e6bfa7a2228d (diff) | |
download | aspectj-197afeadcb72402b3262c795ede32a7c5a6c7def.tar.gz aspectj-197afeadcb72402b3262c795ede32a7c5a6c7def.zip |
FindBugs: fixes.
Diffstat (limited to 'ajbrowser')
-rw-r--r-- | ajbrowser/src/org/aspectj/tools/ajbrowser/BasicEditor.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ajbrowser/src/org/aspectj/tools/ajbrowser/BasicEditor.java b/ajbrowser/src/org/aspectj/tools/ajbrowser/BasicEditor.java index 720ed65fd..f5a0fa4ae 100644 --- a/ajbrowser/src/org/aspectj/tools/ajbrowser/BasicEditor.java +++ b/ajbrowser/src/org/aspectj/tools/ajbrowser/BasicEditor.java @@ -123,10 +123,10 @@ public class BasicEditor implements EditorAdapter { } public void saveContents() throws IOException { - if (filePath != NO_FILE && filePath != "" && editorPane.getText() != "") { + if (!filePath.equals(NO_FILE) && !filePath.equals("") && !editorPane.getText().equals("")) { BufferedWriter writer = new BufferedWriter(new FileWriter(filePath)); writer.write(editorPane.getText()); - writer.flush(); + writer.close(); } } @@ -169,6 +169,7 @@ public class BasicEditor implements EditorAdapter { contents.append('\n'); line = reader.readLine(); } + reader.close(); return contents.toString(); } catch (IOException ioe) { return "ERROR: could not read file \"" + filePath + "\", make sure that you have mounted /project/aop on X:\\"; |