Now, this is an interesting development in the ongoing war against Android. Oracle didn’t just sue Google for allegedly infringing its Java patents; it also claimed copyright infringement. Oracle has amended its complaint, and, fair is fair, they’ve got the code to prove it: indeed, Android contains code that appears to be copied verbatim from Java – mind you, appears. However, the code in question comes straight from Apache’s Harmony project, which raises the question – would a respected and long-established cornerstone of the open source world really accept tainted code in the first place?

The amended complaint reiterates the patent claims, but also goes into more detail about the copyright infringement part of the lawsuit. Oracle trots out some code comparisons of the ‘PolicyNodeImpl.java’ class library, and compares Oracle’s version with that of Android – the parts look identical (but might not be – more below). Interestingly enough, this isn’t really Google’s code; it’s code from Apache’s Harmony project.

“In at least several instances, Android computer program code also was directly copied from copyrighted Oracle America code,” Oracle states in the amended complaint, “For example, as may be readily seen in Exhibit J, the source code in Android’s ‘PolicyNodeImpl.java’ class is nearly identical to ‘PolicyNodeImpl.java’ in Oracle America’s Java, not just in name, but in the source code on a line-for-line basis.”

Since this code comes from the Harmony project, which is part of Apache, I’m really wondering just how much merit Oracle’s complaint has. Oracle is being disingenuous by claiming Google copied code from Oracle, while it’s quite clear the code has actually been taken from Harmony. Of course, if Harmony has no right to use this code, then Google is also liable. However, the reverse is also true – if Google is found to have violated Oracle’s copyright with this piece of code, then so did the Harmony project.

It gets weirder, though. While the code in the Android source tree states it’s Harmony code, this class can actually not be found in the current Harmony source.

Then there’s the fact that this piece of code actually seems to be testing code, as in, code that doesn’t actually ship on devices (can anyone please confirm this?), which, I think, is also an important distinction, as Oracle claims we’re talking about code shipped to customers on devices.

But there’s more. The code indeed looks copied, but is it, really? Carlo Daffara generated a diff of the two files, which paints a slightly different picture. According to a comment over at Groklaw (I know, I know, but he makes a good point), any similarities can easily be explained by “using the same naming convention for variables and the widespread use of automatic code generation in the Java community”.

This is not as clear-cut a matter as it seems, but I’m sure the usual suspects will rail on Google anyway. Surely more to follow.