Skip to content

Commit

Permalink
Mark the "previous value or null" type of Properties.compute as n…
Browse files Browse the repository at this point in the history
…ullable. (#117)

This matches [what we have for
`Map.compute`](https://github.com/jspecify/jdk/blob/7cc2fbd5f404bf5403bd1375b47024a855838fef/src/java.base/share/classes/java/util/Map.java#L1247),
noting that `Properties` is a `Hashtable<Object, Object>` and so a
`Map<Object, Object>`.

See previous discussion in
#114 (comment)
  • Loading branch information
cpovirk authored Dec 19, 2024
1 parent 7cc2fbd commit 7630b5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/util/Properties.java
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ public synchronized Object computeIfAbsent(Object key,

@Override
public synchronized @Nullable Object compute(Object key,
BiFunction<? super Object, ? super Object, ?> remappingFunction) {
BiFunction<? super Object, ? super @Nullable Object, ?> remappingFunction) {
return map.compute(key, remappingFunction);
}

Expand Down

0 comments on commit 7630b5d

Please sign in to comment.