Skip to content

Commit 943605b

Browse files
author
Ravi Nadahar
committed
Address review feedback
Signed-off-by: Ravi Nadahar <nadahar@rediffmail.com>
1 parent 364bd58 commit 943605b

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

bundles/org.openhab.core.addon.marketplace/src/main/java/org/openhab/core/addon/marketplace/AbstractRemoteAddonService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ public abstract class AbstractRemoteAddonService implements AddonService {
6969
if (compatible != 0) {
7070
return compatible;
7171
}
72+
Version v1 = addon1.getVersion();
7273
Version v2 = addon2.getVersion();
73-
return v2 == null ? 1 : v2.compareTo(addon1.getVersion());
74+
return v1 == null && v2 == null ? 0 : v2 == null ? 1 : v2.compareTo(v1);
7475
};
7576

7677
protected final Version coreVersion;

bundles/org.openhab.core.addon/src/main/java/org/openhab/core/addon/Addon.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
package org.openhab.core.addon;
1414

15-
import java.util.HashMap;
15+
import java.util.LinkedHashMap;
1616
import java.util.List;
1717
import java.util.Map;
1818
import java.util.Objects;
@@ -362,7 +362,7 @@ private Builder(Addon addon) {
362362
this.connection = addon.connection;
363363
this.backgroundColor = addon.backgroundColor;
364364
this.imageLink = addon.imageLink;
365-
this.properties = addon.properties;
365+
this.properties = new LinkedHashMap<>(addon.properties);
366366
this.loggerPackages = addon.loggerPackages;
367367
}
368368

@@ -446,7 +446,7 @@ public Builder withKeywords(String keywords) {
446446
return countries;
447447
}
448448

449-
public Builder withCountries(List<@NonNull String> countries) {
449+
public Builder withCountries(@Nullable List<@NonNull String> countries) {
450450
this.countries = countries;
451451
return this;
452452
}
@@ -474,7 +474,7 @@ public Builder withImageLink(@Nullable String imageLink) {
474474
public Builder withProperty(@NonNull String key, @NonNull Object value) {
475475
Map<@NonNull String, @NonNull Object> props = this.properties;
476476
if (props == null) {
477-
props = new HashMap<>();
477+
props = new LinkedHashMap<>();
478478
}
479479
props.put(key, value);
480480
this.properties = props;

bundles/org.openhab.core/src/main/java/org/openhab/core/common/VersionRange.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public int hashCode() {
199199
if (h != 0) {
200200
return h;
201201
}
202-
return h = Objects.hash(leftInclusive, left, right, rightInclusive);
202+
return hash = Objects.hash(leftInclusive, left, right, rightInclusive);
203203
}
204204

205205
@Override

0 commit comments

Comments
 (0)