Skip to content

Commit

Permalink
chore: sonar warnings fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jumas committed Oct 9, 2024
1 parent 8d7c85b commit c89b49b
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,9 @@ private void fillWorkItemFields(IWorkItem workItem, Map<String, Object> mappingR
@VisibleForTesting
boolean ensureValidValue(String fieldId, Object value, Set<FieldMetadata> fieldMetadataSet) {
FieldMetadata fieldMetadata = getFieldMetadataForField(fieldMetadataSet, fieldId);
if (FieldType.BOOLEAN.getType().equals(fieldMetadata.getType())) {
if (!(value instanceof String) || !("true".equalsIgnoreCase((String) value) || "false".equalsIgnoreCase((String) value))) {
throw new IllegalArgumentException(String.format("'%s' isn't a valid boolean value", value == null ? "" : value));
}
if (FieldType.BOOLEAN.getType().equals(fieldMetadata.getType()) &&
(!(value instanceof String) || !("true".equalsIgnoreCase((String) value) || "false".equalsIgnoreCase((String) value)))) {
throw new IllegalArgumentException(String.format("'%s' isn't a valid boolean value", value == null ? "" : value));
}
return true;
}
Expand Down

0 comments on commit c89b49b

Please sign in to comment.