Skip to content

Commit

Permalink
Fix Semantics default synonyms (#3511)
Browse files Browse the repository at this point in the history
Fix incorrect Property id

Signed-off-by: Jimmy Tanagra <[email protected]>
  • Loading branch information
jimtng authored Apr 1, 2023
1 parent 4182980 commit 003635d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
* @author Kai Kreuzer - Initial contribution
*/
@NonNullByDefault
@TagInfo(id = "MeasurementProperty")
@TagInfo(id = "Property")
public interface Property extends Tag {
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.Set;
import java.util.TreeMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
Expand Down Expand Up @@ -84,7 +85,10 @@ public static List<String> getLabelAndSynonyms(Class<? extends Tag> tag, Locale
String entry = rb.getString(tag.getAnnotation(TagInfo.class).id());
return List.of(entry.toLowerCase(locale).split(","));
} catch (MissingResourceException e) {
return List.of(tag.getAnnotation(TagInfo.class).label());
TagInfo tagInfo = tag.getAnnotation(TagInfo.class);
Stream<String> label = Stream.of(tagInfo.label());
Stream<String> synonyms = Stream.of(tagInfo.synonyms().split(","));
return Stream.concat(label, synonyms).map(s -> s.toLowerCase(locale)).distinct().toList();
}
}

Expand Down

0 comments on commit 003635d

Please sign in to comment.