You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ra...@apache.org on 2018/11/21 18:00:01 UTC

[34/50] [abbrv] carbondata git commit: [HOTFIX] Intializing the CSDK object reference to NULL

[HOTFIX] Intializing the CSDK object reference to NULL

NULL intialization done to JObjects in CPP files of CSDK. This prevents seg fault when these objects are referenced without initilization.

This closes #2935


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

Branch: refs/heads/branch-1.5
Commit: b772b18e5075673bf4fdd76bc8eca255d0aeffdd
Parents: d4bd4ab
Author: brijoobopanna <br...@huawei.com>
Authored: Tue Nov 20 18:59:54 2018 +0530
Committer: ravipesala <ra...@gmail.com>
Committed: Wed Nov 21 22:43:46 2018 +0530

----------------------------------------------------------------------
 store/CSDK/src/CarbonProperties.h   |  6 +++---
 store/CSDK/src/CarbonReader.h       |  6 +++---
 store/CSDK/src/CarbonRow.h          | 24 ++++++++++++------------
 store/CSDK/src/CarbonSchemaReader.h |  4 ++--
 store/CSDK/src/CarbonWriter.h       |  6 +++---
 store/CSDK/src/Schema.h             |  6 +++---
 6 files changed, 26 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/b772b18e/store/CSDK/src/CarbonProperties.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonProperties.h b/store/CSDK/src/CarbonProperties.h
index a5d391b..39fbbda 100644
--- a/store/CSDK/src/CarbonProperties.h
+++ b/store/CSDK/src/CarbonProperties.h
@@ -22,17 +22,17 @@ private:
     /**
      * carbonProperties Class
      */
-    jclass carbonPropertiesClass;
+    jclass carbonPropertiesClass = NULL;
 
     /**
      * carbonProperties Object
      */
-    jobject carbonPropertiesObject;
+    jobject carbonPropertiesObject = NULL;
 public:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * Constructor of CarbonProperties

http://git-wip-us.apache.org/repos/asf/carbondata/blob/b772b18e/store/CSDK/src/CarbonReader.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonReader.h b/store/CSDK/src/CarbonReader.h
index 20c90bf..246e24b 100644
--- a/store/CSDK/src/CarbonReader.h
+++ b/store/CSDK/src/CarbonReader.h
@@ -38,12 +38,12 @@ private:
      * carbonReaderBuilder object for building carbonReader
      * it can configure some operation
      */
-    jobject carbonReaderBuilderObject;
+    jobject carbonReaderBuilderObject = NULL;
 
     /**
      * carbonReader object for reading data
      */
-    jobject carbonReaderObject;
+    jobject carbonReaderObject = NULL;
 
     /**
      * Return true if carbonReaderBuilder Object isn't NULL
@@ -65,7 +65,7 @@ public:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * create a CarbonReaderBuilder object for building carbonReader,

http://git-wip-us.apache.org/repos/asf/carbondata/blob/b772b18e/store/CSDK/src/CarbonRow.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonRow.h b/store/CSDK/src/CarbonRow.h
index 3dae5d3..c57f826 100644
--- a/store/CSDK/src/CarbonRow.h
+++ b/store/CSDK/src/CarbonRow.h
@@ -19,21 +19,21 @@
 
 class CarbonRow {
 private:
-    jmethodID getShortId;
-    jmethodID getIntId;
-    jmethodID getLongId;
-    jmethodID getDoubleId;
-    jmethodID getFloatId;
-    jmethodID getBooleanId;
-    jmethodID getStringId;
-    jmethodID getDecimalId;
-    jmethodID getVarcharId;
-    jmethodID getArrayId;
+    jmethodID getShortId = NULL;
+    jmethodID getIntId = NULL;
+    jmethodID getLongId = NULL;
+    jmethodID getDoubleId = NULL;
+    jmethodID getFloatId = NULL;
+    jmethodID getBooleanId = NULL;
+    jmethodID getStringId = NULL;
+    jmethodID getDecimalId = NULL;
+    jmethodID getVarcharId = NULL;
+    jmethodID getArrayId = NULL;
 
     /**
      * RowUtil Class for read data from Carbon Row
      */
-    jclass rowUtilClass;
+    jclass rowUtilClass = NULL;
 
     /**
      * carbon row data
@@ -57,7 +57,7 @@ public:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * Constructor and express the carbon row result

http://git-wip-us.apache.org/repos/asf/carbondata/blob/b772b18e/store/CSDK/src/CarbonSchemaReader.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonSchemaReader.h b/store/CSDK/src/CarbonSchemaReader.h
index 5c1b324..2746773 100644
--- a/store/CSDK/src/CarbonSchemaReader.h
+++ b/store/CSDK/src/CarbonSchemaReader.h
@@ -23,12 +23,12 @@ private:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * carbonSchemaReader Class for get method id and call method
      */
-    jclass carbonSchemaReaderClass;
+    jclass carbonSchemaReaderClass = NULL;
 
 public:
 

http://git-wip-us.apache.org/repos/asf/carbondata/blob/b772b18e/store/CSDK/src/CarbonWriter.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/CarbonWriter.h b/store/CSDK/src/CarbonWriter.h
index 2c8c715..a822432 100644
--- a/store/CSDK/src/CarbonWriter.h
+++ b/store/CSDK/src/CarbonWriter.h
@@ -22,7 +22,7 @@ private:
     /**
     * jni env
     */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * carbonWriterBuilder object for building carbonWriter
@@ -33,12 +33,12 @@ private:
     /**
      * carbonWriter object for writing data
      */
-    jobject carbonWriterObject;
+    jobject carbonWriterObject = NULL;
 
     /**
      * carbon writer class
      */
-    jclass carbonWriter;
+    jclass carbonWriter = NULL;
 
     /**
      * write method id

http://git-wip-us.apache.org/repos/asf/carbondata/blob/b772b18e/store/CSDK/src/Schema.h
----------------------------------------------------------------------
diff --git a/store/CSDK/src/Schema.h b/store/CSDK/src/Schema.h
index e9ddf4e..67434ef 100644
--- a/store/CSDK/src/Schema.h
+++ b/store/CSDK/src/Schema.h
@@ -28,17 +28,17 @@ private:
     /**
      * jni env
      */
-    JNIEnv *jniEnv;
+    JNIEnv *jniEnv = NULL;
 
     /**
      * schema class for get method id
      */
-    jclass schemaClass;
+    jclass schemaClass = NULL;
 
     /**
      * carbon schema data
      */
-    jobject schema;
+    jobject schema = NULL;
 
     /**
      * check ordinal, ordinal can't be negative