[crossfire] Latest CVS version of java editor SERIOUSLY flawed on my system

Andreas Kirschbaum kirschbaum at myrealbox.com
Mon Apr 11 01:31:44 CDT 2005


Brendan Lally wrote:
>
     
      ok, but wouldn't that leave a file with the name written on the first line,
     
     >
     
      and nothing below it?
     
     
Not necessarily: the caller just does something like

    try {
       <open file>
       <call writeMapArch>
       <close file>
    }
    catch(IOException e) {
       ...
    }

That means that the file will not be closed if writeMapArch throws any
Exception. And if the virtual machine terminates because of that
(NullPointer)Exception, it could be possible that the file may not be closed at
all. And since the "file" is a BufferedWriter, the already written first
line(s) could be still in the (memory) buffer but not yet written to disk.


>
     
      > Therefore, the proposed patch seem good to me. But I'd rather write
     
     >
     
      >
     
     >
     
      > |     private String region = "";           // the region the
     
     >
     
      >
     
     >
     
      > instead of
     
     >
     
      >
     
     >
     
      > |     private String region = new String(); // the region the
     
     >
     
     
     >
     
      Forgive my ignorance but what is the difference between those two lines?
     
     
There is no difference. I just find the first alternative more readable.

    
    


More information about the crossfire mailing list