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

rouazana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 9c17803dcd1c26fe4c9c09ec97f8c120edc89d44
Author: Matthieu Baechler <[email protected]>
AuthorDate: Thu Jul 25 18:10:20 2019 +0200

    JAMES-2813 fix missing licenses and weird indents
---
 .../migration/CassandraMigrationService.java       |  5 ++++-
 .../migration/CassandraSchemaTransitions.java      | 18 ++++++++++++++++
 .../cassandra/migration/MigrationTask.java         | 25 +++++++++++-----------
 .../cassandra/versions/SchemaTransitionTest.java   | 20 +++++++++++++++--
 .../mail/migration/AttachmentV2Migration.java      |  6 +++---
 5 files changed, 55 insertions(+), 19 deletions(-)

diff --git 
a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/CassandraMigrationService.java
 
b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/CassandraMigrationService.java
index 543ca3f..ec94384 100644
--- 
a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/CassandraMigrationService.java
+++ 
b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/CassandraMigrationService.java
@@ -65,7 +65,10 @@ public class CassandraMigrationService {
     }
 
     private void checkTarget(SchemaVersion target) {
-        
getCurrentVersion().orElse(DEFAULT_VERSION).listTransitionsForTarget(target).forEach(this::checkMigration);
+        getCurrentVersion()
+            .orElse(DEFAULT_VERSION)
+            .listTransitionsForTarget(target)
+            .forEach(this::checkMigration);
     }
 
     private void checkMigration(SchemaTransition transition) {
diff --git 
a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/CassandraSchemaTransitions.java
 
b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/CassandraSchemaTransitions.java
index 6780c9d..e9c3c19 100644
--- 
a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/CassandraSchemaTransitions.java
+++ 
b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/CassandraSchemaTransitions.java
@@ -1,3 +1,21 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
 package org.apache.james.backends.cassandra.migration;
 
 import java.util.Map;
diff --git 
a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/MigrationTask.java
 
b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/MigrationTask.java
index a41d768..16c4d81 100644
--- 
a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/MigrationTask.java
+++ 
b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/MigrationTask.java
@@ -90,9 +90,9 @@ public class MigrationTask implements Task {
     @Override
     public Result run() {
         getCurrentVersion().listTransitionsForTarget(target)
-                .stream()
-                .map(this::migration)
-                .forEach(Throwing.consumer(this::runMigration).sneakyThrow());
+            .stream()
+            .map(this::migration)
+            .forEach(Throwing.consumer(this::runMigration).sneakyThrow());
         return Result.COMPLETED;
     }
 
@@ -102,10 +102,9 @@ public class MigrationTask implements Task {
 
     private Tuple2<SchemaTransition, Migration> migration(SchemaTransition 
transition) {
         return Tuples.of(
-                transition,
-                transitions.findMigration(transition)
-                        .orElseThrow(() -> new MigrationException("unable to 
find a required Migration for transition " + transition)));
-
+            transition,
+            transitions.findMigration(transition)
+                .orElseThrow(() -> new MigrationException("unable to find a 
required Migration for transition " + transition)));
     }
 
     private void runMigration(Tuple2<SchemaTransition, Migration> tuple) 
throws InterruptedException {
@@ -119,12 +118,12 @@ public class MigrationTask implements Task {
         LOGGER.info("Migrating to version {} ", transition.toAsString());
         Migration migration = tuple.getT2();
         migration.asTask().run()
-                .onComplete(
-                        () -> 
schemaVersionDAO.updateVersion(transition.to()).block(),
-                        () -> LOGGER.info("Migrating to version {} done", 
transition.toAsString()))
-                .onFailure(
-                        () -> LOGGER.warn(failureMessage(transition.to())),
-                        () -> throwMigrationException(transition.to()));
+            .onComplete(
+                () -> schemaVersionDAO.updateVersion(transition.to()).block(),
+                () -> LOGGER.info("Migrating to version {} done", 
transition.toAsString()))
+            .onFailure(
+                () -> LOGGER.warn(failureMessage(transition.to())),
+                () -> throwMigrationException(transition.to()));
     }
 
     private void throwMigrationException(SchemaVersion newVersion) {
diff --git 
a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/versions/SchemaTransitionTest.java
 
b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/versions/SchemaTransitionTest.java
index 64defab..795ed94 100644
--- 
a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/versions/SchemaTransitionTest.java
+++ 
b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/versions/SchemaTransitionTest.java
@@ -1,3 +1,21 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
 package org.apache.james.backends.cassandra.versions;
 
 import org.junit.jupiter.api.Test;
@@ -11,6 +29,4 @@ class SchemaTransitionTest {
         EqualsVerifier.forClass(SchemaTransition.class)
                 .verify();
     }
-
-
 }
\ No newline at end of file
diff --git 
a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2Migration.java
 
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2Migration.java
index 856afd0..333224a 100644
--- 
a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2Migration.java
+++ 
b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2Migration.java
@@ -49,9 +49,9 @@ public class AttachmentV2Migration implements Migration {
     @Override
     public void apply() {
         attachmentDAOV1.retrieveAll()
-                .flatMap(this::migrateAttachment)
-                .doOnError(t -> LOGGER.error("Error while performing 
attachmentDAO V2 migration", t))
-                .blockLast();
+            .flatMap(this::migrateAttachment)
+            .doOnError(t -> LOGGER.error("Error while performing attachmentDAO 
V2 migration", t))
+            .blockLast();
     }
 
     private Mono<Void> migrateAttachment(Attachment attachment) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to