From a8f15ec6be3dbed123ce7982cd20299069007cc0 Mon Sep 17 00:00:00 2001 From: delvh Date: Sat, 7 Mar 2020 22:04:02 +0100 Subject: [PATCH] Changed compiler compliance to 11, modularized all packages (#29) * added package- and module-info.java, changed JRE from 8 to 11 * moved ObjectProcessor into the processors package Co-authored-by: CyB3RC0nN0R --- .classpath | 64 +++++++++---------- .github/workflows/maven.yml | 4 +- .settings/org.eclipse.jdt.core.prefs | 8 +-- ....eclipse.wst.common.project.facet.core.xml | 2 +- pom.xml | 21 ++++-- .../java/envoy/server/data/package-info.java | 9 +++ .../server/net/ObjectMessageProcessor.java | 2 +- .../java/envoy/server/net/package-info.java | 9 +++ src/main/java/envoy/server/package-info.java | 9 +++ .../processors/ContactOperationProcessor.java | 1 - .../ContactsRequestEventProcessor.java | 1 - .../IdGeneratorRequestProcessor.java | 1 - .../processors/LoginCredentialProcessor.java | 1 - .../server/processors/MessageProcessor.java | 1 - .../MessageStatusChangeProcessor.java | 1 - .../{ => processors}/ObjectProcessor.java | 2 +- .../processors/UserStatusChangeProcessor.java | 1 - .../envoy/server/processors/package-info.java | 10 +++ src/main/java/module-info.java | 15 +++++ 19 files changed, 108 insertions(+), 54 deletions(-) create mode 100644 src/main/java/envoy/server/data/package-info.java create mode 100644 src/main/java/envoy/server/net/package-info.java create mode 100644 src/main/java/envoy/server/package-info.java rename src/main/java/envoy/server/{ => processors}/ObjectProcessor.java (96%) create mode 100644 src/main/java/envoy/server/processors/package-info.java create mode 100644 src/main/java/module-info.java diff --git a/.classpath b/.classpath index fab7589..05e358d 100644 --- a/.classpath +++ b/.classpath @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 91106d3..da5f736 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -9,9 +9,9 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up JDK 1.8 + - name: Set up JDK 11 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 11 - name: Build with Maven run: mvn -B package --file pom.xml diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 8ded9c8..5be8ad6 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -9,9 +9,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.compliance=11 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -72,7 +72,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warn org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled @@ -112,4 +112,4 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.source=11 diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index 90f3be6..2fcb919 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,5 +1,5 @@ - + diff --git a/pom.xml b/pom.xml index 22bcff3..edb27fa 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ informatik-ag-ngl envoy-server-standalone - 0.1-alpha + 0.1-beta Envoy Server https://github.com/informatik-ag-ngl/envoy-server-standalone @@ -13,8 +13,8 @@ UTF-8 UTF-8 - 1.8 - 1.8 + 11 + 11 @@ -28,12 +28,12 @@ com.github.informatik-ag-ngl envoy-common - v0.2-alpha + develop-SNAPSHOT com.github.informatik-ag-ngl java-nio-server - v0.1-alpha + master-SNAPSHOT org.hibernate @@ -54,11 +54,20 @@ src/main/resources + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + + org.apache.maven.plugins maven-assembly-plugin - 2.4.1 + 3.2.0 package diff --git a/src/main/java/envoy/server/data/package-info.java b/src/main/java/envoy/server/data/package-info.java new file mode 100644 index 0000000..81b16a3 --- /dev/null +++ b/src/main/java/envoy/server/data/package-info.java @@ -0,0 +1,9 @@ +/** + * This package contains classes related to persistence. + * + * @author Kai S. K. Engelbart + * @author Leon Hofmeister + * @author Maximilian Käfer + * @since Envoy v0.1-alpha + */ +package envoy.server.data; \ No newline at end of file diff --git a/src/main/java/envoy/server/net/ObjectMessageProcessor.java b/src/main/java/envoy/server/net/ObjectMessageProcessor.java index 346e253..5f0d098 100644 --- a/src/main/java/envoy/server/net/ObjectMessageProcessor.java +++ b/src/main/java/envoy/server/net/ObjectMessageProcessor.java @@ -9,7 +9,7 @@ import com.jenkov.nioserver.IMessageProcessor; import com.jenkov.nioserver.Message; import com.jenkov.nioserver.WriteProxy; -import envoy.server.ObjectProcessor; +import envoy.server.processors.ObjectProcessor; /** * Handles incoming objects.
diff --git a/src/main/java/envoy/server/net/package-info.java b/src/main/java/envoy/server/net/package-info.java new file mode 100644 index 0000000..0c1e178 --- /dev/null +++ b/src/main/java/envoy/server/net/package-info.java @@ -0,0 +1,9 @@ +/** + * This package contains all classes related to client connection management. + * + * @author Kai S. K. Engelbart + * @author Leon Hofmeister + * @author Maximilian Käfer + * @since Envoy v0.1-alpha + */ +package envoy.server.net; \ No newline at end of file diff --git a/src/main/java/envoy/server/package-info.java b/src/main/java/envoy/server/package-info.java new file mode 100644 index 0000000..7297478 --- /dev/null +++ b/src/main/java/envoy/server/package-info.java @@ -0,0 +1,9 @@ +/** + * This package contains the class that manages application startup. + * + * @author Kai S. K. Engelbart + * @author Leon Hofmeister + * @author Maximilian Käfer + * @since Envoy Server Standalone v0.1-alpha + */ +package envoy.server; \ No newline at end of file diff --git a/src/main/java/envoy/server/processors/ContactOperationProcessor.java b/src/main/java/envoy/server/processors/ContactOperationProcessor.java index 5b0e079..3c6c6d8 100644 --- a/src/main/java/envoy/server/processors/ContactOperationProcessor.java +++ b/src/main/java/envoy/server/processors/ContactOperationProcessor.java @@ -5,7 +5,6 @@ import java.util.Arrays; import envoy.data.Contacts; import envoy.event.ContactOperationEvent; -import envoy.server.ObjectProcessor; import envoy.server.data.PersistenceManager; import envoy.server.net.ConnectionManager; import envoy.server.net.ObjectWriteProxy; diff --git a/src/main/java/envoy/server/processors/ContactsRequestEventProcessor.java b/src/main/java/envoy/server/processors/ContactsRequestEventProcessor.java index f00492c..6ed4746 100644 --- a/src/main/java/envoy/server/processors/ContactsRequestEventProcessor.java +++ b/src/main/java/envoy/server/processors/ContactsRequestEventProcessor.java @@ -6,7 +6,6 @@ import java.util.stream.Collectors; import envoy.data.Contacts; import envoy.event.ContactSearchRequest; import envoy.event.ContactSearchResult; -import envoy.server.ObjectProcessor; import envoy.server.data.PersistenceManager; import envoy.server.data.User; import envoy.server.net.ConnectionManager; diff --git a/src/main/java/envoy/server/processors/IdGeneratorRequestProcessor.java b/src/main/java/envoy/server/processors/IdGeneratorRequestProcessor.java index b8e0cda..52aa3ca 100644 --- a/src/main/java/envoy/server/processors/IdGeneratorRequestProcessor.java +++ b/src/main/java/envoy/server/processors/IdGeneratorRequestProcessor.java @@ -4,7 +4,6 @@ import java.io.IOException; import envoy.data.IdGenerator; import envoy.event.IdGeneratorRequest; -import envoy.server.ObjectProcessor; import envoy.server.data.ConfigItem; import envoy.server.data.PersistenceManager; import envoy.server.net.ObjectWriteProxy; diff --git a/src/main/java/envoy/server/processors/LoginCredentialProcessor.java b/src/main/java/envoy/server/processors/LoginCredentialProcessor.java index 90cd09a..1bc736f 100644 --- a/src/main/java/envoy/server/processors/LoginCredentialProcessor.java +++ b/src/main/java/envoy/server/processors/LoginCredentialProcessor.java @@ -12,7 +12,6 @@ import envoy.data.Message.MessageStatus; import envoy.data.User; import envoy.data.User.UserStatus; import envoy.event.HandshakeRejectionEvent; -import envoy.server.ObjectProcessor; import envoy.server.data.Message; import envoy.server.data.PersistenceManager; import envoy.server.net.ConnectionManager; diff --git a/src/main/java/envoy/server/processors/MessageProcessor.java b/src/main/java/envoy/server/processors/MessageProcessor.java index 93211f1..1a62829 100644 --- a/src/main/java/envoy/server/processors/MessageProcessor.java +++ b/src/main/java/envoy/server/processors/MessageProcessor.java @@ -5,7 +5,6 @@ import java.util.Date; import envoy.data.Message; import envoy.event.MessageStatusChangeEvent; -import envoy.server.ObjectProcessor; import envoy.server.data.PersistenceManager; import envoy.server.net.ConnectionManager; import envoy.server.net.ObjectWriteProxy; diff --git a/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java b/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java index ad52145..912fc67 100644 --- a/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java +++ b/src/main/java/envoy/server/processors/MessageStatusChangeProcessor.java @@ -5,7 +5,6 @@ import java.io.IOException; import envoy.data.Message.MessageStatus; import envoy.event.MessageStatusChangeEvent; import envoy.exception.EnvoyException; -import envoy.server.ObjectProcessor; import envoy.server.data.PersistenceManager; import envoy.server.net.ConnectionManager; import envoy.server.net.ObjectWriteProxy; diff --git a/src/main/java/envoy/server/ObjectProcessor.java b/src/main/java/envoy/server/processors/ObjectProcessor.java similarity index 96% rename from src/main/java/envoy/server/ObjectProcessor.java rename to src/main/java/envoy/server/processors/ObjectProcessor.java index 6828598..00eabe9 100644 --- a/src/main/java/envoy/server/ObjectProcessor.java +++ b/src/main/java/envoy/server/processors/ObjectProcessor.java @@ -1,4 +1,4 @@ -package envoy.server; +package envoy.server.processors; import java.io.IOException; diff --git a/src/main/java/envoy/server/processors/UserStatusChangeProcessor.java b/src/main/java/envoy/server/processors/UserStatusChangeProcessor.java index c720191..5660c09 100644 --- a/src/main/java/envoy/server/processors/UserStatusChangeProcessor.java +++ b/src/main/java/envoy/server/processors/UserStatusChangeProcessor.java @@ -4,7 +4,6 @@ import java.io.IOException; import envoy.data.User.UserStatus; import envoy.event.UserStatusChangeEvent; -import envoy.server.ObjectProcessor; import envoy.server.data.PersistenceManager; import envoy.server.data.User; import envoy.server.net.ConnectionManager; diff --git a/src/main/java/envoy/server/processors/package-info.java b/src/main/java/envoy/server/processors/package-info.java new file mode 100644 index 0000000..02a68a0 --- /dev/null +++ b/src/main/java/envoy/server/processors/package-info.java @@ -0,0 +1,10 @@ +/** + * This package contains all classes that process data received from client + * connections. + * + * @author Kai S. K. Engelbart + * @author Leon Hofmeister + * @author Maximilian Käfer + * @since Envoy v0.1-alpha + */ +package envoy.server.processors; \ No newline at end of file diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java new file mode 100644 index 0000000..08d68c0 --- /dev/null +++ b/src/main/java/module-info.java @@ -0,0 +1,15 @@ +/** + * This module contains all classes defining the server application of the Envoy + * project. + * + * @author Kai S. K. Engelbart + * @author Leon Hofmeister + * @author Maximilian Käfer + * @since Envoy Server Standalone v0.1-beta + */ +module envoy.server { + + requires transitive envoy.common; + requires transitive java.nio.server; + requires transitive java.persistence; +}