Twitter4J

replace json parser for the better performance

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: on hold
  • Component/s: http
  • Labels:
    None

Activity

Hide
Dan F added a comment -
A better reason to replace the JSON parser is that JSONObject from org.json has parsing bugs. I see them every couple of days listening to the Twitter stream. See for example: http://sourceforge.net/tracker/?func=detail&aid=2062744&group_id=171425&atid=857928

Also, the string "null" becomes a Java null instead of the String null.

I'd recommend looking at gson (http://code.google.com/p/google-gson/). Clean and fast.

Also, I'd recommend just introducing a jar dependency instead of embedding the source code in your own code. There are a lot of good reasons to just use the jar.
Show
Dan F added a comment - A better reason to replace the JSON parser is that JSONObject from org.json has parsing bugs. I see them every couple of days listening to the Twitter stream. See for example: http://sourceforge.net/tracker/?func=detail&aid=2062744&group_id=171425&atid=857928 Also, the string "null" becomes a Java null instead of the String null. I'd recommend looking at gson (http://code.google.com/p/google-gson/). Clean and fast. Also, I'd recommend just introducing a jar dependency instead of embedding the source code in your own code. There are a lot of good reasons to just use the jar.
Hide
Alessandro Bahgat added a comment -
Hi Dan,
I'd recommend using gson too. I've worked with it a while ago, and it was great.
As far as I remember, however, it supports Java 5+ (the source code used enums, at the very least), which would make it incompatible with the 1.4.2 target of twitter4j. How would you deal with that?

By the way, I guess that the 1.4.2 target would make it harder to include other libraries as dependencies as most of them target Java 5+.
Show
Alessandro Bahgat added a comment - Hi Dan, I'd recommend using gson too. I've worked with it a while ago, and it was great. As far as I remember, however, it supports Java 5+ (the source code used enums, at the very least), which would make it incompatible with the 1.4.2 target of twitter4j. How would you deal with that? By the way, I guess that the 1.4.2 target would make it harder to include other libraries as dependencies as most of them target Java 5+.
Hide
Dan F added a comment -
I have no response. I would not target before Java 1.5.
Show
Dan F added a comment - I have no response. I would not target before Java 1.5.
Hide
Yusuke Yamamoto added a comment -
Java 5.0 or earlier are EOL'ed, but there are some users using Twitter4J on WebSphere AP server which is based on JDK1.4.
Therefore Twitter4J supports JDK 1.4.2.
Show
Yusuke Yamamoto added a comment - Java 5.0 or earlier are EOL'ed, but there are some users using Twitter4J on WebSphere AP server which is based on JDK1.4. Therefore Twitter4J supports JDK 1.4.2.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: