aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/java/lang/reflect/Proxy.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/lang/reflect/Proxy.java')
-rw-r--r--libjava/classpath/java/lang/reflect/Proxy.java19
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 7a5fd30de16..137cb5a48a6 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.