javaee-esprit / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

With null accountName, get infinity loop #842

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Version of google-api-java-client (e.g. 1.15.0-rc)?

1.17.0-rc

Java environment (e.g. Java 6, Android 2.3, App Engine)?

Android 4.2.2

Describe the problem.

from source GoogleAccountCredential.java:

public String getToken() throws IOException, GoogleAuthException {
    if (backOff != null) {
      backOff.reset();
    }

    while (true) {
      try {
        return GoogleAuthUtil.getToken(context, accountName, scope);
      } catch (IOException e) {
        // network or server error, so retry using back-off policy
        try {
          if (backOff == null || !BackOffUtils.next(sleeper, backOff)) {
            throw e;
          }
        } catch (InterruptedException e2) {
          // ignore
        }
      }
    }

If accountName = "" (something wrong, yes), GoogleAuthUtil.getToken runs 
forever. No exception or something.

How would you expect it to be fixed?

Exception?

Original issue reported on code.google.com by rusxa...@gmail.com on 14 Oct 2013 at 1:01