You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2018/05/15 09:22:50 UTC
[4/4] james-project git commit: MAILBOX-331 Fix Eclipse warnings
MAILBOX-331 Fix Eclipse warnings
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/c2b85a00
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/c2b85a00
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/c2b85a00
Branch: refs/heads/master
Commit: c2b85a004115d4249825a731a92a313bcecc7ced
Parents: 6d67d2f
Author: Antoine Duprat <ad...@linagora.com>
Authored: Mon May 14 12:24:13 2018 +0200
Committer: benwa <bt...@linagora.com>
Committed: Tue May 15 16:21:41 2018 +0700
----------------------------------------------------------------------
.../test/java/org/apache/james/mailbox/MailboxManagerTest.java | 5 -----
.../java/org/apache/james/eventsourcing/CommandDispatcher.java | 4 +++-
.../org/apache/james/eventsourcing/EventSourcingSystem.java | 2 +-
.../org/apache/james/mailbox/quota/model/QuotaThresholds.java | 2 +-
.../org/apache/james/eventsourcing/EventSourcingSystemTest.java | 4 ++--
5 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/james-project/blob/c2b85a00/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
----------------------------------------------------------------------
diff --git a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
index cda734b..b729b64 100644
--- a/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
+++ b/mailbox/api/src/test/java/org/apache/james/mailbox/MailboxManagerTest.java
@@ -23,7 +23,6 @@ import static org.assertj.core.api.Assertions.assertThatCode;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
-import java.time.Instant;
import java.util.List;
import java.util.Optional;
@@ -44,12 +43,8 @@ import org.apache.james.mailbox.model.MailboxPath;
import org.apache.james.mailbox.model.MessageId;
import org.apache.james.mailbox.model.MessageRange;
import org.apache.james.mailbox.model.MultimailboxesSearchQuery;
-import org.apache.james.mailbox.model.Quota;
-import org.apache.james.mailbox.model.QuotaRoot;
import org.apache.james.mailbox.model.SearchQuery;
import org.apache.james.mailbox.model.search.MailboxQuery;
-import org.apache.james.mailbox.quota.QuotaCount;
-import org.apache.james.mailbox.quota.QuotaSize;
import org.apache.james.mailbox.util.EventCollector;
import org.apache.james.mime4j.dom.Message;
import org.assertj.core.api.JUnitSoftAssertions;
http://git-wip-us.apache.org/repos/asf/james-project/blob/c2b85a00/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/CommandDispatcher.java
----------------------------------------------------------------------
diff --git a/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/CommandDispatcher.java b/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/CommandDispatcher.java
index ef5bfd4..de8b63f 100644
--- a/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/CommandDispatcher.java
+++ b/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/CommandDispatcher.java
@@ -78,10 +78,11 @@ public class CommandDispatcher {
}
private final EventBus eventBus;
+ @SuppressWarnings("rawtypes")
private final Map<Class, CommandHandler> handlers;
@Inject
- public CommandDispatcher(EventBus eventBus, Collection<CommandHandler> handlers) {
+ public CommandDispatcher(EventBus eventBus, Collection<CommandHandler<?>> handlers) {
this.eventBus = eventBus;
this.handlers = handlers.stream()
.collect(Guavate.toImmutableMap(CommandHandler::handledClass, handler -> handler));
@@ -99,6 +100,7 @@ public class CommandDispatcher {
.findFirst();
}
+ @SuppressWarnings("unchecked")
private boolean tryDispatch(Command c) {
try {
List<Event> events =
http://git-wip-us.apache.org/repos/asf/james-project/blob/c2b85a00/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventSourcingSystem.java
----------------------------------------------------------------------
diff --git a/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventSourcingSystem.java b/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventSourcingSystem.java
index e627224..22a2788 100644
--- a/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventSourcingSystem.java
+++ b/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/eventsourcing/EventSourcingSystem.java
@@ -25,7 +25,7 @@ public class EventSourcingSystem {
private final EventBus eventBus;
private final CommandDispatcher commandDispatcher;
- public EventSourcingSystem(Set<CommandDispatcher.CommandHandler> handlers, Set<Subscriber> subscribers, EventStore eventStore) {
+ public EventSourcingSystem(Set<CommandDispatcher.CommandHandler<?>> handlers, Set<Subscriber> subscribers, EventStore eventStore) {
this.eventBus = new EventBus(eventStore, subscribers);
this.commandDispatcher = new CommandDispatcher(eventBus, handlers);
}
http://git-wip-us.apache.org/repos/asf/james-project/blob/c2b85a00/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/mailbox/quota/model/QuotaThresholds.java
----------------------------------------------------------------------
diff --git a/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/mailbox/quota/model/QuotaThresholds.java b/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/mailbox/quota/model/QuotaThresholds.java
index 7a7cff4..042799e 100644
--- a/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/mailbox/quota/model/QuotaThresholds.java
+++ b/mailbox/plugin/quota-mailing/src/main/java/org/apache/james/mailbox/quota/model/QuotaThresholds.java
@@ -42,7 +42,7 @@ public class QuotaThresholds {
.collect(Guavate.toImmutableList());
}
- public QuotaThreshold highestExceededThreshold(Quota quota) {
+ public QuotaThreshold highestExceededThreshold(Quota<?> quota) {
return quotaThresholds.stream()
.filter(quotaLevel -> quotaLevel.isExceeded(quota))
.findFirst()
http://git-wip-us.apache.org/repos/asf/james-project/blob/c2b85a00/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java
----------------------------------------------------------------------
diff --git a/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java b/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java
index f0feab2..19c3925 100644
--- a/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java
+++ b/mailbox/plugin/quota-mailing/src/test/java/org/apache/james/eventsourcing/EventSourcingSystemTest.java
@@ -22,7 +22,7 @@ package org.apache.james.eventsourcing;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyList;
+import static org.mockito.Matchers.anyListOf;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -87,7 +87,7 @@ public interface EventSourcingSystemTest {
@Test
default void throwingStoreShouldNotLeadToPusblishing() {
EventStore eventStore = mock(EventStore.class);
- doThrow(new RuntimeException()).when(eventStore).appendAll(anyList());
+ doThrow(new RuntimeException()).when(eventStore).appendAll(anyListOf(Event.class));
when(eventStore.getEventsOfAggregate(any())).thenReturn(EventStore.History.empty());
DataCollectorSubscriber subscriber = new DataCollectorSubscriber();
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org