It was pretty clear, until this case. What's different here is that Oracle initially had both patent and copyright claims, and appeals to cases involving patents go to the Court of Appeals for the Federal Circuit (CAFC) instead of to the appeals court that normally serves the district court that came from (9th Circuit, in this case).
When an appeal goes to CAFC because of patent claims, CAFC handles the entire appeal. Result: instead of this being decided be an appellate court that has extensive experience in copyright (9th Circuit) in this case, and even with similar issues within copyright, it ends up at CAFC which is not nearly as experienced in the relevant areas of law.
CAFC is supposed to follow the precedent from the circuit the appeal came from in matters like this that hitched a ride with a patent issue, which is why there was so much surprise and consternation at their ruling. As far as I can see, most lawyers and legal scholars though 9th Circuit precedent would result in a win for Google.
Personally, I dislike the way other things piggyback their way to CAFC. Besides the problem mentioned above of it putting issues before CAFC that they are not experienced with, it also makes for weird precedent.
Whenever CAFC goes in a different direction from one of the regular appeals courts, you then have a situation where you effectively have two different rules in that area in that circuit, one for when the case also has a patent issue and one for when it does not.
We could do a better job of getting test cases through the courts that clarify the law.
Or we could invent new mechanisms for turning rulings from specific cases into general principles that people can rely on.
Or we could allow somewhat more hypothetical cases in certain circumstances.
As I understand it, in the US, after a few cases like the Phoenix BIOS one people came to believe that a clean-room reimplementation of an exisiting interface was generally permitted, and so people stopped suing and we didn't get a flow of cases exploring the limits of that principle.
So now when Oracle comes along and points out that the Java API is a lot bigger, and arguably more creative, than the PC BIOS call interface, there isn't an existing case that settles the question.
I can see why there's reluctance to allow people to get courts to decide hypothetical questions, but this case seems to be a decent example of when it would be helpful: if Google had had the option of getting a ruling ahead of time on whether its Java library clone was permitted, it might have saved an awful lot of time and money.
A judge can use examples and hypotheticals (called "obiter dictum"), but that doesn't create a binding precedent and later judges may ignore it, refute it or alternatively convert it into precedent by adopting the reasoning in a decision.
And sometimes laws simply get reinterpreted, after hundreds of years precedent.
Even in Canada there have been multiple occasions where Parliament did not act within the time limit and now there is no law at all.
I think the process where the legislature writes a vague law and leaves it for the courts to decide what it actually means over a series of cases has fallen down badly here.