A federal judge upheld a major copyright victory for Google, ruling this week that it was “reasonable” for a jury to find the company’s use of software code belonging to Oracle as “fair use.”
In a 20-page ruling published Tuesday in San Francisco, U.S. District Judge William Alsup parsed the four factors that make up the “fair use” test, and also gave Google an implicit boost as the case winds its way back to an appeals court—and possibly to the Supreme Court.
“Overall, avoiding cross-system babel promoted the progress of science and useful arts — or so our jury could reasonably have found,” wrote Alsup, citing the intellectual property clause of the U.S. Constitution.
Alsup’s ruling comes nearly two weeks after the jury’s verdict in a trial that riveted many in Silicon Valley and the tech community, and which saw Oracle demand $9 billion in damages.
The case turned on Google’s (GOOG) allegedly unlawful use of Java APIs for its Android operating system. Java is an open source programming language. But Oracle (ORCL) claims Google needed permission to use the APIs, which allow different software programs to interact, and which Oracle acquired years ago from a defunct company called Sun Microsystems.
In explaining why the jury’s fair use finding was reasonable, Alsup emphasized the difference between “declaring code,” which is used to identify different actions, and “implementing code,” which carries out the actions. The judge likened the Java APIs to an arrangement of typewriter keys.
The judgment also contained other simple analogies, and explanations of code and APIs (It’s a very lucid read. I’ve posted it here, and underlined some of the relevant bits).
A Google spokesperson declined to comment on the new ruling, and referred to an earlier statement: “Today’s verdict that Android makes fair use of Java APIs represents a win for the Android ecosystem, for the Java programming community, and for software developers who rely on open and free programming languages.”
In a statement, Oracle’s general counsel, Dorian Daley, said it would purse the appeal.
“Google’s wholesale copying and use of the Oracle code to create a Java based operating system to compete with the Java platform defies any supportable legal basis for a fair use defense and turns copyright on its head,” said Daley in an email statement.
Get Data Sheet, Fortune’s technology newsletter.
A route to the Supreme Court?
Much of the Alsup ruling focuses on technical issues in copyright law, which could receive considerable attention on appeal.
The most notable of these is whether jury should have considered Google’s alleged bad faith in using the APIs.
Prior to trial, Alsup agreed that Oracle could make “bad faith” part of the fair use analysis, and the company did not so at length, portraying Google’s behavior as dishonest and shifty. But, in a retort to Oracle, Alsup wrote that allowing bad faith arguments opened the door for Google to argue it had acted in the good faith belief that it was not committing copyright infringement.
For more about Google, watch:
The judge emphasized, however, that the law is unclear whether good faith should even be part of the fair use analysis at all, and effectively teed up the issue for appeal.
If Oracle goes forward with its planned appeal, which it almost certainly will, the case will land back at the U.S. Federal Circuit Court, which many in the tech community claim badly botched an earlier ruling in the case.
That prior ruling overturned Alsup’s earlier finding that the APIs shouldn’t be subject to copyright at all since they are functional and do involve the requisite degree of creativity.
In the event the Federal Circuit issues a new ruling, the matter could go back to Supreme Court, which last year declined to hear an appeal of the case. It the top court decides to take the case on a second go-round, the justices would be in position to review everything at stake including whether APIs are copyrightable or if they should be subject to fair use.
Finally, in his new ruling, Alsup describes the bitterness that has often inflected the case. For instance, in regard to one of Google’s witnesses, the former CEO of Sun Microsystems, Jonathan Schwartz.
“Oracle’s harsh cross-examination focused on character assassination and showing that Schwartz resented Oracle for its treatment of Schwartz after the buyout,” writes Alsup.
More broadly, the case has attracted so much interest in part because of what it is at stake: APIs are a basic building block of modern software development, and letting companies control them with copyright could lead to a potential chilling effect in which coders are wary of using tools many have assumed to be free.
Story has been updated with comments from Google and Oracle spokespersons.