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 2013/12/03 19:09:18 UTC

[4/5] git commit: [OLINGO-73] Minor fix for null inline count

[OLINGO-73] Minor fix for null inline count


Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/f3b58c2d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/f3b58c2d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/f3b58c2d

Branch: refs/heads/master
Commit: f3b58c2da38efbf356fcf8ac4635cd580bfbf46d
Parents: 1cac509
Author: Christian Amend <ch...@apache.org>
Authored: Tue Dec 3 14:10:05 2013 +0100
Committer: Chandan V A <ch...@sap.com>
Committed: Tue Dec 3 23:32:48 2013 +0530

----------------------------------------------------------------------
 .../core/ep/consumer/XmlFeedConsumer.java       | 21 ++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/f3b58c2d/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
index 611bb0e..5cd1258 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
@@ -105,18 +105,19 @@ public class XmlFeedConsumer {
         reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_M_2007_08, FormatXml.M_COUNT);
 
         String inlineCountString = reader.getElementText();
-        try {
-          int inlineCountNumber = Integer.valueOf(inlineCountString);
-          if (inlineCountNumber >= 0) {
-            metadata.setInlineCount(inlineCountNumber);
-          } else {
-            throw new EntityProviderException(EntityProviderException.INLINECOUNT_INVALID
-                .addContent(inlineCountNumber));
+        if (inlineCountString != null) {
+          try {
+            int inlineCountNumber = Integer.valueOf(inlineCountString);
+            if (inlineCountNumber >= 0) {
+              metadata.setInlineCount(inlineCountNumber);
+            } else {
+              throw new EntityProviderException(EntityProviderException.INLINECOUNT_INVALID
+                  .addContent(inlineCountNumber));
+            }
+          } catch (NumberFormatException e) {
+            throw new EntityProviderException(EntityProviderException.INLINECOUNT_INVALID.addContent(""), e);
           }
-        } catch (NumberFormatException e) {
-          throw new EntityProviderException(EntityProviderException.INLINECOUNT_INVALID.addContent(""), e);
         }
-
       } else if (FormatXml.ATOM_LINK.equals(reader.getLocalName())) {
         reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_LINK);