classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: URLClassLoader reindent


From: Mark Wielaard
Subject: [cp-patches] FYI: URLClassLoader reindent
Date: Thu, 17 Nov 2005 16:25:48 +0100

Hi,

This just reindents URLClassLoader to match the libgcj version a bit
more. Will make merging easier.

2005-11-17  Mark Wielaard  <address@hidden>

        * java/net/URLClassLoader.java: Reindented.

No code changes.

Committed,

Mark
Index: java/net/URLClassLoader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URLClassLoader.java,v
retrieving revision 1.42
diff -u -r1.42 URLClassLoader.java
--- java/net/URLClassLoader.java        22 Oct 2005 09:39:48 -0000      1.42
+++ java/net/URLClassLoader.java        17 Nov 2005 15:23:22 -0000
@@ -536,15 +536,15 @@
     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 @@
     // 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();

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]