Skip to content

Commit 6f297ae

Browse files
committed
fix some warnings in common modules
1 parent 66cd7cd commit 6f297ae

30 files changed

+185
-178
lines changed

weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxConsts.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class WxConsts {
6161
/**
6262
* 群发反馈消息代码所对应的文字描述
6363
*/
64-
public static final Map<String, String> MASS_ST_2_DESC = new HashMap<String, String>();
64+
public static final Map<String, String> MASS_ST_2_DESC = new HashMap<>();
6565
///////////////////////
6666
// 微信端推送过来的事件类型
6767
///////////////////////

weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxMessageInMemoryDuplicateChecker.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class WxMessageInMemoryDuplicateChecker implements WxMessageDuplicateChec
2525
/**
2626
* 消息id->消息时间戳的map
2727
*/
28-
private final ConcurrentHashMap<String, Long> msgId2Timestamp = new ConcurrentHashMap<String, Long>();
28+
private final ConcurrentHashMap<String, Long> msgId2Timestamp = new ConcurrentHashMap<>();
2929

3030
/**
3131
* 后台清理线程是否已经开启
@@ -56,19 +56,19 @@ public WxMessageInMemoryDuplicateChecker(Long timeToLive, Long clearPeriod) {
5656
}
5757

5858
protected void checkBackgroundProcessStarted() {
59-
if (backgroundProcessStarted.getAndSet(true)) {
59+
if (this.backgroundProcessStarted.getAndSet(true)) {
6060
return;
6161
}
6262
Thread t = new Thread(new Runnable() {
6363
@Override
6464
public void run() {
6565
try {
6666
while (true) {
67-
Thread.sleep(clearPeriod);
67+
Thread.sleep(WxMessageInMemoryDuplicateChecker.this.clearPeriod);
6868
Long now = System.currentTimeMillis();
69-
for (Map.Entry<String, Long> entry : msgId2Timestamp.entrySet()) {
70-
if (now - entry.getValue() > timeToLive) {
71-
msgId2Timestamp.entrySet().remove(entry);
69+
for (Map.Entry<String, Long> entry : WxMessageInMemoryDuplicateChecker.this.msgId2Timestamp.entrySet()) {
70+
if (now - entry.getValue() > WxMessageInMemoryDuplicateChecker.this.timeToLive) {
71+
WxMessageInMemoryDuplicateChecker.this.msgId2Timestamp.entrySet().remove(entry);
7272
}
7373
}
7474
}
@@ -87,7 +87,7 @@ public boolean isDuplicate(String messageId) {
8787
return false;
8888
}
8989
checkBackgroundProcessStarted();
90-
Long timestamp = msgId2Timestamp.putIfAbsent(messageId, System.currentTimeMillis());
90+
Long timestamp = this.msgId2Timestamp.putIfAbsent(messageId, System.currentTimeMillis());
9191
return timestamp != null;
9292
}
9393

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/WxAccessToken.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ public static WxAccessToken fromJson(String json) {
1616
}
1717

1818
public String getAccessToken() {
19-
return accessToken;
19+
return this.accessToken;
2020
}
2121

2222
public void setAccessToken(String accessToken) {
2323
this.accessToken = accessToken;
2424
}
2525

2626
public int getExpiresIn() {
27-
return expiresIn;
27+
return this.expiresIn;
2828
}
2929

3030
public void setExpiresIn(int expiresIn) {

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/WxCardApiSignature.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,71 +39,71 @@ public String toString() {
3939
}
4040

4141
public String getAppId() {
42-
return appId;
42+
return this.appId;
4343
}
4444

4545
public void setAppId(String appId) {
4646
this.appId = appId;
4747
}
4848

4949
public String getCardId() {
50-
return cardId;
50+
return this.cardId;
5151
}
5252

5353
public void setCardId(String cardId) {
5454
this.cardId = cardId;
5555
}
5656

5757
public String getCardType() {
58-
return cardType;
58+
return this.cardType;
5959
}
6060

6161
public void setCardType(String cardType) {
6262
this.cardType = cardType;
6363
}
6464

6565
public String getLocationId() {
66-
return locationId;
66+
return this.locationId;
6767
}
6868

6969
public void setLocationId(String locationId) {
7070
this.locationId = locationId;
7171
}
7272

7373
public String getCode() {
74-
return code;
74+
return this.code;
7575
}
7676

7777
public void setCode(String code) {
7878
this.code = code;
7979
}
8080

8181
public String getOpenId() {
82-
return openId;
82+
return this.openId;
8383
}
8484

8585
public void setOpenId(String openId) {
8686
this.openId = openId;
8787
}
8888

8989
public Long getTimestamp() {
90-
return timestamp;
90+
return this.timestamp;
9191
}
9292

9393
public void setTimestamp(Long timestamp) {
9494
this.timestamp = timestamp;
9595
}
9696

9797
public String getNonceStr() {
98-
return nonceStr;
98+
return this.nonceStr;
9999
}
100100

101101
public void setNonceStr(String nonceStr) {
102102
this.nonceStr = nonceStr;
103103
}
104104

105105
public String getSignature() {
106-
return signature;
106+
return this.signature;
107107
}
108108

109109
public void setSignature(String signature) {

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/WxJsapiSignature.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,39 @@ public class WxJsapiSignature implements Serializable {
1919
private String signature;
2020

2121
public String getSignature() {
22-
return signature;
22+
return this.signature;
2323
}
2424

2525
public void setSignature(String signature) {
2626
this.signature = signature;
2727
}
2828

2929
public String getNoncestr() {
30-
return noncestr;
30+
return this.noncestr;
3131
}
3232

3333
public void setNoncestr(String noncestr) {
3434
this.noncestr = noncestr;
3535
}
3636

3737
public long getTimestamp() {
38-
return timestamp;
38+
return this.timestamp;
3939
}
4040

4141
public void setTimestamp(long timestamp) {
4242
this.timestamp = timestamp;
4343
}
4444

4545
public String getUrl() {
46-
return url;
46+
return this.url;
4747
}
4848

4949
public void setUrl(String url) {
5050
this.url = url;
5151
}
5252

5353
public String getAppid() {
54-
return appid;
54+
return this.appid;
5555
}
5656

5757
public void setAppid(String appid) {

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/menu/WxMenu.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class WxMenu implements Serializable {
1919

2020
private static final long serialVersionUID = -7083914585539687746L;
2121

22-
private List<WxMenuButton> buttons = new ArrayList<WxMenuButton>();
22+
private List<WxMenuButton> buttons = new ArrayList<>();
2323

2424
private WxMenuRule matchRule;
2525

@@ -40,15 +40,15 @@ public static WxMenu fromJson(InputStream is) {
4040
}
4141

4242
public List<WxMenuButton> getButtons() {
43-
return buttons;
43+
return this.buttons;
4444
}
4545

4646
public void setButtons(List<WxMenuButton> buttons) {
4747
this.buttons = buttons;
4848
}
4949

5050
public WxMenuRule getMatchRule() {
51-
return matchRule;
51+
return this.matchRule;
5252
}
5353

5454
public void setMatchRule(WxMenuRule matchRule) {
@@ -62,7 +62,7 @@ public String toJson() {
6262
@Override
6363
public String toString() {
6464
return "WxMenu{" +
65-
"buttons=" + buttons +
65+
"buttons=" + this.buttons +
6666
'}';
6767
}
6868

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/menu/WxMenuButton.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class WxMenuButton {
1414
private String url;
1515
private String mediaId;
1616

17-
private List<WxMenuButton> subButtons = new ArrayList<WxMenuButton>();
17+
private List<WxMenuButton> subButtons = new ArrayList<>();
1818

1919
@Override
2020
public String toString() {
@@ -23,47 +23,47 @@ public String toString() {
2323
}
2424

2525
public String getType() {
26-
return type;
26+
return this.type;
2727
}
2828

2929
public void setType(String type) {
3030
this.type = type;
3131
}
3232

3333
public String getName() {
34-
return name;
34+
return this.name;
3535
}
3636

3737
public void setName(String name) {
3838
this.name = name;
3939
}
4040

4141
public String getKey() {
42-
return key;
42+
return this.key;
4343
}
4444

4545
public void setKey(String key) {
4646
this.key = key;
4747
}
4848

4949
public String getUrl() {
50-
return url;
50+
return this.url;
5151
}
5252

5353
public void setUrl(String url) {
5454
this.url = url;
5555
}
5656

5757
public List<WxMenuButton> getSubButtons() {
58-
return subButtons;
58+
return this.subButtons;
5959
}
6060

6161
public void setSubButtons(List<WxMenuButton> subButtons) {
6262
this.subButtons = subButtons;
6363
}
6464

6565
public String getMediaId() {
66-
return mediaId;
66+
return this.mediaId;
6767
}
6868

6969
public void setMediaId(String mediaId) {

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/menu/WxMenuRule.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,55 +13,55 @@ public class WxMenuRule {
1313
private String language;
1414

1515
public String getTagId() {
16-
return tagId;
16+
return this.tagId;
1717
}
1818

1919
public void setTagId(String tagId) {
2020
this.tagId = tagId;
2121
}
2222

2323
public String getSex() {
24-
return sex;
24+
return this.sex;
2525
}
2626

2727
public void setSex(String sex) {
2828
this.sex = sex;
2929
}
3030

3131
public String getCountry() {
32-
return country;
32+
return this.country;
3333
}
3434

3535
public void setCountry(String country) {
3636
this.country = country;
3737
}
3838

3939
public String getProvince() {
40-
return province;
40+
return this.province;
4141
}
4242

4343
public void setProvince(String province) {
4444
this.province = province;
4545
}
4646

4747
public String getCity() {
48-
return city;
48+
return this.city;
4949
}
5050

5151
public void setCity(String city) {
5252
this.city = city;
5353
}
5454

5555
public String getClientPlatformType() {
56-
return clientPlatformType;
56+
return this.clientPlatformType;
5757
}
5858

5959
public void setClientPlatformType(String clientPlatformType) {
6060
this.clientPlatformType = clientPlatformType;
6161
}
6262

6363
public String getLanguage() {
64-
return language;
64+
return this.language;
6565
}
6666

6767
public void setLanguage(String language) {

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/result/WxError.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,23 @@ public static Builder newBuilder() {
2929
}
3030

3131
public int getErrorCode() {
32-
return errorCode;
32+
return this.errorCode;
3333
}
3434

3535
public void setErrorCode(int errorCode) {
3636
this.errorCode = errorCode;
3737
}
3838

3939
public String getErrorMsg() {
40-
return errorMsg;
40+
return this.errorMsg;
4141
}
4242

4343
public void setErrorMsg(String errorMsg) {
4444
this.errorMsg = errorMsg;
4545
}
4646

4747
public String getJson() {
48-
return json;
48+
return this.json;
4949
}
5050

5151
public void setJson(String json) {
@@ -54,10 +54,10 @@ public void setJson(String json) {
5454

5555
@Override
5656
public String toString() {
57-
if (json != null) {
58-
return json;
57+
if (this.json != null) {
58+
return this.json;
5959
}
60-
return "错误: Code=" + errorCode + ", Msg=" + errorMsg;
60+
return "错误: Code=" + this.errorCode + ", Msg=" + this.errorMsg;
6161
}
6262

6363
public static class Builder {

0 commit comments

Comments
 (0)