Google’s use of Oracle’s code is fair use:

https://supreme.justia.com/cases/federal/us/593/18-956/#tab-opinion-4382274

However, what happens next is anything but clear. Here are two perspectives from JD Supra and the Copyright Alliance.