You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2019/04/08 08:26:32 UTC

[qpid-broker-j] 02/02: QPID-8294: [Broker-J] Fix code formatting

This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 920db7be6d8248b1662044000a7bf809605ca26c
Author: Alex Rudyy <or...@apache.org>
AuthorDate: Mon Apr 8 09:19:41 2019 +0100

    QPID-8294: [Broker-J] Fix code formatting
---
 .../store/jdbc/AbstractJDBCMessageStore.java       | 29 +++++++++++++---------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/AbstractJDBCMessageStore.java b/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/AbstractJDBCMessageStore.java
index f3ae9ad..171a2f9 100644
--- a/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/AbstractJDBCMessageStore.java
+++ b/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/AbstractJDBCMessageStore.java
@@ -462,28 +462,29 @@ public abstract class AbstractJDBCMessageStore implements MessageStore
 
     void removeMessages(List<Long> messageIds)
     {
-        if(messageIds != null && !messageIds.isEmpty())
+        if (messageIds != null && !messageIds.isEmpty())
         {
-            try(Connection conn = newConnection())
+            try (Connection conn = newConnection())
             {
                 try
                 {
-                    for (int i = 0; i <= messageIds.size() / IN_CLAUSE_MAX_SIZE; i++) {
+                    for (int i = 0; i <= messageIds.size() / IN_CLAUSE_MAX_SIZE; i++)
+                    {
                         List<Long> boundMessageIds = messageIds.stream()
-                                .skip(i * IN_CLAUSE_MAX_SIZE)
-                                .limit(IN_CLAUSE_MAX_SIZE)
-                                .collect(Collectors.toList());
+                                                               .skip(i * IN_CLAUSE_MAX_SIZE)
+                                                               .limit(IN_CLAUSE_MAX_SIZE)
+                                                               .collect(Collectors.toList());
 
                         removeMessagesFromDatabase(conn, boundMessageIds);
                     }
                 }
-                catch(SQLException e)
+                catch (SQLException e)
                 {
                     try
                     {
                         conn.rollback();
                     }
-                    catch(SQLException t)
+                    catch (SQLException t)
                     {
                         // ignore - we are re-throwing underlying exception
                     }
@@ -493,15 +494,19 @@ public abstract class AbstractJDBCMessageStore implements MessageStore
             }
             catch (SQLException e)
             {
-                throw new StoreException("Error removing messages with ids " + messageIds + " from database: " + e.getMessage(), e);
+                throw new StoreException("Error removing messages with ids "
+                                         + messageIds
+                                         + " from database: "
+                                         + e.getMessage(), e);
             }
         }
     }
 
-    void removeMessagesFromDatabase(Connection conn, List<Long> messageIds) throws SQLException {
+    void removeMessagesFromDatabase(Connection conn, List<Long> messageIds) throws SQLException
+    {
         String inpart = messageIds.stream().map(Object::toString).collect(Collectors.joining(", ", "(", ")"));
 
-        try(Statement stmt = conn.createStatement())
+        try (Statement stmt = conn.createStatement())
         {
             int results = stmt.executeUpdate("DELETE FROM " + getMetaDataTableName() + " WHERE message_id IN " + inpart);
             stmt.close();
@@ -515,7 +520,7 @@ public abstract class AbstractJDBCMessageStore implements MessageStore
             getLogger().debug("Deleted metadata for messages {}", messageIds);
         }
 
-        try(Statement stmt = conn.createStatement())
+        try (Statement stmt = conn.createStatement())
         {
             stmt.executeUpdate("DELETE FROM " + getMessageContentTableName() + " WHERE message_id IN " + inpart);
             getLogger().debug("Deleted content for messages {}", messageIds);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org