-
Bug
-
Resolution: Unresolved
-
P5
-
None
-
None
SonarCloud reports an oddity in `java.util.stream.FindOps.FindSink.OfRef.get()`
```
@Override
public Optional<T> get() {
return hasValue ? Optional.of(value) : null;
}
```
The method return type is Optional, but it returns `null`.
Looks like a minor overlook, as similar code in ReduceOps returns Optional.empty(). There might be other implications to this.
```
@Override
public Optional<T> get() {
return hasValue ? Optional.of(value) : null;
}
```
The method return type is Optional, but it returns `null`.
Looks like a minor overlook, as similar code in ReduceOps returns Optional.empty(). There might be other implications to this.