This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: java.rmi.server.RMIClassLoader


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I commited the attached patch to reformat the code of 
java.rmi.server.RMIClassLoader.


Michael
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/dJwLWSOgCCdjSDsRAjqaAJ4m0ApULt3UsCGl+WyXG6DDKWu29wCgiW2E
nK8+tKLU6vmj7JBpWDyBXak=
=Xq3b
-----END PGP SIGNATURE-----
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2194
diff -u -b -B -r1.2194 ChangeLog
--- ChangeLog	26 Sep 2003 19:59:55 -0000	1.2194
+++ ChangeLog	26 Sep 2003 20:02:03 -0000
@@ -1,3 +1,8 @@
+2003-09-26  Michael Koch  <konqueror@gmx.de>
+
+	* java/rmi/server/RMIClassLoader.java:
+	Reformatted file, no functional code changes.
+
 2003-09-26  Sascha Brawer  <brawer@dandelis.ch>
 
 	* java/awt/image/SinglePixelPackedSampleModel.java (createDataBuffer): 
Index: java/rmi/server/RMIClassLoader.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/rmi/server/RMIClassLoader.java,v
retrieving revision 1.6
diff -u -b -B -r1.6 RMIClassLoader.java
--- java/rmi/server/RMIClassLoader.java	2 Jan 2003 00:14:24 -0000	1.6
+++ java/rmi/server/RMIClassLoader.java	26 Sep 2003 20:02:03 -0000
@@ -1,5 +1,6 @@
 /* RMIClassLoader.java
-  Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
+  Copyright (c) 1996, 1997, 1998, 1999, 2002, 2003
+  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -37,12 +38,12 @@
 
 package java.rmi.server;
 
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
 import java.net.URLClassLoader;
 import java.io.IOException;
 import java.io.DataInputStream;
-import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -51,40 +52,47 @@
 import java.util.StringTokenizer;
 import java.util.WeakHashMap;
 
+
+/**
+ * This class provides a set of public static utility methods for supporting
+ * network-based class loading in RMI. These methods are called by RMI's
+ * internal marshal streams to implement the dynamic class loading of types for
+ * RMI parameters and return values.
+ */
 public class RMIClassLoader
 {
-
   static private class MyClassLoader extends URLClassLoader
   {
-
-    private MyClassLoader(URL[] urls, ClassLoader parent, String annotation)
+    private MyClassLoader (URL[] urls, ClassLoader parent, String annotation)
     {
-      super(urls, parent);
+      super (urls, parent);
       this.annotation = annotation;
     }
 
-    private MyClassLoader(URL[] urls, ClassLoader parent)
+    private MyClassLoader (URL[] urls, ClassLoader parent)
     {
       super (urls, parent);
-      this.annotation = urlToAnnotation(urls);
+      this.annotation = urlToAnnotation (urls);
     }
 
-    public static String urlToAnnotation(URL[] urls)
+    public static String urlToAnnotation (URL[] urls)
     {
       if (urls.length == 0)
 	return null;
 
-      StringBuffer annotation = new StringBuffer(64*urls.length);
-      for(int i = 0; i < urls.length; i++)
+      StringBuffer annotation = new StringBuffer (64 * urls.length);
+
+      for (int i = 0; i < urls.length; i++)
 	{
-	  annotation.append(urls[i].toExternalForm());
-	  annotation.append(' ');
+        annotation.append (urls [i].toExternalForm());
+        annotation.append (' ');
 	}
 
       return annotation.toString();
     }
 
-    public final String getClassAnnotation(){
+    public final String getClassAnnotation()
+    {
       return annotation;
     }
 
@@ -106,16 +115,17 @@
   static
   {
     // 89 is a nice prime number for Hashtable initial capacity
-    cacheLoaders = new Hashtable(89);
-    cacheAnnotations = new Hashtable(89);
+    cacheLoaders = new Hashtable (89);
+    cacheAnnotations = new Hashtable (89);
+
+    defaultAnnotation = System.getProperty ("java.rmi.server.defaultAnnotation");
     
-    defaultAnnotation = System.getProperty("java.rmi.server.defaultAnnotation");
     try 
       {
 	if (defaultAnnotation != null)
-	  defaultCodebase = new URL(defaultAnnotation);
+        defaultCodebase = new URL (defaultAnnotation);
       }
-    catch(Exception _)
+    catch (Exception _)
       {
 	defaultCodebase = null;
       }
@@ -130,13 +141,13 @@
   /**
    * @deprecated
    */
-  public static Class loadClass(String name)
+  public static Class loadClass (String name)
     throws MalformedURLException, ClassNotFoundException
   {
-    return (loadClass("", name));
+    return loadClass ("", name);
   }
 
-  public static Class loadClass(String codebases, String name) 
+  public static Class loadClass (String codebases, String name)
     throws MalformedURLException, ClassNotFoundException 
   {
     Class c = null;
@@ -185,12 +197,15 @@
 	
     if (loader instanceof MyClassLoader)
       {
-	return ((MyClassLoader)loader).getClassAnnotation();
+        return ((MyClassLoader) loader).getClassAnnotation();
       }
 	
-    String s = (String)cacheAnnotations.get(loader);
+    String s = (String) cacheAnnotations.get (loader);
+
     if (s != null)
+      {
       return s;
+      }
 	    
     if (loader instanceof URLClassLoader)
       {
@@ -213,9 +228,8 @@
   /**
    * @deprecated
    */
-  public static Object getSecurityContext(ClassLoader loader)
+  public static Object getSecurityContext (ClassLoader loader)
   {
-    throw new Error("Not implemented");
+    throw new Error ("Not implemented");
   }
-
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]