URLClassLoader.java (URLClassLoader): Now package-private.
authorTom Tromey <tromey@redhat.com>
Sat, 6 Nov 2004 23:22:05 +0000 (23:22 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Sat, 6 Nov 2004 23:22:05 +0000 (23:22 +0000)
* 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.

From-SVN: r90203

libjava/ChangeLog
libjava/java/net/URLClassLoader.java
libjava/java/nio/charset/CoderResult.java
libjava/java/rmi/server/RMIClassLoader.java
libjava/java/util/TimeZone.java

index 2fa28a3a515120c8ac15986319697143e5ecf4eb..3e2c5f2613a3047927f8da1851f00ebd4094e322 100644 (file)
@@ -1,3 +1,15 @@
+2004-11-06  Tom Tromey  <tromey@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-06  Tom Tromey  <tromey@redhat.com>
 
        * java/security/Permissions.java (perms): Now package-private.
index b991be8addf51b2d344663bd82ba9ccdfaa25905..c3238e5ccafde583dd6cf607990a7050877d1310 100644 (file)
@@ -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.
 
@@ -661,8 +661,9 @@ public class URLClassLoader extends SecureClassLoader
     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
@@ -674,8 +675,7 @@ public class URLClassLoader extends SecureClassLoader
    *
    * @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 49c66637c792ff67bc87dc7f2a5a883e39f991da..782418342b9a437eb3e930376755c1bf8fd5a406 100644 (file)
@@ -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 @@ public class CoderResult
   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 @@ public class CoderResult
   {
     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 f33ee80501c3f2ba74b2e650e32b4d4f51de74ea..006bc4539f8227f3127c8f4746f314f55ed36078 100644 (file)
@@ -57,7 +57,8 @@ public class RMIClassLoader
 {
   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 1e06e535611bc12ec2ce1b6ec036c90d39ffbbdd..39cdcd3e239d1e1e988e15ce55aeb28bfa9229c1 100644 (file)
@@ -134,7 +134,8 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
   /* 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) 
       {