From 8d9e1db8f27a1970ad602a3bfecc757ec13d9e7e Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 8 Jul 2024 14:25:42 +0200 Subject: [PATCH] Fix some ugly shit --- .../base/data/versioning/FourNumberVersioningSystem.java | 3 ++- .../base/data/versioning/SemanticVersioningSystem.java | 3 ++- .../data/versioning/StarOpenSourceVersioningSystem.java | 3 ++- .../base/data/versioning/ThreeNumberVersioningSystem.java | 3 ++- .../base/data/versioning/TwoNumberVersioningSystem.java | 3 ++- .../sosengine/base/internal/placeholders/JvmArguments.java | 6 ++++-- .../base/internal/placeholders/JvmImplementationName.java | 6 ++++-- .../base/internal/placeholders/JvmImplementationVendor.java | 6 ++++-- .../internal/placeholders/JvmImplementationVersion.java | 6 ++++-- .../sosengine/base/internal/placeholders/JvmJava.java | 6 ++++-- .../sosengine/base/internal/placeholders/JvmUptime.java | 6 ++++-- .../internal/placeholders/crashhandler/IssuerClass.java | 6 ++++-- .../internal/placeholders/crashhandler/IssuerCodePart.java | 6 ++++-- .../base/internal/placeholders/crashhandler/IssuerInfo.java | 6 ++++-- .../internal/placeholders/crashhandler/IssuerMessage.java | 6 ++++-- .../internal/placeholders/crashhandler/IssuerPackage.java | 6 ++++-- .../base/internal/placeholders/crashhandler/IssuerPath.java | 6 ++++-- .../base/internal/placeholders/crashhandler/Stacktrace.java | 6 ++++-- .../base/internal/placeholders/logger/LogClass.java | 6 ++++-- .../base/internal/placeholders/logger/LogCodePart.java | 6 ++++-- .../base/internal/placeholders/logger/LogColorPrimary.java | 6 ++++-- .../internal/placeholders/logger/LogColorSecondary.java | 6 ++++-- .../base/internal/placeholders/logger/LogInfo.java | 6 ++++-- .../base/internal/placeholders/logger/LogLevel.java | 6 ++++-- .../base/internal/placeholders/logger/LogMessage.java | 6 ++++-- .../base/internal/placeholders/logger/LogPackage.java | 6 ++++-- .../base/internal/placeholders/logger/LogPath.java | 6 ++++-- 27 files changed, 98 insertions(+), 49 deletions(-) diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/FourNumberVersioningSystem.java b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/FourNumberVersioningSystem.java index 2009d1f..b0d87a7 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/FourNumberVersioningSystem.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/FourNumberVersioningSystem.java @@ -88,8 +88,9 @@ public final class FourNumberVersioningSystem implements VersioningSystem { private final int number4; /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "n4"; } diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/SemanticVersioningSystem.java b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/SemanticVersioningSystem.java index b7cc1e6..e5df3ac 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/SemanticVersioningSystem.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/SemanticVersioningSystem.java @@ -107,8 +107,9 @@ public final class SemanticVersioningSystem implements VersioningSystem { private final int build; /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "Semantic"; } diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/StarOpenSourceVersioningSystem.java b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/StarOpenSourceVersioningSystem.java index b411994..63e7952 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/StarOpenSourceVersioningSystem.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/StarOpenSourceVersioningSystem.java @@ -107,8 +107,9 @@ public final class StarOpenSourceVersioningSystem implements VersioningSystem { private final String fork; /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "StarOpenSource"; } diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/ThreeNumberVersioningSystem.java b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/ThreeNumberVersioningSystem.java index bdaac63..c9b4fb0 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/ThreeNumberVersioningSystem.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/ThreeNumberVersioningSystem.java @@ -75,8 +75,9 @@ public final class ThreeNumberVersioningSystem implements VersioningSystem { private final int number3; /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "n3"; } diff --git a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/TwoNumberVersioningSystem.java b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/TwoNumberVersioningSystem.java index 741adb2..ac1936f 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/data/versioning/TwoNumberVersioningSystem.java +++ b/base/src/main/java/de/staropensource/sosengine/base/data/versioning/TwoNumberVersioningSystem.java @@ -62,8 +62,9 @@ public final class TwoNumberVersioningSystem implements VersioningSystem { private final int number2; /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "n2"; } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmArguments.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmArguments.java index c6c7b2e..85176a3 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmArguments.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmArguments.java @@ -39,14 +39,16 @@ public final class JvmArguments implements Placeholder { public JvmArguments() {} /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "jvm_arguments"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { StringBuilder arguments = new StringBuilder(); for (String argument : JvmInformation.getArguments()) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationName.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationName.java index 614cb6d..6e6cb2b 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationName.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationName.java @@ -39,14 +39,16 @@ public final class JvmImplementationName implements Placeholder { public JvmImplementationName() {} /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "jvm_implementation_name"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", JvmInformation.getImplementationName()); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationVendor.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationVendor.java index 435f1d8..4cf2c8e 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationVendor.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationVendor.java @@ -39,14 +39,16 @@ public final class JvmImplementationVendor implements Placeholder { public JvmImplementationVendor() {} /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "jvm_implementation_vendor"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", JvmInformation.getImplementationVendor()); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationVersion.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationVersion.java index 02f99ea..426f905 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationVersion.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmImplementationVersion.java @@ -39,14 +39,16 @@ public final class JvmImplementationVersion implements Placeholder { public JvmImplementationVersion() {} /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "jvm_implementation_version"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", JvmInformation.getImplementationVersion()); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmJava.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmJava.java index 01b0cae..2c61b41 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmJava.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmJava.java @@ -39,14 +39,16 @@ public final class JvmJava implements Placeholder { public JvmJava() {} /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "jvm_java"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", String.valueOf(JvmInformation.getJavaVersion())); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmUptime.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmUptime.java index edb6539..9d40905 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmUptime.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/JvmUptime.java @@ -39,14 +39,16 @@ public final class JvmUptime implements Placeholder { public JvmUptime() {} /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "jvm_uptime"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", String.valueOf(JvmInformation.getUptime())); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerClass.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerClass.java index 1539b77..35f417f 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerClass.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerClass.java @@ -50,14 +50,16 @@ public final class IssuerClass implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "issuer_class"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", logIssuer.getClazz().getName().replace(logIssuer.getClazz().getPackageName() + ".", "")); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerCodePart.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerCodePart.java index 9d66e2b..12990c7 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerCodePart.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerCodePart.java @@ -50,14 +50,16 @@ public final class IssuerCodePart implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "issuer_code_part"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", logIssuer.getCodePart().name()); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerInfo.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerInfo.java index b7fc4ea..3950d06 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerInfo.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerInfo.java @@ -50,14 +50,16 @@ public final class IssuerInfo implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "issuer_info"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { if (logIssuer.getAdditionalInformation() == null) return text.replace("%" + getName() + "%", ""); else diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerMessage.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerMessage.java index bbdebb7..accdd94 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerMessage.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerMessage.java @@ -49,14 +49,16 @@ public final class IssuerMessage implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "issuer_message"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", message); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerPackage.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerPackage.java index f33bebf..bbbf916 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerPackage.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerPackage.java @@ -50,14 +50,16 @@ public final class IssuerPackage implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "issuer_package"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", logIssuer.getClazz().getPackageName()); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerPath.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerPath.java index 6e33482..159411a 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerPath.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/IssuerPath.java @@ -50,14 +50,16 @@ public final class IssuerPath implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "issuer_path"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", logIssuer.getClazz().getName()); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/Stacktrace.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/Stacktrace.java index c3b0c8b..43ab919 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/Stacktrace.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/crashhandler/Stacktrace.java @@ -51,14 +51,16 @@ public final class Stacktrace implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "stacktrace"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { if (throwable == null) return text.replace("%" + getName() + "%", "No stacktrace is available."); else { diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogClass.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogClass.java index 6527d60..947bff0 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogClass.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogClass.java @@ -50,14 +50,16 @@ public final class LogClass implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "log_class"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", logIssuer.getClazz().getName().replace(logIssuer.getClazz().getPackageName() + ".", "")); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogCodePart.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogCodePart.java index c3ff6c5..1894c07 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogCodePart.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogCodePart.java @@ -50,14 +50,16 @@ public final class LogCodePart implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "log_code_part"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", logIssuer.getCodePart().name()); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogColorPrimary.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogColorPrimary.java index 87d32be..9ed48ce 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogColorPrimary.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogColorPrimary.java @@ -50,14 +50,16 @@ public final class LogColorPrimary implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "log_color_primary"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { String color; switch (level) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogColorSecondary.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogColorSecondary.java index 89ca6b5..07a4646 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogColorSecondary.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogColorSecondary.java @@ -50,14 +50,16 @@ public final class LogColorSecondary implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "log_color_secondary"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { String color; switch (level) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogInfo.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogInfo.java index f10067a..2e4de39 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogInfo.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogInfo.java @@ -50,14 +50,16 @@ public final class LogInfo implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "log_info"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { if (logIssuer.getAdditionalInformation() != null) return text.replace("%" + getName() + "%", "/" + logIssuer.getAdditionalInformation()); return text.replace("%" + getName() + "%", ""); diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogLevel.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogLevel.java index d417086..22636b3 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogLevel.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogLevel.java @@ -49,14 +49,16 @@ public final class LogLevel implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "log_level"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { String levelText; switch (level) { diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogMessage.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogMessage.java index 7732d75..a79cd2f 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogMessage.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogMessage.java @@ -49,14 +49,16 @@ public final class LogMessage implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "log_message"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", message); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogPackage.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogPackage.java index e3e531a..1eea6ae 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogPackage.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogPackage.java @@ -50,14 +50,16 @@ public final class LogPackage implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "log_package"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", logIssuer.getClazz().getPackageName()); } } diff --git a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogPath.java b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogPath.java index 2d98aea..fb79b99 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogPath.java +++ b/base/src/main/java/de/staropensource/sosengine/base/internal/placeholders/logger/LogPath.java @@ -50,14 +50,16 @@ public final class LogPath implements Placeholder { } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String getName() { + public String getName() { return "log_path"; } /** {@inheritDoc} */ + @NotNull @Override - public @NotNull String replace(@NotNull String text) { + public String replace(@NotNull String text) { return text.replace("%" + getName() + "%", logIssuer.getClazz().getName()); } }