Oracle has made an all-or-next-to-nothing bet in its ongoing court battle with Google.

On Tuesday, Oracle said that if Judge William Alsup rules that the Java APIs are not subject to copyright, it will not seek extensive damages from Google for infringing copyrights related to other parts of the Java platform. The move came after a stern rebuke from Alsup, who accused Oracle of going on a "fishing expedition" for damages beyond the standard amount for copyright infringement.

Last week, a jury was unable to decide whether Google went beyond "fair use" of Oracle's copyrights in cloning 37 Java APIs, or application programming interfaces, leaving the key question in the trial unanswered. But it did decide that the search giant infringed in lifting nine lines of Oracle code for inclusion with Android, and the judge ruled that Google infringed by including eight decompiled files from the Java platform.

Android contains 15 million lines of code, so that the code deemed to infringe on Oracle copyrights is relatively small. But during a heated back and forth with William Alsup, Oracle lead counsel David Boies argued that Oracle still had the right to ask for infringer's profits – a portion of Android's revenue, about $3 million a day. But he eventually agreed to forgo infringer's profit if Alsup ruled that Oracle could not claim infringement on the Java APIs.

Initially, Boies argued that if the copied files allowed Android to reach the market even two days faster than it would have without them, then Google pulled in an extra $6 million to $7 million thanks to copyrighted Oracle code. But Judge Alsup said it seemed more like Oracle was "in a fix" because it had pushed all these infringement charges and almost come up empty. Later, he said that if Oracle forgoes the statutory damages – i.e., the standard damages – in its fight for infringer's profits, it could get nothing.

Boies made a big zero with his fingers to show he understood.

But Judge Alsup wasn't convinced. He told the court he had learned to code in Java for the trial – implying that he knew other languages as well – and he said that he had written some of the infringing code at least a hundred times since Oracle filed its suit in August 2010. "I can do it. You can do it. It's so simple," he said, adding that it takes less than five minutes. Then looked directly at Boies. "You're one of the best lawyers in America – how can you make that argument?" he demanded.

Boies tried to lighten the mood. "I couldn't program that in six months," he said. "But I accept that there are people who could." He then returned to his original reasoning: that Google lifted the code in an effort to accelerate the time it took to get Android to market, but this time, he hedged a bit. "Every time I get in this situation, I feel like I'm either saying [the lifted code] is important or it's nothing," he said. "But it was something that was copied."

Boies then proposed the all-or-next-to-nothing deal that hinges on whether the Java APIs are subject to copyright. Alsup said on Tuesday that he plans to rule on that question in a week, and this could cut out the heart of Oracle's case. Boies said that if Alsup rules that the Java APIs are not subject to copyright, Oracle will drop the claims for infringer's damages for Oracle's other copyright claims.

That still leaves damages related to possible patent infringement by Google, but this would likely be a small amount as well, nowhere close to the "hundreds of millions" of dollars in damages that Oracle might have won for copyright infringement.

Oracle's all-or-next-to-nothing deal is not set in stone, but Google said it was amenable to the idea. The two sides must still agree on the wording of the agreement and present it to the judge.

If approved, the arrangement further complicates an already complicated trial. If the jury returns a verdict in the ongoing patent phase of the trial sometime soon, then Judge Alsup will have to decide if the jury is still needed for a potential damages phase.

The argument over infringer's profits arose after Oracle indicated it would call Larry Page and Eric Schmidt to the witness stand for the damages phase. Google's Purcell argued that this was a stunt designed to turn the case into a Java-versus-Android battle when only a few lines of code were infringed. Google said that calling Google's top executives was outrageous.

But Judge Alsup did not agree. "The fact that Mr. Big is being subpoenaed? I'm sorry but this is a big case," he said. "That doesn't cut much with me." But because he was pressed for time, he made no ruling and simply left the two sides to work out an agreement on the logistics of the damages phase.