Skip to content

Commit 049775e

Browse files
authored
DuplicateValueCheck in MessagesBundleGroupValidator does not work #23 (#34)
Fixed the reporting of duplicate values + bonus fix: the Execution Environment is now set in the target platform file.
1 parent 97547cd commit 049775e

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

org.eclipse.babel.editor/src/org/eclipse/babel/editor/resource/validator/MessagesBundleGroupValidator.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public static void validate(MessagesBundleGroup messagesBundleGroup,
3131
// already open.
3232
// else, create MessagesBundle from PropertiesIFileResource
3333

34-
DuplicateValueCheck duplicateCheck = MsgEditorPreferences.getInstance()
35-
.getReportDuplicateValues() ? new DuplicateValueCheck() : null;
34+
boolean performDuplicateValueCheck = MsgEditorPreferences.getInstance().getReportDuplicateValues();
35+
3636
String[] keys = messagesBundleGroup.getMessageKeys();
3737
for (int i = 0; i < keys.length; i++) {
3838
String key = keys[i];
@@ -44,19 +44,19 @@ public static void validate(MessagesBundleGroup messagesBundleGroup,
4444
MissingValueCheck.MISSING_KEY));
4545
}
4646
}
47-
if (duplicateCheck != null) {
47+
if (performDuplicateValueCheck) {
4848
if (!MsgEditorPreferences.getInstance()
4949
.getReportDuplicateValuesOnlyInRootLocales()
50-
|| (locale == null || locale.toString().length() == 0)) {
50+
|| (locale == null || locale.toString().length() == 0) ) {
5151
// either the locale is the root locale either
5252
// we report duplicated on all the locales anyways.
53-
if (duplicateCheck.checkKey(messagesBundleGroup,
53+
DuplicateValueCheck duplicateCheck = new DuplicateValueCheck();
54+
if (duplicateCheck.checkKey(messagesBundleGroup,
5455
messagesBundleGroup.getMessage(key, locale))) {
5556
markerStrategy.markFailed(new ValidationFailureEvent(
5657
messagesBundleGroup, locale, key,
5758
duplicateCheck));
5859
}
59-
duplicateCheck.reset();
6060
}
6161
}
6262
}

org.eclipse.babel.tapiji.tools.target/org.eclipse.babel.tapiji.tools.target.target

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
<repository location="https://download.eclipse.org/releases/2023-09/202309131000/"/>
1010
</location>
1111
</locations>
12+
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
1213
</target>

0 commit comments

Comments
 (0)