We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abb236e commit dbb7330Copy full SHA for dbb7330
src/main/java/org/scijava/optional/AbstractOptions.java
@@ -73,9 +73,7 @@ public String toString()
73
@Override
74
public < T > T getValueOrDefault( final String key, final T defaultValue )
75
{
76
- @SuppressWarnings( "unchecked" )
77
- final T value = ( T ) theOptions.get( key );
78
- return value == null ? defaultValue : value;
+ return theOptions.containsKey( key ) ? ( T ) theOptions.get( key ) : defaultValue;
79
}
80
81
0 commit comments