Skip to content

Commit ab5233a

Browse files
committed
Ensure positive URI hash values
Fixes #37
1 parent e65d819 commit ab5233a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Download.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ default String computeVersionString(String uri, String defaultVersion) {
296296
var version = property == null || property.isBlank() ? defaultVersion : property;
297297
return switch (version) {
298298
case "PARSE_URI" -> parseVersion(uri).orElse("UNKNOWN-VERSION");
299-
case "HASH_URI" -> Integer.toString(uri.hashCode());
299+
case "HASH_URI" -> Integer.toString(Math.abs(uri.hashCode()));
300300
default -> version;
301301
};
302302
}

0 commit comments

Comments
 (0)