geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1243417 - in /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive: ClassesArchive.java FileArchive.java JarArchive.java
Date Mon, 13 Feb 2012 04:58:30 GMT
Author: dblevins
Date: Mon Feb 13 04:58:30 2012
New Revision: 1243417

URL: http://svn.apache.org/viewvc?rev=1243417&view=rev
Log:
Patch from Romain Manni-Bucau, XBEAN-199: use a bufferedinputstream in org.apache.xbean.finder.archive.Archive#getBytecode
implementations
Thanks, Romain!

Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/ClassesArchive.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/FileArchive.java
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/ClassesArchive.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/ClassesArchive.java?rev=1243417&r1=1243416&r2=1243417&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/ClassesArchive.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/ClassesArchive.java
Mon Feb 13 04:58:30 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.xbean.finder.archive;
 
+import java.io.BufferedInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
@@ -69,7 +70,7 @@ public class ClassesArchive implements A
         }
         for (ClassLoader loader : loaders) {
             URL resource = loader.getResource(className);
-            if (resource != null) return resource.openStream();
+            if (resource != null) return new BufferedInputStream(resource.openStream());
         }
 
         throw new ClassNotFoundException(className);

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/FileArchive.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/FileArchive.java?rev=1243417&r1=1243416&r2=1243417&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/FileArchive.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/FileArchive.java
Mon Feb 13 04:58:30 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.xbean.finder.archive;
 
+import java.io.BufferedInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
@@ -57,7 +58,7 @@ public class FileArchive implements Arch
         }
 
         URL resource = loader.getResource(className);
-        if (resource != null) return resource.openStream();
+        if (resource != null) return new BufferedInputStream(resource.openStream());
 
         throw new ClassNotFoundException(className);
     }

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java?rev=1243417&r1=1243416&r2=1243417&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java
Mon Feb 13 04:58:30 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.xbean.finder.archive;
 
+import java.io.BufferedInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
@@ -55,7 +56,7 @@ public class JarArchive implements Archi
         }
 
         URL resource = loader.getResource(className);
-        if (resource != null) return resource.openStream();
+        if (resource != null) return new BufferedInputStream(resource.openStream());
 
         throw new ClassNotFoundException(className);
     }



Mime
View raw message