> The API isn't the text, it's an idea that happens to be represented by text
Well, if this was true, google wouldn't have needed to copy-paste the api definitions. Representing the same idea would be possible many different ways. And no copying would be needed.
> Oracle would have had to hold a patent to the Java API,
According to paperwork, they sued google for patent infringement too, those arguments were just rejected by the legal people.
> Should astronomers re-derive general relativity from first principles every time they calculate the orbit of an asteroid, simply because Einstein wrote some words on a page?
Yes, at least for the first 70 years... both patents and copyrights are for limited amount of time. Of course applying the information in new context is still possible, in case you don't need to copy-paste the text exactly like it was written in the original.