From 8f523f3a1047919d3563daf1ef47ba87336ebe89 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 15 Nov 2005 23:20:01 +0000 Subject: Imported GNU Classpath 0.19 + gcj-import-20051115. * sources.am: Regenerated. * Makefile.in: Likewise. * scripts/makemake.tcl: Use glob -nocomplain. From-SVN: r107049 --- libjava/classpath/java/lang/reflect/Proxy.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'libjava/classpath/java/lang/reflect/Proxy.java') 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. *
  • Reflection works as expected: {@link Class#getInterfaces()} and * {@link Class#getMethods()} work as they do on normal classes.
  • - *
  • The method {@link #isProxyClass()} will distinguish between + *
  • 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}.
  • *
  • 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.
  • *
  • 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.
  • + * {@link #newProxyInstance(ClassLoader, Class[], InvocationHandler)} + * is shorthand to do the necessary reflection. * * *

    Proxy Instances

    @@ -126,7 +126,7 @@ import java.util.Set; * a {@link ClassCastException}. *
  • 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 including the trailing dot * or an empty string for the unnamed (aka default) package. */ - String pack; + String pack = ""; /** * The interfaces this class implements. Non-null, but possibly empty. -- cgit v1.1