You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: we aren't handling some configuration parameters in the execution path which have documented default values
Despite the defaults listed in README.md, certain implementations of ConfigContext result in NullPointerExceptions. Adding getters for disableNativeSignatures and noAuth to these classes would save some trouble for developers that choose to use these classes. One option is to implement getters in these classes if the behavior of null is best decided by the class itself. Most of these classes use MantaUtils.parseBooleanOrNull
Problematic Classes Classes that do what they say they do:
MapConfigContext: uses MantaUtils.parseBooleanOrNull which returns null when passed null
EnvVarConfigContext: uses MantaUtils.parseBooleanOrNull as well
StandardConfigContext: doesn't implement anything, which is probably as intended and implies the null-handling for default behavior belongs outside these classes
ChainedConfigContext: abstracts over arrays of multiple ConfigContexts and probably shouldn't be concerned with this kind of thing
Alternatively, we could modify the lines that cause the NullPointerExceptions codepath to check handle nulls explicitly, specifically the following two lines
The fundamental problem is that we don't have a stable value for UNSET. I could see us refactor to a wrapping object that would allow for that information to be stored, but that would be a fair bit of work.
TL;DR: we aren't handling some configuration parameters in the execution path which have documented default values
Despite the defaults listed in README.md, certain implementations of
ConfigContext
result inNullPointerException
s. Adding getters fordisableNativeSignatures
andnoAuth
to these classes would save some trouble for developers that choose to use these classes. One option is to implement getters in these classes if the behavior of null is best decided by the class itself. Most of these classes useMantaUtils.parseBooleanOrNull
Problematic ClassesClasses that do what they say they do:MapConfigContext
: usesMantaUtils.parseBooleanOrNull
which returns null when passed nullEnvVarConfigContext
: usesMantaUtils.parseBooleanOrNull
as wellStandardConfigContext
: doesn't implement anything, which is probably as intended and implies the null-handling for default behavior belongs outside these classes: abstracts over arrays of multipleChainedConfigContext
ConfigContext
s and probably shouldn't be concerned with this kind of thingAlternatively, we could modify the lines that cause the
NullPointerException
s codepath to check handle nulls explicitly, specifically the following two linesuseNativeCodeToSign
Code used to verify which classes throw and which don't:
https://gist.github.com/tjcelaya/df63bfe932afff07de4f501d6daff241
The text was updated successfully, but these errors were encountered: