mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-10 06:11:08 +01:00
Small code style fixes and optimizations
This commit is contained in:
parent
845779d40b
commit
9b9064beae
8 changed files with 13 additions and 21 deletions
|
|
@ -179,12 +179,12 @@ public class SignatureVerifyingInputStream extends FilterInputStream {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b) throws IOException {
|
||||
public int read(@Nonnull byte[] b) throws IOException {
|
||||
return read(b, 0, b.length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b, int off, int len) throws IOException {
|
||||
public int read(@Nonnull byte[] b, int off, int len) throws IOException {
|
||||
int read = super.read(b, off, len);
|
||||
|
||||
final boolean endOfStream = read == -1;
|
||||
|
|
|
|||
|
|
@ -342,10 +342,7 @@ public class SecretKeyRingEditor implements SecretKeyRingEditorInterface {
|
|||
}
|
||||
|
||||
boolean found = false;
|
||||
Iterator<PGPSecretKey> iterator = secretKeyRing.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
PGPSecretKey secretKey = iterator.next();
|
||||
|
||||
for (PGPSecretKey secretKey : secretKeyRing) {
|
||||
// Skip over unaffected subkeys
|
||||
if (secretKey.getKeyID() != fingerprint.getKeyId()) {
|
||||
secretKeyList.add(secretKey);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
package org.pgpainless.key.util;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public final class UserId implements CharSequence {
|
||||
public static final class Builder {
|
||||
private String name;
|
||||
|
|
@ -127,7 +129,7 @@ public final class UserId implements CharSequence {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public @Nonnull String toString() {
|
||||
return asString(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ public class CollectionUtils {
|
|||
public static <I> List<I> iteratorToList(Iterator<I> iterator) {
|
||||
List<I> items = new ArrayList<>();
|
||||
while (iterator.hasNext()) {
|
||||
Object o = iterator.next();
|
||||
items.add((I) o);
|
||||
I item = iterator.next();
|
||||
items.add(item);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue