Fix checkstyle issues

This commit is contained in:
Paul Schaub 2020-10-20 22:58:45 +02:00
parent 9670e5ecb9
commit 1b389f678a
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
3 changed files with 20 additions and 3 deletions

View File

@ -26,7 +26,6 @@ import java.util.Date;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import javax.annotation.Nonnull;
@ -53,6 +52,7 @@ import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyDecryptorBuilder;
import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder;
import org.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.algorithm.KeyFlag;
import org.pgpainless.algorithm.SignatureType;
import org.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.key.generation.type.ECDH;
import org.pgpainless.key.generation.type.ECDSA;
@ -215,7 +215,7 @@ public class KeyRingBuilder implements KeyRingBuilderInterface {
@Override
public WithAdditionalUserIdOrPassphrase withAdditionalUserId(@Nonnull String userId) {
if (Objects.equals(KeyRingBuilder.this.userId, userId)) {
if (KeyRingBuilder.this.userId.equals(userId)) {
throw new IllegalArgumentException("Additional user-id MUST NOT be equal to primary user-id.");
}
KeyRingBuilder.this.additionalUserIds.add(userId);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2018 Paul Schaub.
* Copyright 2018-2020 Paul Schaub.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@ -1,3 +1,18 @@
/*
* Copyright 2018 Paul Schaub.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.key.generation;
import static org.junit.Assert.assertEquals;
@ -43,6 +58,8 @@ public class GenerateKeyWithAdditionalUserIdTest {
armor.close();
// echo this | gpg --list-packets
// CHECKSTYLE:OFF
System.out.println(byteOut.toString("UTF-8"));
// CHECKSTYLE:ON
}
}