diff options
author | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
commit | 8f523f3a1047919d3563daf1ef47ba87336ebe89 (patch) | |
tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/java/lang/reflect/Proxy.java | |
parent | 02e549bfaaec38f68307e7f34e46ea57ea1809af (diff) | |
download | gcc-8f523f3a1047919d3563daf1ef47ba87336ebe89.zip gcc-8f523f3a1047919d3563daf1ef47ba87336ebe89.tar.gz gcc-8f523f3a1047919d3563daf1ef47ba87336ebe89.tar.bz2 |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
From-SVN: r107049
Diffstat (limited to 'libjava/classpath/java/lang/reflect/Proxy.java')
-rw-r--r-- | libjava/classpath/java/lang/reflect/Proxy.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libjava/classpath/java/lang/reflect/Proxy.java b/libjava/classpath/java/lang/reflect/Proxy.java index 7a5fd30..137cb5a 100644 --- a/libjava/classpath/java/lang/reflect/Proxy.java +++ b/libjava/classpath/java/lang/reflect/Proxy.java @@ -100,7 +100,7 @@ import java.util.Set; * belongs to the classloader you designated.</li> * <li>Reflection works as expected: {@link Class#getInterfaces()} and * {@link Class#getMethods()} work as they do on normal classes.</li> - * <li>The method {@link #isProxyClass()} will distinguish between + * <li>The method {@link #isProxyClass(Class)} will distinguish between * true proxy classes and user extensions of this class. It only * returns true for classes created by {@link #getProxyClass}.</li> * <li>The {@link ProtectionDomain} of a proxy class is the same as for @@ -111,8 +111,8 @@ import java.util.Set; * the only way to create an instance of the proxy class.</li> * <li>The proxy class contains a single constructor, which takes as * its only argument an {@link InvocationHandler}. The method - * {@link #newInstance} is shorthand to do the necessary - * reflection.</li> + * {@link #newProxyInstance(ClassLoader, Class[], InvocationHandler)} + * is shorthand to do the necessary reflection.</li> * </ul> * * <h3>Proxy Instances</h3> @@ -126,7 +126,7 @@ import java.util.Set; * a {@link ClassCastException}.</li> * <li>Each proxy instance has an invocation handler, which can be * accessed by {@link #getInvocationHandler(Object)}. Any call - * to an interface method, including {@link Object#hashcode()}, + * to an interface method, including {@link Object#hashCode()}, * {@link Object#equals(Object)}, or {@link Object#toString()}, * but excluding the public final methods of Object, will be * encoded and passed to the {@link InvocationHandler#invoke} @@ -413,8 +413,6 @@ public class Proxy implements Serializable */ ProxyType(ClassLoader loader, Class[] interfaces) { - if (loader == null) - loader = ClassLoader.getSystemClassLoader(); this.loader = loader; this.interfaces = interfaces; } @@ -426,8 +424,7 @@ public class Proxy implements Serializable */ public int hashCode() { - //loader is always not null - int hash = loader.hashCode(); + int hash = loader == null ? 0 : loader.hashCode(); for (int i = 0; i < interfaces.length; i++) hash = hash * 31 + interfaces[i].hashCode(); return hash; @@ -436,7 +433,7 @@ public class Proxy implements Serializable /** * Calculates equality. * - * @param the object to compare to + * @param other object to compare to * @return true if it is a ProxyType with same data */ public boolean equals(Object other) @@ -586,7 +583,7 @@ public class Proxy implements Serializable /** * Calculates equality. * - * @param the object to compare to + * @param other object to compare to * @return true if it is a ProxySignature with same data */ public boolean equals(Object other) @@ -617,7 +614,7 @@ public class Proxy implements Serializable * The package this class is in <b>including the trailing dot</b> * or an empty string for the unnamed (aka default) package. */ - String pack; + String pack = ""; /** * The interfaces this class implements. Non-null, but possibly empty. |