« first day (115 days earlier)      last day (1324 days later) » 

4:45 AM
java.lang.NullPointerException :P
at bugs.stackoverflow.belisarius.utils.PostUtils.editorAlsoOwner(PostUtils.java:45)
looks like it can be easily fixed
there's also java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at revisionList.get(1)
 
 
2 hours later…
7:08 AM
@double-beep No user_id? At long ownerId = post.get("owner").getAsJsonObject().get("user_id").getAsLong();
@double-beep This line? String previousRevisionGuid = revisionsList.get(1).get("revision_guid").getAsString(); at github.com/SOBotics/Belisarius/blob/master/src/main/java/bugs/…
 
 
4 hours later…
11:32 AM
@Scratte not sure
probably no owner
in the second case, then I fixed the error
@Scratte yes
probably some edge case
I could wrap it in a if (revisionsList.size() > 1), perhaps?
 
12:25 PM
@Scratte getting another error java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
how can I handle posts being null?
 
1:06 PM
is the post null or does it just not have a "last_activity_date"?
and why does the API need a new date if you ask for another page?
 
@Scratte there are no recent posts
and... also the jsoup timeout seems to be just 2 secs
so I increased that one
 
1:23 PM
Oh.. if there are no posts, then you can't find any data on it :)
So it's posts.get(0) giving the nullpointerexception?
 
yeah
 
It has a size() method :) And a isJsonNull() but I do not know what a JsonNull is.
I expect if posts are empty then you do not need to even attempt to loop them and hasMore would not be true :)
But that is a little strange. The last result should have had hasMore set to false, no?
 
so if (posts.size() == 0) { return postIdsAndTitles } )?
@Scratte the first page returned the error
 
When does the first page return empty?
 
@Scratte if there are no active posts in a minute
 
1:34 PM
@double-beep Yes, you can put that in before the loop. See what happens :D
You'll return an empty map, no?
I still don't understand why there's a change to both the page and the lastPostTime in the loop.
 
@Scratte yep, right
@Scratte because there won't be >1 pages
it's highly unlikely
would posts be accessible from outside the loop?
 
1:50 PM
@double-beep No :) Not outside the while loop
@double-beep Heh.. but.. that's not a very good reason :D Isn't the logic flawed?
 
@Scratte yeah, probably
@Scratte I can define it outside, change it inside and access it again from outside, right?
 
@double-beep Yes :)
But.. I think you may get a compiler error if you access it outside without initializing it outside too.
 
 
4 hours later…
6:03 PM
?!? com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 1048546 path $.items[29].body
java.lang.NullPointerException
        at bugs.stackoverflow.belisarius.services.ApiService.getLatestRevisions(ApiService.java:35)
that looks like a problem on SE API's side
 
6:19 PM
@double-beep What does the logging say?
 
@Scratte for which exception?
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 1048546 path $.items[29].body
        at com.google.gson.internal.Streams.parse(Streams.java:60)
        at com.google.gson.JsonParser.parse(JsonParser.java:84)
        at com.google.gson.JsonParser.parse(JsonParser.java:59)
        at com.google.gson.JsonParser.parse(JsonParser.java:45)
        at bugs.stackoverflow.belisarius.utils.JsonUtils.get(JsonUtils.java:49)
        at bugs.stackoverflow.belisarius.utils.ApiUtils.getLastestRevisions(ApiUtils.java:24)
java.lang.NullPointerException
        at bugs.stackoverflow.belisarius.services.ApiService.getLatestRevisions(ApiService.java:35)
        at bugs.stackoverflow.belisarius.Belisarius.getPostsWithLatestRevision(Belisarius.java:149)
        at bugs.stackoverflow.belisarius.Belisarius.getPosts(Belisarius.java:60)
        at bugs.stackoverflow.belisarius.services.MonitorService.execute(MonitorService.java:86)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
 
Ohh.. I forgot you changed all the exception handling :)
@double-beep This.. I'm not sure about.
 
I've got the JSON API returned
for the first one
 
Huh?
 
gson failed to parse the returned JSON
 
6:25 PM
The second one confuses me. StackTraces on threads always confuses me.. it's never the last one and it's rarely the first one either.
 
what's wrong with the second?
 
No idea :)
 
I mean, why does it confuse you?
 
Because I try to find the reason further down. But it seems to be setQuota(revisionJson.get("quota_remaining").getAsInt());
Which makes sense if there is no result due to some other error.
Is there some character limit on the payload?
 
nah
 
6:34 PM
com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 1048546 path $.items[29].body <-- looks odd though
 
I'll probably have to investigate the jsondump file
didn't search enough: stackoverflow.com/a/14676920
the jsondump file size is 1048576, which is 1MB
 
Ahh.. so that's why it's missing a termination string :)
Does the API specify a max size on a payload?
I mean what it it sends you the entire history of every post ever created? :D
 

« first day (115 days earlier)      last day (1324 days later) »