Skip to content

Commit

Permalink
refactor: make loadFromProperties private (#2287)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Laprun <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
  • Loading branch information
metacosm authored and csviri committed Nov 13, 2024
1 parent f3ade92 commit 18cf3a5
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ public class Utils {
* via the {@code git-commit-id-plugin} maven plugin.
*
* @return a {@link Version} object encapsulating the version information
* @deprecated use {@link #VERSION} instead, as this method will be made internal in a future
* release
*/
@Deprecated
public static Version loadFromProperties() {
private static Version loadFromProperties() {
final var is =
Thread.currentThread().getContextClassLoader().getResourceAsStream("version.properties");

Expand Down Expand Up @@ -79,9 +76,8 @@ public static int ensureValid(int value, String description, int minValue, int d
throw new IllegalArgumentException(
"Default value for " + description + " must be greater than " + minValue);
}
log.warn("Requested " + description + " should be greater than " + minValue + ". Requested: "
+ value + ", using " + defaultValue + (defaultValue == minValue ? "" : " (default)") +
" instead");
log.warn("Requested {} should be greater than {}. Requested: {}, using {}{} instead",
description, minValue, value, defaultValue, defaultValue == minValue ? "" : " (default)");
value = defaultValue;
}
return value;
Expand Down

0 comments on commit 18cf3a5

Please sign in to comment.