james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject svn commit: r1726766 - in /james/project/trunk: mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/user/ server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/ server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/...
Date Tue, 26 Jan 2016 10:43:10 GMT
Author: matthieu
Date: Tue Jan 26 10:43:10 2016
New Revision: 1726766

URL: http://svn.apache.org/viewvc?rev=1726766&view=rev
Log:
JAMES-1669 use diamond operator when possible

Modified:
    james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapperTest.java
    james/project/trunk/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java
    james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
    james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java

Modified: james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapperTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapperTest.java?rev=1726766&r1=1726765&r2=1726766&view=diff
==============================================================================
--- james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapperTest.java
(original)
+++ james/project/trunk/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/user/CassandraSubscriptionMapperTest.java
Tue Jan 26 10:43:10 2016
@@ -66,10 +66,10 @@ public class CassandraSubscriptionMapper
         LOG.info("Creating subscription list");
         SimpleSubscription subscription;
         String user, mailbox;
-        subscriptionList = new HashMap<String, List<SimpleSubscription>>();
+        subscriptionList = new HashMap<>();
         for (int i = 0; i < USERS; i++) {
             user = "user" + i;
-            final List<SimpleSubscription> mailboxes = new ArrayList<SimpleSubscription>();
+            final List<SimpleSubscription> mailboxes = new ArrayList<>();
             subscriptionList.put(user, mailboxes);
 
             for (int j = 0; j < MAILBOX_NO; j++) {

Modified: james/project/trunk/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java?rev=1726766&r1=1726765&r2=1726766&view=diff
==============================================================================
--- james/project/trunk/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java
(original)
+++ james/project/trunk/server/protocols/jmap/src/main/java/org/apache/james/jmap/utils/SortToComparatorConvertor.java
Tue Jan 26 10:43:10 2016
@@ -47,7 +47,7 @@ public class SortToComparatorConvertor {
     public static <M extends MailboxMessage<Id>, Id extends MailboxId> Comparator<M>
comparatorFor(List<String> sort) {
         return sort.stream()
             .map(SortToComparatorConvertor::<M, Id> comparatorForField)
-            .reduce(new EmptyComparator<M>(), (x, y) -> x.thenComparing(y));
+            .reduce(new EmptyComparator<>(), (x, y) -> x.thenComparing(y));
     }
 
     @SuppressWarnings("unchecked")

Modified: james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java?rev=1726766&r1=1726765&r2=1726766&view=diff
==============================================================================
--- james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
(original)
+++ james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/methods/GetMailboxesMethodTest.java
Tue Jan 26 10:43:10 2016
@@ -73,7 +73,7 @@ public class GetMailboxesMethodTest {
         mailboxMapperFactory = new InMemoryMailboxSessionMapperFactory();
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
-        mailboxManager = new StoreMailboxManager<InMemoryId>(mailboxMapperFactory,
new MockAuthenticator(), aclResolver, groupMembershipResolver);
+        mailboxManager = new StoreMailboxManager<>(mailboxMapperFactory, new MockAuthenticator(),
aclResolver, groupMembershipResolver);
         mailboxManager.init();
 
         getMailboxesMethod = new GetMailboxesMethod<>(mailboxManager, mailboxMapperFactory);

Modified: james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java?rev=1726766&r1=1726765&r2=1726766&view=diff
==============================================================================
--- james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java
(original)
+++ james/project/trunk/server/protocols/jmap/src/test/java/org/apache/james/jmap/utils/SortToComparatorConvertorTest.java
Tue Jan 26 10:43:10 2016
@@ -48,9 +48,9 @@ public class SortToComparatorConvertorTe
     @SuppressWarnings("unchecked")
     public void setup() {
         LocalDate date = LocalDate.now();
-        firstMessage = new SimpleMailboxMessage<TestId>(new Date(date.toEpochDay()),
0, 0, null, new Flags(), new PropertyBuilder(), null);
+        firstMessage = new SimpleMailboxMessage<>(new Date(date.toEpochDay()), 0, 0,
null, new Flags(), new PropertyBuilder(), null);
         firstMessage.setUid(1);
-        secondMessage = new SimpleMailboxMessage<TestId>(new Date(date.plusDays(1).toEpochDay()),
0, 0, null, new Flags(), new PropertyBuilder(), null);
+        secondMessage = new SimpleMailboxMessage<>(new Date(date.plusDays(1).toEpochDay()),
0, 0, null, new Flags(), new PropertyBuilder(), null);
         secondMessage.setUid(2);
         messages = Lists.newArrayList(firstMessage, secondMessage);
     }
@@ -90,7 +90,7 @@ public class SortToComparatorConvertorTe
     @Test
     @SuppressWarnings("unchecked")
     public void comparatorForShouldChainComparatorsWhenOnlyMultipleElementInList() {
-        SimpleMailboxMessage<TestId> thirdMessage = new SimpleMailboxMessage<TestId>(secondMessage.getInternalDate(),
0, 0, null, new Flags(), new PropertyBuilder(), null);
+        SimpleMailboxMessage<TestId> thirdMessage = new SimpleMailboxMessage<>(secondMessage.getInternalDate(),
0, 0, null, new Flags(), new PropertyBuilder(), null);
         thirdMessage.setUid(3);
         messages.add(thirdMessage);
 



---------------------------------------------------------------------
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