Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-support/pmd/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<rule ref="category/java/performance.xml/AddEmptyString"/>
<rule ref="category/java/performance.xml/AppendCharacterWithChar" />
<rule ref="category/java/performance.xml/AvoidFileStream"/>
<rule ref="category/java/performance.xml/BigIntegerInstantiation"/>
<rule ref="category/java/performance.xml/InefficientEmptyStringCheck"/>
<rule ref="category/java/performance.xml/InefficientStringBuffering"/>
<rule ref="category/java/performance.xml/StringInstantiation"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,8 @@ private void updateCachedData(
}

private synchronized void updateCachedRootCAId(String s) {
BigInteger candidateNewId = new BigInteger(s);
if (rootCaCertId == null
|| new BigInteger(rootCaCertId).compareTo(candidateNewId) < 0) {
|| new BigInteger(rootCaCertId).compareTo(new BigInteger(s)) < 0) {
rootCaCertId = s;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private X509Certificate generateCertificate(BigInteger caCertSerialId) throws Op

BigInteger serial;
if (caCertSerialId == null) {
serial = new BigInteger(Long.toString(Time.monotonicNow()));
serial = BigInteger.valueOf(Time.monotonicNow());
} else {
serial = caCertSerialId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,7 @@ public void run() {
CertificateServer newRootCAServer = null;
BigInteger newId = BigInteger.ONE;
try {
newId = new BigInteger(String.valueOf(
sequenceIdGen.getNextId(CERTIFICATE_ID)));
newId = BigInteger.valueOf(sequenceIdGen.getNextId(CERTIFICATE_ID));
newRootCAServer =
HASecurityUtils.initializeRootCertificateServer(secConf,
scm.getCertificateStore(), scmStorageConfig, newId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class TestRootCARotationManager {
private File testDir;
private String cID = UUID.randomUUID().toString();
private String scmID = UUID.randomUUID().toString();
private BigInteger certID = new BigInteger("1");
private BigInteger certID = BigInteger.ONE;

@BeforeEach
public void init() throws IOException, TimeoutException,
Expand Down