Skip to content

Commit

Permalink
Fix Marketplace add-on range pattern matching
Browse files Browse the repository at this point in the history
With this fix it will use the correct string for pattern matching add-on version ranges introduced in openhab#2811.

Signed-off-by: Wouter Born <github@maindrain.net>
  • Loading branch information
wborn committed Dec 30, 2022
1 parent 98b4902 commit c663843
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private Addon convertTopicItemToAddon(DiscourseTopicItem topic, List<DiscourseUs

int compatibilityStart = topic.title.lastIndexOf("["); // version range always starts with [
if (topic.title.lastIndexOf(" ") < compatibilityStart) { // check includes [ not present
String potentialRange = topic.title.substring(compatibilityStart + 1);
String potentialRange = topic.title.substring(compatibilityStart);
Matcher matcher = BundleVersion.RANGE_PATTERN.matcher(potentialRange);
if (matcher.matches()) {
try {
Expand All @@ -300,6 +300,8 @@ private Addon convertTopicItemToAddon(DiscourseTopicItem topic, List<DiscourseUs
logger.debug("Failed to determine compatibility for addon {}: {}", topic.title, e.getMessage());
compatible = true;
}
} else {
logger.debug("Range pattern does not match '{}'", potentialRange);
}
}

Expand Down

0 comments on commit c663843

Please sign in to comment.