1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-23 04:42:06 +01:00

Reduce complexity of statements

This commit is contained in:
Paul Schaub 2021-08-15 15:44:28 +02:00
parent 6467217bd1
commit e368a8b16a

View file

@ -111,7 +111,7 @@ public class KeyRingReader {
do { do {
next = objectFactory.nextObject(); next = objectFactory.nextObject();
if (next == null) { if (next == null) {
break; return null;
} }
if (next instanceof PGPMarker) { if (next instanceof PGPMarker) {
continue; continue;
@ -120,8 +120,6 @@ public class KeyRingReader {
return (PGPPublicKeyRing) next; return (PGPPublicKeyRing) next;
} }
} while (true); } while (true);
return null;
} }
public static PGPPublicKeyRingCollection readPublicKeyRingCollection(@Nonnull InputStream inputStream) public static PGPPublicKeyRingCollection readPublicKeyRingCollection(@Nonnull InputStream inputStream)
@ -136,7 +134,7 @@ public class KeyRingReader {
do { do {
next = objectFactory.nextObject(); next = objectFactory.nextObject();
if (next == null) { if (next == null) {
break; return new PGPPublicKeyRingCollection(rings);
} }
if (next instanceof PGPMarker) { if (next instanceof PGPMarker) {
continue; continue;
@ -152,8 +150,6 @@ public class KeyRingReader {
} }
} }
} while (true); } while (true);
return new PGPPublicKeyRingCollection(rings);
} }
public static PGPSecretKeyRing readSecretKeyRing(@Nonnull InputStream inputStream) throws IOException { public static PGPSecretKeyRing readSecretKeyRing(@Nonnull InputStream inputStream) throws IOException {
@ -166,7 +162,7 @@ public class KeyRingReader {
do { do {
next = objectFactory.nextObject(); next = objectFactory.nextObject();
if (next == null) { if (next == null) {
break; return null;
} }
if (next instanceof PGPMarker) { if (next instanceof PGPMarker) {
continue; continue;
@ -176,8 +172,6 @@ public class KeyRingReader {
return (PGPSecretKeyRing) next; return (PGPSecretKeyRing) next;
} }
} while (true); } while (true);
return null;
} }
public static PGPSecretKeyRingCollection readSecretKeyRingCollection(@Nonnull InputStream inputStream) public static PGPSecretKeyRingCollection readSecretKeyRingCollection(@Nonnull InputStream inputStream)
@ -192,7 +186,7 @@ public class KeyRingReader {
do { do {
next = objectFactory.nextObject(); next = objectFactory.nextObject();
if (next == null) { if (next == null) {
break; return new PGPSecretKeyRingCollection(rings);
} }
if (next instanceof PGPMarker) { if (next instanceof PGPMarker) {
continue; continue;
@ -208,8 +202,6 @@ public class KeyRingReader {
} }
} }
} while (true); } while (true);
return new PGPSecretKeyRingCollection(rings);
} }
public static PGPKeyRingCollection readKeyRingCollection(@Nonnull InputStream inputStream, boolean isSilent) public static PGPKeyRingCollection readKeyRingCollection(@Nonnull InputStream inputStream, boolean isSilent)