From 9cb5cbffd3acee3e31ee6ac7d820c699feec232f Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 27 Jun 2024 20:29:08 +0200 Subject: [PATCH] Update comments and javadoc --- .../staropensource/sosengine/base/Engine.java | 13 ++++--- .../sosengine/base/EngineConfiguration.java | 6 ++-- .../sosengine/base/classes/Placeholder.java | 2 +- .../base/classes/SubsystemConfiguration.java | 6 ++-- .../base/classes/helpers/EventHelper.java | 12 ++++--- .../base/classes/logging/LogIssuer.java | 10 +++--- .../base/data/info/EngineInformation.java | 4 +-- .../base/data/info/JvmInformation.java | 4 +-- .../sosengine/base/events/LogEvent.java | 6 ++-- .../sosengine/base/logging/CrashHandler.java | 34 ++++++++----------- .../sosengine/base/logging/Logger.java | 2 +- .../base/logging/LoggerInstance.java | 18 +++++----- .../crashhandler/IssuerClass.java | 2 +- .../crashhandler/IssuerCodePart.java | 2 +- .../placeholders/crashhandler/IssuerInfo.java | 2 +- .../crashhandler/IssuerMessage.java | 2 +- .../crashhandler/IssuerPackage.java | 2 +- .../placeholders/crashhandler/IssuerPath.java | 2 +- .../placeholders/crashhandler/Stacktrace.java | 2 +- .../logging/placeholders/logger/LogClass.java | 2 +- .../placeholders/logger/LogCodePart.java | 2 +- .../placeholders/logger/LogColorPrimary.java | 2 +- .../logger/LogColorSecondary.java | 2 +- .../logging/placeholders/logger/LogInfo.java | 2 +- .../logging/placeholders/logger/LogLevel.java | 2 +- .../placeholders/logger/LogMessage.java | 2 +- .../placeholders/logger/LogPackage.java | 2 +- .../logging/placeholders/logger/LogPath.java | 2 +- .../sosengine/base/types/Vec2.java | 12 +++---- .../sosengine/base/types/Vec2i.java | 10 +++--- .../sosengine/base/types/Vec3.java | 18 +++++----- .../sosengine/base/types/Vec3i.java | 18 +++++----- .../sosengine/base/utility/ListFormatter.java | 1 + .../sosengine/base/utility/Miscellaneous.java | 2 +- .../base/utility/PlaceholderEngine.java | 4 +-- .../base/utility/PropertyParser.java | 20 +++++------ .../base/utility/ShortcodeConverter.java | 28 ++++++++------- .../base/utility/StackTraceParser.java | 2 +- .../sosengine/unittests/UnitLogger.java | 16 ++++----- .../graphics/vulkan/VulkanSubsystem.java | 12 ++++--- .../slf4j_compat/CompatibilityLogger.java | 10 +++--- 41 files changed, 155 insertions(+), 147 deletions(-) diff --git a/base/src/main/java/de/staropensource/sosengine/base/Engine.java b/base/src/main/java/de/staropensource/sosengine/base/Engine.java index 04d91d0..fbff927 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/Engine.java +++ b/base/src/main/java/de/staropensource/sosengine/base/Engine.java @@ -92,7 +92,7 @@ public final class Engine implements SubsystemMainClass { * @since 1-alpha0 */ public Engine() { - // Check if sos!engine is already loaded + // Only allow one instance if (instance == null) instance = this; else { @@ -201,15 +201,17 @@ public final class Engine implements SubsystemMainClass { * @since 1-alpha0 */ public void precomputeEventListeners() { + // Internal events EventHelper.precomputeEventListeners(InternalEngineShutdownEvent.class); + // General events EventHelper.precomputeEventListeners(EngineCrashEvent.class); EventHelper.precomputeEventListeners(EngineShutdownEvent.class); EventHelper.precomputeEventListeners(LogEvent.class); } /** - * Starts base engine threads. + * Starts engine threads. * * @since 1-alpha1 */ @@ -220,18 +222,21 @@ public final class Engine implements SubsystemMainClass { /** * Shuts the engine and JVM down. * - * @param exitCode the code to exit with, from 0-255 + * @param exitCode code to exit with, from 0-255 * @since 1-alpha0 */ public void shutdown(@Range(from = 0, to = 255) int exitCode) { logger.info("Shutting engine down"); shuttingDown = true; + logger.verb("Notifiying classes about shutdown"); new EngineShutdownEvent().callEvent(); + logger.verb("Notifying subsystems about shutdown"); new InternalEngineShutdownEvent().callEvent(); + logger.verb("Shutting down JVM with code " + exitCode); - Logger.flushLogMessages(); + Logger.flushLogMessages(); // Flush all log messages before exiting Runtime.getRuntime().exit(exitCode); } diff --git a/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java b/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java index 74ead89..b55cd2d 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java +++ b/base/src/main/java/de/staropensource/sosengine/base/EngineConfiguration.java @@ -252,6 +252,7 @@ public final class EngineConfiguration implements SubsystemConfiguration { else Logger.crash(new LogIssuer(getClass(), CodePart.ENGINE), "Tried initializing " + getClass().getName() + " twice"); + // Load default configuration loadDefaultConfiguration(); } @@ -260,6 +261,7 @@ public final class EngineConfiguration implements SubsystemConfiguration { // Define variables PropertyParser parser = new PropertyParser(properties); + // Loop through all properties for (String property : properties.stringPropertyNames()) { // Check if property name starts with group if (!property.startsWith(group)) continue; @@ -267,7 +269,7 @@ public final class EngineConfiguration implements SubsystemConfiguration { // Skip to important stuff property = property.substring(group.length()); - // Match settings + // Overwrite matching settings try { switch (property) { case "debug" -> debug = parser.getBoolean(group + property); @@ -294,7 +296,7 @@ public final class EngineConfiguration implements SubsystemConfiguration { } catch (NullPointerException ignored) {} } - // Disable all debug options if 'debug' is disabled + // Disable all debugging switches if 'debug' is disabled if (!debug) { debugEvents = false; debugShortcodeConverter = false; diff --git a/base/src/main/java/de/staropensource/sosengine/base/classes/Placeholder.java b/base/src/main/java/de/staropensource/sosengine/base/classes/Placeholder.java index 611e6cd..26dcd0f 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/classes/Placeholder.java +++ b/base/src/main/java/de/staropensource/sosengine/base/classes/Placeholder.java @@ -42,7 +42,7 @@ public interface Placeholder { /** * Replaces the placeholder with it's appropriate content. * - * @param text the text to process + * @param text text to process * @return the processed text * @since 1-alpha0 */ diff --git a/base/src/main/java/de/staropensource/sosengine/base/classes/SubsystemConfiguration.java b/base/src/main/java/de/staropensource/sosengine/base/classes/SubsystemConfiguration.java index 86220fe..4bc590b 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/classes/SubsystemConfiguration.java +++ b/base/src/main/java/de/staropensource/sosengine/base/classes/SubsystemConfiguration.java @@ -49,7 +49,7 @@ public interface SubsystemConfiguration { * Loads the subsystem configuration from the specified {@link Properties}.
* Unless you want to allow configuration overriding, resetting the configuration using {@code loadDefaultConfiguration()} is advised. * - * @param properties the {@link Properties} object + * @param properties {@link Properties} object * @see SubsystemConfiguration#loadDefaultConfiguration() * @since 1-alpha0 */ @@ -76,8 +76,8 @@ public interface SubsystemConfiguration { /** * Returns a configuration setting. * - * @param setting the setting name - * @return the setting's value or {@code null} if not found + * @param setting setting name + * @return setting's value or {@code null} if not found */ Object getSetting(@NotNull String setting); } 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 5843348..71ee5fd 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 @@ -65,11 +65,12 @@ public class EventHelper { * @since 1-alpha0 */ public static void logCall(@NotNull Class clazz, @NotNull Object ... arguments) { + // Print event call if event debugging is enabled if (EngineConfiguration.getInstance().isDebugEvents()) if (arguments.length == 0) - Logger.diag(new LogIssuer(clazz), "Event " + clazz.getName() + " called"); + Logger.diag(new LogIssuer(clazz), "Event " + clazz.getName() + " emitted"); else - Logger.diag(new LogIssuer(clazz), "Event " + clazz.getName() + " called with arguments " + ListFormatter.formatArray(arguments)); + Logger.diag(new LogIssuer(clazz), "Event " + clazz.getName() + " emitted, passing arguments " + ListFormatter.formatArray(arguments)); } /** @@ -86,6 +87,7 @@ public class EventHelper { if (forceScanning || !cachedEventListeners.containsKey(clazz)) { // Scan entire classpath through Reflections library + // (enforced or not cached) Reflections reflections = new Reflections( new ConfigurationBuilder() .setUrls(ClasspathHelper.forJavaClassPath()) @@ -100,7 +102,7 @@ public class EventHelper { if (method.getAnnotation(EventListener.class).event() == clazz) methods.add(method); - // Sort 'methods' linked list + // Sort 'methods' linked list after event priority methods.sort(Comparator.comparing(method0 -> method0.getAnnotation(EventListener.class).priority())); } else // 'forcedScanning' is false and matching event listeners are cached @@ -147,7 +149,7 @@ public class EventHelper { } /** - * Precomputes all event listeners listening on some event. + * Caches all event listeners listening on some event. * Will recompute all event listeners if the specified event is already cached. * * @param clazz event listeners to (p)recompute, set to {@code null} to recompute all cached events @@ -170,7 +172,7 @@ public class EventHelper { /** * Removes events from the event listener cache. * - * @param clazz event class to remove cached event listeners for, set to {@code null} to remove all cached event listeners + * @param clazz event class to remove cached event listeners for or {@code null} to remove all cached event listeners * @since 1-alpha0 */ public static void removePrecomputedEventListeners(@Nullable Class clazz) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/classes/logging/LogIssuer.java b/base/src/main/java/de/staropensource/sosengine/base/classes/logging/LogIssuer.java index 896f720..e088651 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/classes/logging/LogIssuer.java +++ b/base/src/main/java/de/staropensource/sosengine/base/classes/logging/LogIssuer.java @@ -75,7 +75,7 @@ public class LogIssuer { /** * Constructor. * - * @param clazz the issuing class + * @param clazz issuing class * @param additionalInformation additional information about the issuer * @param codePart identifies to which part of the program the class belongs to * @since 1-alpha0 @@ -90,7 +90,7 @@ public class LogIssuer { /** * Constructor. * - * @param clazz the issuing class + * @param clazz issuing class * @param additionalInformation additional information about the issuer * @since 1-alpha0 */ @@ -104,8 +104,8 @@ public class LogIssuer { /** * Constructor. * - * @param clazz the issuing class - * @param codePart identifies to which part of the program the class belongs to + * @param clazz issuing class + * @param codePart identifies to which part of the program the class belongs to * @since 1-alpha0 */ public LogIssuer(@NotNull Class clazz, @NotNull CodePart codePart) { @@ -117,7 +117,7 @@ public class LogIssuer { /** * Constructor. * - * @param clazz the issuing class + * @param clazz issuing class * @since 1-alpha0 */ public LogIssuer(@NotNull Class clazz) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/info/EngineInformation.java b/base/src/main/java/de/staropensource/sosengine/base/data/info/EngineInformation.java index bb21500..0ae7b92 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/info/EngineInformation.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/info/EngineInformation.java @@ -225,12 +225,12 @@ public final class EngineInformation { return; } - // Load properties from gradle.properties + // Load properties from bundled gradle.properties Properties properties = new Properties(); InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("gradle.properties"); if (inputStream == null) { - logger.crash("Unable to load build information: InputStream is null"); + logger.crash("Unable to load build information: The bundled gradle.properties file could not be found. Do symlinks work on the system that built this JAR?"); return; } diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java b/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java index aeecd17..dd59ef3 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/info/JvmInformation.java @@ -48,10 +48,10 @@ public final class JvmInformation { public static int getJavaVersion() { String version = System.getProperty("java.version"); - if (version.startsWith("1.")) + if (version.startsWith("1.")) // Omit "1." (if present) version = version.substring(2, 3); else { - if (version.contains(".")) + if (version.contains(".")) // Only get MAJOR version version = version.substring(0, version.indexOf(".")); } diff --git a/base/src/main/java/de/staropensource/sosengine/base/events/LogEvent.java b/base/src/main/java/de/staropensource/sosengine/base/events/LogEvent.java index ab68dd6..5a85500 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/events/LogEvent.java +++ b/base/src/main/java/de/staropensource/sosengine/base/events/LogEvent.java @@ -53,9 +53,9 @@ public final class LogEvent implements Event { /** * Calls the event and notifies all annotated methods. * - * @param level the log level - * @param logIssuer the log issuer - * @param message the log message + * @param level log level + * @param logIssuer log issuer + * @param message log message * @since 1-alpha0 */ public void callEvent(@NotNull LogLevel level, @NotNull LogIssuer logIssuer, @NotNull String message) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/CrashHandler.java b/base/src/main/java/de/staropensource/sosengine/base/logging/CrashHandler.java index e7f50d6..307d94b 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/CrashHandler.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/CrashHandler.java @@ -44,13 +44,6 @@ import java.util.*; */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) public final class CrashHandler { - /** - * Hopefully {@code false} :)
- * Note: Switching this to true might cause issues. Just don't do it ^^ - * - * @since 1-alpha0 - */ - public static boolean crashed = false; /** * Contains the template used to print a crash report. @@ -115,13 +108,12 @@ public final class CrashHandler { * @since 1-alpha0 */ public static void handleCrash(@NotNull LogIssuer logIssuer, @NotNull String message, @Nullable Throwable throwable) { - crashed = true; String base = crashTemplate; - // Convert crashContent to String and replace %content% in crashTemplate with the result + // Replace '%content%' with crash content base = base.replace("%content%", processCrashContent()); // This is so simple we don't need the PlaceholderEngine to do it for us - // Execute LoggerImpl#prePlaceholder + // Invoke LoggerImpl#prePlaceholder base = Logger.getLoggerImplementation().prePlaceholder(LogLevel.CRASH, logIssuer, base); // Create list of temporary placeholders @@ -140,13 +132,13 @@ public final class CrashHandler { // Replace placeholders base = PlaceholderEngine.getInstance().process(base, temporaryPlaceholders); - // Execute LoggerImpl#postPlaceholder + // Invoke LoggerImpl#postPlaceholder base = Logger.getLoggerImplementation().postPlaceholder(LogLevel.CRASH, logIssuer, base); - // Print log message + // Print log message by invoking LoggerImpl#print Logger.getLoggerImplementation().print(LogLevel.CRASH, logIssuer, base); - // Send EngineCrash event + // Emit EngineCrashEvent new EngineCrashEvent().callEvent(); // Shutdown (engine &) JVM @@ -159,8 +151,8 @@ public final class CrashHandler { /** * Internal method for generating the crash message content. Do not call. * - * @param map the {@link LinkedHashMap} to process - * @param indentationSize the indentation level + * @param map {@link LinkedHashMap} to process + * @param indentationSize indentation level * @return crash content string * @see CrashHandler#processCrashContent() * @since 1-alpha0 @@ -170,11 +162,10 @@ public final class CrashHandler { * We can safely ignore this as this method * 1. checks data types as best as it can, * 2. only works on a String and not on a File or something which could cause damage, and - * 3. we can trust our own engine and the application not doing shit in here. - * as an application or subsystem developer you'll likely want useful crash information. + * 3. we can trust our own engine and possibly subsystems not doing shit in here. + * As a subsystem developer you'll likely want useful crash information. * * But hey, if someone breaks this method (which may be possible idk didn't test it) then congrats! - * If someone opens a pull requests wanting to "fix" this method, I'll happily decline it :) */ @NotNull private static String processCrashContent(@NotNull LinkedHashMap map, int indentationSize) { @@ -189,6 +180,11 @@ public final class CrashHandler { // Invalid content value, skip continue; + /* + * I'm too lazy to describe what you are seeing down below, + * so uuhhh just try breaking it and see what happens. + */ + if (!content.isEmpty()) content.append("\n"); @@ -205,11 +201,9 @@ public final class CrashHandler { else content.append(" ".repeat(indentationSize)).append("-> "); content.append(key).append("\n"); - // We are the types in this function already //noinspection unchecked content.append(processCrashContent((LinkedHashMap) map.get(key), indentationSize + 1)); } - } return content.toString(); diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/Logger.java b/base/src/main/java/de/staropensource/sosengine/base/logging/Logger.java index 6bfc787..3f14efa 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/Logger.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/Logger.java @@ -65,7 +65,7 @@ public final class Logger { * -- SETTER -- * Sets the active {@link LoggerImpl}. * - * @param loggerImplementation the new active {@link LoggerImpl} + * @param loggerImplementation new active {@link LoggerImpl} * @see LoggerImpl * @since 1-alpha0 */ diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/LoggerInstance.java b/base/src/main/java/de/staropensource/sosengine/base/logging/LoggerInstance.java index e3ca0a1..cbcfbb8 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/LoggerInstance.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/LoggerInstance.java @@ -58,7 +58,7 @@ public final class LoggerInstance { /** * Prints a diagnostic message. * - * @param message the diagnostic message + * @param message diagnostic message * @since 1-alpha0 */ public void diag(@NotNull String message) { @@ -68,7 +68,7 @@ public final class LoggerInstance { /** * Prints a verbose message. * - * @param message the verbose message + * @param message verbose message * @since 1-alpha0 */ public void verb(@NotNull String message) { @@ -78,7 +78,7 @@ public final class LoggerInstance { /** * Prints a silent warning message. * - * @param message the silent warning message + * @param message silent warning message * @since 1-alpha0 */ public void sarn(@NotNull String message) { @@ -88,7 +88,7 @@ public final class LoggerInstance { /** * Prints an informational message. * - * @param message the informational message + * @param message informational message * @since 1-alpha0 */ public void info(@NotNull String message) { @@ -98,7 +98,7 @@ public final class LoggerInstance { /** * Prints a warning message. * - * @param message the warning message + * @param message warning message * @since 1-alpha0 */ public void warn(@NotNull String message) { @@ -108,7 +108,7 @@ public final class LoggerInstance { /** * Prints an error message. * - * @param message the error message + * @param message error message * @since 1-alpha0 */ public void error(@NotNull String message) { @@ -118,8 +118,8 @@ public final class LoggerInstance { /** * Crashes the entire engine. * - * @param message the diagnostic message - * @param throwable the throwable that caused this crash + * @param message diagnostic message + * @param throwable throwable that caused this crash * @see CrashHandler * @since 1-alpha0 */ @@ -130,7 +130,7 @@ public final class LoggerInstance { /** * Crashes the entire engine. * - * @param message the diagnostic message + * @param message diagnostic message * @see CrashHandler * @since 1-alpha0 */ diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerClass.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerClass.java index 2734ab8..371709d 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerClass.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerClass.java @@ -42,7 +42,7 @@ public final class IssuerClass implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public IssuerClass(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerCodePart.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerCodePart.java index b3c510d..2385256 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerCodePart.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerCodePart.java @@ -42,7 +42,7 @@ public final class IssuerCodePart implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public IssuerCodePart(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerInfo.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerInfo.java index cd9c717..ae0a564 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerInfo.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerInfo.java @@ -42,7 +42,7 @@ public final class IssuerInfo implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public IssuerInfo(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerMessage.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerMessage.java index 54a5cd0..4391ad4 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerMessage.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerMessage.java @@ -41,7 +41,7 @@ public final class IssuerMessage implements Placeholder { /** * Constructor. * - * @param message the message to use + * @param message message to use * @since 1-alpha0 */ public IssuerMessage(@NotNull String message) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerPackage.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerPackage.java index 315bb8b..dcc89b4 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerPackage.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerPackage.java @@ -42,7 +42,7 @@ public final class IssuerPackage implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public IssuerPackage(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerPath.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerPath.java index d5664d1..9ee5513 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerPath.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/IssuerPath.java @@ -42,7 +42,7 @@ public final class IssuerPath implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public IssuerPath(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/Stacktrace.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/Stacktrace.java index 7aa5862..1ead79d 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/Stacktrace.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/crashhandler/Stacktrace.java @@ -43,7 +43,7 @@ public final class Stacktrace implements Placeholder { /** * Constructor. * - * @param throwable the {@link Throwable} to use + * @param throwable {@link Throwable} to use * @since 1-alpha0 */ public Stacktrace(@Nullable Throwable throwable) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogClass.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogClass.java index c4d1554..e091aa0 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogClass.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogClass.java @@ -42,7 +42,7 @@ public final class LogClass implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public LogClass(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogCodePart.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogCodePart.java index f6d8066..cafce64 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogCodePart.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogCodePart.java @@ -42,7 +42,7 @@ public final class LogCodePart implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public LogCodePart(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogColorPrimary.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogColorPrimary.java index 93c42c1..3c4bf3b 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogColorPrimary.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogColorPrimary.java @@ -42,7 +42,7 @@ public final class LogColorPrimary implements Placeholder { /** * Constructor. * - * @param level the {@link LogLevel} to use + * @param level {@link LogLevel} to use * @since 1-alpha0 */ public LogColorPrimary(@NotNull LogLevel level) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogColorSecondary.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogColorSecondary.java index 9bae45f..7079838 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogColorSecondary.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogColorSecondary.java @@ -42,7 +42,7 @@ public final class LogColorSecondary implements Placeholder { /** * Constructor. * - * @param level the {@link LogLevel} to use + * @param level {@link LogLevel} to use * @since 1-alpha0 */ public LogColorSecondary(@NotNull LogLevel level) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogInfo.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogInfo.java index 42a12ad..b142639 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogInfo.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogInfo.java @@ -42,7 +42,7 @@ public final class LogInfo implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public LogInfo(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogLevel.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogLevel.java index 8af98b0..8738722 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogLevel.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogLevel.java @@ -41,7 +41,7 @@ public final class LogLevel implements Placeholder { /** * Constructor. * - * @param level the {@link de.staropensource.sosengine.base.classes.logging.LogLevel} to use + * @param level {@link de.staropensource.sosengine.base.classes.logging.LogLevel} to use * @since 1-alpha0 */ public LogLevel(@NotNull de.staropensource.sosengine.base.classes.logging.LogLevel level) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogMessage.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogMessage.java index 91d0c29..7b7eafd 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogMessage.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogMessage.java @@ -41,7 +41,7 @@ public final class LogMessage implements Placeholder { /** * Constructor. * - * @param message the message to use + * @param message message to use * @since 1-alpha0 */ public LogMessage(@NotNull String message) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogPackage.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogPackage.java index aa05d19..7f904d2 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogPackage.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogPackage.java @@ -42,7 +42,7 @@ public final class LogPackage implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public LogPackage(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogPath.java b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogPath.java index c02776d..2cf5333 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogPath.java +++ b/base/src/main/java/de/staropensource/sosengine/base/logging/placeholders/logger/LogPath.java @@ -42,7 +42,7 @@ public final class LogPath implements Placeholder { /** * Constructor. * - * @param logIssuer the {@link LogIssuer} to use + * @param logIssuer {@link LogIssuer} to use * @since 1-alpha0 */ public LogPath(@NotNull LogIssuer logIssuer) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/types/Vec2.java b/base/src/main/java/de/staropensource/sosengine/base/types/Vec2.java index eb7bf52..ef12dea 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/types/Vec2.java +++ b/base/src/main/java/de/staropensource/sosengine/base/types/Vec2.java @@ -39,13 +39,13 @@ public class Vec2 { * -- GETTER -- * Returns the X axis value. * - * @return the X axis value + * @return X axis value * @since 1-alpha0 * * -- SETTER -- * Sets the X axis value. * - * @param x the X axis value + * @param x X axis value * @since 1-alpha0 */ private float x; @@ -58,13 +58,13 @@ public class Vec2 { * -- GETTER -- * Returns the Y axis value. * - * @return the Y axis value + * @return Y axis value * @since 1-alpha0 * * -- SETTER -- * Sets the Y axis value. * - * @param y the Y axis value + * @param y Y axis value * @since 1-alpha0 */ private float y; @@ -72,8 +72,8 @@ public class Vec2 { /** * Constructor. * - * @param x the X axis value - * @param y the Y axis value + * @param x X axis value + * @param y Y axis value * @since 1-alpha0 */ public Vec2(float x, float y) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/types/Vec2i.java b/base/src/main/java/de/staropensource/sosengine/base/types/Vec2i.java index 2f0d396..09e89ce 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/types/Vec2i.java +++ b/base/src/main/java/de/staropensource/sosengine/base/types/Vec2i.java @@ -45,7 +45,7 @@ public class Vec2i { * -- SETTER -- * Sets the X axis value. * - * @param x the X axis value + * @param x X axis value * @since 1-alpha0 */ private int x; @@ -58,13 +58,13 @@ public class Vec2i { * -- GETTER -- * Returns the Y axis value. * - * @return the Y axis value + * @return Y axis value * @since 1-alpha0 * * -- SETTER -- * Sets the Y axis value. * - * @param y the Y axis value + * @param y Y axis value * @since 1-alpha0 */ private int y; @@ -72,8 +72,8 @@ public class Vec2i { /** * Constructor. * - * @param x the X axis value - * @param y the Y axis value + * @param x X axis value + * @param y Y axis value * @since 1-alpha0 */ public Vec2i(int x, int y) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/types/Vec3.java b/base/src/main/java/de/staropensource/sosengine/base/types/Vec3.java index 564d780..2952cb7 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/types/Vec3.java +++ b/base/src/main/java/de/staropensource/sosengine/base/types/Vec3.java @@ -39,13 +39,13 @@ public class Vec3 { * -- GETTER -- * Returns the X axis value. * - * @return the X axis value + * @return X axis value * @since 1-alpha0 * * -- SETTER -- * Sets the X axis value. * - * @param x the X axis value + * @param x X axis value * @since 1-alpha0 */ private float x; @@ -58,13 +58,13 @@ public class Vec3 { * -- GETTER -- * Returns the Y axis value. * - * @return the Y axis value + * @return Y axis value * @since 1-alpha0 * * -- SETTER -- * Sets the Y axis value. * - * @param y the Y axis value + * @param y Y axis value * @since 1-alpha0 */ private float y; @@ -77,13 +77,13 @@ public class Vec3 { * -- GETTER -- * Returns the Z axis value. * - * @return the Z axis value + * @return Z axis value * @since 1-alpha0 * * -- SETTER -- * Sets the Z axis value. * - * @param z the Z axis value + * @param z Z axis value * @since 1-alpha0 */ private float z; @@ -91,9 +91,9 @@ public class Vec3 { /** * Constructor. * - * @param x the X axis value - * @param y the Y axis value - * @param z the Z axis value + * @param x X axis value + * @param y Y axis value + * @param z Z axis value * @since 1-alpha0 */ public Vec3(float x, float y, float z) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/types/Vec3i.java b/base/src/main/java/de/staropensource/sosengine/base/types/Vec3i.java index 95267fc..f84c6e2 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/types/Vec3i.java +++ b/base/src/main/java/de/staropensource/sosengine/base/types/Vec3i.java @@ -39,13 +39,13 @@ public class Vec3i { * -- GETTER -- * Returns the X axis value. * - * @return the X axis value + * @return X axis value * @since 1-alpha0 * * -- SETTER -- * Sets the X axis value. * - * @param x the X axis value + * @param x X axis value * @since 1-alpha0 */ private int x; @@ -58,13 +58,13 @@ public class Vec3i { * -- GETTER -- * Returns the Y axis value. * - * @return the Y axis value + * @return Y axis value * @since 1-alpha0 * * -- SETTER -- * Sets the Y axis value. * - * @param y the Y axis value + * @param y Y axis value * @since 1-alpha0 */ private int y; @@ -77,13 +77,13 @@ public class Vec3i { * -- GETTER -- * Returns the Z axis value. * - * @return the Z axis value + * @return Z axis value * @since 1-alpha0 * * -- SETTER -- * Sets the Z axis value. * - * @param z the Z axis value + * @param z Z axis value * @since 1-alpha0 */ private int z; @@ -91,9 +91,9 @@ public class Vec3i { /** * Constructor. * - * @param x the X axis value - * @param y the Y axis value - * @param z the Z axis value + * @param x X axis value + * @param y Y axis value + * @param z Z axis value * @since 1-alpha0 */ public Vec3i(int x, int y, int z) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/ListFormatter.java b/base/src/main/java/de/staropensource/sosengine/base/utility/ListFormatter.java index 5c77fe0..f53b325 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/ListFormatter.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/ListFormatter.java @@ -28,6 +28,7 @@ import java.util.Set; /** * Converts various data types to {@link String}s. + * This class is unfinished. * * @since 1-alpha0 */ diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/Miscellaneous.java b/base/src/main/java/de/staropensource/sosengine/base/utility/Miscellaneous.java index fad260d..ba31482 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/Miscellaneous.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/Miscellaneous.java @@ -73,7 +73,7 @@ public final class Miscellaneous { /** * Measures the execution time of a {@link Runnable}. * - * @param runnable the {@link Runnable} to execute + * @param runnable {@link Runnable} to execute * @return execution time in milliseconds * @see Runnable * @since 1-alpha0 diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/PlaceholderEngine.java b/base/src/main/java/de/staropensource/sosengine/base/utility/PlaceholderEngine.java index fb17ce5..2c4fb64 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/PlaceholderEngine.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/PlaceholderEngine.java @@ -122,7 +122,7 @@ public final class PlaceholderEngine { /** * Process all placeholders for a given {@code text}. * - * @param text the text to process + * @param text text to process * @param temporaryPlaceholders placeholders to process only for this run * @return the processed text * @since 1-alpha0 @@ -145,7 +145,7 @@ public final class PlaceholderEngine { /** * Process all placeholders for a given {@code text}. * - * @param text the text to process + * @param text text to process * @return the processed text * @since 1-alpha0 */ diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/PropertyParser.java b/base/src/main/java/de/staropensource/sosengine/base/utility/PropertyParser.java index 12187cb..1592900 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/PropertyParser.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/PropertyParser.java @@ -82,7 +82,7 @@ public class PropertyParser { /** * Constructor. * - * @param properties the {@link Properties} to use + * @param properties {@link Properties} to use * @since 1-alpha0 */ public PropertyParser(@NotNull Properties properties) { @@ -93,7 +93,7 @@ public class PropertyParser { /** * Just returns the property value. * - * @param name the property name + * @param name property name * @return a {@link String} * @throws NullPointerException if the specified property does not exist * @see String @@ -111,7 +111,7 @@ public class PropertyParser { /** * Parses a property as a {@link Boolean}. * - * @param name the property name + * @param name property name * @return a {@link Boolean} * @throws NullPointerException if the specified property does not exist * @see Boolean @@ -137,7 +137,7 @@ public class PropertyParser { /** * Parses a property as a {@link Tristate}. * - * @param name the property name + * @param name property name * @return a {@link Tristate} * @throws NullPointerException if the specified property does not exist * @see Tristate @@ -166,7 +166,7 @@ public class PropertyParser { /** * Parses a property as a {@link Byte}. * - * @param name the property name + * @param name property name * @return a {@link Byte} * @throws NullPointerException if the specified property does not exist * @throws NumberFormatException if the specified property cannot be parsed as a {@link Byte} @@ -191,7 +191,7 @@ public class PropertyParser { /** * Parses a property as a {@link Short}. * - * @param name the property name + * @param name property name * @return a {@link Short} * @throws NullPointerException if the specified property does not exist * @throws NumberFormatException if the specified property cannot be parsed as a {@link Short} @@ -216,7 +216,7 @@ public class PropertyParser { /** * Parses a property as an {@link Integer}. * - * @param name the property name + * @param name property name * @param unsigned determines if the {@link Integer} is unsigned * @return an {@link Integer} * @throws NullPointerException if the specified property does not exist @@ -245,7 +245,7 @@ public class PropertyParser { /** * Parses a property as a {@link Long}. * - * @param name the property name + * @param name property name * @param unsigned determines if the {@link Long} is unsigned * @return a {@link Long} * @throws NullPointerException if the specified property does not exist @@ -274,7 +274,7 @@ public class PropertyParser { /** * Parses a property as a {@link Float}. * - * @param name the property name + * @param name property name * @return a {@link Float} * @throws NullPointerException if the specified property does not exist * @throws NumberFormatException if the specified property cannot be parsed as an {@link Float} @@ -299,7 +299,7 @@ public class PropertyParser { /** * Parses a property as a {@link Double}. * - * @param name the property name + * @param name property name * @return a {@link Double} * @throws NullPointerException if the specified property does not exist * @throws NumberFormatException if the specified property cannot be parsed as an {@link Double} diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/ShortcodeConverter.java b/base/src/main/java/de/staropensource/sosengine/base/utility/ShortcodeConverter.java index f6a0f28..3fead00 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/ShortcodeConverter.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/ShortcodeConverter.java @@ -78,7 +78,7 @@ public class ShortcodeConverter { /** * Converts shortcodes into ANSI escape sequences. * - * @param text the text to process + * @param text text to process * @param noErrors prevents printing tag/shortcode errors, overrides the engine configuration setting * @return {@link Ansi} sequence * @see EngineConfiguration#errorShortcodeConverter @@ -87,12 +87,15 @@ public class ShortcodeConverter { @NotNull public Ansi process(@NotNull String text, boolean noErrors) { Ansi ansi = Ansi.ansi(); - boolean tagActive = false; - String part = ""; + boolean tagActive = false; // Indicates that a tag is being parsed + String part = ""; // Current part. May be a tag, may be regular text + // Iterate through every character for (char character : text.toCharArray()) { if (tagActive) { + // A tag is being parsed if (character == '>') { + // Tag is ending, disable tag parsing tagActive = false; // fg:* @@ -213,29 +216,28 @@ public class ShortcodeConverter { ansi.a("<" + part + ">"); } - // Reset part + // Empty 'part' part = ""; } else - // Add character to part + // Tag has not ended yet, add character to 'part' //noinspection StringConcatenationInLoop // It bloats the code to do it with StringBuilder part += character; } else { - // Detect if character is start of tag + // Regular text is being parsed if (character == '<') { - // Insert previous text + // Tag is starting, insert previous text ansi.a(part); - // Prepare variables - part = ""; - tagActive = true; + part = ""; // Empty 'part' + tagActive = true; // Enable tag processing } else - // Add character to part + // Regular text, add character to 'part' //noinspection StringConcatenationInLoop // It bloats the code to do it with StringBuilder part += character; } } - // Insert remaining characters + // Processing ended, insert leftover text ansi.a(part); return ansi; @@ -244,7 +246,7 @@ public class ShortcodeConverter { /** * Converts shortcodes into ANSI escape sequences. * - * @param text the text to process + * @param text text to process * @return {@link Ansi} sequence * @since 1-alpha0 */ diff --git a/base/src/main/java/de/staropensource/sosengine/base/utility/StackTraceParser.java b/base/src/main/java/de/staropensource/sosengine/base/utility/StackTraceParser.java index c430cff..0d55626 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/utility/StackTraceParser.java +++ b/base/src/main/java/de/staropensource/sosengine/base/utility/StackTraceParser.java @@ -49,7 +49,7 @@ public class StackTraceParser { /** * Constructor. * - * @param throwable the throwable to use + * @param throwable throwable to use * @since 1-alpha0 */ public StackTraceParser(@NotNull Throwable throwable) { diff --git a/base/src/main/java/de/staropensource/sosengine/unittests/UnitLogger.java b/base/src/main/java/de/staropensource/sosengine/unittests/UnitLogger.java index d0ced73..5abd55d 100644 --- a/base/src/main/java/de/staropensource/sosengine/unittests/UnitLogger.java +++ b/base/src/main/java/de/staropensource/sosengine/unittests/UnitLogger.java @@ -38,7 +38,7 @@ public class UnitLogger { /** * Constructor. * - * @param clazz the parent class + * @param clazz parent class */ public UnitLogger(Class clazz) { this.clazz = clazz; @@ -47,8 +47,8 @@ public class UnitLogger { /** * Prints a log message. * - * @param level the log level - * @param message the log message (and arguments if called with level {@code SILENT_WARNING}) + * @param level log level + * @param message log message (and arguments if called with level {@code SILENT_WARNING}) */ private void log(@NotNull LogLevel level, @NotNull String message, List<@Nullable Object> additionalStuff) { String messageSingle = message; @@ -92,7 +92,7 @@ public class UnitLogger { /** * Prints a diagnostic message. * - * @param message the diagnostic log message + * @param message diagnostic log message */ public void diag(@NotNull String message) { log(LogLevel.DIAGNOSTIC, message, null); @@ -101,7 +101,7 @@ public class UnitLogger { /** * Prints a verbose message. * - * @param message the verbose log message + * @param message verbose log message */ public void verb(@NotNull String message) { log(LogLevel.VERBOSE, message, null); @@ -120,7 +120,7 @@ public class UnitLogger { /** * Prints a informational message. * - * @param message the informational log message + * @param message informational log message */ public void info(@NotNull String message) { log(LogLevel.INFORMATIONAL, message, null); @@ -129,7 +129,7 @@ public class UnitLogger { /** * Prints a warning message. * - * @param message the warning log message + * @param message warning log message */ public void warn(@NotNull String message) { log(LogLevel.WARNING, message, null); @@ -138,7 +138,7 @@ public class UnitLogger { /** * Prints a error message. * - * @param message the error log message + * @param message error log message */ public void error(@NotNull String message) { log(LogLevel.ERROR, message, null); diff --git a/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java b/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java index 27ed034..9921587 100644 --- a/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java +++ b/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java @@ -89,13 +89,15 @@ public final class VulkanSubsystem implements ApiMainClass { return; } - // Warn about instability - logger.warn("The Vulkan Graphics API is in an unfinished state. Trying to initialize the Graphics API will cause an engine crash."); + long initTime = Miscellaneous.measureExecutionTime(() -> { + // Warn about instability + logger.warn("The Vulkan Graphics API is in an unfinished state. Trying to initialize the Graphics API will cause an engine crash."); - // Register Graphics API - GraphicsSubsystem.getInstance().registerGraphicsApi(this); + // Register Graphics API + GraphicsSubsystem.getInstance().registerGraphicsApi(this); + }); - logger.info("Initialized subsystem"); + logger.info("Initialized subsystem in " + initTime + "ms"); } /** {@inheritDoc} */ diff --git a/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/CompatibilityLogger.java b/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/CompatibilityLogger.java index 6bda3d2..d5a40f1 100644 --- a/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/CompatibilityLogger.java +++ b/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/CompatibilityLogger.java @@ -157,11 +157,11 @@ public class CompatibilityLogger extends LegacyAbstractLogger { /** * Just redirects to {@code forwardLogCall}. * - * @param level the SLF4J level for this event - * @param marker The marker to be used for this event, may be null. - * @param messagePattern The message pattern which will be parsed and formatted - * @param arguments the array of arguments to be formatted, may be null - * @param throwable The exception whose stack trace should be logged, may be null + * @param level SLF4J level for this event + * @param marker marker to be used for this event, may be null. + * @param messagePattern message pattern which will be parsed and formatted + * @param arguments array of arguments to be formatted, may be null + * @param throwable exception whose stack trace should be logged, may be null * @see CompatibilityLogger#forwardLogCall(Level, String, Object[], Throwable) */ @Override