Rename MAX_RECURSION_DEPTH constant to avoid confusion

This commit is contained in:
Paul Schaub 2021-12-07 23:46:44 +01:00
parent 35462ab539
commit 710f676dc3
1 changed files with 3 additions and 2 deletions

View File

@ -74,7 +74,8 @@ public final class DecryptionStreamFactory {
private static final Logger LOGGER = LoggerFactory.getLogger(DecryptionStreamFactory.class);
private static final int MAX_RECURSION_DEPTH = 16;
// Maximum nesting depth of packets (e.g. compression, encryption...)
private static final int MAX_PACKET_NESTING_DEPTH = 16;
private final ConsumerOptions options;
private final OpenPgpMetadata.Builder resultBuilder = OpenPgpMetadata.getBuilder();
@ -188,7 +189,7 @@ public final class DecryptionStreamFactory {
}
private InputStream processPGPPackets(@Nonnull PGPObjectFactory objectFactory, int depth) throws IOException, PGPException {
if (depth >= MAX_RECURSION_DEPTH) {
if (depth >= MAX_PACKET_NESTING_DEPTH) {
throw new PGPException("Maximum recursion depth of packages exceeded.");
}
Object nextPgpObject;