flightstats / hub

fault tolerant, highly available service for data storage and distribution
http://www.flightstats.com
MIT License
103 stars 35 forks source link

Convert a bunch of guava Optionals to java's Optionals #1134

Closed lkemmerer closed 5 years ago

lkemmerer commented 5 years ago

Hub uses guava Optionals pretty heavily. I found this out when I tried to write Optional.empty() and got an error. IntelliJ agrees that java native's Optional is superior and it helped me do some refactoring. There were a couple cases more complicated than replacing absent with empty (the most complicated of them was replacing asSet), but generally this was pretty trivial. IntelliJ also decided to expand a bunch of import *s.

I didn't replace everything; just until the code started compiling again without mention of guava's Optional in any of the files I touched. It's a start, though.

If folks think this is a relatively safe change to consider merging, I'll deploy it to dev and run tests there beforehand. Local integration tests were green.