Stop using deprecated guava method

I also fixed a bunch of static analysis warnings while doing this cleanup.