Skip to content

Commit b06e200

Browse files
committed
fix spotbug suggestions
Signed-off-by: Kavindu Dodanduwa <[email protected]>
1 parent 266a370 commit b06e200

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/model/FlagParser.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.io.ByteArrayOutputStream;
1414
import java.io.IOException;
1515
import java.io.InputStream;
16+
import java.nio.charset.Charset;
1617
import java.util.HashMap;
1718
import java.util.Iterator;
1819
import java.util.Map;
@@ -51,7 +52,7 @@ public class FlagParser {
5152
}
5253

5354
JsonSchemaFactory instance = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7);
54-
SCHEMA_VALIDATOR = instance.getSchema(result.toString());
55+
SCHEMA_VALIDATOR = instance.getSchema(result.toString("UTF-8"));
5556
}
5657
} catch (Throwable e) {
5758
// log only, do not throw

providers/flagd/src/main/java/dev/openfeature/contrib/providers/flagd/resolver/process/targeting/lib/Murmur3.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737

3838
package dev.openfeature.contrib.providers.flagd.resolver.process.targeting.lib;
3939

40+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
41+
4042
@SuppressWarnings("PMD")
4143
public class Murmur3 {
4244
// from 64-bit linear congruential generator
@@ -141,6 +143,7 @@ public static int hash32(byte[] data, int length, int seed) {
141143
* @param seed - seed. (default 0)
142144
* @return - hashcode
143145
*/
146+
@SuppressFBWarnings(value = {"SF_SWITCH_FALLTHROUGH", "SF_SWITCH_NO_DEFAULT"}, justification = "Expected")
144147
public static int hash32(byte[] data, int offset, int length, int seed) {
145148
int hash = seed;
146149
final int nblocks = length >> 2;
@@ -264,6 +267,7 @@ public static long hash64(byte[] data, int offset, int length) {
264267
* @param seed - seed. (default is 0)
265268
* @return - hashcode
266269
*/
270+
@SuppressFBWarnings(value = "SF_SWITCH_NO_DEFAULT", justification = "Expected")
267271
public static long hash64(byte[] data, int offset, int length, int seed) {
268272
long hash = seed;
269273
final int nblocks = length >> 3;
@@ -338,6 +342,7 @@ public static long[] hash128(byte[] data) {
338342
* @param seed - seed. (default is 0)
339343
* @return - hashcode (2 longs)
340344
*/
345+
@SuppressFBWarnings(value = "SF_SWITCH_NO_DEFAULT", justification = "Expected")
341346
public static long[] hash128(byte[] data, int offset, int length, int seed) {
342347
long h1 = seed;
343348
long h2 = seed;
@@ -518,6 +523,7 @@ public final void add(byte[] data, int offset, int length) {
518523
System.arraycopy(data, offset + consumed, tail, 0, tailLen);
519524
}
520525

526+
@SuppressFBWarnings(value = {"SF_SWITCH_FALLTHROUGH", "SF_SWITCH_NO_DEFAULT"}, justification = "Expected")
521527
public final int end() {
522528
int k1 = 0;
523529
switch (tailLen) {
@@ -549,4 +555,4 @@ public final int end() {
549555
private static int orBytes(byte b1, byte b2, byte b3, byte b4) {
550556
return (b1 & 0xff) | ((b2 & 0xff) << 8) | ((b3 & 0xff) << 16) | ((b4 & 0xff) << 24);
551557
}
552-
}
558+
}

0 commit comments

Comments
 (0)