groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Improve robust: Check type before casting
Date Thu, 21 Dec 2017 00:22:43 GMT
Repository: groovy
Updated Branches:
  refs/heads/master 3edec28ff -> 947aed975


Improve robust: Check type before casting


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/947aed97
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/947aed97
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/947aed97

Branch: refs/heads/master
Commit: 947aed975b6d9758762c145e679c534eb4ce71ef
Parents: 3edec28
Author: sunlan <sunlan@apache.org>
Authored: Thu Dec 21 08:22:37 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Thu Dec 21 08:22:37 2017 +0800

----------------------------------------------------------------------
 src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/947aed97/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java b/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
index 4f8f48c..0781108 100644
--- a/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
+++ b/src/main/java/org/codehaus/groovy/classgen/asm/MopWriter.java
@@ -69,6 +69,10 @@ public class MopWriter {
         }
 
         public boolean equals(Object obj) {
+            if (!(obj instanceof MopKey)) {
+                return false;
+            }
+
             MopKey other = (MopKey) obj;
             return other.name.equals(name) && equalParameterTypes(other.params,params);
         }


Mime
View raw message