Changeset 12:8506f7f68274

Updated GPL version
author unexist
date Sat, 03 Apr 2021 16:17:33 +0200
parents 1a7534e691ff
children d014524657e5
files checkstyle/file.header src/main/java/dev/unexist/showcase/todo/adapters/MessageResource.java src/main/java/dev/unexist/showcase/todo/adapters/TodoResource.java src/main/java/dev/unexist/showcase/todo/adapters/cdi/TodoCdiConsumer.java src/main/java/dev/unexist/showcase/todo/adapters/cloudevents/TodoCloudEventConsumer.java src/main/java/dev/unexist/showcase/todo/adapters/cloudevents/TodoCloudEventProducer.java src/main/java/dev/unexist/showcase/todo/adapters/smallrye/TodoSmallryeConsumer.java src/main/java/dev/unexist/showcase/todo/adapters/smallrye/TodoSmallryeProducer.java src/main/java/dev/unexist/showcase/todo/application/RestApplication.java src/main/java/dev/unexist/showcase/todo/domain/todo/DueDate.java src/main/java/dev/unexist/showcase/todo/domain/todo/Todo.java src/main/java/dev/unexist/showcase/todo/domain/todo/TodoBase.java src/main/java/dev/unexist/showcase/todo/domain/todo/TodoRepository.java src/main/java/dev/unexist/showcase/todo/domain/todo/TodoService.java src/main/java/dev/unexist/showcase/todo/infrastructure/serializer/DateSerializer.java src/main/resources/application.properties src/test/java/dev/unexist/showcase/todo/application/TodoResourceTest.java
diffstat 17 files changed, 26 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/checkstyle/file.header	Wed Mar 10 10:35:57 2021 +0100
+++ b/checkstyle/file.header	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
 ^ \* @copyright (\d\d\d\d)(-(\d\d\d\d))? ([^<]*) <([^@]*)@(.*)>$
 ^ \* @version \$Id
 ^ \*$
-^ \* This program can be distributed under the terms of the GNU GPLv2.$
+^ \* This program can be distributed under the terms of the GNU GPLv3.$
 ^ \* See the file LICENSE for details.$
 ^ \*\*/$
 ^$
--- a/src/main/java/dev/unexist/showcase/todo/adapters/MessageResource.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/MessageResource.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/adapters/TodoResource.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/TodoResource.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/adapters/cdi/TodoCdiConsumer.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/cdi/TodoCdiConsumer.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -19,7 +19,7 @@
 import javax.enterprise.context.ApplicationScoped;
 
 @ApplicationScoped
-@KafkaConfig(bootstrapServers ="localhost:9092")
+@KafkaConfig(bootstrapServers = "localhost:9092")
 public class TodoCdiConsumer {
     private static final Logger LOGGER = LoggerFactory.getLogger(TodoCdiConsumer.class);
 
--- a/src/main/java/dev/unexist/showcase/todo/adapters/cloudevents/TodoCloudEventConsumer.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/cloudevents/TodoCloudEventConsumer.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -28,6 +28,7 @@
 @ApplicationScoped
 public class TodoCloudEventConsumer {
     private static final Logger LOGGER = LoggerFactory.getLogger(TodoCloudEventConsumer.class);
+    private static final int POLL_IN_MILLIS = 100;
 
     KafkaConsumer<String, CloudEvent> consumer;
 
@@ -49,7 +50,8 @@
     }
 
     public void receive() {
-        ConsumerRecords<String, CloudEvent> consumerRecords = consumer.poll(Duration.ofMillis(100));
+        ConsumerRecords<String, CloudEvent> consumerRecords = consumer.poll(
+                Duration.ofMillis(POLL_IN_MILLIS));
         consumerRecords.forEach(record -> {
             LOGGER.info("Record key: {}", record.key());
             LOGGER.info("Record value: {}", record.value().toString());
--- a/src/main/java/dev/unexist/showcase/todo/adapters/cloudevents/TodoCloudEventProducer.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/cloudevents/TodoCloudEventProducer.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -70,10 +70,8 @@
 
             LOGGER.info("Record sent to partition {} with offset {}",
                     metadata.partition(), metadata.offset());
-        } catch (InterruptedException|ExecutionException e) {
-            LOGGER.error("Error while trying to send the record");
-
-            e.printStackTrace();
+        } catch (InterruptedException | ExecutionException e) {
+            LOGGER.error("Error while trying to send the record", e);
         }
 
         this.producer.flush();
--- a/src/main/java/dev/unexist/showcase/todo/adapters/smallrye/TodoSmallryeConsumer.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/smallrye/TodoSmallryeConsumer.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/adapters/smallrye/TodoSmallryeProducer.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/adapters/smallrye/TodoSmallryeProducer.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/application/RestApplication.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/application/RestApplication.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/DueDate.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/DueDate.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/Todo.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/Todo.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoBase.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoBase.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -57,7 +57,7 @@
     public void setDueDate(DueDate dueDate) {
         this.dueDate = dueDate;
 
-        if (null != dueDate.getStart() && null != dueDate.getDue()){
+        if (null != dueDate.getStart() && null != dueDate.getDue()) {
             this.done = dueDate.getStart().isBefore(dueDate.getDue());
         }
     }
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoRepository.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoRepository.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
@@ -65,7 +65,7 @@
             this.list.set(todo.getId(), todo);
 
             ret = true;
-        } catch(IndexOutOfBoundsException e) {
+        } catch (IndexOutOfBoundsException e) {
             LOGGER.warn("update: id={} not found", todo.getId());
         }
 
@@ -114,7 +114,7 @@
      *          A {@link Optional} with the result of the lookup
      **/
 
-    public Optional<Todo> findById(int id ) {
+    public Optional<Todo> findById(int id) {
         return this.list.stream()
                 .filter(t -> t.getId() == id)
                 .findFirst();
--- a/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoService.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/domain/todo/TodoService.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2020 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/java/dev/unexist/showcase/todo/infrastructure/serializer/DateSerializer.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/java/dev/unexist/showcase/todo/infrastructure/serializer/DateSerializer.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2021 Christoph Kappel <christoph@unexist.dev>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/
 
--- a/src/main/resources/application.properties	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/main/resources/application.properties	Sat Apr 03 16:17:33 2021 +0200
@@ -13,7 +13,7 @@
 mp.openapi.extensions.smallrye.info.contact.email=christoph@unexist.dev
 mp.openapi.extensions.smallrye.info.contact.name=@hg.author@
 mp.openapi.extensions.smallrye.info.contact.url=https://unexist.dev
-mp.openapi.extensions.smallrye.info.license.name=GPLv2
+mp.openapi.extensions.smallrye.info.license.name=GPLv3
 mp.openapi.extensions.smallrye.info.license.url=https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
 
 
--- a/src/test/java/dev/unexist/showcase/todo/application/TodoResourceTest.java	Wed Mar 10 10:35:57 2021 +0100
+++ b/src/test/java/dev/unexist/showcase/todo/application/TodoResourceTest.java	Sat Apr 03 16:17:33 2021 +0200
@@ -5,7 +5,7 @@
  * @copyright 2019 Christoph Kappel <unexist@subforge.org>
  * @version $Id$
  *
- * This program can be distributed under the terms of the GNU GPLv2.
+ * This program can be distributed under the terms of the GNU GPLv3.
  * See the file LICENSE for details.
  **/