You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemall.apache.org by ta...@apache.org on 2017/09/22 06:58:20 UTC

[6/7] incubator-hivemall git commit: Avoid KryoException: java.lang.NullPointerException

Avoid KryoException: java.lang.NullPointerException


Project: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/commit/983d8376
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/tree/983d8376
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hivemall/diff/983d8376

Branch: refs/heads/dev/v0.4.2
Commit: 983d8376a0c3dd0da0fb02766e6559225fb30f32
Parents: 0c0e6a4
Author: Takuya Kitazawa <k....@gmail.com>
Authored: Thu Sep 21 13:48:51 2017 +0900
Committer: Takuya Kitazawa <ta...@apache.org>
Committed: Fri Sep 22 15:49:02 2017 +0900

----------------------------------------------------------------------
 nlp/src/main/java/hivemall/nlp/tokenizer/KuromojiUDF.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hivemall/blob/983d8376/nlp/src/main/java/hivemall/nlp/tokenizer/KuromojiUDF.java
----------------------------------------------------------------------
diff --git a/nlp/src/main/java/hivemall/nlp/tokenizer/KuromojiUDF.java b/nlp/src/main/java/hivemall/nlp/tokenizer/KuromojiUDF.java
index 93b3095..36d408d 100644
--- a/nlp/src/main/java/hivemall/nlp/tokenizer/KuromojiUDF.java
+++ b/nlp/src/main/java/hivemall/nlp/tokenizer/KuromojiUDF.java
@@ -66,7 +66,10 @@ public final class KuromojiUDF extends GenericUDF {
     private static final long MAX_INPUT_STREAM_SIZE = 32L * 1024L * 1024L; // ~32MB
 
     private Mode _mode;
-    private CharArraySet _stopWords;
+
+    // lazy instantiation to avoid org.apache.hive.com.esotericsoftware.kryo.KryoException: java.lang.NullPointerException
+    private transient CharArraySet _stopWords;
+
     private Set<String> _stopTags;
     private UserDictionary _userDict;