You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2017/12/12 16:06:28 UTC

groovy git commit: Revert "Refine DgmConverter to gain better IO performance"

Repository: groovy
Updated Branches:
  refs/heads/master 6e2a7dda7 -> a42dc880e


Revert "Refine DgmConverter to gain better IO performance"

This reverts commit 1b248d3


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/a42dc880
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/a42dc880
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/a42dc880

Branch: refs/heads/master
Commit: a42dc880e084c2f08a384cc3f2f0978e68dc6d21
Parents: 6e2a7dd
Author: sunlan <su...@apache.org>
Authored: Wed Dec 13 00:06:16 2017 +0800
Committer: sunlan <su...@apache.org>
Committed: Wed Dec 13 00:06:16 2017 +0800

----------------------------------------------------------------------
 .../org/codehaus/groovy/tools/DgmConverter.java | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/a42dc880/src/main/org/codehaus/groovy/tools/DgmConverter.java
----------------------------------------------------------------------
diff --git a/src/main/org/codehaus/groovy/tools/DgmConverter.java b/src/main/org/codehaus/groovy/tools/DgmConverter.java
index 5228a93..ba714bb 100644
--- a/src/main/org/codehaus/groovy/tools/DgmConverter.java
+++ b/src/main/org/codehaus/groovy/tools/DgmConverter.java
@@ -29,7 +29,6 @@ import org.objectweb.asm.Label;
 import org.objectweb.asm.MethodVisitor;
 import org.objectweb.asm.Opcodes;
 
-import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -94,23 +93,12 @@ public class DgmConverter implements Opcodes {
             cw.visitEnd();
 
             final byte[] bytes = cw.toByteArray();
-
             File targetFile = new File(targetDirectory + className + ".class").getCanonicalFile();
             targetFile.getParentFile().mkdirs();
-
-            BufferedOutputStream bufferedOutputStream = null;
-            try {
-                bufferedOutputStream =
-                        new BufferedOutputStream(
-                                new FileOutputStream(targetFile));
-
-                bufferedOutputStream.write(bytes);
-                bufferedOutputStream.flush();
-            } finally {
-                if (null != bufferedOutputStream) {
-                    bufferedOutputStream.close();
-                }
-            }
+            final FileOutputStream fileOutputStream = new FileOutputStream(targetFile);
+            fileOutputStream.write(bytes);
+            fileOutputStream.flush();
+            fileOutputStream.close();
         }
 
         GeneratedMetaMethod.DgmMethodRecord.saveDgmInfo(records, targetDirectory+"/META-INF/dgminfo");