From 9392b4f2abd79b587b4f3b0b801661d68b81d50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Ha=C3=9Flinger?= Date: Thu, 23 Sep 2021 22:40:38 +0200 Subject: [PATCH 1/2] Fix npe if path prefix is undefined. Resolves #57 --- .../marhali/easyi18n/model/SettingsState.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/marhali/easyi18n/model/SettingsState.java b/src/main/java/de/marhali/easyi18n/model/SettingsState.java index 5119119..2638c7d 100644 --- a/src/main/java/de/marhali/easyi18n/model/SettingsState.java +++ b/src/main/java/de/marhali/easyi18n/model/SettingsState.java @@ -11,6 +11,7 @@ public class SettingsState { public static final String DEFAULT_PREVIEW_LOCALE = "en"; public static final String DEFAULT_FILE_PATTERN = ".*"; + public static final String DEFAULT_PATH_PREFIX = ""; public static final boolean DEFAULT_CODE_ASSISTANCE = true; private String localesPath; @@ -45,6 +46,14 @@ public class SettingsState { this.previewLocale = previewLocale; } + public @NotNull String getPathPrefix() { + return pathPrefix != null ? pathPrefix : DEFAULT_PATH_PREFIX; + } + + public void setPathPrefix(String pathPrefix) { + this.pathPrefix = pathPrefix; + } + public boolean isCodeAssistance() { return codeAssistance == null ? DEFAULT_CODE_ASSISTANCE : codeAssistance; } @@ -52,12 +61,4 @@ public class SettingsState { public void setCodeAssistance(boolean codeAssistance) { this.codeAssistance = codeAssistance; } - - public void setPathPrefix(String pathPrefix) { - this.pathPrefix = pathPrefix; - } - - public String getPathPrefix() { - return pathPrefix; - } } \ No newline at end of file From 221352b00877312f72464ad102c2d4644a4f39ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Ha=C3=9Flinger?= Date: Thu, 23 Sep 2021 22:44:21 +0200 Subject: [PATCH 2/2] Prepare hotfix release --- CHANGELOG.md | 3 +++ gradle.properties | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b33c112..5098bbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ # easy-i18n Changelog ## [Unreleased] +### Fixed +- Exception on key annotation if path-prefix is undefined + ## [1.5.0] ### Added - Support for YAML locale files. Thanks to @sunarya-thito diff --git a/gradle.properties b/gradle.properties index 960eda4..c31f92e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ pluginGroup = de.marhali.easyi18n pluginName = easy-i18n -pluginVersion = 1.5.0 +pluginVersion = 1.5.1 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions.