mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-15 17:02:06 +01:00
Make checkstyle happy
This commit is contained in:
parent
0ee3f0ed9a
commit
08d516c990
14 changed files with 74 additions and 4 deletions
|
@ -12,7 +12,6 @@ import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
import org.bouncycastle.bcpg.sig.RevocationReason;
|
import org.bouncycastle.bcpg.sig.RevocationReason;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
|
@ -36,6 +35,7 @@ import org.pgpainless.wot.dijkstra.sq.CertificationSet;
|
||||||
import org.pgpainless.wot.dijkstra.sq.Network;
|
import org.pgpainless.wot.dijkstra.sq.Network;
|
||||||
import org.pgpainless.wot.dijkstra.sq.Optional;
|
import org.pgpainless.wot.dijkstra.sq.Optional;
|
||||||
import org.pgpainless.wot.dijkstra.sq.ReferenceTime;
|
import org.pgpainless.wot.dijkstra.sq.ReferenceTime;
|
||||||
|
import org.pgpainless.wot.sugar.Supplier;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import pgp.certificate_store.certificate.Certificate;
|
import pgp.certificate_store.certificate.Certificate;
|
||||||
|
@ -140,7 +140,7 @@ public class WebOfTrust implements CertificateAuthority {
|
||||||
return nb.buildNetwork();
|
return nb.buildNetwork();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class NetworkBuilder {
|
private static final class NetworkBuilder {
|
||||||
|
|
||||||
// Index structures
|
// Index structures
|
||||||
private final Map<OpenPgpFingerprint, KeyRingInfo> byFingerprint = new HashMap<>();
|
private final Map<OpenPgpFingerprint, KeyRingInfo> byFingerprint = new HashMap<>();
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package org.pgpainless.wot.sugar;
|
||||||
|
|
||||||
|
public interface Supplier<T> {
|
||||||
|
|
||||||
|
T get();
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Syntactic sugar, backported from Java 8.
|
||||||
|
*/
|
||||||
|
package org.pgpainless.wot.sugar;
|
|
@ -19,6 +19,8 @@ public class WebOfTrustTest {
|
||||||
WebOfTrust wot = new WebOfTrust(store);
|
WebOfTrust wot = new WebOfTrust(store);
|
||||||
wot.initialize();
|
wot.initialize();
|
||||||
|
|
||||||
|
// CHECKSTYLE:OFF
|
||||||
System.out.println(wot);
|
System.out.println(wot);
|
||||||
|
// CHECKSTYLE:ON
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test fixtures for WOT.
|
||||||
|
*/
|
||||||
|
package org.pgpainless.wot.testfixtures;
|
|
@ -11,6 +11,8 @@ public class AJavaClass {
|
||||||
* Used by {@link org.pgpainless.kotlin_experiments.java_from_kotlin.AccessJavaFromKotlin}.
|
* Used by {@link org.pgpainless.kotlin_experiments.java_from_kotlin.AccessJavaFromKotlin}.
|
||||||
*/
|
*/
|
||||||
public void doSomething() {
|
public void doSomething() {
|
||||||
|
// CHECKSTYLE:OFF
|
||||||
System.out.println("Something has been done.");
|
System.out.println("Something has been done.");
|
||||||
|
// CHECKSTYLE:ON
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@ public class AccessKotlinFromJava {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// from src/kotlin/.../
|
// from src/kotlin/.../
|
||||||
AKotlinClass kotlin = new AKotlinClass();
|
AKotlinClass kotlin = new AKotlinClass();
|
||||||
|
// CHECKSTYLE:OFF
|
||||||
kotlin.printToStdout();
|
kotlin.printToStdout();
|
||||||
|
// CHECKSTYLE:ON
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demonstration package.
|
||||||
|
* TODO: Delete later.
|
||||||
|
*/
|
||||||
|
package org.pgpainless.kotlin_experiments.kotlin_from_java;
|
|
@ -0,0 +1,9 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demonstration package.
|
||||||
|
* TODO: Delete later.
|
||||||
|
*/
|
||||||
|
package org.pgpainless.kotlin_experiments;
|
|
@ -121,7 +121,7 @@ public final class CertificationSet {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (Map.Entry<Optional<String>, List<Certification>> entry : certifications.entrySet()) {
|
for (Map.Entry<Optional<String>, List<Certification>> entry : certifications.entrySet()) {
|
||||||
for (Certification certification : entry.getValue()) {
|
for (Certification certification : entry.getValue()) {
|
||||||
sb.append(certification).append("\n");
|
sb.append(certification).append('\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
|
|
@ -67,4 +67,4 @@ public class Network {
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,8 @@ package org.pgpainless.kotlin_experiments
|
||||||
class AKotlinClass {
|
class AKotlinClass {
|
||||||
|
|
||||||
fun printToStdout() {
|
fun printToStdout() {
|
||||||
|
// CHECKSTYLE:OFF
|
||||||
println("'Hello, World' from Kotlin!")
|
println("'Hello, World' from Kotlin!")
|
||||||
|
// CHECKSTYLE:ON
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demonstration package.
|
||||||
|
* TODO: Delete later.
|
||||||
|
*/
|
||||||
|
package org.pgpainless.kotlin_experiments.java_from_kotlin;
|
|
@ -0,0 +1,9 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demonstration package.
|
||||||
|
* TODO: Delete later.
|
||||||
|
*/
|
||||||
|
package org.pgpainless.kotlin_experiments;
|
Loading…
Reference in a new issue