diff options
author | Tom Tromey <tromey@redhat.com> | 2004-11-06 23:22:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2004-11-06 23:22:05 +0000 |
commit | 92002f50bdb0358ddacacddd2fb8713489df6dd6 (patch) | |
tree | 9a0fa8e97e9f83cfdb351e4722e437af907915d6 /libjava/java/nio | |
parent | 96859aa4707f4f338d6cd0ceaa47b867e34dd2ef (diff) | |
download | gcc-92002f50bdb0358ddacacddd2fb8713489df6dd6.zip gcc-92002f50bdb0358ddacacddd2fb8713489df6dd6.tar.gz gcc-92002f50bdb0358ddacacddd2fb8713489df6dd6.tar.bz2 |
URLClassLoader.java (URLClassLoader): Now package-private.
* 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
Diffstat (limited to 'libjava/java/nio')
-rw-r--r-- | libjava/java/nio/charset/CoderResult.java | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libjava/java/nio/charset/CoderResult.java b/libjava/java/nio/charset/CoderResult.java index 49c6663..7824183 100644 --- a/libjava/java/nio/charset/CoderResult.java +++ b/libjava/java/nio/charset/CoderResult.java @@ -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"); |