We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This code is dangerous because PrintWriter swallows IOExceptions:
@Override public AccessToken refreshAccessToken() throws IOException { Socket socket = new Socket("localhost", this.getAuthPort()); socket.setSoTimeout(READ_TIMEOUT_MS); AccessToken token; try { PrintWriter out = new PrintWriter(socket.getOutputStream(), true); out.println(GET_AUTH_TOKEN_REQUEST); BufferedReader input = new BufferedReader(new InputStreamReader(socket.getInputStream())); input.readLine(); // Skip over the first line JsonParser parser = OAuth2Utils.JSON_FACTORY.createJsonParser(input); List<Object> messageArray = (List<Object>) parser.parseArray(ArrayList.class, Object.class); String accessToken = messageArray.get(ACCESS_TOKEN_INDEX).toString(); token = new AccessToken(accessToken, null); } finally { socket.close(); } return token; }
The text was updated successfully, but these errors were encountered:
chingor13
No branches or pull requests
This code is dangerous because PrintWriter swallows IOExceptions:
The text was updated successfully, but these errors were encountered: