james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [2/6] james-project git commit: Fix eclipse warnings
Date Thu, 01 Feb 2018 02:07:32 GMT
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/f7db5863
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/f7db5863
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/f7db5863

Branch: refs/heads/master
Commit: f7db5863c979c350d3524b558f9d5cc8d7be7e2b
Parents: 7aa3aec
Author: Raphael Ouazana <raphael.ouazana@linagora.com>
Authored: Tue Jan 30 15:43:43 2018 +0100
Committer: benwa <btellier@linagora.com>
Committed: Thu Feb 1 09:05:14 2018 +0700

----------------------------------------------------------------------
 .../mailrepository/jcr/JCRMailRepository.java   | 10 ++--------
 .../impl/JamesMailetContext.java                |  8 +++++---
 .../remote/delivery/RemoteDeliveryTest.java     |  1 -
 .../apache/james/smtpserver/SMTPServerTest.java |  1 -
 .../webadmin/routes/MailQueueRoutesTest.java    | 20 ++++++++++----------
 5 files changed, 17 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/f7db5863/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
----------------------------------------------------------------------
diff --git a/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
b/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
index 3fd5754..0b36906 100644
--- a/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
+++ b/server/data/data-jcr/src/main/java/org/apache/james/mailrepository/jcr/JCRMailRepository.java
@@ -128,7 +128,6 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
             try {
                 Collection<String> keys = new ArrayList<>();
                 QueryManager manager = session.getWorkspace().getQueryManager();
-                @SuppressWarnings("deprecation")
                 Query query = manager.createQuery("/jcr:root/" + MAIL_PATH + "//element(*,james:mail)",
Query.XPATH);
                 NodeIterator iterator = query.execute().getNodes();
                 while (iterator.hasNext()) {
@@ -150,7 +149,6 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
             try {
                 String name = toSafeName(key);
                 QueryManager manager = session.getWorkspace().getQueryManager();
-                @SuppressWarnings("deprecation")
                 Query query = manager.createQuery("/jcr:root/" + MAIL_PATH + "//element("
+ name + ",james:mail)", Query.XPATH);
                 NodeIterator iterator = query.execute().getNodes();
                 if (iterator.hasNext()) {
@@ -493,7 +491,7 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
             node = node.getProperty("jcr:content").getNode();
         }
 
-        try (@SuppressWarnings("deprecation") InputStream stream = node.getProperty("jcr:data").getStream())
{
+        try (InputStream stream = node.getProperty("jcr:data").getStream()) {
             Properties properties = System.getProperties();
             return new MimeMessage(javax.mail.Session.getDefaultInstance(properties), stream);
         }
@@ -514,7 +512,6 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
      * @throws IOException
      *             if an IO error occurs
      */
-    @SuppressWarnings("deprecation")
     private void setMessage(Node node, final MimeMessage message) throws RepositoryException,
IOException {
         try {
             node = node.getNode("jcr:content");
@@ -554,7 +551,7 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
             Property property = iterator.nextProperty();
             String name = Text.unescapeIllegalJcrChars(property.getName().substring("jamesattr:".length()));
             if (property.getType() == PropertyType.BINARY) {
-                try (@SuppressWarnings("deprecation") InputStream input = property.getStream())
{
+                try (InputStream input = property.getStream()) {
                     ObjectInputStream stream = new ObjectInputStream(input);
                     mail.setAttribute(name, (Serializable) stream.readObject());
                 } catch (ClassNotFoundException e) {
@@ -578,7 +575,6 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
      * @throws IOException
      *             if an IO error occurs
      */
-    @SuppressWarnings("deprecation")
     private void setAttributes(Node node, Mail mail) throws RepositoryException, IOException
{
         Iterator<String> iterator = mail.getAttributeNames();
         while (iterator.hasNext()) {
@@ -604,7 +600,6 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
             try {
                 String name = ISO9075.encode(Text.escapeIllegalJcrChars(key));
                 QueryManager manager = session.getWorkspace().getQueryManager();
-                @SuppressWarnings("deprecation")
                 Query query = manager.createQuery("/jcr:root/" + MAIL_PATH + "//element("
+ name + ",james:mail)", Query.XPATH);
                 NodeIterator nodes = query.execute().getNodes();
                 if (nodes.hasNext()) {
@@ -633,7 +628,6 @@ public class JCRMailRepository extends AbstractMailRepository implements
MailRep
                 final String xpath = "/jcr:root/" + MAIL_PATH + "//element(" + name + ",james:mail)";
 
                 QueryManager manager = session.getWorkspace().getQueryManager();
-                @SuppressWarnings("deprecation")
                 Query query = manager.createQuery(xpath, Query.XPATH);
                 NodeIterator iterator = query.execute().getNodes();
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/f7db5863/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/JamesMailetContext.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/JamesMailetContext.java
b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/JamesMailetContext.java
index dcee0ed..209faa8 100644
--- a/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/JamesMailetContext.java
+++ b/server/mailet/mailetcontainer-camel/src/main/java/org/apache/james/mailetcontainer/impl/JamesMailetContext.java
@@ -53,7 +53,6 @@ import org.apache.james.queue.api.MailQueueFactory;
 import org.apache.james.server.core.MailImpl;
 import org.apache.james.user.api.UsersRepository;
 import org.apache.james.user.api.UsersRepositoryException;
-import org.apache.mailet.HostAddress;
 import org.apache.mailet.LookupException;
 import org.apache.mailet.Mail;
 import org.apache.mailet.MailetContext;
@@ -296,13 +295,14 @@ public class JamesMailetContext implements MailetContext, Configurable
{
      * @since Mailet API v2.2.0a16-unstable
      */
     @Override
-    public Iterator<HostAddress> getSMTPHostAddresses(String domainName) {
+    @Deprecated
+    public Iterator<org.apache.mailet.HostAddress> getSMTPHostAddresses(String domainName)
{
         try {
             return new MXHostAddressIterator(dns.findMXRecords(domainName).iterator(), dns,
false);
         } catch (TemporaryResolutionException e) {
             // TODO: We only do this to not break backward compatiblity. Should
             // fixed later
-            return ImmutableSet.<HostAddress>of().iterator();
+            return ImmutableSet.<org.apache.mailet.HostAddress>of().iterator();
         }
     }
 
@@ -334,6 +334,7 @@ public class JamesMailetContext implements MailetContext, Configurable
{
     }
 
     @Override
+    @Deprecated
     public void log(LogLevel logLevel, String s) {
         switch (logLevel) {
             case INFO:
@@ -351,6 +352,7 @@ public class JamesMailetContext implements MailetContext, Configurable
{
     }
 
     @Override
+    @Deprecated
     public void log(LogLevel logLevel, String s, Throwable throwable) {
         switch (logLevel) {
             case INFO:

http://git-wip-us.apache.org/repos/asf/james-project/blob/f7db5863/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/RemoteDeliveryTest.java
----------------------------------------------------------------------
diff --git a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/RemoteDeliveryTest.java
b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/RemoteDeliveryTest.java
index 79850b0..d9f84fc 100644
--- a/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/RemoteDeliveryTest.java
+++ b/server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/RemoteDeliveryTest.java
@@ -99,7 +99,6 @@ public class RemoteDeliveryTest {
     private ManageableMailQueue mailQueue;
 
     @Before
-    @SuppressWarnings("unchecked")
     public void setUp() {
         MailQueueFactory<ManageableMailQueue> queueFactory = new MemoryMailQueueFactory(new
RawMailQueueItemDecoratorFactory());
         mailQueue = queueFactory.createQueue(RemoteDeliveryConfiguration.OUTGOING);

http://git-wip-us.apache.org/repos/asf/james-project/blob/f7db5863/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java
b/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java
index fd26ff6..35a5ebf 100644
--- a/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java
+++ b/server/protocols/protocols-smtp/src/test/java/org/apache/james/smtpserver/SMTPServerTest.java
@@ -74,7 +74,6 @@ import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.ImmutableList;
 
-@SuppressWarnings("deprecation")
 public class SMTPServerTest {
 
     final class AlterableDNSServer implements DNSService {

http://git-wip-us.apache.org/repos/asf/james-project/blob/f7db5863/server/protocols/webadmin/webadmin-mailqueue/src/test/java/org/apache/james/webadmin/routes/MailQueueRoutesTest.java
----------------------------------------------------------------------
diff --git a/server/protocols/webadmin/webadmin-mailqueue/src/test/java/org/apache/james/webadmin/routes/MailQueueRoutesTest.java
b/server/protocols/webadmin/webadmin-mailqueue/src/test/java/org/apache/james/webadmin/routes/MailQueueRoutesTest.java
index f0f99d6..3a33798 100644
--- a/server/protocols/webadmin/webadmin-mailqueue/src/test/java/org/apache/james/webadmin/routes/MailQueueRoutesTest.java
+++ b/server/protocols/webadmin/webadmin-mailqueue/src/test/java/org/apache/james/webadmin/routes/MailQueueRoutesTest.java
@@ -402,7 +402,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryShouldReturnNoContent() throws Exception {
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .queryParam("delayed", "true")
@@ -426,7 +426,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryRequiresDelayedParameter() throws Exception {
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .body("{\"delayed\": \"false\"}")
@@ -438,7 +438,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryShouldRejectFalseDelayedParam() throws Exception
{
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .queryParam("delayed", "false")
@@ -451,7 +451,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryShouldRejectNonBooleanDelayedParam() throws Exception
{
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .queryParam("delayed", "wrong")
@@ -464,7 +464,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryShouldRejectRequestWithoutBody() throws Exception
{
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .queryParam("delayed", "true")
@@ -543,7 +543,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryShouldRejectRequestWithoutDelayedParameter() throws
Exception {
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .queryParam("delayed", "true")
@@ -556,7 +556,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryShouldAcceptRequestWithUnknownFields() throws
Exception {
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .queryParam("delayed", "true")
@@ -572,7 +572,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryShouldRejectMalformedJsonPayload() throws Exception
{
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .queryParam("delayed", "true")
@@ -585,7 +585,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryShouldRejectTrueDelayedAttribute() throws Exception
{
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .queryParam("delayed", "false")
@@ -610,7 +610,7 @@ public class MailQueueRoutesTest {
 
     @Test
     public void forcingDelayedMailsDeliveryShouldRejectStringDelayedAttribute() throws Exception
{
-        MemoryMailQueue queue = mailQueueFactory.createQueue(FIRST_QUEUE);
+        mailQueueFactory.createQueue(FIRST_QUEUE);
 
         given()
             .queryParam("delayed", "false")


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