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:47 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/64e6200e
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/64e6200e
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/64e6200e

Branch: refs/heads/GROOVY_2_5_X
Commit: 64e6200e74ea7fe1020c63a65f3705b25f9c56b7
Parents: 7122926
Author: sunlan <sunlan@apache.org>
Authored: Thu Dec 21 08:22:37 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Thu Dec 21 08:54:41 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/64e6200e/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