OSDN Git Service
(root)
/
mikutoga
/
Pmd2XML.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
パッケージ移動
[mikutoga/Pmd2XML.git]
/
src
/
main
/
java
/
jp
/
sfjp
/
mikutoga
/
pmd2xml
/
Pmd2Xml.java
diff --git
a/src/main/java/jp/sfjp/mikutoga/pmd2xml/Pmd2Xml.java
b/src/main/java/jp/sfjp/mikutoga/pmd2xml/Pmd2Xml.java
index
c4c4c07
..
c0af924
100644
(file)
--- a/
src/main/java/jp/sfjp/mikutoga/pmd2xml/Pmd2Xml.java
+++ b/
src/main/java/jp/sfjp/mikutoga/pmd2xml/Pmd2Xml.java
@@
-19,8
+19,8
@@
import java.io.OutputStream;
import java.io.PrintStream;
import java.nio.channels.FileChannel;
import java.util.Properties;
import java.io.PrintStream;
import java.nio.channels.FileChannel;
import java.util.Properties;
-import jp.s
ourceforge.mikutoga
.parser.MmdFormatException;
-import jp.s
ourceforge
.mikutoga.pmd.IllegalPmdDataException;
+import jp.s
fjp.mikutoga.bin
.parser.MmdFormatException;
+import jp.s
fjp
.mikutoga.pmd.IllegalPmdDataException;
import jp.sourceforge.mikutoga.xml.TogaXmlException;
import org.xml.sax.SAXException;
import jp.sourceforge.mikutoga.xml.TogaXmlException;
import org.xml.sax.SAXException;
@@
-217,12
+217,19
@@
public final class Pmd2Xml {
if( ! file.exists() ) return;
if( ! file.isFile() ) return;
if( ! file.exists() ) return;
if( ! file.isFile() ) return;
- FileOutputStream foStream = new FileOutputStream(file);
- FileChannel channnel = foStream.getChannel();
- channnel.truncate(0);
+ if(file.length() <= 0L) return;
- channnel.close();
- foStream.close();
+ FileOutputStream foStream = new FileOutputStream(file);
+ try{
+ FileChannel channnel = foStream.getChannel();
+ try{
+ channnel.truncate(0L);
+ }finally{
+ channnel.close();
+ }
+ }finally{
+ foStream.close();
+ }
return;
}
return;
}