You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2015/06/03 03:37:03 UTC
logging-log4j2 git commit: Use Apache Commons IOUtils instead of
sun.misc.IOUtils.
Repository: logging-log4j2
Updated Branches:
refs/heads/master e0cda1fbd -> d2aea7458
Use Apache Commons IOUtils instead of sun.misc.IOUtils.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d2aea745
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d2aea745
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d2aea745
Branch: refs/heads/master
Commit: d2aea7458f08e8b9d48f3768b719aafaf4246007
Parents: e0cda1f
Author: Gary Gregory <ga...@gmail.com>
Authored: Tue Jun 2 18:36:58 2015 -0700
Committer: Gary Gregory <ga...@gmail.com>
Committed: Tue Jun 2 18:36:58 2015 -0700
----------------------------------------------------------------------
.../apache/logging/log4j/core/selector/TestClassLoader.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d2aea745/log4j-core/src/test/java/org/apache/logging/log4j/core/selector/TestClassLoader.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/selector/TestClassLoader.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/selector/TestClassLoader.java
index af4d422..d0414b2 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/selector/TestClassLoader.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/selector/TestClassLoader.java
@@ -22,10 +22,10 @@ import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
+import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.core.util.Closer;
import org.apache.logging.log4j.core.util.Throwables;
import org.apache.logging.log4j.util.LoaderUtil;
-import sun.misc.IOUtils;
/**
* ClassLoader that loads class in this package (or sub-package) by hand, otherwise delegating to the TCCL.
@@ -57,10 +57,9 @@ public class TestClassLoader extends ClassLoader {
final URLConnection uc = resource.openConnection();
final int len = uc.getContentLength();
final InputStream in = new BufferedInputStream(uc.getInputStream());
- byte[] bytecode;
+ byte[] bytecode = new byte[len];
try {
- // laziness means using sun.misc
- bytecode = IOUtils.readFully(in, len, true);
+ IOUtils.readFully(in, bytecode);
} finally {
Closer.closeSilently(in);
}