Token.java: JSONObject["expires_in"] not a string #8

Closed
dreadworks opened this Issue Jan 6, 2013 · 0 comments

Projects

None yet

2 participants

java.io.IOException: JSONObject["expires_in"] not a string.
at com.soundcloud.api.Token.(Token.java:78)

When the refresh token is found in line 66, the value from the EXPIRES_IN token is also (correctly) retrieved using json.getLong(). But when the Iterator arrives on 'expires', it uses the else case and tries to retrieve a string to put it into 'customParameters'. This fails due to the wrong type.

I was able to temporarily fix this simply by changing the last else in line 72 to

    } else if (!EXPIRES_IN.equals(key)) {

...but this may not be the best style. What if more keys get used in one case...

@jberkel jberkel closed this in f38e1a9 Jan 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment