Author: rdonkin Date: Sun Jan 18 11:23:38 2009 New Revision: 735526 URL: http://svn.apache.org/viewvc?rev=735526&view=rev Log: Generify
Modified: james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/FetchPartPathDecoder.java james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/Imap4Rev1CommandParserFactory.java james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/SearchCommandParser.java Modified: james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/FetchPartPathDecoder.java URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/FetchPartPathDecoder.java?rev=735526&r1=735525&r2=735526&view=diff ============================================================================== --- james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/FetchPartPathDecoder.java (original) +++ james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/FetchPartPathDecoder.java Sun Jan 18 11:23:38 2009 @@ -54,7 +54,7 @@ private int used; - private List names; + private List<String> names; public FetchPartPathDecoder() { } @@ -356,7 +356,7 @@ private void readHeaderNames(final int at, final CharSequence sectionSpecification) throws ProtocolException { - names = new ArrayList(); + names = new ArrayList<String>(); final int firstWordStart = skipSpaces(at, sectionSpecification); readHeaderNames(firstWordStart, firstWordStart, sectionSpecification); } Modified: james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java?rev=735526&r1=735525&r2=735526&view=diff ============================================================================== --- james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java (original) +++ james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/base/AbstractImapCommandParser.java Sun Jan 18 11:23:38 2009 @@ -130,8 +130,7 @@ * * @param request * <code>ImapRequestLineReader</code>, not null - * @param tag - * TODO + * @param tag command tag, not null * @param command * <code>ImapCommand</code> to be parsed, not null * @return <code>ImapCommandMessage</code>, not null @@ -389,8 +388,8 @@ } /** - * Consumes a CRLF from the request. TODO we're being liberal, the spec - * insists on \r\n for new lines. + * Consumes a CRLF from the request. + * TODO: This is too liberal, the spec insists on \r\n for new lines. * * @param request * @throws ProtocolException @@ -443,16 +442,6 @@ } /** - * Reads a base64 argument from the request. - */ - public byte[] base64(ImapRequestLineReader request) - throws ProtocolException { - // TODO: throw unsupported exception? - // TODO: log - return null; - } - - /** * Reads a "flags" argument from the request. */ public Flags flagList(ImapRequestLineReader request) @@ -547,10 +536,6 @@ return (chr >= 0x01 && chr <= 0x7f); } - private boolean isCHAR8(char chr) { - return (chr >= 0x01 && chr <= 0xff); - } - protected static boolean isListWildcard(char chr) { return (chr == '*' || chr == '%'); } @@ -585,7 +570,7 @@ return new IdRange[] { parseRange(nextWord) }; } - ArrayList rangeList = new ArrayList(); + ArrayList<IdRange> rangeList = new ArrayList<IdRange>(); int pos = 0; while (commaPos != -1) { String range = nextWord.substring(pos, commaPos); Modified: james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/Imap4Rev1CommandParserFactory.java URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/Imap4Rev1CommandParserFactory.java?rev=735526&r1=735525&r2=735526&view=diff ============================================================================== --- james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/Imap4Rev1CommandParserFactory.java (original) +++ james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/Imap4Rev1CommandParserFactory.java Sun Jan 18 11:23:38 2009 @@ -42,7 +42,7 @@ */ public class Imap4Rev1CommandParserFactory extends AbstractLogEnabled implements ImapCommandParserFactory { - private Map _imapCommands; + private Map<String, Class> _imapCommands; private final Imap4Rev1MessageFactory messageFactory; @@ -57,7 +57,7 @@ this.messageFactory = messageFactory; this.commandFactory = commandFactory; this.statusResponseFactory = statusResponseFactory; - _imapCommands = new HashMap(); + _imapCommands = new HashMap<String, Class>(); // Commands valid in any state // CAPABILITY, NOOP, and LOGOUT Modified: james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/SearchCommandParser.java URL: http://svn.apache.org/viewvc/james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/SearchCommandParser.java?rev=735526&r1=735525&r2=735526&view=diff ============================================================================== --- james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/SearchCommandParser.java (original) +++ james/protocols/imap/trunk/decode/src/main/java/org/apache/james/imap/decode/imap4rev1/SearchCommandParser.java Sun Jan 18 11:23:38 2009 @@ -45,7 +45,7 @@ class SearchCommandParser extends AbstractUidCommandParser implements InitialisableCommandFactory { /** Lazy loaded */ - private Collection charsetNames; + private Collection<String> charsetNames; public SearchCommandParser() { } @@ -130,12 +130,12 @@ private SearchKey paren(ImapRequestLineReader request, Charset charset) throws ProtocolException { request.consume(); - List keys = new ArrayList(); + List<SearchKey> keys = new ArrayList<SearchKey>(); addUntilParen(request, keys, charset); return SearchKey.buildAnd(keys); } - private void addUntilParen(ImapRequestLineReader request, List keys, + private void addUntilParen(ImapRequestLineReader request, List<SearchKey> keys, Charset charset) throws ProtocolException { final char next = request.nextWordChar(); if (next == ')') { @@ -908,7 +908,7 @@ final SearchKey firstKey = searchKey(request, null, true); final SearchKey result; if (request.nextChar() == ' ') { - List keys = new ArrayList(); + List<SearchKey> keys = new ArrayList<SearchKey>(); keys.add(firstKey); while (request.nextChar() == ' ') { request.nextWordChar(); @@ -936,11 +936,11 @@ private synchronized void loadCharsetNames() { if (charsetNames == null) { - charsetNames = new HashSet(); + charsetNames = new HashSet<String>(); for (final Iterator it = Charset.availableCharsets().values() .iterator(); it.hasNext();) { final Charset charset = (Charset) it.next(); - final Set aliases = charset.aliases(); + final Set<String> aliases = charset.aliases(); charsetNames.addAll(aliases); } } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org