fix typo in java feign client (#11751)

This commit is contained in:
William Cheng 2022-03-01 11:22:19 +08:00 committed by GitHub
parent d2b80984ed
commit 9d86d1db5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 12 deletions

View File

@ -299,7 +299,7 @@ public class ApiClient {
/**
* Configures a listener which is notified when a new access token is received.
* @param accessTokenListener Acesss token listener
* @param accessTokenListener Access token listener
*/
public void registerAccessTokenListener(AccessTokenListener accessTokenListener) {
OAuth apiAuthorization = getAuthorization(OAuth.class);

View File

@ -11,7 +11,7 @@ import java.util.Collection;
public abstract class OAuth implements RequestInterceptor {
//https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
static final int LEEWAY_SENCONDS = 10;
static final int LEEWAY_SECONDS = 10;
static final int MILLIS_PER_SECOND = 1000;
@ -90,7 +90,7 @@ public abstract class OAuth implements RequestInterceptor {
*/
public synchronized void setAccessToken(String accessToken, Integer expiresIn) {
this.accessToken = accessToken;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SENCONDS;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SECONDS;
}
}
}

View File

@ -267,7 +267,7 @@ public class ApiClient {
/**
* Configures a listener which is notified when a new access token is received.
* @param accessTokenListener Acesss token listener
* @param accessTokenListener Access token listener
*/
public void registerAccessTokenListener(AccessTokenListener accessTokenListener) {
OAuth apiAuthorization = getAuthorization(OAuth.class);

View File

@ -11,7 +11,7 @@ import java.util.Collection;
public abstract class OAuth implements RequestInterceptor {
//https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
static final int LEEWAY_SENCONDS = 10;
static final int LEEWAY_SECONDS = 10;
static final int MILLIS_PER_SECOND = 1000;
@ -90,7 +90,7 @@ public abstract class OAuth implements RequestInterceptor {
*/
public synchronized void setAccessToken(String accessToken, Integer expiresIn) {
this.accessToken = accessToken;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SENCONDS;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SECONDS;
}
}
}

View File

@ -274,7 +274,7 @@ public class ApiClient {
/**
* Configures a listener which is notified when a new access token is received.
* @param accessTokenListener Acesss token listener
* @param accessTokenListener Access token listener
*/
public void registerAccessTokenListener(AccessTokenListener accessTokenListener) {
OAuth apiAuthorization = getAuthorization(OAuth.class);

View File

@ -11,7 +11,7 @@ import java.util.Collection;
public abstract class OAuth implements RequestInterceptor {
//https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
static final int LEEWAY_SENCONDS = 10;
static final int LEEWAY_SECONDS = 10;
static final int MILLIS_PER_SECOND = 1000;
@ -90,7 +90,7 @@ public abstract class OAuth implements RequestInterceptor {
*/
public synchronized void setAccessToken(String accessToken, Integer expiresIn) {
this.accessToken = accessToken;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SENCONDS;
this.expirationTimeSeconds = expiresIn == null ? null : System.currentTimeMillis() / MILLIS_PER_SECOND + expiresIn - LEEWAY_SECONDS;
}
}
}