This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit a7672685f70b4ac108f615afcea9367aa72f172e Author: Matthieu Baechler <[email protected]> AuthorDate: Wed Apr 15 23:17:22 2020 +0200 [Refactoring] we don't need an empty string for an empty InputStream --- .../java/org/apache/james/imap/processor/fetch/EmptyContent.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EmptyContent.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EmptyContent.java index a92e646..35b09a2 100644 --- a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EmptyContent.java +++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EmptyContent.java @@ -26,10 +26,11 @@ import org.apache.james.mailbox.model.Content; /** * Just an Empty {@link Content} - * */ public class EmptyContent implements Content { + private static final byte[] EMPTY_ARRAY = new byte[0]; + /** * Return 0 as this {@link Content} is empty */ @@ -40,7 +41,7 @@ public class EmptyContent implements Content { @Override public InputStream getInputStream() throws IOException { - return new ByteArrayInputStream("".getBytes()); + return new ByteArrayInputStream(EMPTY_ARRAY); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
