summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2005-11-17 15:26:27 +0000
committerMark Wielaard <mark@klomp.org>2005-11-17 15:26:27 +0000
commit230cead2459925f59caff32d7cd876903cdba0a9 (patch)
tree249067e71d80fdee06815cef97965c6dc2bbb0c4
parent2d159c89299bac0aa4667ef9221217efb38e3b42 (diff)
downloadclasspath-230cead2459925f59caff32d7cd876903cdba0a9.tar.gz
2005-11-17 Mark Wielaard <mark@klomp.org>
* java/net/URLClassLoader.java: Reindented.
-rw-r--r--ChangeLog4
-rw-r--r--java/net/URLClassLoader.java98
2 files changed, 53 insertions, 49 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d768c589..026c64f70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-11-17 Mark Wielaard <mark@klomp.org>
+
+ * java/net/URLClassLoader.java: Reindented.
+
2005-11-17 Roman Kennke <kennke@aicas.com>
* javax/swing/JApplet.java
diff --git a/java/net/URLClassLoader.java b/java/net/URLClassLoader.java
index 726778eba..9d0e50410 100644
--- a/java/net/URLClassLoader.java
+++ b/java/net/URLClassLoader.java
@@ -536,15 +536,15 @@ public class URLClassLoader extends SecureClassLoader
Resource getResource(String name)
{
try
- {
- File file = new File(dir, name).getCanonicalFile();
- if (file.exists() && !file.isDirectory())
- return new FileResource(this, file);
- }
+ {
+ File file = new File(dir, name).getCanonicalFile();
+ if (file.exists() && !file.isDirectory())
+ return new FileResource(this, file);
+ }
catch (IOException e)
- {
- // Fall through...
- }
+ {
+ // Fall through...
+ }
return null;
}
}
@@ -873,47 +873,47 @@ public class URLClassLoader extends SecureClassLoader
// construct the class (and watch out for those nasty IOExceptions)
try
{
- byte[] data;
- InputStream in = resource.getInputStream();
- try
- {
- int length = resource.getLength();
- if (length != -1)
- {
- // We know the length of the data.
- // Just try to read it in all at once
- data = new byte[length];
- int pos = 0;
- while (length - pos > 0)
- {
- int len = in.read(data, pos, length - pos);
- if (len == -1)
- throw new EOFException("Not enough data reading from: "
- + in);
- pos += len;
- }
- }
- else
- {
- // We don't know the data length.
- // Have to read it in chunks.
- ByteArrayOutputStream out = new ByteArrayOutputStream(4096);
- byte[] b = new byte[4096];
- int l = 0;
- while (l != -1)
- {
- l = in.read(b);
- if (l != -1)
- out.write(b, 0, l);
- }
- data = out.toByteArray();
- }
- }
- finally
- {
- in.close();
- }
- final byte[] classData = data;
+ byte[] data;
+ InputStream in = resource.getInputStream();
+ try
+ {
+ int length = resource.getLength();
+ if (length != -1)
+ {
+ // We know the length of the data.
+ // Just try to read it in all at once
+ data = new byte[length];
+ int pos = 0;
+ while (length - pos > 0)
+ {
+ int len = in.read(data, pos, length - pos);
+ if (len == -1)
+ throw new EOFException("Not enough data reading from: "
+ + in);
+ pos += len;
+ }
+ }
+ else
+ {
+ // We don't know the data length.
+ // Have to read it in chunks.
+ ByteArrayOutputStream out = new ByteArrayOutputStream(4096);
+ byte[] b = new byte[4096];
+ int l = 0;
+ while (l != -1)
+ {
+ l = in.read(b);
+ if (l != -1)
+ out.write(b, 0, l);
+ }
+ data = out.toByteArray();
+ }
+ }
+ finally
+ {
+ in.close();
+ }
+ final byte[] classData = data;
// Now get the CodeSource
final CodeSource source = resource.getCodeSource();