IMAP: fix from audit

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@983 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-04-01 09:11:32 +00:00
parent 3e4d4e58b3
commit 28c02c9a3a
1 changed files with 2 additions and 1 deletions

View File

@ -535,6 +535,7 @@ public class ImapConnection extends AbstractConnection {
if (parameters != null) {
StringTokenizer paramTokens = new StringTokenizer(parameters);
while (paramTokens.hasMoreTokens()) {
@SuppressWarnings({"NonConstantStringShouldBeStringBuffer"})
String param = paramTokens.nextToken();
if ("FLAGS".equals(param)) {
buffer.append(" FLAGS (").append(message.getImapFlags()).append(')');
@ -583,7 +584,6 @@ public class ImapConnection extends AbstractConnection {
// load message
MimeMessage mimeMessage = message.getMimeMessage();
int partIndex = 0;
// try to parse message part index
String partIndexString = StringUtil.getToken(param, "[", "]");
if ("".equals(partIndexString)) {
@ -596,6 +596,7 @@ public class ImapConnection extends AbstractConnection {
// write headers only
mimeMessage.writeTo(new PartOutputStream(baos, true, false, startIndex, maxSize));
} else {
int partIndex;
// try to parse part index
try {
partIndex = Integer.parseInt(partIndexString);