You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2014/08/31 05:22:51 UTC
[1/2] git commit: [OLINGO-409] Fix NPE in $expand call
Repository: olingo-odata2
Updated Branches:
refs/heads/master 7852087f9 -> fe1b1c97f
[OLINGO-409] Fix NPE in $expand call
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/78f31a8e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/78f31a8e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/78f31a8e
Branch: refs/heads/master
Commit: 78f31a8e6cf5cb1db1600ad400d4259ea0f0cb8a
Parents: 7092ad3
Author: Chandan V A <ch...@sap.com>
Authored: Sun Aug 31 08:44:47 2014 +0530
Committer: Chandan V A <ch...@sap.com>
Committed: Sun Aug 31 08:44:47 2014 +0530
----------------------------------------------------------------------
.../odata2/jpa/processor/core/access/data/JPAEntityParser.java | 3 +++
.../odata2/jpa/processor/core/access/data/JPAProcessorImpl.java | 5 +++--
.../odata2/jpa/processor/core/callback/JPAExpandCallBack.java | 4 +++-
3 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/78f31a8e/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
index 9543bfe..318d05e 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
@@ -163,6 +163,9 @@ public final class JPAEntityParser {
Object result = null;
String methodName = null;
HashMap<String, Object> navigationMap = new HashMap<String, Object>();
+ if (jpaEntity == null) {
+ return navigationMap;
+ }
if (navigationPropertyList != null
&& navigationPropertyList.size() != 0) {
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/78f31a8e/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java
index e7f041b..8c497d3 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAProcessorImpl.java
@@ -131,8 +131,9 @@ public class JPAProcessorImpl implements JPAProcessor {
return (List<Object>) process((GetFunctionImportUriInfo) uriParserResultView);
}
InlineCount inlineCount = uriParserResultView.getInlineCount();
- Integer top = uriParserResultView.getTop();
- if (top != null && top.intValue() == 0 && inlineCount != null && inlineCount.equals(InlineCount.ALLPAGES)) {
+ Integer top = uriParserResultView.getTop() == null ? 1 : uriParserResultView.getTop().intValue();
+ boolean hasNoAllPages = inlineCount == null ? true : !inlineCount.equals(InlineCount.ALLPAGES);
+ if (top.intValue() == 0 && hasNoAllPages) {
return new ArrayList<Object>();
}
JPQLContextType contextType = null;
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/78f31a8e/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java
index 19bcf77..41cad61 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/callback/JPAExpandCallBack.java
@@ -87,7 +87,9 @@ public class JPAExpandCallBack implements OnWriteFeedContent, OnWriteEntryConten
}
HashMap<String, Object> navigationMap =
jpaResultParser.parse2EdmNavigationValueMap(inlinedEntry, currentNavPropertyList);
- edmPropertyValueMap.putAll(navigationMap);
+ if (edmPropertyValueMap != null) {
+ edmPropertyValueMap.putAll(navigationMap);
+ }
result.setEntryData(edmPropertyValueMap);
}
result.setInlineProperties(getInlineEntityProviderProperties(context));
[2/2] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/olingo-odata2.git
Posted by ch...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/olingo-odata2.git
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/fe1b1c97
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/fe1b1c97
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/fe1b1c97
Branch: refs/heads/master
Commit: fe1b1c97fc2f2fdd464479fc4f793c7a27a0abeb
Parents: 78f31a8 7852087
Author: Chandan V A <ch...@sap.com>
Authored: Sun Aug 31 08:52:29 2014 +0530
Committer: Chandan V A <ch...@sap.com>
Committed: Sun Aug 31 08:52:29 2014 +0530
----------------------------------------------------------------------
.../ep/producer/JsonLinkEntityProducer.java | 10 ++-
.../ep/producer/JsonLinksEntityProducer.java | 11 +--
.../ep/producer/JsonLinkEntityProducerTest.java | 17 +++++
.../producer/JsonLinksEntityProducerTest.java | 76 ++++++++++++++++++++
4 files changed, 107 insertions(+), 7 deletions(-)
----------------------------------------------------------------------