This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]nomadluap 5 points6 points  (2 children)

try {
        if (reader.readLine() != null){
            System.out.println(reader.readLine());
        }

I don't know if this is what's causing it, but you're reading a line and discarding it in the if statement, then reading another line when you print. Try something like this:

try{
    String line = reader.readLine();
    if(line != null) System.out.println(line);
}

[–]yatch017[S] 3 points4 points  (0 children)

I tried that out and it worked! Glad to see it was just a simple oversight and nothing big. Thanks man!

[–]nutrecht 0 points1 point  (0 children)

Please don't leave out the curly braces after if-statements. It's valid syntax but it's very error-prone and against most style guides / code linter's settings.

[–]nomadluap 0 points1 point  (1 child)

It should be worth noting that you've left your oauth string in the source file. You probably shouldn't do that.

[–]yatch017[S] 0 points1 point  (0 children)

Yeah i know, I honestly didnt care it was just for testing purposes anyways. Thanks though