diff options
author | Pekka Enberg <penberg@kernel.org> | 2011-09-11 11:15:12 +0300 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-03-12 10:55:56 +0200 |
commit | 2dfd5525ea3daa519addbcda40b49f480e63bcc9 (patch) | |
tree | 4e283cc14582d670f4a508432a77d646fbabe7a6 | |
parent | 15553fa6ebbf89e75798f468bbc1d962f16eda47 (diff) | |
download | classpath-2dfd5525ea3daa519addbcda40b49f480e63bcc9.tar.gz |
Implement MethodType.equals()
Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r-- | java/lang/invoke/MethodType.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/java/lang/invoke/MethodType.java b/java/lang/invoke/MethodType.java index dd58cb09c..4d021c711 100644 --- a/java/lang/invoke/MethodType.java +++ b/java/lang/invoke/MethodType.java @@ -244,9 +244,17 @@ public final class MethodType return ptypes.toArray(new Class<?>[0]); } - public boolean equals(Object object) + public boolean equals(Object obj) { - throw new UnsupportedOperationException(); + if (this == obj) + return true; + + if (!(obj instanceof MethodType)) + return false; + + MethodType mh = (MethodType) obj; + + return rtype.equals(mh.rtype) && ptypes.equals(mh.ptypes); } public int hashCode() |