You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2014/11/13 06:12:47 UTC

phoenix git commit: PHOENIX-1449 Fix PropertiesUtil.deepCopy()

Repository: phoenix
Updated Branches:
  refs/heads/4.2 adc859f8f -> d365f2193


PHOENIX-1449 Fix PropertiesUtil.deepCopy()


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

Branch: refs/heads/4.2
Commit: d365f2193c8fed6574cc1a383bfe3b4106c9740e
Parents: adc859f
Author: James Taylor <jt...@salesforce.com>
Authored: Wed Nov 12 21:12:36 2014 -0800
Committer: James Taylor <jt...@salesforce.com>
Committed: Wed Nov 12 21:12:36 2014 -0800

----------------------------------------------------------------------
 .../main/java/org/apache/phoenix/compile/DeleteCompiler.java  | 4 +++-
 .../src/main/java/org/apache/phoenix/util/PropertiesUtil.java | 7 +++++--
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d365f219/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
index 1331a2a..2d7de4d 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/compile/DeleteCompiler.java
@@ -166,7 +166,9 @@ public class DeleteCompiler {
                     }
                     connection.commit();
                     mutations.clear();
-                    indexMutations.clear();
+                    if (indexMutations != null) {
+                        indexMutations.clear();
+                    }
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/d365f219/phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java
index d894e58..a69947e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/PropertiesUtil.java
@@ -17,6 +17,7 @@
  */
 package org.apache.phoenix.util;
 
+import java.util.Map.Entry;
 import java.util.Properties;
 
 public class PropertiesUtil {
@@ -31,8 +32,10 @@ public class PropertiesUtil {
      */
     public static Properties deepCopy(Properties properties) {
         Properties newProperties = new Properties();
-        for (String pName : properties.stringPropertyNames()) {
-            newProperties.setProperty(pName, properties.getProperty(pName));
+        for (Entry<Object, Object> entry : properties.entrySet()) {
+            String key = entry.getKey().toString();
+            String value = entry.getValue().toString();
+            newProperties.put(key, value);
         }
         return newProperties;
     }