diff --git a/src/main/java/net/knarcraft/knarlib/formatting/StringFormatter.java b/src/main/java/net/knarcraft/knarlib/formatting/StringFormatter.java index c9daa01..48a9d32 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/StringFormatter.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/StringFormatter.java @@ -28,7 +28,7 @@ public final class StringFormatter { * @param pluginName
The name of the using plugin (used for the message prefix)
* @param translatorThe translator to use for translating messages
*/ - public StringFormatter(String pluginName, Translator translator) { + public StringFormatter(@NotNull String pluginName, @NotNull Translator translator) { this.pluginName = pluginName; this.translator = translator; } @@ -201,13 +201,9 @@ public final class StringFormatter { */ private String getFormattedMessage(@NotNull String message) { message = ColorHelper.translateColorCodes(message, this.colorConversion); - if (this.pluginName == null) { - return message; - } else { - String coloredPrefix = ColorHelper.translateColorCodes(namePrefix + ChatColor.RESET + - this.pluginName + ChatColor.RESET + nameSuffix, this.colorConversion); - return coloredPrefix + " " + ChatColor.RESET + message; - } + String coloredPrefix = ColorHelper.translateColorCodes(namePrefix + this.pluginName + + nameSuffix, this.colorConversion); + return coloredPrefix + " " + ChatColor.RESET + message; } } diff --git a/src/main/java/net/knarcraft/knarlib/formatting/StringReplacer.java b/src/main/java/net/knarcraft/knarlib/formatting/StringReplacer.java index c858bb5..9898e9d 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/StringReplacer.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/StringReplacer.java @@ -1,5 +1,7 @@ package net.knarcraft.knarlib.formatting; +import org.jetbrains.annotations.NotNull; + import java.util.HashMap; import java.util.Map; @@ -25,7 +27,7 @@ public final class StringReplacer { * * @param replacementInputThe input string to replace placeholders for
*/ - public StringReplacer(String replacementInput) { + public StringReplacer(@NotNull String replacementInput) { this.replacementInput = replacementInput; } @@ -35,7 +37,7 @@ public final class StringReplacer { * @param placeholderThe placeholder to replace
* @param valueThe replacement value
*/ - public void add(String placeholder, String value) { + public void add(@NotNull String placeholder, @NotNull String value) { this.replacements.put(placeholder, value); } @@ -44,7 +46,7 @@ public final class StringReplacer { * * @param placeholderThe placeholder to remove
*/ - public void remove(String placeholder) { + public void remove(@NotNull String placeholder) { this.replacements.remove(placeholder); } @@ -55,7 +57,7 @@ public final class StringReplacer { * * @returnThe string with placeholders replaced
*/ - public String replace() { + public @NotNull String replace() { if (replacementInput == null) { throw new IllegalStateException("This method cannot be run without a defined string"); } @@ -68,7 +70,7 @@ public final class StringReplacer { * @param inputThe string to replace placeholders in
* @returnThe string with placeholders replaced
*/ - public String replace(String input) { + public @NotNull String replace(@NotNull String input) { return StringFormatter.replacePlaceholders(input, replacements.keySet().toArray(new String[0]), replacements.values().toArray(new String[0])); } diff --git a/src/main/java/net/knarcraft/knarlib/formatting/TimeFormatter.java b/src/main/java/net/knarcraft/knarlib/formatting/TimeFormatter.java index 6689db0..237821d 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/TimeFormatter.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/TimeFormatter.java @@ -1,5 +1,7 @@ package net.knarcraft.knarlib.formatting; +import org.jetbrains.annotations.NotNull; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -28,7 +30,7 @@ public final class TimeFormatter { * @param durationThe duration, in seconds, to display
* @returnThe string used for displaying this sign's duration
*/ - public static String getDurationString(Translator translator, long duration) { + public static String getDurationString(@NotNull Translator translator, long duration) { //Initialize time units once, and only if this method is actually used if (sortedUnits == null) { initializeUnits(translator); @@ -76,8 +78,8 @@ public final class TimeFormatter { * @param castToIntWhether to cast the duration to an int
* @returnThe formatted duration string
*/ - private static String formatDurationString(double duration, Translator translator, - TranslatableMessage translatableMessage, boolean castToInt) { + private static String formatDurationString(double duration, @NotNull Translator translator, + @NotNull TranslatableMessage translatableMessage, boolean castToInt) { String durationFormat = translator.getTranslatedMessage(TranslatableTimeUnit.DURATION_FORMAT); durationFormat = replacePlaceholder(durationFormat, "{unit}", translator.getTranslatedMessage(translatableMessage)); @@ -88,7 +90,7 @@ public final class TimeFormatter { /** * Initializes the mapping of available time units for formatting permission sign duration */ - private static void initializeUnits(Translator translator) { + private static void initializeUnits(@NotNull Translator translator) { //Register each time unit with a registered singular and plural translation timeUnits = new HashMap<>(); registerTimeUnit(translator, 315360000, TranslatableTimeUnit.UNIT_DECADE, TranslatableTimeUnit.UNIT_DECADES); @@ -102,7 +104,7 @@ public final class TimeFormatter { TranslatableTimeUnit.UNIT_SECONDS); //As now and seconds are the base units, those must be registered to use getDurationString - if (!registeredSeconds || !hasTranslation(translator, TranslatableTimeUnit.UNIT_NOW)) { + if (!registeredSeconds || !translator.hasTranslation(TranslatableTimeUnit.UNIT_NOW)) { throw new IllegalStateException("A translation is missing for UNIT_SECOND, UNIT_SECONDS or UNIT_NOW"); } @@ -121,11 +123,12 @@ public final class TimeFormatter { * @param pluralThe translatable time unit to use for the plural form
* @returnTrue if the time unit was registered. False if a translation is missing
*/ - private static boolean registerTimeUnit(Translator translator, double seconds, TranslatableTimeUnit singular, - TranslatableTimeUnit plural) { + private static boolean registerTimeUnit(@NotNull Translator translator, double seconds, + @NotNull TranslatableTimeUnit singular, + @NotNull TranslatableTimeUnit plural) { String singularTranslation = translator.getTranslatedMessage(singular); String pluralTranslation = translator.getTranslatedMessage(plural); - if (hasTranslation(translator, singular) && hasTranslation(translator, plural)) { + if (translator.hasTranslation(singular) && translator.hasTranslation(plural)) { timeUnits.put(seconds, new TranslatableTimeUnit[]{singular, plural}); return true; } else { @@ -133,16 +136,4 @@ public final class TimeFormatter { } } - /** - * Checks whether the given translatable message has a registered translation - * - * @param translatorThe translator to check
- * @param translatableMessageThe translatable message to check
- * @returnTrue if a non-empty translation has been registered
- */ - private static boolean hasTranslation(Translator translator, TranslatableMessage translatableMessage) { - String translation = translator.getTranslatedMessage(translatableMessage); - return translation != null && !translation.isBlank(); - } - } diff --git a/src/main/java/net/knarcraft/knarlib/formatting/TranslatableMessage.java b/src/main/java/net/knarcraft/knarlib/formatting/TranslatableMessage.java index c35a1bc..803f492 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/TranslatableMessage.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/TranslatableMessage.java @@ -1,5 +1,7 @@ package net.knarcraft.knarlib.formatting; +import org.jetbrains.annotations.NotNull; + /** * A message which can be translated */ @@ -13,7 +15,7 @@ public interface TranslatableMessage { * * @returnThe name of this translatable message
*/ - String name(); + @NotNull String name(); /** * Gets all translatable messages @@ -22,6 +24,6 @@ public interface TranslatableMessage { * * @returnAll translatable messages
*/ - TranslatableMessage[] getAllMessages(); + @NotNull TranslatableMessage[] getAllMessages(); } diff --git a/src/main/java/net/knarcraft/knarlib/formatting/TranslatableTimeUnit.java b/src/main/java/net/knarcraft/knarlib/formatting/TranslatableTimeUnit.java index 2e4151d..49a9dd8 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/TranslatableTimeUnit.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/TranslatableTimeUnit.java @@ -1,5 +1,7 @@ package net.knarcraft.knarlib.formatting; +import org.jetbrains.annotations.NotNull; + /** * An enum containing all translatable time units * @@ -101,7 +103,7 @@ public enum TranslatableTimeUnit implements TranslatableMessage { ; @Override - public TranslatableMessage[] getAllMessages() { + public @NotNull TranslatableMessage[] getAllMessages() { return TranslatableTimeUnit.values(); } diff --git a/src/main/java/net/knarcraft/knarlib/formatting/Translator.java b/src/main/java/net/knarcraft/knarlib/formatting/Translator.java index 858910d..3d23c08 100644 --- a/src/main/java/net/knarcraft/knarlib/formatting/Translator.java +++ b/src/main/java/net/knarcraft/knarlib/formatting/Translator.java @@ -5,12 +5,12 @@ import net.knarcraft.knarlib.util.ColorHelper; import net.knarcraft.knarlib.util.FileHelper; import org.bukkit.Bukkit; import org.bukkit.configuration.file.YamlConfiguration; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.io.BufferedReader; import java.io.File; -import java.io.FileInputStream; import java.io.FileNotFoundException; -import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -41,7 +41,7 @@ public final class Translator { * * @param translatableMessageA translatable message in the category to register
*/ - public void registerMessageCategory(TranslatableMessage translatableMessage) { + public void registerMessageCategory(@NotNull TranslatableMessage translatableMessage) { messageCategories.add(translatableMessage); } @@ -54,12 +54,8 @@ public final class Translator { * * @param colorConversionThe color conversion to be used
*/ - public void setColorConversion(ColorConversion colorConversion) { - if (colorConversion != null) { - this.colorConversion = colorConversion; - } else { - throw new IllegalArgumentException("Color conversion cannot be null"); - } + public void setColorConversion(@NotNull ColorConversion colorConversion) { + this.colorConversion = colorConversion; } /** @@ -69,7 +65,8 @@ public final class Translator { * @param fallbackLanguageThe default language to fall back on in the case of missing translations
* @param selectedLanguageThe currently selected language
*/ - public void loadLanguages(File dataFolder, String fallbackLanguage, String selectedLanguage) { + public void loadLanguages(@NotNull File dataFolder, @NotNull String fallbackLanguage, + @NotNull String selectedLanguage) { backupTranslatedMessages = loadTranslatedMessages(fallbackLanguage); translatedMessages = loadCustomTranslatedMessages(dataFolder, selectedLanguage); if (translatedMessages == null) { @@ -77,13 +74,24 @@ public final class Translator { } } + /** + * Checks whether the given translatable message has a translation + * + * @param translatableMessageThe translatable message to check
+ * @returnTrue if the message has a translation
+ */ + public boolean hasTranslation(@NotNull TranslatableMessage translatableMessage) { + return backupTranslatedMessages.containsKey(translatableMessage) && + !backupTranslatedMessages.get(translatableMessage).isBlank(); + } + /** * Gets a translated version of the given translatable message * * @param translatableMessageThe message to translate
* @returnThe translated message
*/ - public String getTranslatedMessage(TranslatableMessage translatableMessage) { + public @NotNull String getTranslatedMessage(@NotNull TranslatableMessage translatableMessage) { if (translatedMessages == null) { return "Translated strings not loaded"; } @@ -104,7 +112,7 @@ public final class Translator { * @param languageThe language chosen by the user
* @returnA mapping of all strings for the given language
*/ - public MapThe selected language
* @returnThe loaded translated strings, or null if no custom language file exists
*/ - public MapThe buffered reader to read from
* @returnThe loaded translated strings
*/ - private MapThe z-offset/spread of the spawned particles
* @param extraExtra data for the particle. Usage depends on the particle type.
*/ - public ParticleConfig(ParticleMode particleMode, Particle particleType, int particleAmount, double particleDensity, - double heightOffset, double offsetX, double offsetY, double offsetZ, double extra) { + public ParticleConfig(@NotNull ParticleMode particleMode, @NotNull Particle particleType, int particleAmount, + double particleDensity, double heightOffset, double offsetX, double offsetY, double offsetZ, + double extra) { this.particleMode = particleMode; this.particleType = particleType; this.particleAmount = particleAmount; @@ -88,7 +89,7 @@ public final class ParticleConfig { * * @returnThe particle mode
*/ - public ParticleMode getParticleMode() { + public @NotNull ParticleMode getParticleMode() { return particleMode; } @@ -97,7 +98,7 @@ public final class ParticleConfig { * * @returnThe particle type
*/ - public Particle getParticleType() { + public @NotNull Particle getParticleType() { return particleType; } diff --git a/src/main/java/net/knarcraft/knarlib/particle/ParticleSpawner.java b/src/main/java/net/knarcraft/knarlib/particle/ParticleSpawner.java index 5775df9..8faa133 100644 --- a/src/main/java/net/knarcraft/knarlib/particle/ParticleSpawner.java +++ b/src/main/java/net/knarcraft/knarlib/particle/ParticleSpawner.java @@ -69,7 +69,7 @@ public final class ParticleSpawner implements Runnable { * * @returnThe id used for stored calculations
*/ - public UUID getStoredCalculationId() { + public @NotNull UUID getStoredCalculationId() { return this.storedCalculationId; } @@ -131,7 +131,7 @@ public final class ParticleSpawner implements Runnable { * * @returnThe particle config to use
*/ - private ParticleConfig getParticleConfig() { + private @NotNull ParticleConfig getParticleConfig() { ParticleConfig materialConfig = this.materialConfigs.get(processingBlock.getType()); if (materialConfig != null) { return materialConfig; diff --git a/src/main/java/net/knarcraft/knarlib/particle/ParticleTrailSpawner.java b/src/main/java/net/knarcraft/knarlib/particle/ParticleTrailSpawner.java index d36eead..19c2275 100644 --- a/src/main/java/net/knarcraft/knarlib/particle/ParticleTrailSpawner.java +++ b/src/main/java/net/knarcraft/knarlib/particle/ParticleTrailSpawner.java @@ -85,7 +85,7 @@ public final class ParticleTrailSpawner implements Runnable { * * @param playerIdThe id of the player to remove the trail for
*/ - public void removeTrail(UUID playerId) { + public void removeTrail(@NotNull UUID playerId) { this.playersWithTrails.remove(playerId); this.playerParticles.remove(playerId); } @@ -95,7 +95,7 @@ public final class ParticleTrailSpawner implements Runnable { * * @param playerIdThe id of the player to add the trail to
*/ - public void startTrail(UUID playerId) { + public void startTrail(@NotNull UUID playerId) { this.playerParticles.put(playerId, randomParticle()); this.playersWithTrails.add(playerId); } @@ -105,7 +105,7 @@ public final class ParticleTrailSpawner implements Runnable { * * @returnA random particle
*/ - private Particle randomParticle() { + private @NotNull Particle randomParticle() { Particle spawnParticle = null; while (spawnParticle == null || spawnParticle.getDataType() != Void.class) { spawnParticle = randomTrailTypes.get(random.nextInt(randomTrailTypes.size())); diff --git a/src/main/java/net/knarcraft/knarlib/util/ColorHelper.java b/src/main/java/net/knarcraft/knarlib/util/ColorHelper.java index 0c8cf7e..f5793bd 100644 --- a/src/main/java/net/knarcraft/knarlib/util/ColorHelper.java +++ b/src/main/java/net/knarcraft/knarlib/util/ColorHelper.java @@ -3,6 +3,7 @@ package net.knarcraft.knarlib.util; import net.knarcraft.knarlib.property.ColorConversion; import net.md_5.bungee.api.ChatColor; import org.bukkit.Color; +import org.jetbrains.annotations.NotNull; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -25,7 +26,7 @@ public final class ColorHelper { * @param colorThe color to invert
* @returnThe inverted color
*/ - public static Color invert(Color color) { + public static @NotNull Color invert(@NotNull Color color) { return color.setRed(255 - color.getRed()).setGreen(255 - color.getGreen()).setBlue(255 - color.getBlue()); } @@ -35,7 +36,7 @@ public final class ColorHelper { * @param colorThe color to convert into a chat color
* @returnThe resulting chat color
*/ - public static ChatColor fromColor(Color color) { + public static @NotNull ChatColor fromColor(@NotNull Color color) { return ChatColor.of(String.format("#%02X%02X%02X", color.getRed(), color.getGreen(), color.getBlue())); } @@ -58,7 +59,7 @@ public final class ColorHelper { * @param colorConversionThe type of color conversion to apply before stripping
* @returnThe message without color codes
*/ - public static String stripColorCodes(String message, ColorConversion colorConversion) { + public static @NotNull String stripColorCodes(@NotNull String message, @NotNull ColorConversion colorConversion) { return ChatColor.stripColor(translateColorCodes(message, colorConversion)); } @@ -69,7 +70,7 @@ public final class ColorHelper { * @param colorConversionThe type of color conversion to apply
* @returnThe string with color codes applied
*/ - public static String translateColorCodes(String message, ColorConversion colorConversion) { + public static @NotNull String translateColorCodes(@NotNull String message, @NotNull ColorConversion colorConversion) { return switch (colorConversion) { case NONE -> message; case NORMAL -> ChatColor.translateAlternateColorCodes('&', message); @@ -85,7 +86,7 @@ public final class ColorHelper { * @param onlyRGBWhether to only convert RGB (hexadecimal) color codes. If false, &[a-f0-9] will be converted as well.
* @returnThe message with color codes translated
*/ - private static String translateAllColorCodes(String message, boolean onlyRGB) { + private static @NotNull String translateAllColorCodes(@NotNull String message, boolean onlyRGB) { if (!onlyRGB) { message = ChatColor.translateAlternateColorCodes('&', message); } diff --git a/src/main/java/net/knarcraft/knarlib/util/FileHelper.java b/src/main/java/net/knarcraft/knarlib/util/FileHelper.java index 89556d8..481eed2 100644 --- a/src/main/java/net/knarcraft/knarlib/util/FileHelper.java +++ b/src/main/java/net/knarcraft/knarlib/util/FileHelper.java @@ -1,6 +1,8 @@ package net.knarcraft.knarlib.util; import net.knarcraft.knarlib.property.ColorConversion; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -33,7 +35,7 @@ public final class FileHelper { * @returnA buffered read for reading the file
* @throws FileNotFoundExceptionIf unable to get an input stream for the given file
*/ - public static BufferedReader getBufferedReaderForInternalFile(String file) throws FileNotFoundException { + public static @NotNull BufferedReader getBufferedReaderForInternalFile(@NotNull String file) throws FileNotFoundException { InputStream inputStream = getInputStreamForInternalFile(file); if (inputStream == null) { throw new FileNotFoundException("Unable to read the given file"); @@ -50,7 +52,7 @@ public final class FileHelper { * @param fileThe file to read
* @returnAn input stream for the file
*/ - public static InputStream getInputStreamForInternalFile(String file) { + public static @Nullable InputStream getInputStreamForInternalFile(@NotNull String file) { return FileHelper.class.getResourceAsStream(file); } @@ -61,7 +63,7 @@ public final class FileHelper { * @returnA buffered reader reading the file
* @throws FileNotFoundExceptionIf the given file does not exist
*/ - public static BufferedReader getBufferedReaderFromString(String file) throws FileNotFoundException { + public static @NotNull BufferedReader getBufferedReaderFromString(@NotNull String file) throws FileNotFoundException { FileInputStream fileInputStream = new FileInputStream(file); return getBufferedReaderFromInputStream(fileInputStream); } @@ -72,7 +74,7 @@ public final class FileHelper { * @param inputStreamThe input stream to read
* @returnA buffered reader reading the input stream
*/ - public static BufferedReader getBufferedReaderFromInputStream(InputStream inputStream) { + public static @NotNull BufferedReader getBufferedReaderFromInputStream(@NotNull InputStream inputStream) { InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8); return new BufferedReader(inputStreamReader); } @@ -84,7 +86,7 @@ public final class FileHelper { * @returnA buffered writer writing to the file
* @throws FileNotFoundExceptionIf the file does not exist
*/ - public static BufferedWriter getBufferedWriterFromString(String file) throws FileNotFoundException { + public static @NotNull BufferedWriter getBufferedWriterFromString(@NotNull String file) throws FileNotFoundException { FileOutputStream fileOutputStream = new FileOutputStream(file); OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fileOutputStream, StandardCharsets.UTF_8); return new BufferedWriter(outputStreamWriter); @@ -99,8 +101,9 @@ public final class FileHelper { * @returnA map containing the read pairs
* @throws IOExceptionIf unable to read from the stream
*/ - public static MapThe string to remove the BOM from
* @returnA string guaranteed without a BOM
*/ - private static String removeUTF8BOM(String string) { + private static @NotNull String removeUTF8BOM(@NotNull String string) { String UTF8_BOM = "\uFEFF"; if (string.startsWith(UTF8_BOM)) { string = string.substring(1); diff --git a/src/main/java/net/knarcraft/knarlib/util/ParticleHelper.java b/src/main/java/net/knarcraft/knarlib/util/ParticleHelper.java index 0ad6dc6..3763060 100644 --- a/src/main/java/net/knarcraft/knarlib/util/ParticleHelper.java +++ b/src/main/java/net/knarcraft/knarlib/util/ParticleHelper.java @@ -229,7 +229,7 @@ public final class ParticleHelper { * @param blockThe block to check
* @returnThe height of the block
*/ - public static double getBlockHeight(Block block) { + public static double getBlockHeight(@NotNull Block block) { double maxY = 0; for (BoundingBox boundingBox : block.getCollisionShape().getBoundingBoxes()) { if (boundingBox.getMaxY() > maxY) { diff --git a/src/main/java/net/knarcraft/knarlib/util/TabCompletionHelper.java b/src/main/java/net/knarcraft/knarlib/util/TabCompletionHelper.java index 69b3988..795910d 100644 --- a/src/main/java/net/knarcraft/knarlib/util/TabCompletionHelper.java +++ b/src/main/java/net/knarcraft/knarlib/util/TabCompletionHelper.java @@ -1,5 +1,7 @@ package net.knarcraft.knarlib.util; +import org.jetbrains.annotations.NotNull; + import java.util.ArrayList; import java.util.List; @@ -19,7 +21,7 @@ public final class TabCompletionHelper { * @param typedTextThe text the player has started typing
* @returnThe given string values that contain the player's typed text
*/ - public static ListThe text the player has started typing
* @returnThe given string values that start with the player's typed text
*/ - public static ListThe supplier used to get the current plugin version
* @param setVersionMethodA method to call with the new version as an argument. Can be used to alert admins about an available update or similar.
*/ - public static void checkForUpdate(Plugin plugin, String apiResourceURL, SupplierThe supplier used to get the current plugin version
* @param setVersionMethodA method to call with the new version as an argument. Can be used to alert admins about an available update or similar.
*/ - private static void queryAPI(Plugin plugin, String APIResourceURL, SupplierThe old (current) plugin version
* @returnThe string to display
*/ - public static String getUpdateAvailableString(String newVersion, String oldVersion) { + public static @NotNull String getUpdateAvailableString(@NotNull String newVersion, @NotNull String oldVersion) { return String.format(updateNotice, newVersion, oldVersion); } @@ -88,7 +92,7 @@ public final class UpdateChecker { * @param newVersionThe new version to check
* @returnTrue if the new version is higher than the old one
*/ - public static boolean isVersionHigher(String oldVersion, String newVersion) { + public static boolean isVersionHigher(@NotNull String oldVersion, @NotNull String newVersion) { oldVersion = removeNonNumericCharacters(oldVersion); newVersion = removeNonNumericCharacters(newVersion); String[] oldVersionParts = oldVersion.split("\\."); @@ -110,7 +114,7 @@ public final class UpdateChecker { * @param versionStringThe version string to clean
* @returnThe string with non-numeric characters replaced
*/ - private static String removeNonNumericCharacters(String versionString) { + private static @NotNull String removeNonNumericCharacters(@NotNull String versionString) { return versionString.replaceAll("[^0-9.]", ""); }