Patch: FYI: Classpath mergelet

Tom Tromey tromey@redhat.com
Sat Mar 29 01:33:00 GMT 2003


I'm checking this in.

This merges Package and Proxy from Classpath.
The former is an old divergence that it is now safe to remove.
The latter is an API compatibility fixlet.

Tom

Index: libjava/ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* java/lang/reflect/Proxy.java: New version from Classpath.
	* java/lang/Package.java: New version from Classpath.

Index: libjava/java/lang/Package.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/Package.java,v
retrieving revision 1.5
diff -u -r1.5 Package.java
--- libjava/java/lang/Package.java 2 Mar 2003 21:20:26 -0000 1.5
+++ libjava/java/lang/Package.java 29 Mar 2003 01:32:01 -0000
@@ -1,5 +1,5 @@
 /* Package.java -- information about a package
-   Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -269,8 +269,7 @@
   public static Package getPackage(String name)
   {
     // Get the caller's classloader
-    SecurityManager sm = System.getSecurityManager();
-    Class c = sm.getClassContext()[1];
+    Class c = VMSecurityManager.getClassContext()[1];
     ClassLoader cl = c.getClassLoader();
     return cl != null ? cl.getPackage(name) : null;
   }
@@ -284,8 +283,7 @@
   public static Package[] getPackages()
   {
     // Get the caller's classloader
-    SecurityManager sm = System.getSecurityManager();
-    Class c = sm.getClassContext()[1];
+    Class c = VMSecurityManager.getClassContext()[1];
     ClassLoader cl = c.getClassLoader();
     // Sun's implementation returns the packages loaded by the bootstrap
     // classloader if cl is null, but right now our bootstrap classloader
@@ -313,12 +311,7 @@
    */
   public String toString()
   {
-    return "package: " + name +
-	   " spec: " + specTitle +
-	   " version: " + specVersion +
-	   " vendor: " + specVendor +
-	   " implementation: " + implTitle +
-	   " version: " + implVersion +
-	   " vendor: " + implVendor + " sealed: " + sealed;
+    return ("package " + name + (specTitle == null ? "" : ", " + specTitle)
+	    + (specVersion == null ? "" : ", version " + specVersion));
   }
 } // class Package
Index: libjava/java/lang/reflect/Proxy.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/reflect/Proxy.java,v
retrieving revision 1.2
diff -u -r1.2 Proxy.java
--- libjava/java/lang/reflect/Proxy.java 3 Nov 2002 20:27:30 -0000 1.2
+++ libjava/java/lang/reflect/Proxy.java 29 Mar 2003 01:32:02 -0000
@@ -185,7 +185,7 @@
    * Proxy.
    * @serial invocation handler associated with this proxy instance
    */
-  protected final InvocationHandler h;
+  protected InvocationHandler h;
 
   /**
    * Constructs a new Proxy from a subclass (usually a proxy class),



More information about the Java-patches mailing list