karishma-tirthani / odata4j

Automatically exported from code.google.com/p/odata4j
0 stars 0 forks source link

NPE receiving null DateTimeOffset #181

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Bug reported in group odata4j-discuss:

getting a NPE on the client side receiving a entity containing a null 
DateTimeOffset:

java.lang.RuntimeException: java.lang.NullPointerException
at org.core4j.ReadOnlyIterator.hasNext(ReadOnlyIterator.java:50)
at org.core4j.Enumerable$FuncIterator.hasNext(Enumerable.java:482)
at org.core4j.Enumerable$FuncIterator.hasNext(Enumerable.java:482)
at org.core4j.Enumerable.count(Enumerable.java:106)
...
Caused by: java.lang.NullPointerException
at java.util.regex.Matcher.getTextLength(Matcher.java:1140)
at java.util.regex.Matcher.reset(Matcher.java:291)
at java.util.regex.Matcher.<init>(Matcher.java:211)
at java.util.regex.Pattern.matcher(Pattern.java:888)
at org.odata4j.internal.InternalUtil.parseDateTime(InternalUtil.java:73)
at org.odata4j.core.OSimpleObjects.parse(OSimpleObjects.java:123)
at org.odata4j.core.OProperties.parseSimple(OProperties.java:112)
at 
org.odata4j.format.xml.AtomFeedFormatParser.parseProperties(AtomFeedFormatParser
.java:205)
at 
org.odata4j.format.xml.AtomFeedFormatParser.parseDSAtomEntry(AtomFeedFormatParse
r.java:249)
at 
org.odata4j.format.xml.AtomFeedFormatParser.parseEntry(AtomFeedFormatParser.java
:360)
at 
org.odata4j.format.xml.AtomFeedFormatParser.parseFeed(AtomFeedFormatParser.java:
155)
at 
org.odata4j.format.xml.AtomFeedFormatParser.parse(AtomFeedFormatParser.java:143)
at 
org.odata4j.format.xml.AtomFeedFormatParser.parse(AtomFeedFormatParser.java:41)
at 
org.odata4j.jersey.consumer.ConsumerQueryEntitiesRequest$EntryIterator.advance(C
onsumerQueryEntitiesRequest.java:81)
at org.core4j.ReadOnlyIterator.hasNext(ReadOnlyIterator.java:48)
... 30 more

content fragment:
<content type="application/xml">
<m:properties>
<d:EndTime m:type="Edm.DateTimeOffset" m:null="true"/>
<d:StartTime 
m:type="Edm.DateTimeOffset">2012-04-06T02:18:18.584-05:00</d:StartTime>
...
</m:properties></content>

Original issue reported on code.google.com by philipp.sebastian.thun on 2 Jun 2012 at 9:50

GoogleCodeExporter commented 8 years ago
Fixed with revision 2c193b035653.

Original comment by philipp.sebastian.thun on 2 Jun 2012 at 10:00