You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2014/09/01 16:48:18 UTC
git commit: [CXF-5938] Initializing the stack directly in visit() to
avoid NPE in cases when a thread that invokes initially was not the same
which initiakilized the stack in the constructor
Repository: cxf
Updated Branches:
refs/heads/master 0983a2bb2 -> ec4435d70
[CXF-5938] Initializing the stack directly in visit() to avoid NPE in cases when a thread that invokes initially was not the same which initiakilized the stack in the constructor
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ec4435d7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ec4435d7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ec4435d7
Branch: refs/heads/master
Commit: ec4435d70cb0097e34f38bc0f47c0faca03b4bb0
Parents: 0983a2b
Author: Sergey Beryozkin <sb...@talend.com>
Authored: Mon Sep 1 15:47:59 2014 +0100
Committer: Sergey Beryozkin <sb...@talend.com>
Committed: Mon Sep 1 15:47:59 2014 +0100
----------------------------------------------------------------------
.../apache/cxf/jaxrs/ext/search/lucene/LuceneQueryVisitor.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf/blob/ec4435d7/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/lucene/LuceneQueryVisitor.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/lucene/LuceneQueryVisitor.java b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/lucene/LuceneQueryVisitor.java
index 1836ce7..750b37c 100644
--- a/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/lucene/LuceneQueryVisitor.java
+++ b/rt/rs/extensions/search/src/main/java/org/apache/cxf/jaxrs/ext/search/lucene/LuceneQueryVisitor.java
@@ -103,8 +103,6 @@ public class LuceneQueryVisitor<T> extends AbstractSearchConditionVisitor<T, Que
queryBuilder = new QueryBuilder(analyzer);
}
- state.set(new Stack<List<Query>>());
- state.get().push(new ArrayList<Query>());
}
public void setContentsFieldMap(Map<String, String> map) {
@@ -121,6 +119,9 @@ public class LuceneQueryVisitor<T> extends AbstractSearchConditionVisitor<T, Que
}
public void visit(SearchCondition<T> sc) {
+ if (state.get() == null) {
+ reset();
+ }
PrimitiveStatement statement = sc.getStatement();
if (statement != null) {
if (statement.getProperty() != null) {