Oracle was dealt a minor setback in its lawsuit against Google when a judge denied its motion to toss out one of Google's key defences against copyright infringement in Android.

Earlier this week a jury found Google had infringed Oracle's copyrights on the APIs (application programming interfaces) in Java, but was unable to agree on whether that infringement was protected by "fair use," which allows for copying under certain circumstances.

With the jury hung on that issue, Oracle had asked the judge in the case, William Alsup, to rule as a matter of law that Google's fair use defence was invalid. Such rulings are granted when a judge, having heard all the evidence in a case, concludes there is no question left for a jury to decide.

Alsup ruled from the bench yesterday that he was denying the motion. "I don't think it would be right to rule in favour of Oracle," he said.

It doesn't mean Google has escaped liability for copyright infringement, but it means the question of fair use will probably now go to another jury. That means a partial retrial of the case is more likely.

Alsup made his ruling from the bench after two hours of intense argument from trial lawyers for Google and Oracle. The arguments also touched on a bigger, more important issue in the case - that of whether the Java APIs can be copyrighted under US law at all. The judge said he is "working hard on that" question and did not yet make a ruling.

Alsup did rule in Oracle's favour on two smaller issues. Google had asked Alsup to overturn the jury's finding that it infringed Oracle's copyright by copying nine lines of code in Java known as the rangeCheck function, and by copying documentation that accompanies the Java APIs. Alsup denied both motions, saying the jury reached those decisions on reasonable grounds.

While Alsup decides how to deal with the May 7 partial verdict on copyright infringement, the jury has already moved on to the next phase of the trial, to assess Oracle's patent claims. They heard testimony on the patent issues yesterday morning from Google's Android chief, Andy Rubin, from other engineers, and from one of Oracle's hired experts.

There are only two patents at issue in the trial, however, one of which expires at the end of this year, and Oracle's copyright claims are considered more significant.

Oracle sued Google in 2010, accusing it of infringing its Java patents and copyrights in Google's Android OS. Google says it built Android using publicly available Java code and by creating a clean room version of Sun's Java virtual machine.

The trial is a complicated one with several overlapping threads. Separate from the arguments yesterday, Google filed a motion last night asking that the proceedings be declared a mistrial, on the grounds that the issues of infringement and fair use must be decided together, not by separate juries.

Alsup has yet to rule on that motion but has done all he can throughout the case to avoid a retrial.

"I hate to even contemplate the idea of another trial, but if it comes to that, that's the way it will have to be," he said at one point.

Find your next job with techworld jobs