artiya4u / google-http-java-client

Automatically exported from code.google.com/p/google-http-java-client
0 stars 0 forks source link

AtomFeedParser stops after an entry that has any whitespace following </entry> #157

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-http-java-client (e.g. 1.5.0-beta)?
1.11.0-beta

Java environment (e.g. Java 6, Android 2.3, App Engine)?
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01, mixed mode)

Describe the problem.
com.google.api.client.http.xml.atom.AtomFeedParser.parseNextEntry stops 
(returns null) after the entry that has any whitespace after </entry>. 
E.g. when you have formatted input like:

...
<entry>
  ...
</entry> 
<entry>
  ...
</entry> 
...

there is a XmlPullParser.TEXT == "\n" between entries. 

How would you expect it to be fixed?
adding a check

if (parser.getEventType() == XmlPullParser.TEXT) {
  parser.next();
}

just before

if (parser.getEventType() == XmlPullParser.START_TAG) {

in AbstractAtomFeedParser.parseNextEntry works.

Original issue reported on code.google.com by rolandas...@gmail.com on 10 Oct 2012 at 4:47