This is an automated email from the ASF dual-hosted git repository.

gjacoby pushed a commit to branch 4.x-HBase-1.3
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/4.x-HBase-1.3 by this push:
     new 776f54b  PHOENIX-5380 : Avoid possibility of ClassCastException with 
equals() of Column and Scenario
776f54b is described below

commit 776f54b52083bdab9b99a78d001ff92ebb2d7080
Author: Viraj Jasani <vjas...@salesforce.com>
AuthorDate: Fri Jun 28 22:16:09 2019 +0530

    PHOENIX-5380 : Avoid possibility of ClassCastException with equals() of 
Column and Scenario
    
    Signed-off-by: Geoffrey Jacoby <gjac...@apache.org>
---
 .../src/main/java/org/apache/phoenix/pherf/configuration/Column.java   | 3 +++
 .../src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java | 3 +++
 2 files changed, 6 insertions(+)

diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
index 0d64a39..c121451 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Column.java
@@ -62,6 +62,9 @@ public class Column {
      */
     @Override
     public boolean equals(Object column) {
+        if (!(column instanceof Column)) {
+            return false;
+        }
         Column col = (Column)column;
         return (getType() == col.getType());
     }
diff --git 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
index db9a714..53b2d25 100644
--- 
a/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
+++ 
b/phoenix-pherf/src/main/java/org/apache/phoenix/pherf/configuration/Scenario.java
@@ -56,6 +56,9 @@ public class Scenario {
      */
     @Override
     public boolean equals(Object object) {
+        if (!(object instanceof Scenario)) {
+            return false;
+        }
         Scenario scenario = (Scenario) object;
         return (this.tableName.equals(scenario.getTableName()));
     }

Reply via email to