[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: more trampoline patches

Kaffe CVS cvs-commits at kaffe.org
Wed Nov 10 02:55:25 PST 2004


PatchSet 5426 
Date: 2004/11/10 10:50:38
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: more trampoline patches

2004-11-10  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/java/net/URLClassLoader.java,
        libraries/javalib/java/nio/charset/CoderResult.java,
        libraries/javalib/java/rmi/server/RMIClassLoader.java,
        libraries/javalib/java/util/TimeZone.java:
        Resynced with GNU Classpath.

        2004-11-06  Tom Tromey  <tromey at redhat.com>

        * java/net/URLClassLoader.java (URLClassLoader): Now
        package-private.
        * java/nio/charset/CoderResult.java (CoderResult): Now
        package-private.
        (get): Likewise.
        (Cache): Likewise.  Dont synchronize on this.
        * java/rmi/server/RMIClassLoader.java (MyClassLoader): Now
        package-private.
        * java/util/TimeZone.java (timezones): Now package-private.

Members: 
	ChangeLog:1.2975->1.2976 
	libraries/javalib/java/net/URLClassLoader.java:1.17->1.18 
	libraries/javalib/java/nio/charset/CoderResult.java:1.1->1.2 
	libraries/javalib/java/rmi/server/RMIClassLoader.java:1.7->1.8 
	libraries/javalib/java/util/TimeZone.java:1.19->1.20 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2975 kaffe/ChangeLog:1.2976
--- kaffe/ChangeLog:1.2975	Tue Nov  9 22:08:15 2004
+++ kaffe/ChangeLog	Wed Nov 10 10:50:38 2004
@@ -1,3 +1,23 @@
+2004-11-10  Dalibor Topic  <robilad at kaffe.org>
+
+	* libraries/javalib/java/net/URLClassLoader.java,
+	libraries/javalib/java/nio/charset/CoderResult.java,
+	libraries/javalib/java/rmi/server/RMIClassLoader.java,
+	libraries/javalib/java/util/TimeZone.java:
+	Resynced with GNU Classpath.
+
+	2004-11-06  Tom Tromey  <tromey at redhat.com>
+
+        * java/net/URLClassLoader.java (URLClassLoader): Now
+        package-private.
+        * java/nio/charset/CoderResult.java (CoderResult): Now
+        package-private.
+        (get): Likewise.
+        (Cache): Likewise.  Don't synchronize on `this'.
+        * java/rmi/server/RMIClassLoader.java (MyClassLoader): Now
+        package-private.
+        * java/util/TimeZone.java (timezones): Now package-private.
+
 2004-11-09  Dalibor Topic  <robilad at kaffe.org>
 
 	* libraries/javalib/java/security/Permissions.java,
Index: kaffe/libraries/javalib/java/net/URLClassLoader.java
diff -u kaffe/libraries/javalib/java/net/URLClassLoader.java:1.17 kaffe/libraries/javalib/java/net/URLClassLoader.java:1.18
--- kaffe/libraries/javalib/java/net/URLClassLoader.java:1.17	Mon Oct  4 09:37:47 2004
+++ kaffe/libraries/javalib/java/net/URLClassLoader.java	Wed Nov 10 10:50:44 2004
@@ -1,5 +1,5 @@
 /* URLClassLoader.java --  ClassLoader that loads classes from one or more URLs
-   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -573,8 +573,9 @@
     addURLs(urls);
   }
 
+  // Package-private to avoid a trampoline constructor.
   /**
-   * Private constructor used by the static
+   * Package-private constructor used by the static
    * <code>newInstance(URL[])</code> method.  Creates an
    * <code>URLClassLoader</code> with the given parent but without any
    * <code>URL</code>s yet. This is used to bypass the normal security
@@ -586,8 +587,7 @@
    *
    * @param securityContext the security context of the unprivileged code.
    */
-  private URLClassLoader(ClassLoader parent,
-                         AccessControlContext securityContext)
+  URLClassLoader(ClassLoader parent, AccessControlContext securityContext)
   {
     super(parent);
     this.factory = null;
Index: kaffe/libraries/javalib/java/nio/charset/CoderResult.java
diff -u kaffe/libraries/javalib/java/nio/charset/CoderResult.java:1.1 kaffe/libraries/javalib/java/nio/charset/CoderResult.java:1.2
--- kaffe/libraries/javalib/java/nio/charset/CoderResult.java:1.1	Thu Nov 28 13:39:26 2002
+++ kaffe/libraries/javalib/java/nio/charset/CoderResult.java	Wed Nov 10 10:50:44 2004
@@ -1,5 +1,5 @@
 /* CoderResult.java -- 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -82,7 +82,8 @@
   private final int type;
   private final int length;
 
-  private CoderResult (int type, int length)
+  // Package-private to avoid a trampoline constructor.
+  CoderResult (int type, int length)
   {
     this.type = type;
     this.length = length;
@@ -157,19 +158,14 @@
   {
     private final HashMap cache;
 
-    private Cache ()
+    // Package-private to avoid a trampoline constructor.
+    Cache ()
     {
-      // If we didn't synchronize on this, then cache would be initialized
-      // without holding a lock.  Undefined behavior would occur if the
-      // first thread to call get(int) was not the same as the one that
-      // called the constructor.
-      synchronized (this)
-        {
-          cache = new HashMap ();
-        }
+      cache = new HashMap ();
     }
 
-    private synchronized CoderResult get (int length)
+    // Package-private to avoid a trampoline.
+    synchronized CoderResult get (int length)
     {
       if (length <= 0)
         throw new IllegalArgumentException ("Non-positive length");
Index: kaffe/libraries/javalib/java/rmi/server/RMIClassLoader.java
diff -u kaffe/libraries/javalib/java/rmi/server/RMIClassLoader.java:1.7 kaffe/libraries/javalib/java/rmi/server/RMIClassLoader.java:1.8
--- kaffe/libraries/javalib/java/rmi/server/RMIClassLoader.java:1.7	Sat Oct 23 18:03:42 2004
+++ kaffe/libraries/javalib/java/rmi/server/RMIClassLoader.java	Wed Nov 10 10:50:45 2004
@@ -57,7 +57,8 @@
 {
   private static class MyClassLoader extends URLClassLoader
   {
-    private MyClassLoader (URL[] urls, ClassLoader parent, String annotation)
+    // Package-private to avoid a trampoline constructor.
+    MyClassLoader (URL[] urls, ClassLoader parent, String annotation)
     {
       super (urls, parent);
       this.annotation = annotation;
Index: kaffe/libraries/javalib/java/util/TimeZone.java
diff -u kaffe/libraries/javalib/java/util/TimeZone.java:1.19 kaffe/libraries/javalib/java/util/TimeZone.java:1.20
--- kaffe/libraries/javalib/java/util/TimeZone.java:1.19	Sun Sep 12 07:55:19 2004
+++ kaffe/libraries/javalib/java/util/TimeZone.java	Wed Nov 10 10:50:45 2004
@@ -134,7 +134,8 @@
   /* initialize this static field lazily to overhead if
    * it is not needed: 
    */
-  private static synchronized HashMap timezones()
+  // Package-private to avoid a trampoline.
+  static synchronized HashMap timezones()
   {
     if (timezones0 == null) 
       {




More information about the kaffe mailing list