1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-05 20:15:59 +01:00

Clean close() method

This commit is contained in:
Paul Schaub 2022-09-14 19:41:22 +02:00
parent 80e98a02ac
commit 8625b2086c

View file

@ -348,17 +348,11 @@ public class OpenPgpMessageInputStream extends InputStream {
if (in != null) {
in.close();
in = null; // TODO: Collect result of in before nulling
if (automaton.getState() != PDA.State.LiteralMessage) {
automaton.next(InputAlphabet.EndOfSequence);
automaton.assertValid();
}
} else {
automaton.next(InputAlphabet.EndOfSequence);
automaton.assertValid();
in = null;
}
super.close();
automaton.next(InputAlphabet.EndOfSequence);
automaton.assertValid();
closed = true;
}