IBM BIOS replication
I'm puzzled why little or none of the coverage of this case seems to mention the IBM PC and BIOS replication (pardon me if I've missed this).
IBM's legal/IP team were shocked at how quickly 'clones' of the PC BIOS appeared. Those developed by the two team clean-room approach were never hit with legal claims as it was obvious to IBM that the APIs had been reproduced in a fair-use/reverse-engineering approach which didn't infringe on their rights, no matter how much it annoyed IBM.
They say in Press Training never to accept the premise of the question: the Supremes are being asked to choose between *all* of Oracle's claims and *all* of Google's. When all the options are equally unacceptable, start looking for more options.
And the middle road here appears to be, protect the IP of the code that makes something work, while ruling that APIs, whether documented or not, cannot be protected by copyright.
A lot of the excellent comments going before cover patents and copyright and their differences. Copyright is actually a poor model for software (easy to obtain copyright protection, lasts - these days - nearly for ever or as long as Disney want, it's free to obtain, doesn't need to be renewed annually, and protections are massive), while patents are extremely expensive to obtain, have to be renewed annually, and each one only applies to a specific jurisdiction - and they last typically 12-16years and then that's it. Good, basic patents really do reflect the work that went into their creation - the patent protecting the Fritz-Haber process for Ammonia production from nitrogen was perfect - covered all methods without revealing the trade secrets of pressure and temperature that had been so expensively determined by theory and experimentation. Most patents these days are Secondary - e.g. patent covering CDs. No-one had thought to use optical phase-contrast to store digital information before, so it was novel.