Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8ba73e8

Browse files
committed
[1.1.0]
SonarQube issues fixedREADME.md updated
1 parent8c0754d commit8ba73e8

File tree

19 files changed

+57
-43
lines changed

19 files changed

+57
-43
lines changed

‎README.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#java-etherscan-api
22

3+
[![GitHub Action](https://github.com/goodforgod/java-etherscan-api/workflows/Java%20CI/badge.svg)](https://github.com/GoodforGod/dummymaker/actions?query=workflow%3A%22Java+CI%22)
4+
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_java-etherscan-api&metric=coverage)](https://sonarcloud.io/dashboard?id=GoodforGod_dummymaker)
5+
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_java-etherscan-api&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=GoodforGod_dummymaker)
6+
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=GoodforGod_java-etherscan-api&metric=ncloc)](https://sonarcloud.io/dashboard?id=GoodforGod_dummymaker)
37
[![Jitpack](https://jitpack.io/v/iSnow/java-etherscan-api.svg)](https://jitpack.io/#GoodforGod/java-etherscan-api)
48

59
[Etherscan](https://etherscan.io/apis) Java API implementation.
@@ -163,6 +167,8 @@ Token API methods migrated to [Account](#account-api) & [Stats](#stats-api) resp
163167

164168
##Version History
165169

170+
**1.1.0** - Improved error handling, QueueManager improved, Gradle 6.7 instead of Maven, GitHub CI, Sonarcloud analyzer, dependencies updated.
171+
166172
**1.0.2** - Minor http client improvements.
167173

168174
**1.0.1** - Gorli & TOBALABA networks support.
@@ -171,4 +177,4 @@ Token API methods migrated to [Account](#account-api) & [Stats](#stats-api) resp
171177

172178
##License
173179

174-
This projectislicensed under the MIT - see the[LICENSE](LICENSE) file for details.
180+
This project licensed under the MIT - see the[LICENSE](LICENSE) file for details.

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
groupId=com.github.goodforgod
22
artifactId=java-etherscan-api
3-
artifactVersion=1.1.0-SNAPSHOT
3+
artifactVersion=1.1.0
44
buildNumber=1
55

66

‎src/main/java/io/api/etherscan/core/impl/BasicProvider.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ abstract class BasicProvider {
4646
<T>Tconvert(finalStringjson,finalClass<T>tClass) {
4747
try {
4848
finalTt =gson.fromJson(json,tClass);
49-
if (tinstanceofStringResponseTO) {
50-
if (((StringResponseTO)t).getResult().startsWith("Max rate limit reached")) {
51-
thrownewRateLimitException(((StringResponseTO)t).getResult());
52-
}
49+
if (tinstanceofStringResponseTO && ((StringResponseTO)t).getResult().startsWith("Max rate limit reached")) {
50+
thrownewRateLimitException(((StringResponseTO)t).getResult());
5351
}
5452

5553
returnt;

‎src/main/java/io/api/etherscan/manager/impl/FakeQueueManager.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
publicclassFakeQueueManagerimplementsIQueueManager {
1212

1313
@Override
14-
publicvoidtakeTurn() {}
14+
publicvoidtakeTurn() {
15+
// no limit or await provided for fake impl so rate limit exception will be
16+
// thrown if too many calls
17+
}
1518
}

‎src/main/java/io/api/etherscan/model/Balance.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
importio.api.etherscan.model.utility.BalanceTO;
44

55
importjava.math.BigInteger;
6+
importjava.util.Objects;
67

78
/**
89
* ! NO DESCRIPTION !
@@ -63,7 +64,7 @@ public boolean equals(Object o) {
6364

6465
if (!balance.equals(balance1.balance))
6566
returnfalse;
66-
returnaddress !=null ?address.equals(balance1.address) :balance1.address ==null;
67+
returnObjects.equals(address,balance1.address);
6768
}
6869

6970
@Override

‎src/main/java/io/api/etherscan/model/BaseTx.java‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
importjava.math.BigInteger;
66
importjava.time.LocalDateTime;
77
importjava.time.ZoneOffset;
8+
importjava.util.Objects;
89

910
/**
1011
* ! NO DESCRIPTION !
@@ -33,7 +34,7 @@ public long getBlockNumber() {
3334

3435
publicLocalDateTimegetTimeStamp() {
3536
if (_timeStamp ==null && !BasicUtils.isEmpty(timeStamp))
36-
_timeStamp =LocalDateTime.ofEpochSecond(Long.valueOf(timeStamp),0,ZoneOffset.UTC);
37+
_timeStamp =LocalDateTime.ofEpochSecond(Long.parseLong(timeStamp),0,ZoneOffset.UTC);
3738
return_timeStamp;
3839
}
3940

@@ -81,15 +82,15 @@ public boolean equals(Object o) {
8182

8283
if (blockNumber !=baseTx.blockNumber)
8384
returnfalse;
84-
if (timeStamp !=null ? !timeStamp.equals(baseTx.timeStamp) :baseTx.timeStamp !=null)
85+
if (!Objects.equals(timeStamp,baseTx.timeStamp))
8586
returnfalse;
86-
if (hash !=null ? !hash.equals(baseTx.hash) :baseTx.hash !=null)
87+
if (!Objects.equals(hash,baseTx.hash))
8788
returnfalse;
88-
if (from !=null ? !from.equals(baseTx.from) :baseTx.from !=null)
89+
if (!Objects.equals(from,baseTx.from))
8990
returnfalse;
90-
if (to !=null ? !to.equals(baseTx.to) :baseTx.to !=null)
91+
if (!Objects.equals(to,baseTx.to))
9192
returnfalse;
92-
returnvalue !=null ?value.equals(baseTx.value) :baseTx.value ==null;
93+
returnObjects.equals(value,baseTx.value);
9394
}
9495

9596
@Override

‎src/main/java/io/api/etherscan/model/Block.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public long getBlockNumber() {
2626

2727
publicLocalDateTimegetTimeStamp() {
2828
if (_timeStamp ==null && !BasicUtils.isEmpty(timeStamp))
29-
_timeStamp =LocalDateTime.ofEpochSecond(Long.valueOf(timeStamp),0,ZoneOffset.UTC);
29+
_timeStamp =LocalDateTime.ofEpochSecond(Long.parseLong(timeStamp),0,ZoneOffset.UTC);
3030
return_timeStamp;
3131
}
3232

‎src/main/java/io/api/etherscan/model/Log.java‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
importjava.time.LocalDateTime;
77
importjava.time.ZoneOffset;
88
importjava.util.List;
9+
importjava.util.Objects;
910

1011
/**
1112
* ! NO DESCRIPTION !
@@ -124,15 +125,15 @@ public boolean equals(Object o) {
124125

125126
Loglog = (Log)o;
126127

127-
if (blockNumber !=null ? !blockNumber.equals(log.blockNumber) :log.blockNumber !=null)
128+
if (!Objects.equals(blockNumber,log.blockNumber))
128129
returnfalse;
129-
if (address !=null ? !address.equals(log.address) :log.address !=null)
130+
if (!Objects.equals(address,log.address))
130131
returnfalse;
131-
if (transactionHash !=null ? !transactionHash.equals(log.transactionHash) :log.transactionHash !=null)
132+
if (!Objects.equals(transactionHash,log.transactionHash))
132133
returnfalse;
133-
if (timeStamp !=null ? !timeStamp.equals(log.timeStamp) :log.timeStamp !=null)
134+
if (!Objects.equals(timeStamp,log.timeStamp))
134135
returnfalse;
135-
returnlogIndex !=null ?logIndex.equals(log.logIndex) :log.logIndex ==null;
136+
returnObjects.equals(logIndex,log.logIndex);
136137
}
137138

138139
@Override

‎src/main/java/io/api/etherscan/model/Price.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ public double inBtc() {
2828

2929
publicLocalDateTimeusdTimestamp() {
3030
if (_ethusd_timestamp ==null)
31-
_ethusd_timestamp =LocalDateTime.ofEpochSecond(Long.valueOf(ethusd_timestamp),0,ZoneOffset.UTC);
31+
_ethusd_timestamp =LocalDateTime.ofEpochSecond(Long.parseLong(ethusd_timestamp),0,ZoneOffset.UTC);
3232
return_ethusd_timestamp;
3333
}
3434

3535
publicLocalDateTimebtcTimestamp() {
3636
if (_ethbtc_timestamp ==null)
37-
_ethbtc_timestamp =LocalDateTime.ofEpochSecond(Long.valueOf(ethbtc_timestamp),0,ZoneOffset.UTC);
37+
_ethbtc_timestamp =LocalDateTime.ofEpochSecond(Long.parseLong(ethbtc_timestamp),0,ZoneOffset.UTC);
3838
return_ethbtc_timestamp;
3939
}
4040

‎src/main/java/io/api/etherscan/model/Status.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
packageio.api.etherscan.model;
22

3+
importjava.util.Objects;
4+
35
/**
46
* Contract Execution Status
57
*
@@ -33,7 +35,7 @@ public boolean equals(Object o) {
3335

3436
if (isError !=status.isError)
3537
returnfalse;
36-
returnerrDescription !=null ?errDescription.equals(status.errDescription) :status.errDescription ==null;
38+
returnObjects.equals(errDescription,status.errDescription);
3739
}
3840

3941
@Override

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp