JUDGE William Alsup knows how to play a bluff. Presiding in the Oracle v Google trial, where the search giant was accused of violating Oracle's copyrights and patents, he had instructed the jury to assume that mimicking work-alike functionality can violate copyright even where it does not involve copying specific programming code. The tech crowd was aghast. Should the jury find in favour of Oracle, many fretted, this would forever change the way software is developed, since much development relies on getting different code to perform similar tasks. 

The jurors subsequently found that Google had infringed no patents and that it had directly pinched a few lines of Oracle's code, penalties for which should not exceed a puny $150,000. Crucially, they also agreed that Google had emulated some features of Oracle's Java platform using different underlying code. They deadlocked on whether this constituted "fair use".

Either way, though, the jury decided on the question of fact: if copyright works in the way Judge Alsup told them to assume, then Google was indeed guilty of infringement. That still left unanswered the question of law: whether the assumption was valid. That is for a judge to decide. And on May 31st Judge Alsup did. Valid it is not. 

"So long as the specific code used to implement a method is different," the judge wrote, "anyone is free under the Copyright Act to write his or her own code to carry out exactly the same function or specification of any methods used [to achieve work-alike functionality]," adding that "where there is only one way to express an idea or function, then everyone is free to do so and no one can monopolise that expression."

He also explained his ruse. Were his ultimate ruling that the general "structure, sequence and organisation" is not protectable to be reversed on appeal, the higher court might simply reinstate his jury's verdict. This gives the appeals court more alternatives as it need not worry about an expensive retrial. Both parties' counsel were in on the feint, but the jury was kept in the dark.

The full 41-page ruling makes for a riveting read. In part that is because the judge has, as he noted during in the trial, written programming code himself—and learned some of the Java language under consideration to test the claims Oracle's lawyers were making about the nature of work-alike functionality. What Oracle attempted to do, it appears, is apply principles of patents (which protect methods) to copyright (which protects specific creative instantiations).

Oracle plans to appeal, but the judge weaved the trial and his decision so intricately that there seems to be little scope for a higher court to find errors. As a programmer, Judge Alsup clearly knows how important it is to avoid bugs.