diff options
author | Harald Musum <musum@yahooinc.com> | 2021-10-14 15:56:18 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2021-10-14 15:56:18 +0200 |
commit | 480dcdf737b6a6cc9134e2ed01723282bce94050 (patch) | |
tree | 81a933487d6f8e0a78f864c4487572e991038dc7 /config/src/main/java/com | |
parent | e2dcc4498c2a194b65a6b4903e1d4f9a7ba1f3d7 (diff) |
Cleanup, no functional changes
Diffstat (limited to 'config/src/main/java/com')
-rw-r--r-- | config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java b/config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java index efad076d85c..ea92738cc26 100644 --- a/config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java +++ b/config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java @@ -33,7 +33,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * Utilities for mangling config text, finding md5sums, finding name and namespace in .def files etc. + * Utilities for mangling config text, finding checksums, finding name and namespace in .def files etc. */ public class ConfigUtils { @@ -46,11 +46,7 @@ public class ConfigUtils { private static final String doubleFormattedMax = new DecimalFormat("#.#").format(1e308); private static final String doubleFormattedMin = new DecimalFormat("#.#", new DecimalFormatSymbols(Locale.ENGLISH)).format(-1e308); - public static String getMd5(ConfigPayload payload) { - return getMd5(getByteBuffer(payload)); - } - - public static String getMd5(String input) { + public static String getMd5(String input) { return getMd5(ByteBuffer.wrap(input.getBytes(StandardCharsets.UTF_8))); } @@ -58,7 +54,7 @@ public class ConfigUtils { return getMd5(input.wrap()); } - public static String getMd5(ByteBuffer input) { + private static String getMd5(ByteBuffer input) { MessageDigest md5 = getMd5Instance(); md5.update(input); return HexDump.toHexString(md5.digest()).toLowerCase(); @@ -81,6 +77,7 @@ public class ConfigUtils { return Long.toHexString(hasher.hash(input, 0)).toLowerCase(); } + @SuppressWarnings("unused") // Used by config integration test in system-test module public static String getXxhash64(ConfigPayload payload) { return getXxhash64(getByteBuffer(payload)); } @@ -95,7 +92,6 @@ public class ConfigUtils { return ByteBuffer.wrap(baos.toByteArray()); } - /** * Replaces sequences of spaces with 1 space, unless inside quotes. Public for testing; * @@ -378,4 +374,5 @@ public class ConfigUtils { public static boolean isGenerationNewer(long newGen, long oldGen) { return (oldGen < newGen) || (newGen == 0); } + } |