groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject [2/2] groovy git commit: Improve robust: Check type before casting
Date Thu, 21 Dec 2017 00:54:15 GMT
Improve robust: Check type before casting

(cherry picked from commit 947aed9)


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

Branch: refs/heads/GROOVY_2_6_X
Commit: 66bba437b96fd305431ca93521b2d1faa0ad43e9
Parents: ac6e37d
Author: sunlan <sunlan@apache.org>
Authored: Thu Dec 21 08:22:37 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Thu Dec 21 08:53:58 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/66bba437/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