Skip to content

Commit e2ca7f4

Browse files
author
Javen
committed
Remove useless code - no need for _authCode instance var
1 parent acc1745 commit e2ca7f4

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/cn/jpush/api/push/PushClient.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public class PushClient {
3939

4040
private boolean _globalSettingEnabled = false;
4141

42-
// Generated HTTP Basic authorization string.
43-
private final String _authCode;
4442
private String _baseUrl;
4543

4644
/**
@@ -67,9 +65,9 @@ public PushClient(String masterSecret, String appKey, int maxRetryTimes) {
6765
public PushClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy) {
6866
ServiceHelper.checkBasic(appKey, masterSecret);
6967

70-
this._authCode = ServiceHelper.getBasicAuthorization(appKey, masterSecret);
68+
String authCode = ServiceHelper.getBasicAuthorization(appKey, masterSecret);
7169
this._baseUrl = HOST_NAME_SSL + PUSH_PATH;
72-
this._httpClient = new NativeHttpClient(this._authCode, maxRetryTimes, proxy);
70+
this._httpClient = new NativeHttpClient(authCode, maxRetryTimes, proxy);
7371
}
7472

7573
/**

src/cn/jpush/api/report/ReportClient.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public class ReportClient {
2020
private static final String REPORT_MESSAGE_PATH = "/v3/messages";
2121

2222
private final NativeHttpClient _httpClient;
23-
private final String _authCode;
2423

2524
public ReportClient(String masterSecret, String appKey) {
2625
this(masterSecret, appKey, IHttpClient.DEFAULT_MAX_RETRY_TIMES, null);
@@ -32,9 +31,9 @@ public ReportClient(String masterSecret, String appKey, int maxRetryTimes) {
3231

3332
public ReportClient(String masterSecret, String appKey, int maxRetryTimes, HttpProxy proxy) {
3433
ServiceHelper.checkBasic(appKey, masterSecret);
35-
_authCode = ServiceHelper.getBasicAuthorization(appKey, masterSecret);
34+
String authCode = ServiceHelper.getBasicAuthorization(appKey, masterSecret);
3635

37-
_httpClient = new NativeHttpClient(_authCode, maxRetryTimes, proxy);
36+
_httpClient = new NativeHttpClient(authCode, maxRetryTimes, proxy);
3837
}
3938

4039

0 commit comments

Comments
 (0)