goxr3plus / XR3Player

🎧 🎼 The MOST ADVANCED JavaFX Media Player
https://xr3player.netlify.com/
GNU Lesser General Public License v3.0
725 stars 176 forks source link

Proper return of Optional #61

Closed HelgeStenstrom closed 4 years ago

HelgeStenstrom commented 4 years ago

Some minor changes. Optional.ofNullable(null); will always return Optional.empty(), so it's better to be explicit.

Optional.ofNullable(x) is not meaningful if x cannot be null. It's better to use Optional.of(x) imagefile cannot be null, because if imageFile is null, the method selectAndSaveImage exits already on line 185.

goxr3plus commented 4 years ago

Good catch i didn't knew that 'Optional.ofNullable(null)' is the same as 'Optional.empty()'