diff options
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:\\"; |