Skip to content

Commit a9c1719

Browse files
committed
Fix formatting so that G-J-F 1.7 and 1.17 stay in sync
1 parent 8ed071c commit a9c1719

17 files changed

Lines changed: 127 additions & 55 deletions

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ jobs:
207207
-Dmaven.test.skip.exec \
208208
-Dcheckstyle.skip \
209209
-Dspotless.check.skip=true \
210-
-Danimal.sniffer.skip=true
210+
-Danimal.sniffer.skip=true \
211211
deploy
212212
else
213213
echo "::error file=SimpleResolver.class::Class file version is not Java 8"

.github/workflows/report.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

pom.xml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
<jna.version>5.13.0</jna.version>
5858
<bouncycastle.version>1.76</bouncycastle.version>
5959
<vertx.version>4.4.6</vertx.version>
60+
<!-- Stay on 1.7 for Java 8 compatibility. Newer versions are used for Java 11+ builds -->
61+
<google-java-format.version>1.7</google-java-format.version>
62+
<spotless.version>2.30.0</spotless.version>
6063

6164
<sonar.projectKey>dnsjava_dnsjava</sonar.projectKey>
6265
<sonar.organization>dnsjava</sonar.organization>
@@ -284,13 +287,24 @@
284287
<plugin>
285288
<groupId>com.diffplug.spotless</groupId>
286289
<artifactId>spotless-maven-plugin</artifactId>
287-
<version>2.40.0</version>
290+
<version>${spotless.version}</version>
291+
<executions>
292+
<execution>
293+
<goals>
294+
<goal>check</goal>
295+
</goals>
296+
<phase>verify</phase>
297+
</execution>
298+
</executions>
288299
<configuration>
289300
<formats>
290301
<format>
291302
<includes>
292303
<include>*.*</include>
293304
</includes>
305+
<excludes>
306+
<exclude>*.iml</exclude>
307+
</excludes>
294308
<trimTrailingWhitespace/>
295309
<endWithNewline/>
296310
</format>
@@ -304,7 +318,7 @@
304318
<include>src/test/java/**/*.java</include>
305319
</includes>
306320
<googleJavaFormat>
307-
<version>1.7</version>
321+
<version>${google-java-format.version}</version>
308322
</googleJavaFormat>
309323
</java>
310324
</configuration>
@@ -536,6 +550,8 @@
536550

537551
<properties>
538552
<mockito.version>5.7.0</mockito.version>
553+
<google-java-format.version>1.17.0</google-java-format.version>
554+
<spotless.version>2.40.0</spotless.version>
539555
</properties>
540556

541557
<build>

src/main/java/org/xbill/DNS/Cache.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ private synchronized void removeElement(Name name, int type) {
316316
public synchronized void clearCache() {
317317
data.clear();
318318
}
319+
319320
/**
320321
* Adds a record to the Cache.
321322
*

src/main/java/org/xbill/DNS/DLVRecord.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,18 @@
1919
*/
2020
public class DLVRecord extends Record {
2121

22-
/** @deprecated use {@link DNSSEC.Digest#SHA1} */
22+
/**
23+
* SHA1 digest ID for DLV records.
24+
*
25+
* @deprecated use {@link DNSSEC.Digest#SHA1}
26+
*/
2327
@Deprecated public static final int SHA1_DIGEST_ID = DNSSEC.Digest.SHA1;
24-
/** @deprecated use {@link DNSSEC.Digest#SHA256} */
28+
29+
/**
30+
* SHA256 digest ID for DLV records.
31+
*
32+
* @deprecated use {@link DNSSEC.Digest#SHA256}
33+
*/
2534
@Deprecated public static final int SHA256_DIGEST_ID = DNSSEC.Digest.SHA256;
2635

2736
private int footprint;

src/main/java/org/xbill/DNS/DNSSEC.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
*
3535
* <p>DNSSEC provides authentication for DNS information.
3636
*
37+
* @author Brian Wellington
3738
* @see RRSIGRecord
3839
* @see DNSKEYRecord
3940
* @see RRset
40-
* @author Brian Wellington
4141
*/
4242
public class DNSSEC {
4343
/** Domain Name System Security (DNSSEC) Algorithm Numbers. */
@@ -350,12 +350,12 @@ public static class SignatureExpiredException extends DNSSECException {
350350
this.now = now;
351351
}
352352

353-
/** @return When the signature expired */
353+
/** When the signature expired. */
354354
public Instant getExpiration() {
355355
return when;
356356
}
357357

358-
/** @return When the verification was attempted */
358+
/** When the verification was attempted. */
359359
public Instant getVerifyTime() {
360360
return now;
361361
}
@@ -372,12 +372,12 @@ public static class SignatureNotYetValidException extends DNSSECException {
372372
this.now = now;
373373
}
374374

375-
/** @return When the signature will become valid */
375+
/** When the signature will become valid. */
376376
public Instant getExpiration() {
377377
return when;
378378
}
379379

380-
/** @return When the verification was attempted */
380+
/** When the verification was attempted. */
381381
public Instant getVerifyTime() {
382382
return now;
383383
}
@@ -1118,10 +1118,10 @@ static void checkAlgorithm(PrivateKey key, int alg) throws UnsupportedAlgorithmE
11181118
* @param privkey The PrivateKey to use when signing
11191119
* @param inception The time at which the signatures should become valid
11201120
* @param expiration The time at which the signatures should expire
1121+
* @return The generated signature
11211122
* @throws UnsupportedAlgorithmException The algorithm is unknown
11221123
* @throws MalformedKeyException The key is malformed
11231124
* @throws DNSSECException Some other error occurred.
1124-
* @return The generated signature
11251125
* @deprecated use {@link #sign(RRset, DNSKEYRecord, PrivateKey, Instant, Instant)}
11261126
*/
11271127
@Deprecated
@@ -1140,10 +1140,10 @@ public static RRSIGRecord sign(
11401140
* @param privkey The PrivateKey to use when signing
11411141
* @param inception The time at which the signatures should become valid
11421142
* @param expiration The time at which the signatures should expire
1143+
* @return The generated signature
11431144
* @throws UnsupportedAlgorithmException The algorithm is unknown
11441145
* @throws MalformedKeyException The key is malformed
11451146
* @throws DNSSECException Some other error occurred.
1146-
* @return The generated signature
11471147
* @deprecated use {@link #sign(RRset, DNSKEYRecord, PrivateKey, Instant, Instant, String)}
11481148
*/
11491149
@Deprecated
@@ -1167,10 +1167,10 @@ public static RRSIGRecord sign(
11671167
* @param privkey The PrivateKey to use when signing
11681168
* @param inception The time at which the signatures should become valid
11691169
* @param expiration The time at which the signatures should expire
1170+
* @return The generated signature
11701171
* @throws UnsupportedAlgorithmException The algorithm is unknown
11711172
* @throws MalformedKeyException The key is malformed
11721173
* @throws DNSSECException Some other error occurred.
1173-
* @return The generated signature
11741174
*/
11751175
public static RRSIGRecord sign(
11761176
RRset rrset, DNSKEYRecord key, PrivateKey privkey, Instant inception, Instant expiration)
@@ -1189,10 +1189,10 @@ public static RRSIGRecord sign(
11891189
* @param expiration The time at which the signatures should expire
11901190
* @param provider The name of the JCA provider. If non-null, it will be passed to JCA
11911191
* getInstance() methods.
1192+
* @return The generated signature
11921193
* @throws UnsupportedAlgorithmException The algorithm is unknown
11931194
* @throws MalformedKeyException The key is malformed
11941195
* @throws DNSSECException Some other error occurred.
1195-
* @return The generated signature
11961196
*/
11971197
public static RRSIGRecord sign(
11981198
RRset rrset,

src/main/java/org/xbill/DNS/DSRecord.java

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
*/
1919
public class DSRecord extends Record {
2020

21-
/** @deprecated use {@link DNSSEC.Digest} */
21+
/**
22+
* DS digest constants.
23+
*
24+
* @deprecated use {@link DNSSEC.Digest}
25+
*/
2226
@Deprecated
2327
public static class Digest {
2428
private Digest() {}
@@ -36,13 +40,32 @@ private Digest() {}
3640
public static final int SHA384 = DNSSEC.Digest.SHA384;
3741
}
3842

39-
/** @deprecated use {@link DNSSEC.Digest#SHA1} */
43+
/**
44+
* SHA1 delegation signer digest ID.
45+
*
46+
* @deprecated use {@link DNSSEC.Digest#SHA1}
47+
*/
4048
@Deprecated public static final int SHA1_DIGEST_ID = DNSSEC.Digest.SHA1;
41-
/** @deprecated use {@link DNSSEC.Digest#SHA256} */
49+
50+
/**
51+
* SHA256 delegation signer digest ID.
52+
*
53+
* @deprecated use {@link DNSSEC.Digest#SHA256}
54+
*/
4255
@Deprecated public static final int SHA256_DIGEST_ID = DNSSEC.Digest.SHA256;
43-
/** @deprecated use {@link DNSSEC.Digest#GOST3411} */
56+
57+
/**
58+
* GOST4311 delegation signer digest ID.
59+
*
60+
* @deprecated use {@link DNSSEC.Digest#GOST3411}
61+
*/
4462
@Deprecated public static final int GOST3411_DIGEST_ID = DNSSEC.Digest.GOST3411;
45-
/** @deprecated use {@link DNSSEC.Digest#SHA384} */
63+
64+
/**
65+
* SHA384 delegation signer digest ID.
66+
*
67+
* @deprecated use {@link DNSSEC.Digest#SHA384}
68+
*/
4669
@Deprecated public static final int SHA384_DIGEST_ID = DNSSEC.Digest.SHA384;
4770

4871
private int footprint;

src/main/java/org/xbill/DNS/Record.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ protected Object readResolve() throws ObjectStreamException {
5555

5656
protected Record() {}
5757

58-
/** @since 3.1 */
58+
/**
59+
* Initialize the basic fields of a record.
60+
*
61+
* @since 3.1
62+
*/
5963
protected Record(Name name, int type, int dclass, long ttl) {
6064
if (!name.isAbsolute()) {
6165
throw new RelativeNameException(name);

src/main/java/org/xbill/DNS/ResolverConfig.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
*/
4545
@Slf4j
4646
public final class ResolverConfig {
47-
/** @since 3.2 */
47+
/**
48+
* System property name to disable {@link ResolverConfigProvider} initialization.
49+
*
50+
* @since 3.2
51+
*/
4852
public static final String CONFIGPROVIDER_SKIP_INIT = "dnsjava.configprovider.skipinit";
4953

5054
private final List<InetSocketAddress> servers = new ArrayList<>(2);

src/main/java/org/xbill/DNS/SVCBBase.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ public abstract class SVCBBase extends Record {
3636
public static final int IPV4HINT = 4;
3737
public static final int ECH = 5;
3838
public static final int IPV6HINT = 6;
39-
/** @deprecated use {@link #ECH} */
39+
40+
/**
41+
* Pre-RFC constant for the {@link #ECH} SVC parameter.
42+
*
43+
* @deprecated use {@link #ECH}
44+
*/
4045
@Deprecated public static final int ECHCONFIG = 5;
4146

4247
protected SVCBBase() {
@@ -498,7 +503,11 @@ public String toString() {
498503
}
499504
}
500505

501-
/** @deprecated use {@link ParameterEch} */
506+
/**
507+
* Pre-RFC class for {@link ParameterEch}.
508+
*
509+
* @deprecated use {@link ParameterEch}
510+
*/
502511
@Deprecated
503512
public static class ParameterEchConfig extends ParameterBase {
504513
private byte[] data;

0 commit comments

Comments
 (0)