[transactionwebhooks] Code generation: update services and models - #2071
AdyenAutomationBot wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Java SDK for transaction webhooks by adding a new networkVariant field to the IssuedCard model, including its enum definition, getter/setter, and builder methods. The review feedback recommends adding a null check to the NetworkVariantEnum.fromValue method to avoid logging false-positive warnings when the networkVariant field is null or missing.
| public static NetworkVariantEnum fromValue(String value) { | ||
| for (NetworkVariantEnum b : NetworkVariantEnum.values()) { | ||
| if (b.value.equals(value)) { | ||
| return b; | ||
| } | ||
| } | ||
| // handling unexpected value | ||
| LOG.warning( | ||
| "NetworkVariantEnum: unexpected enum value '" | ||
| + value | ||
| + "' - Supported values are " | ||
| + Arrays.toString(NetworkVariantEnum.values())); | ||
| return null; | ||
| } |
There was a problem hiding this comment.
If the incoming JSON payload does not contain the networkVariant field or if it is explicitly set to null, Jackson may invoke this @JsonCreator method with a null argument. Currently, passing null will cause the method to loop through the enum values, fail to find a match, and log a warning: unexpected enum value 'null'. In high-throughput environments, this false-positive warning can flood application logs. Consider adding a null check at the beginning of the method to return null immediately without logging a warning.
public static NetworkVariantEnum fromValue(String value) {
if (value == null) {
return null;
}
for (NetworkVariantEnum b : NetworkVariantEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
// handling unexpected value
LOG.warning(
"NetworkVariantEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(NetworkVariantEnum.values()));
return null;
}c62bd5a to
0c75484
Compare
|



This PR contains the automated changes for the
transactionwebhooksservice.The commit history of this PR reflects the
adyen-openapicommits that have been applied.