Skip to content

Commit c857f16

Browse files
committed
feat/flagsmith-provider: Fix checkstyle issues
Signed-off-by: Andrew Helsby <[email protected]>
1 parent 1c04b7e commit c857f16

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

providers/flagsmith/src/main/java/dev.openfeature.contrib.providers.flagsmith/FlagsmithProvider.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public ProviderEvaluation<Value> getObjectEvaluation(
9898
* @param expectedType the expected data type of the flag as a class
9999
* @param <T> the data type of the flag
100100
* @return a ProviderEvaluation object for the given flag type
101-
* @throws OpenFeatureError
101+
* @throws OpenFeatureError when flag evaluation fails
102102
*/
103103
private <T> ProviderEvaluation<T> resolveFlagsmithEvaluation(
104104
String key, T defaultValue, EvaluationContext ctx, Class<?> expectedType
@@ -193,8 +193,8 @@ private <T> T convertValue(Object value, Class<?> expectedType) {
193193

194194
if (flagValue.getClass() != expectedType) {
195195
try {
196-
flagValue = mapJsonNodes(flagValue, expectedType);
197-
} catch (FlagsmithJsonException fje){
196+
flagValue = mapJsonNodes(flagValue, expectedType);
197+
} catch (FlagsmithJsonException fje) {
198198
log.warn(fje.getMessage());
199199
throw new TypeMismatchError("Flag value had an unexpected type "
200200
+ flagValue.getClass() + ", expected " + expectedType + ".");
@@ -253,20 +253,20 @@ private Value objectToValue(Object object) {
253253
* @return A converted object
254254
*/
255255
private <T> T mapJsonNodes(T value, Class<?> expectedType) {
256-
if (value.getClass() == BooleanNode.class && expectedType == Boolean.class){
257-
return (T)Boolean.valueOf(((BooleanNode) value).asBoolean());
256+
if (value.getClass() == BooleanNode.class && expectedType == Boolean.class) {
257+
return (T) Boolean.valueOf(((BooleanNode) value).asBoolean());
258258
}
259259
if (value.getClass() == TextNode.class && expectedType == String.class) {
260-
return (T)((TextNode) value).asText();
260+
return (T) ((TextNode) value).asText();
261261
}
262262
if (value.getClass() == IntNode.class && expectedType == Integer.class) {
263-
return (T)Integer.valueOf(((IntNode) value).asInt());
263+
return (T) Integer.valueOf(((IntNode) value).asInt());
264264
}
265265
if (value.getClass() == DoubleNode.class && expectedType == Double.class) {
266-
return (T)Double.valueOf(((DoubleNode) value).asDouble());
266+
return (T) Double.valueOf(((DoubleNode) value).asDouble());
267267
}
268268
if (value.getClass() == ObjectNode.class && expectedType == Value.class) {
269-
return (T)objectToValue((Object) value);
269+
return (T) objectToValue((Object) value);
270270
}
271271
throw new FlagsmithJsonException("Json object could not be cast to primitive type");
272272
}

providers/flagsmith/src/main/java/dev/openfeature/contrib/providers/flagsmith/exceptions/FlagsmithJsonException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import lombok.Getter;
66

77
/**
8-
* A Flagsmith provider exception is the main exception for the provider
8+
* A Flagsmith provider exception is the main exception for the provider.
99
*/
1010
@Getter
1111
public class FlagsmithJsonException extends GeneralError {

providers/flagsmith/src/main/java/dev/openfeature/contrib/providers/flagsmith/exceptions/FlagsmithProviderException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import lombok.Getter;
66

77
/**
8-
* A Flagsmith provider exception is the main exception for the provider
8+
* A Flagsmith provider exception is the main exception for the provider.
99
*/
1010
@Getter
1111
public class FlagsmithProviderException extends GeneralError {

0 commit comments

Comments
 (0)