From 7f324090c1ee94046dd3a5b5d382f4732f61bce6 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 26 Jul 2024 13:20:56 +0200 Subject: [PATCH] Add some 'final's --- .../sosengine/base/classes/helpers/EventHelper.java | 2 +- .../base/internal/events/InternalEngineShutdownEvent.java | 2 +- .../base/internal/reflection/ReflectionAccessWidener.java | 2 +- .../base/internal/types/DependencySubsystemVector.java | 2 +- .../sosengine/base/internal/types/QueuedLogMessage.java | 2 +- .../sosengine/base/types/logging/LogIssuer.java | 2 +- .../staropensource/sosengine/base/types/logging/LogRule.java | 2 +- .../java/de/staropensource/sosengine/base/utility/Math.java | 2 +- .../staropensource/sosengine/graphics/glfw/GlfwSubsystem.java | 2 +- .../sosengine/graphics/glfw/callbacks/KeyCallback.java | 2 +- .../graphics/glfw/callbacks/MouseButtonCallback.java | 2 +- .../sosengine/graphics/glfw/classes/WindowCallback.java | 2 +- .../graphics/glfw/exceptions/GlfwInitializationException.java | 2 +- .../graphics/glfw/exceptions/NotOnMainThreadException.java | 2 +- .../glfw/exceptions/WindowCreationFailureException.java | 2 +- .../sosengine/graphics/opengl/OpenGlInternalApi.java | 2 +- .../sosengine/graphics/opengl/classes/OpenGlWindow.java | 2 +- .../de/staropensource/sosengine/graphics/classes/Window.java | 4 ++-- .../sosengine/graphics/events/GraphicsApiErrorEvent.java | 2 +- .../sosengine/graphics/events/GraphicsApiShutdownEvent.java | 2 +- .../sosengine/graphics/vulkan/events/GraphicsErrorEvent.java | 2 +- .../main/java/de/staropensource/sosengine/testapp/Main.java | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) diff --git a/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java b/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java index c288ab28..715598ff 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java +++ b/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java @@ -57,7 +57,7 @@ import java.util.Set; */ @Getter @SuppressWarnings({ "unused" }) -public class EventHelper { +public final class EventHelper { /** * Contains all cached event listeners. * diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/events/InternalEngineShutdownEvent.java b/base/src/main/java/de/staropensource/sosengine/base/internal/events/InternalEngineShutdownEvent.java index a88ed89b..607b02f9 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/events/InternalEngineShutdownEvent.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/events/InternalEngineShutdownEvent.java @@ -27,7 +27,7 @@ import de.staropensource.sosengine.base.classes.helpers.EventHelper; * * @since v1-alpha0 */ -public class InternalEngineShutdownEvent implements Event { +public final class InternalEngineShutdownEvent implements Event { /** * Constructs this class. */ diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/reflection/ReflectionAccessWidener.java b/base/src/main/java/de/staropensource/sosengine/base/internal/reflection/ReflectionAccessWidener.java index 87cd50cd..b832f8db 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/reflection/ReflectionAccessWidener.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/reflection/ReflectionAccessWidener.java @@ -32,7 +32,7 @@ import java.lang.reflect.*; * @since v1-alpha2 */ @SuppressWarnings({ "unused" }) -public class ReflectionAccessWidener { +public final class ReflectionAccessWidener { /** * Allows access to an {@link AccessibleObject}. *

diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/types/DependencySubsystemVector.java b/base/src/main/java/de/staropensource/sosengine/base/internal/types/DependencySubsystemVector.java index 752915f2..ba9735f9 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/types/DependencySubsystemVector.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/types/DependencySubsystemVector.java @@ -36,7 +36,7 @@ import java.util.List; */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) @Getter -public class DependencySubsystemVector extends DependencyVector { +public final class DependencySubsystemVector extends DependencyVector { /** * Contains the associated {@link SubsystemMainClass}. * diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/types/QueuedLogMessage.java b/base/src/main/java/de/staropensource/sosengine/base/internal/types/QueuedLogMessage.java index 3e9c2090..d95a3b58 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/types/QueuedLogMessage.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/types/QueuedLogMessage.java @@ -31,7 +31,7 @@ import org.jetbrains.annotations.NotNull; */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) @Getter -public class QueuedLogMessage { +public final class QueuedLogMessage { /** * The log message's issuer. * diff --git a/base/src/main/java/de/staropensource/sosengine/base/types/logging/LogIssuer.java b/base/src/main/java/de/staropensource/sosengine/base/types/logging/LogIssuer.java index cb335921..84bca4cf 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/types/logging/LogIssuer.java +++ b/base/src/main/java/de/staropensource/sosengine/base/types/logging/LogIssuer.java @@ -33,7 +33,7 @@ import org.jetbrains.annotations.Nullable; */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) @Getter -public class LogIssuer { +public final class LogIssuer { /** * Contains the issuing class. * diff --git a/base/src/main/java/de/staropensource/sosengine/base/types/logging/LogRule.java b/base/src/main/java/de/staropensource/sosengine/base/types/logging/LogRule.java index eb560291..5d24fdc6 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/types/logging/LogRule.java +++ b/base/src/main/java/de/staropensource/sosengine/base/types/logging/LogRule.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull; */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) @Getter -public class LogRule { +public final class LogRule { /** * Determines if the log rule should disallow or permit matching log calls. * diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/Math.java b/base/src/main/java/de/staropensource/sosengine/base/utility/Math.java index 086f446c..6bba65af 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/Math.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/Math.java @@ -27,7 +27,7 @@ import java.util.LinkedList; // All mean and double methods have been sourced // from https://stackoverflow.com/a/4191729, tysm @SuppressWarnings({ "unused" }) -public class Math { +public final class Math { /** * Adds padding zeros to a number. * diff --git a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/GlfwSubsystem.java b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/GlfwSubsystem.java index c222f5e2..8d912caa 100644 --- a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/GlfwSubsystem.java +++ b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/GlfwSubsystem.java @@ -47,7 +47,7 @@ import static org.lwjgl.glfw.GLFW.*; */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) @EngineSubsystem -public class GlfwSubsystem implements SubsystemMainClass { +public final class GlfwSubsystem implements SubsystemMainClass { /** * Contains the class instance. * diff --git a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/callbacks/KeyCallback.java b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/callbacks/KeyCallback.java index ce8dbdee..8ae33fa5 100644 --- a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/callbacks/KeyCallback.java +++ b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/callbacks/KeyCallback.java @@ -35,7 +35,7 @@ import static org.lwjgl.glfw.GLFW.*; * @since v1-alpha2 */ @SuppressWarnings({ "unused" }) -public class KeyCallback extends WindowCallback implements GLFWKeyCallbackI { +public final class KeyCallback extends WindowCallback implements GLFWKeyCallbackI { /** * A {@link InputEvent} instance, to avoid creating too many objects * and making too many allocations, which would potentially decrease diff --git a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/callbacks/MouseButtonCallback.java b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/callbacks/MouseButtonCallback.java index e6375352..42d58325 100644 --- a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/callbacks/MouseButtonCallback.java +++ b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/callbacks/MouseButtonCallback.java @@ -35,7 +35,7 @@ import static org.lwjgl.glfw.GLFW.*; * @since v1-alpha2 */ @SuppressWarnings({ "unused" }) -public class MouseButtonCallback extends WindowCallback implements GLFWMouseButtonCallbackI { +public final class MouseButtonCallback extends WindowCallback implements GLFWMouseButtonCallbackI { /** * A {@link InputEvent} instance, to avoid creating too many objects * and making too many allocations, which would potentially decrease diff --git a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/classes/WindowCallback.java b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/classes/WindowCallback.java index de5d9a6d..40e860f6 100644 --- a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/classes/WindowCallback.java +++ b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/classes/WindowCallback.java @@ -29,6 +29,7 @@ import org.jetbrains.annotations.NotNull; * * @since v1-alpha2 */ +@Getter @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) public abstract class WindowCallback { /** @@ -45,7 +46,6 @@ public abstract class WindowCallback { * @since v1-alpha2 */ @NotNull - @Getter private final Window attachedWindow; /** diff --git a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/GlfwInitializationException.java b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/GlfwInitializationException.java index cc025931..bc5dbde9 100644 --- a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/GlfwInitializationException.java +++ b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/GlfwInitializationException.java @@ -24,7 +24,7 @@ package de.staropensource.sosengine.graphics.glfw.exceptions; * * @since v1-alpha2 */ -public class GlfwInitializationException extends RuntimeException { +public final class GlfwInitializationException extends RuntimeException { /** * Constructs this exception. * diff --git a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/NotOnMainThreadException.java b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/NotOnMainThreadException.java index f76b0c8a..4decc51a 100644 --- a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/NotOnMainThreadException.java +++ b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/NotOnMainThreadException.java @@ -24,7 +24,7 @@ package de.staropensource.sosengine.graphics.glfw.exceptions; * * @since v1-alpha2 */ -public class NotOnMainThreadException extends RuntimeException { +public final class NotOnMainThreadException extends RuntimeException { /** * Constructs this exception. * diff --git a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/WindowCreationFailureException.java b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/WindowCreationFailureException.java index 09fab4d7..85138b17 100644 --- a/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/WindowCreationFailureException.java +++ b/graphics/glfw/src/main/java/de/staropensource/sosengine/graphics/glfw/exceptions/WindowCreationFailureException.java @@ -27,7 +27,7 @@ import org.jetbrains.annotations.NotNull; * @since v1-alpha2 */ @SuppressWarnings({ "unused" }) -public class WindowCreationFailureException extends RuntimeException { +public final class WindowCreationFailureException extends RuntimeException { /** * Constructs this exception. * diff --git a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlInternalApi.java b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlInternalApi.java index a0dc4b6a..7935b484 100644 --- a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlInternalApi.java +++ b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlInternalApi.java @@ -24,7 +24,7 @@ import de.staropensource.sosengine.graphics.classes.Window; import de.staropensource.sosengine.graphics.opengl.classes.OpenGlWindow; import org.jetbrains.annotations.NotNull; -public class OpenGlInternalApi implements ApiInternalClass { +public final class OpenGlInternalApi implements ApiInternalClass { /** {@inheritDoc} */ @Override @NotNull diff --git a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/OpenGlWindow.java b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/OpenGlWindow.java index cc4a00eb..fe3815d4 100644 --- a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/OpenGlWindow.java +++ b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/classes/OpenGlWindow.java @@ -37,7 +37,7 @@ import static org.lwjgl.glfw.GLFW.*; * @since v1-alpha0 */ @SuppressWarnings({ "unused" }) -public class OpenGlWindow extends GlfwWindow { +public final class OpenGlWindow extends GlfwWindow { // ------------------------------------------------ [ Window initialization ] ------------------------------------------------ // /** * Creates a new window. diff --git a/graphics/src/main/java/de/staropensource/sosengine/graphics/classes/Window.java b/graphics/src/main/java/de/staropensource/sosengine/graphics/classes/Window.java index 7ca31bea..d89d2803 100644 --- a/graphics/src/main/java/de/staropensource/sosengine/graphics/classes/Window.java +++ b/graphics/src/main/java/de/staropensource/sosengine/graphics/classes/Window.java @@ -566,7 +566,7 @@ public abstract class Window implements AutoCloseable { * @see #terminate() * @since v1-alpha2 */ - public void close() { + public final void close() { terminate(); } @@ -639,7 +639,7 @@ public abstract class Window implements AutoCloseable { */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) @Getter - public static class Builder { + public static final class Builder { /** * Contains the window name. * diff --git a/graphics/src/main/java/de/staropensource/sosengine/graphics/events/GraphicsApiErrorEvent.java b/graphics/src/main/java/de/staropensource/sosengine/graphics/events/GraphicsApiErrorEvent.java index 3166748f..544207bd 100644 --- a/graphics/src/main/java/de/staropensource/sosengine/graphics/events/GraphicsApiErrorEvent.java +++ b/graphics/src/main/java/de/staropensource/sosengine/graphics/events/GraphicsApiErrorEvent.java @@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull; * @since v1-alpha0 */ @SuppressWarnings({ "unused" }) -public class GraphicsApiErrorEvent implements Event { +public final class GraphicsApiErrorEvent implements Event { /** * Constructs this class. */ diff --git a/graphics/src/main/java/de/staropensource/sosengine/graphics/events/GraphicsApiShutdownEvent.java b/graphics/src/main/java/de/staropensource/sosengine/graphics/events/GraphicsApiShutdownEvent.java index 33d2b4eb..aa3d38a7 100644 --- a/graphics/src/main/java/de/staropensource/sosengine/graphics/events/GraphicsApiShutdownEvent.java +++ b/graphics/src/main/java/de/staropensource/sosengine/graphics/events/GraphicsApiShutdownEvent.java @@ -28,7 +28,7 @@ import de.staropensource.sosengine.base.classes.helpers.EventHelper; * @since v1-alpha0 */ @SuppressWarnings({ "unused" }) -public class GraphicsApiShutdownEvent implements Event { +public final class GraphicsApiShutdownEvent implements Event { /** * Constructs this class. */ diff --git a/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/events/GraphicsErrorEvent.java b/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/events/GraphicsErrorEvent.java index afd27064..8efa4d67 100644 --- a/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/events/GraphicsErrorEvent.java +++ b/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/events/GraphicsErrorEvent.java @@ -27,7 +27,7 @@ import org.lwjgl.glfw.GLFWErrorCallbackI; * @since v1-alpha0 */ @SuppressWarnings({ "unused" }) -public class GraphicsErrorEvent extends de.staropensource.sosengine.graphics.events.GraphicsErrorEvent implements GLFWErrorCallbackI { +public final class GraphicsErrorEvent extends de.staropensource.sosengine.graphics.events.GraphicsErrorEvent implements GLFWErrorCallbackI { /** * Constructs this class. */ diff --git a/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java b/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java index 21360dc1..9b251553 100644 --- a/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java +++ b/testapp/src/main/java/de/staropensource/sosengine/testapp/Main.java @@ -47,7 +47,7 @@ import java.util.LinkedHashMap; * The initialization class for sos!engine's development application. */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) -public class Main { +public final class Main { /** * Contains the class instance. *