diff --git a/src/java/davmail/caldav/CaldavConnection.java b/src/java/davmail/caldav/CaldavConnection.java index 63e1dd1c..c2c21bf2 100644 --- a/src/java/davmail/caldav/CaldavConnection.java +++ b/src/java/davmail/caldav/CaldavConnection.java @@ -731,7 +731,7 @@ public class CaldavConnection extends AbstractConnection { } - protected class CaldavRequest { + protected static class CaldavRequest { protected HashSet properties = new HashSet(); protected HashSet hrefs; protected boolean isMultiGet; diff --git a/src/java/davmail/exchange/ICSBufferedReader.java b/src/java/davmail/exchange/ICSBufferedReader.java index a0085d3b..0f0859ea 100644 --- a/src/java/davmail/exchange/ICSBufferedReader.java +++ b/src/java/davmail/exchange/ICSBufferedReader.java @@ -10,6 +10,7 @@ import java.io.IOException; */ public class ICSBufferedReader extends BufferedReader { protected String nextLine; + protected StringBuilder currentLine = new StringBuilder(75); public ICSBufferedReader(Reader in, int sz) throws IOException { super(in, sz); @@ -23,12 +24,17 @@ public class ICSBufferedReader extends BufferedReader { @Override public String readLine() throws IOException { - String currentLine = nextLine; - nextLine = super.readLine(); - while (nextLine != null && nextLine.charAt(0) == ' ') { - currentLine += nextLine.substring(1); + if (nextLine == null) { + return null; + } else { + currentLine.setLength(0); + currentLine.append(nextLine); nextLine = super.readLine(); + while (nextLine != null && nextLine.charAt(0) == ' ') { + currentLine.append(nextLine.substring(1)); + nextLine = super.readLine(); + } + return currentLine.toString(); } - return currentLine; } } diff --git a/src/java/davmail/imap/ImapConnection.java b/src/java/davmail/imap/ImapConnection.java index fef028c7..da850bca 100644 --- a/src/java/davmail/imap/ImapConnection.java +++ b/src/java/davmail/imap/ImapConnection.java @@ -135,7 +135,9 @@ public class ImapConnection extends AbstractConnection { } /** - * Decode SMTP credentials + * Decode IMAP credentials + * @param tokens tokens + * @throws java.io.IOException on error */ protected void parseCredentials(StringTokenizer tokens) throws IOException { if (tokens.hasMoreTokens()) { diff --git a/src/java/davmail/imap/ImapServer.java b/src/java/davmail/imap/ImapServer.java index 9515bb51..e53e82c0 100644 --- a/src/java/davmail/imap/ImapServer.java +++ b/src/java/davmail/imap/ImapServer.java @@ -16,6 +16,9 @@ public class ImapServer extends AbstractServer { /** * Create a ServerSocket to listen for connections. * Start the thread. + * + * @param port imap listen port, 143 if not defined (0) + * @throws java.io.IOException on error */ public ImapServer(int port) throws IOException { super("ImapServer", port, ImapServer.DEFAULT_PORT);