From 7fc8007834589889e2d1a73441bc04e162d167ab Mon Sep 17 00:00:00 2001 From: jmehrens Date: Tue, 19 Mar 2024 16:50:56 -0500 Subject: [PATCH] Remove newlines #474 Signed-off-by: jmehrens jason_mehrens@hotmail.com --- .../java/org/eclipse/angus/mail/imap/IMAPSearchTest.java | 6 ++---- .../eclipse/angus/mail/imap/protocol/SearchSequence.java | 8 ++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/providers/angus-mail/src/test/java/org/eclipse/angus/mail/imap/IMAPSearchTest.java b/providers/angus-mail/src/test/java/org/eclipse/angus/mail/imap/IMAPSearchTest.java index d34d349..2ecf5ba 100644 --- a/providers/angus-mail/src/test/java/org/eclipse/angus/mail/imap/IMAPSearchTest.java +++ b/providers/angus-mail/src/test/java/org/eclipse/angus/mail/imap/IMAPSearchTest.java @@ -103,8 +103,7 @@ public void search(String line) throws IOException { */ //TODO: Fix this TestServer/ProtocolHandler so this test passes. //TODO: Fix the test. - //@Test - @org.junit.Ignore + @Test public void testUtf8Search() { final String find = "\u2019\u7cfb\u7edf"; TestServer server = null; @@ -154,13 +153,12 @@ public void search(String line) throws IOException { } } - //TODO: Fix the test. //@Test @org.junit.Ignore public void testUtf8SubjectLiteral() throws Exception { final String find = "\u2019\u7cfb\u7edf"; SubjectTerm term = new SubjectTerm(find); - InputStream in = new ByteArrayInputStream(new byte[0]); + InputStream in = new ByteArrayInputStream(find.getBytes("UTF-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos, true, "UTF-8"); Properties props = new Properties(); diff --git a/providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/SearchSequence.java b/providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/SearchSequence.java index a14cbed..fa68aaa 100644 --- a/providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/SearchSequence.java +++ b/providers/imap/src/main/java/org/eclipse/angus/mail/imap/protocol/SearchSequence.java @@ -437,7 +437,7 @@ protected Argument size(SizeTerm term) * * Note that this format does not contain the TimeZone */ - private static String[] monthTable = { + private static final String[] monthTable = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; @@ -580,16 +580,12 @@ private static final class Utf8Literal implements Literal { @Override public int size() { - return bytes.length + 4; + return bytes.length; } @Override public void writeTo(OutputStream os) throws IOException { - os.write('\n'); - os.write('\r'); os.write(this.bytes); - os.write('\n'); - os.write('\r'); } } }