james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [15/18] james-project git commit: JAMES-2107 Run IntelliJ inspection: "Explicit type parameter can be removed"
Date Wed, 16 Aug 2017 09:45:48 GMT
http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/LSubProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
index f062ec0..1de8e9a 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
@@ -69,7 +69,7 @@ public class LSubProcessor extends AbstractSubscriptionProcessor<LsubRequest> {
         }
 
         final MailboxQuery expression = new MailboxQuery(basePath, CharsetUtil.decodeModifiedUTF7(mailboxName), mailboxSession.getPathDelimiter());
-        final Collection<String> mailboxResponses = new ArrayList<String>();
+        final Collection<String> mailboxResponses = new ArrayList<>();
         for (String mailbox : mailboxes) {
             respond(responder, expression, mailbox, true, mailboxes, mailboxResponses, mailboxSession.getPathDelimiter());
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
index 8a450c2..71c1361 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java
@@ -122,7 +122,7 @@ public class ListProcessor extends AbstractMailboxProcessor<ListRequest> {
                 }
                 // Get the mailbox for the reference name.
                 final MailboxPath rootPath = new MailboxPath(referenceRoot, "", "");
-                results = new ArrayList<MailboxMetaData>(1);
+                results = new ArrayList<>(1);
                 results.add(new MailboxMetaData() {
 
                     public Children inferiors() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/NamespaceProcessor.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/NamespaceProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/NamespaceProcessor.java
index d881692..724b238 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/NamespaceProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/NamespaceProcessor.java
@@ -69,7 +69,7 @@ public class NamespaceProcessor extends AbstractMailboxProcessor<NamespaceReques
      * @return personal namespaces, not null
      */
     private List<NamespaceResponse.Namespace> buildPersonalNamespaces(MailboxSession mailboxSession, ImapSession session) {
-        final List<NamespaceResponse.Namespace> personalSpaces = new ArrayList<NamespaceResponse.Namespace>();
+        final List<NamespaceResponse.Namespace> personalSpaces = new ArrayList<>();
         String personal = "";
         if (session.supportMultipleNamespaces()) {
             personal = mailboxSession.getPersonalSpace();
@@ -84,7 +84,7 @@ public class NamespaceProcessor extends AbstractMailboxProcessor<NamespaceReques
         if (session.supportMultipleNamespaces() == false || otherUsersSpace == null) {
             otherUsersSpaces = null;
         } else {
-            otherUsersSpaces = new ArrayList<NamespaceResponse.Namespace>(1);
+            otherUsersSpaces = new ArrayList<>(1);
             otherUsersSpaces.add(new NamespaceResponse.Namespace(otherUsersSpace, mailboxSession.getPathDelimiter()));
         }
         return otherUsersSpaces;
@@ -94,7 +94,7 @@ public class NamespaceProcessor extends AbstractMailboxProcessor<NamespaceReques
         List<NamespaceResponse.Namespace> sharedNamespaces = null;
         final Collection<String> sharedSpaces = mailboxSession.getSharedSpaces();
         if (session.supportMultipleNamespaces() && !sharedSpaces.isEmpty()) {
-            sharedNamespaces = new ArrayList<NamespaceResponse.Namespace>(sharedSpaces.size());
+            sharedNamespaces = new ArrayList<>(sharedSpaces.size());
             for (String space : sharedSpaces) {
                 sharedNamespaces.add(new NamespaceResponse.Namespace(space, mailboxSession.getPathDelimiter()));
             }

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
index 3d59941..f102b15 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
@@ -91,8 +91,8 @@ public class SearchProcessor extends AbstractMailboxProcessor<SearchRequest> imp
             MailboxSession msession = ImapSessionUtils.getMailboxSession(session);
             final Iterator<MessageUid> it = mailbox.search(query, msession);
             
-            final Collection<Long> results = new TreeSet<Long>();
-            final Collection<MessageUid> uids = new TreeSet<MessageUid>();
+            final Collection<Long> results = new TreeSet<>();
+            final Collection<MessageUid> uids = new TreeSet<>();
             
             while (it.hasNext()) {
                 final MessageUid uid = it.next();
@@ -130,18 +130,18 @@ public class SearchProcessor extends AbstractMailboxProcessor<SearchRequest> imp
             if (resultOptions == null || resultOptions.isEmpty()) {
                 response = new SearchResponse(ids, highestModSeq);
             } else {
-                List<Long> idList = new ArrayList<Long>(ids.length);
+                List<Long> idList = new ArrayList<>(ids.length);
                 for (long id : ids) {
                     idList.add(id);
                 }
 
-                List<IdRange> idsAsRanges = new ArrayList<IdRange>();
+                List<IdRange> idsAsRanges = new ArrayList<>();
                 for (Long id: idList) {
                     idsAsRanges.add(new IdRange(id));
                 }
                 IdRange[] idRanges = IdRange.mergeRanges(idsAsRanges).toArray(new IdRange[0]);
                 
-                List<UidRange> uidsAsRanges = new ArrayList<UidRange>();
+                List<UidRange> uidsAsRanges = new ArrayList<>();
                 for (MessageUid uid: uids) {
                     uidsAsRanges.add(new UidRange(uid));
                 }
@@ -172,7 +172,7 @@ public class SearchProcessor extends AbstractMailboxProcessor<SearchRequest> imp
                             // if the options contain ALL or COUNT we need to save the complete sequence-set
                             SearchResUtil.saveSequenceSet(session, idRanges);
                         } else {
-                            List<IdRange> savedRanges = new ArrayList<IdRange>();
+                            List<IdRange> savedRanges = new ArrayList<>();
                             if (resultOptions.contains(SearchResultOption.MIN)) {
                                 // Store the MIN
                                 savedRanges.add(new IdRange(min));  
@@ -385,7 +385,7 @@ public class SearchProcessor extends AbstractMailboxProcessor<SearchRequest> imp
 
         // First of check if we have any messages in the mailbox
         // if not we don't need to go through all of this
-        final List<SearchQuery.UidRange> ranges = new ArrayList<SearchQuery.UidRange>();
+        final List<SearchQuery.UidRange> ranges = new ArrayList<>();
         if (selected.existsCount() > 0) {
             for (IdRange range : sequenceNumbers) {
                 long lowVal = range.getLowVal();
@@ -442,7 +442,7 @@ public class SearchProcessor extends AbstractMailboxProcessor<SearchRequest> imp
 
         // First of check if we have any messages in the mailbox
         // if not we don't need to go through all of this
-        final List<SearchQuery.UidRange> ranges = new ArrayList<SearchQuery.UidRange>();
+        final List<SearchQuery.UidRange> ranges = new ArrayList<>();
         if (selected.existsCount() > 0) {
             for (UidRange range : uids) {
                 MessageUid lowVal = range.getLowVal();
@@ -483,7 +483,7 @@ public class SearchProcessor extends AbstractMailboxProcessor<SearchRequest> imp
 
     private Criterion and(List<SearchKey> keys, ImapSession session) throws MessageRangeException {
         final int size = keys.size();
-        final List<Criterion> criteria = new ArrayList<Criterion>(size);
+        final List<Criterion> criteria = new ArrayList<>(size);
         for (SearchKey key : keys) {
             final Criterion criterion = toCriterion(key, session);
             criteria.add(criterion);

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/StoreProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
index d9e213b..a281c8d 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
@@ -112,8 +112,8 @@ public class StoreProcessor extends AbstractMailboxProcessor<StoreRequest> {
                 }
               
             } 
-            final List<MessageUid> failed = new ArrayList<MessageUid>();
-            List<Long> failedMsns = new ArrayList<Long>();
+            final List<MessageUid> failed = new ArrayList<>();
+            List<Long> failedMsns = new ArrayList<>();
             final List<String> userFlags = Arrays.asList(flags.getUserFlags());
             for (IdRange range : idSet) {
                 final SelectedMailbox selected = session.getSelected();
@@ -124,7 +124,7 @@ public class StoreProcessor extends AbstractMailboxProcessor<StoreRequest> {
                         // Ok we have a CONDSTORE option so use the CONDSTORE_COMMAND
                         imapCommand = CONDSTORE_COMMAND;
 
-                        List<MessageUid> uids = new ArrayList<MessageUid>();
+                        List<MessageUid> uids = new ArrayList<>();
 
                         MessageResultIterator results = mailbox.getMessages(messageSet, FetchGroupImpl.MINIMAL, mailboxSession);
                         while (results.hasNext()) {
@@ -199,7 +199,7 @@ public class StoreProcessor extends AbstractMailboxProcessor<StoreRequest> {
                     final StatusResponse response = getStatusResponseFactory().taggedOk(tag, command, HumanReadableText.FAILED, ResponseCode.condStore(idRanges));
                     responder.respond(response);
                 } else {
-                    List<IdRange> ranges = new ArrayList<IdRange>();
+                    List<IdRange> ranges = new ArrayList<>();
                     for (long msn: failedMsns) {
                         ranges.add(new IdRange(msn));
                     }
@@ -267,7 +267,7 @@ public class StoreProcessor extends AbstractMailboxProcessor<StoreRequest> {
         boolean condstoreEnabled = enabled.contains(ImapConstants.SUPPORTS_CONDSTORE);
         
         if (!silent || unchangedSince != -1 || qresyncEnabled || condstoreEnabled) {
-            final Map<MessageUid, Long> modSeqs = new HashMap<MessageUid, Long>();
+            final Map<MessageUid, Long> modSeqs = new HashMap<>();
            
             // Check if we need to also send the the mod-sequences back to the client
             //

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
index 103369d..fdd95cc 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
@@ -51,7 +51,7 @@ import com.google.common.collect.ImmutableList;
  */
 public class SelectedMailboxImpl implements SelectedMailbox, MailboxListener{
 
-    private final Set<MessageUid> recentUids = new TreeSet<MessageUid>();
+    private final Set<MessageUid> recentUids = new TreeSet<>();
 
     private boolean recentUidRemoved = false;
 
@@ -62,9 +62,9 @@ public class SelectedMailboxImpl implements SelectedMailbox, MailboxListener{
     private final ImapSession session;
 
     private final long sessionId;
-    private final Set<MessageUid> flagUpdateUids = new TreeSet<MessageUid>();
+    private final Set<MessageUid> flagUpdateUids = new TreeSet<>();
     private final Flags.Flag uninterestingFlag = Flags.Flag.RECENT;
-    private final Set<MessageUid> expungedUids = new TreeSet<MessageUid>();
+    private final Set<MessageUid> expungedUids = new TreeSet<>();
     private final UidMsnConverter uidMsnConverter;
 
     private boolean isDeletedByOtherSession = false;
@@ -148,7 +148,7 @@ public class SelectedMailboxImpl implements SelectedMailbox, MailboxListener{
     @Override
     public synchronized Collection<MessageUid> getRecent() {
         checkExpungedRecents();
-        return new ArrayList<MessageUid>(recentUids);
+        return new ArrayList<>(recentUids);
     }
 
     @Override
@@ -275,7 +275,7 @@ public class SelectedMailboxImpl implements SelectedMailbox, MailboxListener{
         // copy the TreeSet to fix possible
         // java.util.ConcurrentModificationException
         // See IMAP-278
-        return Collections.unmodifiableSet(new TreeSet<MessageUid>(flagUpdateUids));
+        return Collections.unmodifiableSet(new TreeSet<>(flagUpdateUids));
         
     }
 
@@ -284,7 +284,7 @@ public class SelectedMailboxImpl implements SelectedMailbox, MailboxListener{
         // copy the TreeSet to fix possible
         // java.util.ConcurrentModificationException
         // See IMAP-278
-        return Collections.unmodifiableSet(new TreeSet<MessageUid>(expungedUids));
+        return Collections.unmodifiableSet(new TreeSet<>(expungedUids));
         
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/base/UidMsnConverter.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/base/UidMsnConverter.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/base/UidMsnConverter.java
index fe8c519..5e75c95 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/base/UidMsnConverter.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/base/UidMsnConverter.java
@@ -41,7 +41,7 @@ public class UidMsnConverter {
     }
 
     public synchronized void addAll(List<MessageUid> addedUids) {
-        TreeSet<MessageUid> tmp = new TreeSet<MessageUid>();
+        TreeSet<MessageUid> tmp = new TreeSet<>();
         tmp.addAll(uids);
         tmp.addAll(addedUids);
         uids.clear();

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
index 1c1eff1..333691f 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/EnvelopeBuilder.java
@@ -133,7 +133,7 @@ public final class EnvelopeBuilder {
 
                 AddressList addressList = LenientAddressParser.DEFAULT.parseAddressList(value);
                 final int size = addressList.size();
-                final List<FetchResponse.Envelope.Address> addresses = new ArrayList<FetchResponse.Envelope.Address>(size);
+                final List<FetchResponse.Envelope.Address> addresses = new ArrayList<>(size);
                 for (Address address : addressList) {
                     if (address instanceof Group) {
                         final Group group = (Group) address;

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
index a02fdd1..ec7f3e7 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
@@ -99,7 +99,7 @@ public class FetchProcessor extends AbstractMailboxProcessor<FetchRequest> {
                 condstoreEnablingCommand(session, responder,  metaData, true);
             }
             
-            List<MessageRange> ranges = new ArrayList<MessageRange>();
+            List<MessageRange> ranges = new ArrayList<>();
 
             for (IdRange range : idSet) {
                 MessageRange messageSet = messageRange(session.getSelected(), range, useUids);

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchResponseBuilder.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchResponseBuilder.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchResponseBuilder.java
index d9f1fe5..a9bc77c 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchResponseBuilder.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/FetchResponseBuilder.java
@@ -152,7 +152,7 @@ public final class FetchResponseBuilder {
 
         // BODY part responses.
         Collection<BodyFetchElement> elements = fetch.getBodyElements();
-        this.elements = new ArrayList<FetchResponse.BodyElement>();
+        this.elements = new ArrayList<>();
         for (BodyFetchElement fetchElement : elements) {
             final FetchResponse.BodyElement element = bodyFetch(result, fetchElement);
             if (element != null) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MessageResultUtils.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MessageResultUtils.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MessageResultUtils.java
index 6c83560..4929415 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MessageResultUtils.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MessageResultUtils.java
@@ -43,7 +43,7 @@ public class MessageResultUtils {
      * @throws MessagingException
      */
     public static List<MessageResult.Header> getAll(Iterator<MessageResult.Header> iterator) {
-        final List<MessageResult.Header> results = new ArrayList<MessageResult.Header>();
+        final List<MessageResult.Header> results = new ArrayList<>();
         if (iterator != null) {
             while (iterator.hasNext()) {
                 results.add(iterator.next());
@@ -65,7 +65,7 @@ public class MessageResultUtils {
      * @throws MessagingException
      */
     public static List<MessageResult.Header> getMatching(String[] names, Iterator<MessageResult.Header> iterator) throws MailboxException {
-        final List<MessageResult.Header> results = new ArrayList<MessageResult.Header>(20);
+        final List<MessageResult.Header> results = new ArrayList<>(20);
         if (iterator != null) {
             while (iterator.hasNext()) {
                 MessageResult.Header header = iterator.next();
@@ -98,7 +98,7 @@ public class MessageResultUtils {
     }
 
     private static List<MessageResult.Header> matching(Collection<String> names, Iterator<MessageResult.Header> iterator, boolean not) throws MailboxException {
-        final List<MessageResult.Header> results = new ArrayList<MessageResult.Header>(names.size());
+        final List<MessageResult.Header> results = new ArrayList<>(names.size());
         if (iterator != null) {
             while (iterator.hasNext()) {
                 final MessageResult.Header header = iterator.next();
@@ -176,7 +176,7 @@ public class MessageResultUtils {
      * @throws MessagingException
      */
     public static List<MessageResult.Header> getNotMatching(String[] names, Iterator<MessageResult.Header> iterator) throws MailboxException {
-        final List<MessageResult.Header> results = new ArrayList<MessageResult.Header>(20);
+        final List<MessageResult.Header> results = new ArrayList<>(20);
         if (iterator != null) {
             while (iterator.hasNext()) {
                 MessageResult.Header header = iterator.next();

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MimeDescriptorStructure.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MimeDescriptorStructure.java b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MimeDescriptorStructure.java
index 5ff54fa..6e723ec 100644
--- a/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MimeDescriptorStructure.java
+++ b/protocols/imap/src/main/java/org/apache/james/imap/processor/fetch/MimeDescriptorStructure.java
@@ -79,7 +79,7 @@ final class MimeDescriptorStructure implements FetchResponse.Structure {
     }
 
     private static List<Structure> createParts(boolean allowExtensions, MimeDescriptor descriptor, EnvelopeBuilder builder) throws MailboxException {
-        final List<Structure> results = new ArrayList<Structure>();
+        final List<Structure> results = new ArrayList<>();
         for (Iterator<MimeDescriptor> it = descriptor.parts(); it.hasNext();) {
             final MimeDescriptor partDescriptor = it.next();
             results.add(new MimeDescriptorStructure(allowExtensions, partDescriptor, builder));
@@ -88,7 +88,7 @@ final class MimeDescriptorStructure implements FetchResponse.Structure {
     }
 
     private static List<String> createParameters(MimeDescriptor descriptor) throws MailboxException {
-        final List<String> results = new ArrayList<String>();
+        final List<String> results = new ArrayList<>();
         // TODO: consider revising this
         for (Map.Entry<String, String> entry : descriptor.contentTypeParameters().entrySet()) {
             results.add(entry.getKey());

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java b/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java
index a966d30..a3a3642 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/api/IdRangeTest.java
@@ -18,10 +18,12 @@
  ****************************************************************/
 package org.apache.james.imap.api;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import static org.junit.Assert.*;
 
 import org.apache.james.imap.api.message.IdRange;
 import org.junit.Test;
@@ -34,7 +36,7 @@ public class IdRangeTest {
         IdRange r2 = new IdRange(4, 5);
         IdRange r3 = new IdRange(7, 10);
         
-        List<IdRange> ranges = new ArrayList<IdRange>();
+        List<IdRange> ranges = new ArrayList<>();
         ranges.add(r);
         ranges.add(r2);
         ranges.add(r3);
@@ -55,7 +57,7 @@ public class IdRangeTest {
         IdRange r2 = new IdRange(1, 4);
         IdRange r3 = new IdRange(6, 7);
         
-        List<IdRange> ranges = new ArrayList<IdRange>();
+        List<IdRange> ranges = new ArrayList<>();
         ranges.add(r);
         ranges.add(r2);
         ranges.add(r3);
@@ -75,7 +77,7 @@ public class IdRangeTest {
         IdRange r2 = new IdRange(1, 4);
         IdRange r3 = new IdRange(5, 7);
         
-        List<IdRange> ranges = new ArrayList<IdRange>();
+        List<IdRange> ranges = new ArrayList<>();
         ranges.add(r);
         ranges.add(r2);
         ranges.add(r3);
@@ -93,7 +95,7 @@ public class IdRangeTest {
         IdRange r2 = new IdRange(1, 4);
         IdRange r3 = new IdRange(10, 15);
         
-        List<IdRange> ranges = new ArrayList<IdRange>();
+        List<IdRange> ranges = new ArrayList<>();
         ranges.add(r);
         ranges.add(r2);
         ranges.add(r3);
@@ -111,7 +113,7 @@ public class IdRangeTest {
         IdRange r2 = new IdRange(1, 1);
         IdRange r3 = new IdRange(2, 2);
         
-        List<IdRange> ranges = new ArrayList<IdRange>();
+        List<IdRange> ranges = new ArrayList<>();
         ranges.add(r);
         ranges.add(r2);
         ranges.add(r3);

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserAndParenthesesTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserAndParenthesesTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserAndParenthesesTest.java
index 2e5bb38..a5cdbe2 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserAndParenthesesTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserAndParenthesesTest.java
@@ -54,7 +54,7 @@ public class SearchCommandParserAndParenthesesTest {
             on(), unanswered() };
 
     public static Input and(Input[] parts, boolean parens) {
-        List<SearchKey> keys = new ArrayList<SearchKey>();
+        List<SearchKey> keys = new ArrayList<>();
         StringBuffer buffer = new StringBuffer();
         if (parens) {
             buffer.append("(");

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserTopLevelAndTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserTopLevelAndTest.java b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserTopLevelAndTest.java
index f8f8957..f789f2a 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserTopLevelAndTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/decode/parser/SearchCommandParserTopLevelAndTest.java
@@ -19,7 +19,7 @@
 
 package org.apache.james.imap.decode.parser;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -173,7 +173,7 @@ public class SearchCommandParserTopLevelAndTest {
     }
 
     private void permute(int mutations, Input[] inputs) throws Exception {
-        permute(mutations, new ArrayList<SearchKey>(), new StringBuffer(), inputs);
+        permute(mutations, new ArrayList<>(), new StringBuffer(), inputs);
     }
 
     private void permute(int mutations, List<SearchKey> keys, StringBuffer buffer,
@@ -188,7 +188,7 @@ public class SearchCommandParserTopLevelAndTest {
                     nextBuffer.append(' ');
                 }
                 nextBuffer.append(input.input);
-                List<SearchKey> nextKeys = new ArrayList<SearchKey>(keys);
+                List<SearchKey> nextKeys = new ArrayList<>(keys);
                 nextKeys.add(input.key);
                 permute(mutations, nextKeys, nextBuffer, inputs);
             }

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/encode/FakeImapSession.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/encode/FakeImapSession.java b/protocols/imap/src/test/java/org/apache/james/imap/encode/FakeImapSession.java
index 08a189a..a95f60e 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/encode/FakeImapSession.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/encode/FakeImapSession.java
@@ -39,7 +39,7 @@ public class FakeImapSession implements ImapSession {
     private final Map<String, Object> attributesByKey;
 
     public FakeImapSession() {
-        this.attributesByKey = new ConcurrentHashMap<String, Object>();
+        this.attributesByKey = new ConcurrentHashMap<>();
     }
 
     public void logout() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/encode/FetchResponseEncoderNoExtensionsTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/encode/FetchResponseEncoderNoExtensionsTest.java b/protocols/imap/src/test/java/org/apache/james/imap/encode/FetchResponseEncoderNoExtensionsTest.java
index 860d4cc..76b0ef9 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/encode/FetchResponseEncoderNoExtensionsTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/encode/FetchResponseEncoderNoExtensionsTest.java
@@ -19,7 +19,9 @@
 
 package org.apache.james.imap.encode;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -29,9 +31,6 @@ import java.util.Map;
 import javax.mail.Flags;
 
 import org.apache.james.imap.api.ImapMessage;
-import org.apache.james.imap.encode.FetchResponseEncoder;
-import org.apache.james.imap.encode.ImapEncoder;
-import org.apache.james.imap.encode.ImapResponseComposer;
 import org.apache.james.imap.encode.base.ByteImapResponseWriter;
 import org.apache.james.imap.encode.base.ImapResponseComposerImpl;
 import org.apache.james.imap.message.response.FetchResponse;
@@ -108,9 +107,9 @@ public class FetchResponseEncoderNoExtensionsTest  {
     public void testShouldNotAddExtensionsWithEncodingBodyStructure() throws Exception {
         FetchResponse message = new FetchResponse(100, flags, MessageUid.of(72), null,
                 null, null, null, null, stubStructure, null);
-        final Map<String, String> parameters = new HashMap<String, String>();
+        final Map<String, String> parameters = new HashMap<>();
         parameters.put("CHARSET", "US-ASCII");
-        final List<String> parameterList= new ArrayList<String>();
+        final List<String> parameterList= new ArrayList<>();
         parameterList.add("CHARSET");
         parameterList.add("US-ASCII");
         

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/encode/ListingEncodingUtilsTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/encode/ListingEncodingUtilsTest.java b/protocols/imap/src/test/java/org/apache/james/imap/encode/ListingEncodingUtilsTest.java
index 30dc417..f4ea9f4 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/encode/ListingEncodingUtilsTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/encode/ListingEncodingUtilsTest.java
@@ -21,15 +21,14 @@ package org.apache.james.imap.encode;
 import java.util.ArrayList;
 import java.util.List;
 
-import junit.framework.Assert;
-
 import org.apache.james.imap.encode.base.ByteImapResponseWriter;
 import org.apache.james.imap.encode.base.ImapResponseComposerImpl;
 import org.apache.james.imap.message.response.ListResponse;
-
 import org.junit.Before;
 import org.junit.Test;
 
+import junit.framework.Assert;
+
 public class ListingEncodingUtilsTest  {
 
     final String nameParameter = "LIST";
@@ -42,7 +41,7 @@ public class ListingEncodingUtilsTest  {
     
     @Before
     public void setUp() throws Exception {
-        attributesOutput = new ArrayList<String>();
+        attributesOutput = new ArrayList<>();
       
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/encode/NamespaceResponseEncoderTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/encode/NamespaceResponseEncoderTest.java b/protocols/imap/src/test/java/org/apache/james/imap/encode/NamespaceResponseEncoderTest.java
index db4de83..a01dc53 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/encode/NamespaceResponseEncoderTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/encode/NamespaceResponseEncoderTest.java
@@ -18,7 +18,8 @@
  ****************************************************************/
 package org.apache.james.imap.encode;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -76,7 +77,7 @@ public class NamespaceResponseEncoderTest {
                 oneOf(mockComposer).end(); inSequence(sequence);
             }
         });
-        List<NamespaceResponse.Namespace> namespaces = new ArrayList<NamespaceResponse.Namespace>();
+        List<NamespaceResponse.Namespace> namespaces = new ArrayList<>();
         namespaces.add(new NamespaceResponse.Namespace(aPrefix, aDeliminator
                 .charAt(0)));
         subject.doEncode(new NamespaceResponse(null, null, namespaces),
@@ -104,7 +105,7 @@ public class NamespaceResponseEncoderTest {
                 oneOf(mockComposer).end(); inSequence(sequence);
             }
         });
-        List<NamespaceResponse.Namespace> namespaces = new ArrayList<NamespaceResponse.Namespace>();
+        List<NamespaceResponse.Namespace> namespaces = new ArrayList<>();
         namespaces.add(new NamespaceResponse.Namespace(aPrefix, aDeliminator
                 .charAt(0)));
         subject.doEncode(new NamespaceResponse(null, namespaces, null),
@@ -132,7 +133,7 @@ public class NamespaceResponseEncoderTest {
                 oneOf(mockComposer).end(); inSequence(sequence);
             }
         });
-        List<NamespaceResponse.Namespace> namespaces = new ArrayList<NamespaceResponse.Namespace>();
+        List<NamespaceResponse.Namespace> namespaces = new ArrayList<>();
         namespaces.add(new NamespaceResponse.Namespace(aPrefix, aDeliminator
                 .charAt(0)));
         subject.doEncode(new NamespaceResponse(namespaces, null, null),
@@ -166,7 +167,7 @@ public class NamespaceResponseEncoderTest {
                 oneOf(mockComposer).end(); inSequence(sequence);
             }
         });
-        List<NamespaceResponse.Namespace> namespaces = new ArrayList<NamespaceResponse.Namespace>();
+        List<NamespaceResponse.Namespace> namespaces = new ArrayList<>();
         namespaces.add(new NamespaceResponse.Namespace(aPrefix, aDeliminator
                 .charAt(0)));
         namespaces.add(new NamespaceResponse.Namespace(anotherPrefix,

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/processor/LSubProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/LSubProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/LSubProcessorTest.java
index ad486cc..67d1a77 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/LSubProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/LSubProcessorTest.java
@@ -98,7 +98,7 @@ public class LSubProcessorTest {
     
     @Before
     public void setUp() throws Exception {
-        subscriptions = new ArrayList<String>();
+        subscriptions = new ArrayList<>();
         serverResponseFactory = mockery.mock(StatusResponseFactory.class);
         session = mockery.mock(ImapSession.class);
         command = ImapCommand.anyStateCommand("Command");
@@ -248,7 +248,7 @@ public class LSubProcessorTest {
                  * @see org.apache.james.mailbox.MailboxSession.User#getLocalePreferences()
                  */
                 public List<Locale> getLocalePreferences() {
-                    return new ArrayList<Locale>();
+                    return new ArrayList<>();
                 }
 
                 /**

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/processor/NamespaceProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/NamespaceProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/NamespaceProcessorTest.java
index a0d2dc4..da1bc78 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/NamespaceProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/NamespaceProcessorTest.java
@@ -69,7 +69,7 @@ public class NamespaceProcessorTest {
     
     @Before
     public void setUp() throws Exception {
-        sharedSpaces = new ArrayList<String>();
+        sharedSpaces = new ArrayList<>();
         statusResponseStub = mockery.mock(StatusResponseFactory.class);
         mailboxManagerStub = mockery.mock(MailboxManager.class);
         subject = new NamespaceProcessor(mockery.mock(ImapProcessor.class), mailboxManagerStub, statusResponseStub, new NoopMetricFactory());
@@ -134,7 +134,7 @@ public class NamespaceProcessorTest {
         this.sharedSpaces.add(sharedSpaceStub);
         
         
-        final List<NamespaceResponse.Namespace> sharedSpaces = new ArrayList<NamespaceResponse.Namespace>();
+        final List<NamespaceResponse.Namespace> sharedSpaces = new ArrayList<>();
         sharedSpaces.add(new NamespaceResponse.Namespace(SHARED_PREFIX, MailboxConstants.DEFAULT_DELIMITER));
         final NamespaceResponse response = buildResponse(sharedSpaces);
         
@@ -145,9 +145,9 @@ public class NamespaceProcessorTest {
 
     private NamespaceResponse buildResponse(List<NamespaceResponse.Namespace> sharedSpaces) {
        
-        final List<NamespaceResponse.Namespace> personalSpaces = new ArrayList<NamespaceResponse.Namespace>();
+        final List<NamespaceResponse.Namespace> personalSpaces = new ArrayList<>();
         personalSpaces.add(new NamespaceResponse.Namespace(PERSONAL_PREFIX, MailboxConstants.DEFAULT_DELIMITER));
-        final List<NamespaceResponse.Namespace> otherUsersSpaces = new ArrayList<NamespaceResponse.Namespace>();
+        final List<NamespaceResponse.Namespace> otherUsersSpaces = new ArrayList<>();
         otherUsersSpaces.add(new NamespaceResponse.Namespace(USERS_PREFIX, MailboxConstants.DEFAULT_DELIMITER));
 
         return new NamespaceResponse(personalSpaces, otherUsersSpaces, sharedSpaces);

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/processor/SearchProcessorTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/SearchProcessorTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/SearchProcessorTest.java
index d30df52..a604d4a 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/SearchProcessorTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/SearchProcessorTest.java
@@ -39,7 +39,6 @@ import org.apache.james.imap.api.message.UidRange;
 import org.apache.james.imap.api.message.request.DayMonthYear;
 import org.apache.james.imap.api.message.request.SearchKey;
 import org.apache.james.imap.api.message.request.SearchOperation;
-import org.apache.james.imap.api.message.request.SearchResultOption;
 import org.apache.james.imap.api.message.response.StatusResponse;
 import org.apache.james.imap.api.message.response.StatusResponseFactory;
 import org.apache.james.imap.api.process.ImapProcessor;
@@ -343,11 +342,11 @@ public class SearchProcessorTest {
     @Test
     public void testAND() throws Exception {
         expectsGetSelectedMailbox();
-        List<SearchKey> keys = new ArrayList<SearchKey>();
+        List<SearchKey> keys = new ArrayList<>();
         keys.add(SearchKey.buildOn(DAY_MONTH_YEAR));
         keys.add(SearchKey.buildOld());
         keys.add(SearchKey.buildLarger(SIZE));
-        List<Criterion> criteria = new ArrayList<Criterion>();
+        List<Criterion> criteria = new ArrayList<>();
         criteria.add(SearchQuery.internalDateOn(getDate(DAY, MONTH, YEAR), DateResolution.Day));
         criteria.add(SearchQuery.flagIsUnSet(Flag.RECENT));
         criteria.add(SearchQuery.sizeGreaterThan(SIZE));
@@ -506,7 +505,7 @@ public class SearchProcessorTest {
             allowing(selectedMailbox).hasNewApplicableFlags(); will(returnValue(false));
           
         }});
-        SearchRequest message = new SearchRequest(command, new SearchOperation(key, new ArrayList<SearchResultOption>()), false, TAG);
+        SearchRequest message = new SearchRequest(command, new SearchOperation(key, new ArrayList<>()), false, TAG);
         processor.doProcess(message, session, TAG, command, responder);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java
index e147a47..c8e0338 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/base/SelectedMailboxImplTest.java
@@ -159,7 +159,7 @@ public class SelectedMailboxImplTest {
     }
 
     private void emitEvent(MailboxListener mailboxListener) {
-        TreeMap<MessageUid, MessageMetaData> result = new TreeMap<MessageUid, MessageMetaData>();
+        TreeMap<MessageUid, MessageMetaData> result = new TreeMap<>();
         result.put(EMITTED_EVENT_UID, new SimpleMessageMetaData(EMITTED_EVENT_UID, MOD_SEQ, new Flags(), SIZE, new Date(), new DefaultMessageId()));
         mailboxListener.event(new EventFactory().added(mock(MailboxSession.class), result, mailbox, ImmutableMap.<MessageUid, MailboxMessage> of()));
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/imap/src/test/java/org/apache/james/imap/processor/fetch/MailboxMessageResultUtilsTest.java
----------------------------------------------------------------------
diff --git a/protocols/imap/src/test/java/org/apache/james/imap/processor/fetch/MailboxMessageResultUtilsTest.java b/protocols/imap/src/test/java/org/apache/james/imap/processor/fetch/MailboxMessageResultUtilsTest.java
index a329c7c..8959869 100644
--- a/protocols/imap/src/test/java/org/apache/james/imap/processor/fetch/MailboxMessageResultUtilsTest.java
+++ b/protocols/imap/src/test/java/org/apache/james/imap/processor/fetch/MailboxMessageResultUtilsTest.java
@@ -79,7 +79,7 @@ public class MailboxMessageResultUtilsTest {
         headerOne = new Header("One");
         headerTwo = new Header("Two");
         headerThree = new Header("Three");
-        headers = new ArrayList<MessageResult.Header>();
+        headers = new ArrayList<>();
         headers.add(headerOne);
         headers.add(headerTwo);
         headers.add(headerThree);

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPMultiResponse.java
----------------------------------------------------------------------
diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPMultiResponse.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPMultiResponse.java
index 6590bbc..f6efd59 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPMultiResponse.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPMultiResponse.java
@@ -31,7 +31,7 @@ import org.apache.james.protocols.api.Response;
  */
 public class LMTPMultiResponse implements Response {
 
-    private final List<Response> responses = new ArrayList<Response>();
+    private final List<Response> responses = new ArrayList<>();
 
     public LMTPMultiResponse(Response response) {
         addResponse(response);
@@ -55,7 +55,7 @@ public class LMTPMultiResponse implements Response {
      * @see org.apache.james.protocols.api.Response#getLines()
      */
     public List<CharSequence> getLines() {
-        List<CharSequence> lines = new ArrayList<CharSequence>();
+        List<CharSequence> lines = new ArrayList<>();
         for (Response response: responses) {
             lines.addAll(response.getLines());
         }

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java
----------------------------------------------------------------------
diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java
index cce63ff..64179bd 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/LMTPProtocolHandlerChain.java
@@ -27,8 +27,8 @@ import org.apache.james.protocols.api.handler.CommandHandlerResultLogger;
 import org.apache.james.protocols.api.handler.ProtocolHandler;
 import org.apache.james.protocols.api.handler.WiringException;
 import org.apache.james.protocols.lmtp.core.DataLineMessageHookHandler;
-import org.apache.james.protocols.lmtp.core.ReceivedDataLineFilter;
 import org.apache.james.protocols.lmtp.core.LhloCmdHandler;
+import org.apache.james.protocols.lmtp.core.ReceivedDataLineFilter;
 import org.apache.james.protocols.lmtp.core.WelcomeMessageHandler;
 import org.apache.james.protocols.smtp.SMTPProtocolHandlerChain;
 import org.apache.james.protocols.smtp.SMTPSession;
@@ -67,7 +67,7 @@ public class LMTPProtocolHandlerChain extends SMTPProtocolHandlerChain{
 
     @Override
     protected List<ProtocolHandler> initDefaultHandlers() {
-        List<ProtocolHandler> defaultHandlers = new ArrayList<ProtocolHandler>();
+        List<ProtocolHandler> defaultHandlers = new ArrayList<>();
         defaultHandlers.add(new CommandDispatcher<SMTPSession>());
         defaultHandlers.add(new ExpnCmdHandler());
         defaultHandlers.add(new LhloCmdHandler(new NoopMetricFactory()));

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java
----------------------------------------------------------------------
diff --git a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java
index b85f012..5df57f9 100644
--- a/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java
+++ b/protocols/lmtp/src/main/java/org/apache/james/protocols/lmtp/core/DataLineMessageHookHandler.java
@@ -42,7 +42,7 @@ import org.apache.james.protocols.smtp.dsn.DSNStatus;
  */
 public class DataLineMessageHookHandler extends org.apache.james.protocols.smtp.core.DataLineMessageHookHandler{
 
-    private final List<DeliverToRecipientHook> handlers = new ArrayList<DeliverToRecipientHook>();
+    private final List<DeliverToRecipientHook> handlers = new ArrayList<>();
 
     
     @Override
@@ -75,7 +75,7 @@ public class DataLineMessageHookHandler extends org.apache.james.protocols.smtp.
 
     @Override
     public List<Class<?>> getMarkerInterfaces() {
-        List<Class<?>> markers = new ArrayList<Class<?>>();
+        List<Class<?>> markers = new ArrayList<>();
         markers.add(DeliverToRecipientHook.class);
         return markers;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPSServerTest.java
----------------------------------------------------------------------
diff --git a/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPSServerTest.java b/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPSServerTest.java
index 96d7c34..009fdcf 100644
--- a/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPSServerTest.java
+++ b/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPSServerTest.java
@@ -43,7 +43,7 @@ public abstract class AbstractLMTPSServerTest extends AbstractLMTPServerTest{
 
     protected final class LMTPSClient extends SMTPSClient implements LMTPClient{
 
-        private final List<Integer> replies = new ArrayList<Integer>();
+        private final List<Integer> replies = new ArrayList<>();
         private int rcptCount = 0;
         
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java
----------------------------------------------------------------------
diff --git a/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java b/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java
index 6f7ceb3..7f76506 100644
--- a/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java
+++ b/protocols/lmtp/src/test/java/org/apache/james/protocols/lmtp/AbstractLMTPServerTest.java
@@ -58,7 +58,7 @@ public abstract class AbstractLMTPServerTest extends AbstractSMTPServerTest{
     @Override
     protected Protocol createProtocol(ProtocolHandler... handlers) throws WiringException {
         LMTPProtocolHandlerChain chain = new LMTPProtocolHandlerChain();
-        List<ProtocolHandler> hList = new ArrayList<ProtocolHandler>();
+        List<ProtocolHandler> hList = new ArrayList<>();
 
         for (ProtocolHandler handler : handlers) {
             if (handler instanceof MessageHook) {
@@ -256,7 +256,7 @@ public abstract class AbstractLMTPServerTest extends AbstractSMTPServerTest{
     
     private final class LMTPClientImpl extends SMTPClient implements LMTPClient {
 
-        private final List<Integer> replies = new ArrayList<Integer>();
+        private final List<Integer> replies = new ArrayList<>();
         private int rcptCount = 0;
         
         
@@ -343,7 +343,7 @@ public abstract class AbstractLMTPServerTest extends AbstractSMTPServerTest{
     
     private final class TestDeliverHook implements DeliverToRecipientHook {
         
-        private final List<MailEnvelope> delivered = new ArrayList<MailEnvelope>();
+        private final List<MailEnvelope> delivered = new ArrayList<>();
         
         /*
          * (non-Javadoc)

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/managesieve/src/main/java/org/apache/james/managesieve/core/CoreProcessor.java
----------------------------------------------------------------------
diff --git a/protocols/managesieve/src/main/java/org/apache/james/managesieve/core/CoreProcessor.java b/protocols/managesieve/src/main/java/org/apache/james/managesieve/core/CoreProcessor.java
index c0b8d3f..9c06e4d 100644
--- a/protocols/managesieve/src/main/java/org/apache/james/managesieve/core/CoreProcessor.java
+++ b/protocols/managesieve/src/main/java/org/apache/james/managesieve/core/CoreProcessor.java
@@ -318,7 +318,7 @@ public class CoreProcessor implements CoreCommands {
 
     private Map<Capabilities, String> precomputedCapabilitiesBase(SieveParser parser) {
         String extensions = buildExtensions(parser);
-        Map<Capabilities, String> capabilitiesBase = new HashMap<Capabilities, String>();
+        Map<Capabilities, String> capabilitiesBase = new HashMap<>();
         capabilitiesBase.put(Capabilities.IMPLEMENTATION, IMPLEMENTATION_DESCRIPTION);
         capabilitiesBase.put(Capabilities.VERSION, MANAGE_SIEVE_VERSION);
         capabilitiesBase.put(Capabilities.SASL, constructSaslSupportedAuthenticationMechanisms());

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/managesieve/src/main/java/org/apache/james/managesieve/jsieve/Parser.java
----------------------------------------------------------------------
diff --git a/protocols/managesieve/src/main/java/org/apache/james/managesieve/jsieve/Parser.java b/protocols/managesieve/src/main/java/org/apache/james/managesieve/jsieve/Parser.java
index 8fb8765..c83846c 100644
--- a/protocols/managesieve/src/main/java/org/apache/james/managesieve/jsieve/Parser.java
+++ b/protocols/managesieve/src/main/java/org/apache/james/managesieve/jsieve/Parser.java
@@ -34,7 +34,7 @@ import org.apache.jsieve.parser.generated.ParseException;
 
 public class Parser implements SieveParser {
     
-    private static final List<String> EMPTY_WARNINGS = new ArrayList<String>(0);
+    private static final List<String> EMPTY_WARNINGS = new ArrayList<>(0);
     
     private SieveFactory sieveFactory;
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
----------------------------------------------------------------------
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
index 50ea0be..9dc9b72 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
@@ -57,7 +57,7 @@ public abstract class AbstractAsyncServer implements ProtocolServer{
 
     private volatile int ioWorker = DEFAULT_IO_WORKER_COUNT;
     
-    private List<InetSocketAddress> addresses = new ArrayList<InetSocketAddress>();
+    private List<InetSocketAddress> addresses = new ArrayList<>();
     
     public synchronized void setListenAddresses(InetSocketAddress... addresses) {
         if (started) throw new IllegalStateException("Can only be set when the server is not running");

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/netty/src/main/java/org/apache/james/protocols/netty/ConnectionPerIpLimitUpstreamHandler.java
----------------------------------------------------------------------
diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/ConnectionPerIpLimitUpstreamHandler.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/ConnectionPerIpLimitUpstreamHandler.java
index cd47ba0..c002f9d 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/ConnectionPerIpLimitUpstreamHandler.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/ConnectionPerIpLimitUpstreamHandler.java
@@ -39,7 +39,7 @@ import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
  */
 public class ConnectionPerIpLimitUpstreamHandler extends SimpleChannelUpstreamHandler{
 
-    private final ConcurrentMap<String, AtomicInteger> connections = new ConcurrentHashMap<String, AtomicInteger>();    
+    private final ConcurrentMap<String, AtomicInteger> connections = new ConcurrentHashMap<>();
     private volatile int maxConnectionsPerIp = -1;
     
     public ConnectionPerIpLimitUpstreamHandler(int maxConnectionsPerIp) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
index 9962bdb..985dd39 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3ProtocolHandlerChain.java
@@ -28,11 +28,11 @@ import org.apache.james.protocols.api.handler.CommandHandlerResultLogger;
 import org.apache.james.protocols.api.handler.ProtocolHandler;
 import org.apache.james.protocols.api.handler.ProtocolHandlerChainImpl;
 import org.apache.james.protocols.api.handler.WiringException;
+import org.apache.james.protocols.pop3.core.AbstractPassCmdHandler;
 import org.apache.james.protocols.pop3.core.CapaCmdHandler;
 import org.apache.james.protocols.pop3.core.DeleCmdHandler;
 import org.apache.james.protocols.pop3.core.ListCmdHandler;
 import org.apache.james.protocols.pop3.core.NoopCmdHandler;
-import org.apache.james.protocols.pop3.core.AbstractPassCmdHandler;
 import org.apache.james.protocols.pop3.core.QuitCmdHandler;
 import org.apache.james.protocols.pop3.core.RetrCmdHandler;
 import org.apache.james.protocols.pop3.core.RsetCmdHandler;
@@ -70,7 +70,7 @@ public class POP3ProtocolHandlerChain extends ProtocolHandlerChainImpl{
     }
     
     protected List<ProtocolHandler> initDefaultHandlers(AbstractPassCmdHandler... authHandlers) {
-        List<ProtocolHandler> handlers = new ArrayList<ProtocolHandler>();
+        List<ProtocolHandler> handlers = new ArrayList<>();
         // add all pass handlers
         Collections.addAll(handlers, authHandlers);
         

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
index 326736d..510bb1e 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/POP3Response.java
@@ -84,7 +84,7 @@ public class POP3Response extends AbstractResponse {
      * @return all responseLines
      */
     public List<CharSequence> getLines() {
-        List<CharSequence> responseList = new ArrayList<CharSequence>();
+        List<CharSequence> responseList = new ArrayList<>();
         if (lines.isEmpty()) {
             responseList.add(getRetCode());
         } else {

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java
index 5b9cf57..32db448 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/CapaCmdHandler.java
@@ -27,7 +27,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.james.protocols.api.Request;
@@ -44,7 +43,7 @@ import org.apache.james.protocols.pop3.POP3Session;
 public class CapaCmdHandler implements CommandHandler<POP3Session>, ExtensibleHandler, CapaCapability {    
     private List<CapaCapability> caps;
     private static final Collection<String> COMMANDS = Collections.unmodifiableCollection(Arrays.asList("CAPA"));
-    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("PIPELINING")));
+    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList("PIPELINING")));
 
     @Override
     public void init(Configuration config) throws ConfigurationException {

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java
index 9bfdda9..94b6c71 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/ListCmdHandler.java
@@ -76,7 +76,7 @@ public class ListCmdHandler implements CommandHandler<POP3Session> {
 
                 long size = 0;
                 int count = 0;
-                List<MessageMetaData> validResults = new ArrayList<MessageMetaData>();
+                List<MessageMetaData> validResults = new ArrayList<>();
                 if (uidList.isEmpty() == false) {
 
                     for (MessageMetaData data : uidList) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StatCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StatCmdHandler.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StatCmdHandler.java
index 7ffd46d..a2e305f 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StatCmdHandler.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StatCmdHandler.java
@@ -27,9 +27,9 @@ import java.util.List;
 
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
+import org.apache.james.protocols.api.ProtocolSession.State;
 import org.apache.james.protocols.api.Request;
 import org.apache.james.protocols.api.Response;
-import org.apache.james.protocols.api.ProtocolSession.State;
 import org.apache.james.protocols.api.handler.CommandHandler;
 import org.apache.james.protocols.pop3.POP3Response;
 import org.apache.james.protocols.pop3.POP3Session;
@@ -64,7 +64,7 @@ public class StatCmdHandler implements CommandHandler<POP3Session> {
             long size = 0;
             int count = 0;
             if (uidList.isEmpty() == false) {
-                List<MessageMetaData> validResults = new ArrayList<MessageMetaData>();
+                List<MessageMetaData> validResults = new ArrayList<>();
                 for (MessageMetaData data : uidList) {
                     if (deletedUidList.contains(data.getUid()) == false) {
                         size += data.getSize();

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java
index 0175b13..6249cc7 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/StlsCmdHandler.java
@@ -41,7 +41,7 @@ import org.apache.james.protocols.pop3.POP3StartTlsResponse;
 public class StlsCmdHandler implements CommandHandler<POP3Session>, CapaCapability {
 
     private static final Collection<String> COMMANDS = Collections.unmodifiableCollection(Arrays.asList("STLS"));
-    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("STLS")));
+    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList("STLS")));
 
     private static final Response BEGIN_TLS = new POP3StartTlsResponse(POP3Response.OK_RESPONSE, "Begin TLS negotiation").immutable();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/TopCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/TopCmdHandler.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/TopCmdHandler.java
index dc62494..1994c7a 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/TopCmdHandler.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/TopCmdHandler.java
@@ -42,7 +42,7 @@ import org.apache.james.protocols.pop3.mailbox.MessageMetaData;
  */
 public class TopCmdHandler extends RetrCmdHandler implements CapaCapability {
     private static final Collection<String> COMMANDS = Collections.unmodifiableCollection(Arrays.asList("TOP"));
-    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("TOP")));
+    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList("TOP")));
     
     private static final Response SYNTAX_ERROR = new POP3Response(POP3Response.ERR_RESPONSE, "Usage: TOP [mail number] [Line number]").immutable();
     private static final Response ERROR_MESSAGE_RETR = new POP3Response(POP3Response.ERR_RESPONSE, "Error while retrieving message.").immutable();

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UidlCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UidlCmdHandler.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UidlCmdHandler.java
index 9b4c5b1..48abe13 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UidlCmdHandler.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UidlCmdHandler.java
@@ -27,12 +27,11 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.james.protocols.api.ProtocolSession.State;
 import org.apache.james.protocols.api.Request;
 import org.apache.james.protocols.api.Response;
-import org.apache.james.protocols.api.ProtocolSession.State;
 import org.apache.james.protocols.api.handler.CommandHandler;
 import org.apache.james.protocols.pop3.POP3Response;
 import org.apache.james.protocols.pop3.POP3Session;
@@ -43,18 +42,18 @@ import org.apache.james.protocols.pop3.mailbox.MessageMetaData;
  */
 public class UidlCmdHandler implements CommandHandler<POP3Session>, CapaCapability {
     private static final Collection<String> COMMANDS = Collections.unmodifiableCollection(Arrays.asList("UIDL"));
-    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("UIDL")));
+    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList("UIDL")));
+
+    @Override
+    public void init(Configuration config) throws ConfigurationException {
+
+    }
+
+    @Override
+    public void destroy() {
+
+    }
 
-    @Override
-    public void init(Configuration config) throws ConfigurationException {
-
-    }
-
-    @Override
-    public void destroy() {
-
-    }
-
     /**
      * Handler method called upon receipt of a UIDL command. Returns a listing
      * of message ids to the client.

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UserCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UserCmdHandler.java b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UserCmdHandler.java
index 172bb75..20a0cea 100644
--- a/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UserCmdHandler.java
+++ b/protocols/pop3/src/main/java/org/apache/james/protocols/pop3/core/UserCmdHandler.java
@@ -25,8 +25,8 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
 import org.apache.james.protocols.api.Request;
 import org.apache.james.protocols.api.Response;
 import org.apache.james.protocols.api.handler.CommandHandler;
@@ -39,17 +39,17 @@ import org.apache.james.protocols.pop3.POP3Session;
 public class UserCmdHandler implements CommandHandler<POP3Session>, CapaCapability {
 
     private static final Collection<String> COMMANDS = Collections.unmodifiableCollection(Arrays.asList("USER"));
-    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList("USER")));
+    private static final Set<String> CAPS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList("USER")));
 
-    @Override
-    public void init(Configuration config) throws ConfigurationException {
-
-    }
-
-    @Override
-    public void destroy() {
-
-    }
+    @Override
+    public void init(Configuration config) throws ConfigurationException {
+
+    }
+
+    @Override
+    public void destroy() {
+
+    }
 
     /**
      * Handler method called upon receipt of a USER command. Reads in the user

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractPOP3ServerTest.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractPOP3ServerTest.java b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractPOP3ServerTest.java
index edbf803..1b6098d 100644
--- a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractPOP3ServerTest.java
+++ b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/AbstractPOP3ServerTest.java
@@ -512,7 +512,7 @@ public abstract class AbstractPOP3ServerTest {
     }
 
     private final class TestApopCmdHandler extends AbstractApopCmdHandler {
-        private final Map<String, Mailbox> mailboxes = new HashMap<String, Mailbox>();
+        private final Map<String, Mailbox> mailboxes = new HashMap<>();
        
         public void add(String username, Mailbox mailbox) {
             mailboxes.put(username, mailbox);

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/MockMailbox.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/MockMailbox.java b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/MockMailbox.java
index 308dac8..2aa8add 100644
--- a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/MockMailbox.java
+++ b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/MockMailbox.java
@@ -36,7 +36,7 @@ import com.github.steveash.guavate.Guavate;
 @SuppressWarnings("deprecation")
 public class MockMailbox extends ImapMailbox {
 
-    private final Map<Long, Message> messages = new HashMap<Long, Message>();
+    private final Map<Long, Message> messages = new HashMap<>();
     private final String identifier;
 
     public MockMailbox(String identifier, Message... messages) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/TestPassCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/TestPassCmdHandler.java b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/TestPassCmdHandler.java
index c208ef4..241286e 100644
--- a/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/TestPassCmdHandler.java
+++ b/protocols/pop3/src/test/java/org/apache/james/protocols/pop3/utils/TestPassCmdHandler.java
@@ -26,7 +26,7 @@ import org.apache.james.protocols.pop3.core.AbstractPassCmdHandler;
 import org.apache.james.protocols.pop3.mailbox.Mailbox;
 
 public class TestPassCmdHandler extends AbstractPassCmdHandler {
-    private final Map<String, Mailbox> mailboxes = new HashMap<String, Mailbox>();
+    private final Map<String, Mailbox> mailboxes = new HashMap<>();
    
     public void add(String username, Mailbox mailbox) {
         mailboxes.put(username, mailbox);

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java
index 1fd0d8f..86718d7 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPProtocolHandlerChain.java
@@ -89,7 +89,7 @@ public class SMTPProtocolHandlerChain extends ProtocolHandlerChainImpl {
     }
     
     protected List<ProtocolHandler> initDefaultHandlers() {
-        List<ProtocolHandler> defaultHandlers = new ArrayList<ProtocolHandler>();
+        List<ProtocolHandler> defaultHandlers = new ArrayList<>();
         defaultHandlers.add(new CommandDispatcher<SMTPSession>());
         defaultHandlers.add(new ExpnCmdHandler());
         defaultHandlers.add(new EhloCmdHandler(metricFactory));

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPResponse.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPResponse.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPResponse.java
index 2603be8..5008517 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPResponse.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/SMTPResponse.java
@@ -84,7 +84,7 @@ public class SMTPResponse extends AbstractResponse {
      * @see org.apache.james.protocols.api.Response#getLines()
      */
     public List<CharSequence> getLines() {
-        List<CharSequence> responseList = new ArrayList<CharSequence>();
+        List<CharSequence> responseList = new ArrayList<>();
 
         for (int k = 0; k < lines.size(); k++) {
             StringBuilder respBuff = new StringBuilder(256);

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
index af85d91..624a659 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractAddHeadersFilter.java
@@ -103,7 +103,7 @@ public abstract class AbstractAddHeadersFilter extends SeparatingDataLineFilter{
         public static final String MULTI_LINE_PREFIX = "          ";
         
         public final String name;
-        public final List<String> values = new ArrayList<String>();
+        public final List<String> values = new ArrayList<>();
                 
         public Header(String name, String value) {
             this.name = name;

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
index f2c52ae..a935097 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/AbstractHookableCmdHandler.java
@@ -260,7 +260,7 @@ public abstract class AbstractHookableCmdHandler<Hook extends org.apache.james.p
      * @see org.apache.james.protocols.api.handler.ExtensibleHandler#getMarkerInterfaces()
      */
     public List<Class<?>> getMarkerInterfaces() {
-        List<Class<?>> classes = new ArrayList<Class<?>>(2);
+        List<Class<?>> classes = new ArrayList<>(2);
         classes.add(getHookInterface());
         classes.add(HookResultHook.class);
         return classes;

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
index c68be56..ff63c26 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataCmdHandler.java
@@ -165,7 +165,7 @@ public class DataCmdHandler implements CommandHandler<SMTPSession>, ExtensibleHa
      */
     @SuppressWarnings("unchecked")
     protected Response doDATA(SMTPSession session, String argument) {
-        MailEnvelope env = createEnvelope(session, (MailAddress) session.getAttachment(SMTPSession.SENDER,ProtocolSession.State.Transaction), new ArrayList<MailAddress>((Collection<MailAddress>)session.getAttachment(SMTPSession.RCPT_LIST,ProtocolSession.State.Transaction)));
+        MailEnvelope env = createEnvelope(session, (MailAddress) session.getAttachment(SMTPSession.SENDER,ProtocolSession.State.Transaction), new ArrayList<>((Collection<MailAddress>) session.getAttachment(SMTPSession.RCPT_LIST, ProtocolSession.State.Transaction)));
         session.setAttachment(MAILENV, env,ProtocolSession.State.Transaction);
         session.pushLineHandler(lineHandler);
         

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java
index e5f342b..6f29ae6 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/DataLineMessageHookHandler.java
@@ -182,7 +182,7 @@ public class DataLineMessageHookHandler implements DataLineFilter, ExtensibleHan
      * @see org.apache.james.protocols.api.handler.ExtensibleHandler#getMarkerInterfaces()
      */
     public List<Class<?>> getMarkerInterfaces() {
-        List<Class<?>> classes = new LinkedList<Class<?>>();
+        List<Class<?>> classes = new LinkedList<>();
         classes.add(MessageHook.class);
         classes.add(HookResultHook.class);
         return classes;

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java
index c2bc110..b68897e 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/MailCmdHandler.java
@@ -310,7 +310,7 @@ public class MailCmdHandler extends AbstractHookableCmdHandler<MailHook> {
     @SuppressWarnings({ "unchecked", "rawtypes" })
     public void wireExtensions(Class interfaceName, List extension) {
         if (MailParametersHook.class.equals(interfaceName)) {
-            this.paramHooks = new HashMap<String, MailParametersHook>();
+            this.paramHooks = new HashMap<>();
             for (MailParametersHook hook : (Iterable<MailParametersHook>) extension) {
                 String[] params = hook.getMailParamNames();
                 for (String param : params) {

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java
index 4433b03..5109e5d 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/RcptCmdHandler.java
@@ -89,7 +89,7 @@ public class RcptCmdHandler extends AbstractHookableCmdHandler<RcptHook> impleme
         Collection<MailAddress> rcptColl = (Collection<MailAddress>) session.getAttachment(
                 SMTPSession.RCPT_LIST, State.Transaction);
         if (rcptColl == null) {
-            rcptColl = new ArrayList<MailAddress>();
+            rcptColl = new ArrayList<>();
         }
         MailAddress recipientAddress = (MailAddress) session.getAttachment(
                 CURRENT_RECIPIENT, State.Transaction);

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
index ad5b68c..9ebf858 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/esmtp/AuthCmdHandler.java
@@ -520,7 +520,7 @@ public class AuthCmdHandler
      * @see org.apache.james.protocols.api.handler.ExtensibleHandler#getMarkerInterfaces()
      */
     public List<Class<?>> getMarkerInterfaces() {
-        List<Class<?>> classes = new ArrayList<Class<?>>(1);
+        List<Class<?>> classes = new ArrayList<>(1);
         classes.add(AuthHook.class);
         return classes;
     }

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/SpamTrapHandler.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/SpamTrapHandler.java b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/SpamTrapHandler.java
index 502da8a..7663d6b 100644
--- a/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/SpamTrapHandler.java
+++ b/protocols/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/SpamTrapHandler.java
@@ -40,9 +40,9 @@ import org.apache.james.protocols.smtp.hook.RcptHook;
 public class SpamTrapHandler implements RcptHook {
 
     /** Map which hold blockedIps and blockTime in memory */
-    private final Map<String,Long> blockedIps = new HashMap<String,Long>();
+    private final Map<String,Long> blockedIps = new HashMap<>();
     
-    private Collection<String> spamTrapRecips = new ArrayList<String>();
+    private Collection<String> spamTrapRecips = new ArrayList<>();
     
     /** Default blocktime 12 hours */
     protected long blockTime = 4320000;

http://git-wip-us.apache.org/repos/asf/james-project/blob/03b574c9/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandlerTest.java
----------------------------------------------------------------------
diff --git a/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandlerTest.java b/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandlerTest.java
index 9ed65c1..25ddd96 100644
--- a/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandlerTest.java
+++ b/protocols/smtp/src/test/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandlerTest.java
@@ -95,7 +95,7 @@ public class DNSRBLHandlerTest {
 
             @Override
             protected Collection<String> resolveTXTRecords(String hostname) {
-                List<String> res = new ArrayList<String>();
+                List<String> res = new ArrayList<>();
                 if (hostname == null) {
                     return res;
                 }
@@ -115,8 +115,8 @@ public class DNSRBLHandlerTest {
      */
     private void setupMockedSMTPSession(MailAddress rcpt) {
         mockedSMTPSession = new BaseFakeSMTPSession() {
-            HashMap<String,Object> sessionState = new HashMap<String,Object>();
-            HashMap<String,Object> connectionState = new HashMap<String,Object>();
+            HashMap<String,Object> sessionState = new HashMap<>();
+            HashMap<String,Object> connectionState = new HashMap<>();
             
             @Override
             public InetSocketAddress getRemoteAddress() {


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message