Skip to content

Commit

Permalink
Fixes gradle check failures
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Dec 30, 2024
1 parent ce9d5ec commit 7a868cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public class RecipientTypeRegistry {
private static final Map<String, RecipientType> REGISTRY = new HashMap<>();

public static void registerRecipientType(String key, RecipientType recipientType) {
REGISTRY.put(key.toUpperCase(), recipientType);
REGISTRY.put(key, recipientType);
}

public static RecipientType fromValue(String value) {
RecipientType type = REGISTRY.get(value.toUpperCase());
RecipientType type = REGISTRY.get(value);
if (type == null) {
throw new IllegalArgumentException("Unknown RecipientType: " + value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ public static class ScopeRecipients implements ToXContentFragment, NamedWriteabl
private final Map<RecipientType, Set<String>> recipients;

public ScopeRecipients(Map<RecipientType, Set<String>> recipients) {
if (recipients == null) {
throw new IllegalArgumentException("Recipients map cannot be null");
}
this.recipients = recipients;
}

Expand All @@ -129,7 +132,7 @@ public static ScopeRecipients fromXContent(XContentParser parser) throws IOExcep
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
if (token == XContentParser.Token.FIELD_NAME) {
String fieldName = parser.currentName();
RecipientType recipientType = RecipientTypeRegistry.fromValue(fieldName.toUpperCase());
RecipientType recipientType = RecipientTypeRegistry.fromValue(fieldName);

parser.nextToken();
Set<String> values = new HashSet<>();
Expand Down

0 comments on commit 7a868cb

Please sign in to comment.