jmuehlner commented on code in PR #834:
URL: https://github.com/apache/guacamole-client/pull/834#discussion_r1166009963
##########
extensions/guacamole-vault/modules/guacamole-vault-ksm/src/main/java/org/apache/guacamole/vault/ksm/secret/KsmRecordService.java:
##########
@@ -229,6 +231,10 @@ private <T> String getSingleStringValue(List<T> values,
Function<T, String> mapp
private <T extends KeeperRecordField> T getField(List<KeeperRecordField>
fields,
Class<T> fieldClass, Pattern labelPattern) {
+ // There are no fields if no List was provided at all
+ if (fields == null)
Review Comment:
It would be nice if it worked like that, but as far as I can tell, it needs
the explicit `@NotNull` for the compiler to do anything about it.
##########
extensions/guacamole-vault/modules/guacamole-vault-ksm/src/main/java/org/apache/guacamole/vault/ksm/secret/KsmRecordService.java:
##########
@@ -229,6 +231,10 @@ private <T> String getSingleStringValue(List<T> values,
Function<T, String> mapp
private <T extends KeeperRecordField> T getField(List<KeeperRecordField>
fields,
Class<T> fieldClass, Pattern labelPattern) {
+ // There are no fields if no List was provided at all
+ if (fields == null)
Review Comment:
I'm not suggesting that you do this right now, since it's a bit of a
refactor-cat-in-bathtub thing, but having `@Nullable` and `@NotNull`
annotations is pretty handy for this sort of thing. The compiler would complain
if you try to pass anything that might be null in here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]