Between the Lines

Larry Dignan, Andrew Nusca and Rachel King

Oracle says Google directly copied Java code: Here's the line-by-line comparison

By | October 28, 2010, 5:41am PDT

Oracle amended its Java complaint against Google over Android patent infringement and provided line-by-line comparisons in its exhibits.

In its tweaked complaint, Oracle ups the ante against Google, who has called the lawsuit baseless. Oracle, which first sued Google over Android in August, said:

In at least several instances, Android computer program code also was directly copied from copyrighted Oracle America code. 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.

Indeed, if you look at those exhibits the lines of code are identical.

The amended complaint and Oracle’s key exhibits are embedded below via Scribd. Judge for yourself.

The complaint:

oraclegoog102710complaint

And the key exhibits:

orclgoogcode

orclgoogcode2

Kick off your day with ZDNet's daily e-mail newsletter. It's the freshest tech news and opinion, served hot. Get it.

Topics

Larry Dignan is Editor in Chief of ZDNet and SmartPlanet as well as Editorial Director of ZDNet's sister site TechRepublic.

Disclosure

Larry Dignan

Larry Dignan has nothing to disclose. He doesn’t hold investments in the technology companies he covers.

Biography

Larry Dignan

Larry Dignan is Editor in Chief of ZDNet and SmartPlanet as well as Editorial Director of ZDNet's sister site TechRepublic. He was most recently Executive Editor of News and Blogs at ZDNet. Prior to that he was executive news editor at eWeek and news editor at Baseline. He also served as the East Coast news editor and finance editor at CNET News.com. Larry has covered the technology and financial services industry since 1995, publishing articles in WallStreetWeek.com, Inter@ctive Week, The New York Times, and Financial Planning magazine. He's a graduate of the Columbia School of Journalism and the University of Delaware.

For daily updates, follow Larry on Twitter.

180
Comments

Join the conversation!

Just In

RE: Oracle says Google directly copied Java code: Here's the line-by-line comparison
javabuddy 9th Aug
very interesting, need to know google perspective as well.

Thanks
String vs StringBuffer vs StringBuilder in Java
0 Votes
+ -
out of my depth here but...
eddyrox1@... 28th Oct 2010
can anyone do the honours of elaborating to me how the second one infringes on an open source platform. for me the whole bit of how google competes directly with java as a software platform just isn't settling in.

oh and side note. interesting to see this case wake up again. Oracle sure is going gung ho on their lawsuit bit.
@eddyrox1@... Java is a platform (as well as a language). Android is a platform that uses Java language. The crossover is clear - both platforms.

I don't think Oracle had any real choice here - they have to protect their IP. I don't actually like it, but I can see that if Google's Dalvik becomes more popular than JRE then Oracle's investment in Java is compromised.

If this is true that Google just used Oracle's code then I can't see Google being able to defend that. I'm sure deep in the Googleplex some engineers are probably scrambling to create clean re-implementations of the affected code - maybe this won't go anywhere.

I don't think Google can afford to lose this, though it does make you wonder why Google didn't buy Sun Microsystems when they could... ?
@Jeremy-UK The Java source code is licensed under the GPL. Android's code is under similar licenses (although I'm not certain precisely what these two files are under). Point being, copying is _encouraged_ and I find it hard to believe that Google would have done something blatantly wrong. Still, the example does not obviously look like copied code to me. It looks like replicating functionality using different but similar code. The naming collisions can easily be explained by following well known Java naming conventions. Granted, to the untrained eye it looks a lot like they just changed the names of some things and the spacing. However, you have to bear in mind that this code is the implementation of a particular well known interface. That means it has to function in a very specific way in order to work at all. Therefore, even a cleanroom implementation is going to be substantially similar. It seems to me like Oracle is playing things up hoping for ignorance on the part of the court.

Ultimately, this hurts Oracle. But it doesn't matter to Oracle. They are safely off in their own little bubble and it seems acceptable to them to completely disregard everyone except people shoving cash into their furnace. Oracle is probably mighty upset that Sun released Java under GPL before selling the company and they are likely trying to reign it back under their control even if it means they drive away every single non-paid user. My experience is that Oracle has zero consideration for non-paying customers (e.g. even someone who bought something dreadfully expensive from them and failed to maintain expensive and unnecessary contracts) and is very, very controlling of its customers (unfortunately, I am now one of those customers and have felt the impact of other decisions they've made that has hurt Sun customers).
Jeremy-UK: "If this is true that Google just used Oracle's code then I can't see Google being able to defend that."

This shows you need some basic education on open source licensing. Sun (previous owner of Java) opened up Java to anyone who wanted to use it, for FREE, as long as they published any improvements and changes. IF they made no changes, they were still able to use it FOR FREE.

Understand?

So, Google copying the code was REQUIRED. You have to copy first before use, you have to copy first before making any changes.

ORACLE, the new owner of Sun, does not like that Sun open sourced Java. How are they going to make money off it? Well.... the horse has left the barn.

But, if Oracle can spread enough FUD (Fear, Uncertainty, Doubt) about using Java for free, they can extort money out of companies to PAY to use Java, even though they don't have to.

Microsoft has used this tactic to make some Linux companies pay for Windows license. Just In Case. It's insurance against being sued.

There are a couple of exceptions in Sun's open source license and ORACLE, the new owner, is pursuing that angle -- trying to prove that even though Java is open source, that Google's use falls under the monetary licensing plan.

But your comments that Google can't defend copying OPEN SOURCE java code is laughable. It's supposed to be copied.
@cabdriverjim

Sorry, but to my "trained eye" this looks like a poor copy job. Name collisions are one thing, but whose to say that ALL the private variables would be 1) named exactly the same as the Java ones, and 2) in the exact same order of declaration. Being private, there's absolutely no need for them all to have exactly the same names.

Moving on to the constructor, sure there are some differences in the names of the parameters, and some formatting, but the order of the logic is exactly the same as the Java version.

Come on. This was some lazy developer who decided to copy the Java one and change a few things to try to make it "his own". I would say, at the very least the Java one was definitely used as a reference, and while the developer might not have copy and pasted the code, they no doubt copied much of it verbatim, while changing some names and formatting (adding a brace here and there).
@ChazzMatt - My great-grandfather had a small Bakery in downtown Chicago in the early 1900's and paid a local man for "fire insurance" every week for cash and never had a fire as long as he paid for insurance. It would be interesting if the man he paid was Bill Gates' grandfather!
  • Flagged
@Jeremy-UK what is sad is that last year Oracle was on the other side, until they bought a small company.... so what is this RELALY about?
@Jeremy-UK In what way is Java a platform? please explain. If you look at the code, there are differences that I see. SO direct copying of code does not appear to totally true.
0 Votes
+ -
The code is not the same...
prof123 28th Oct 2010
@Jeremy-UK
If you look closely at the example you can see that it was not simply "copied". Yes, they use the same variable names but there is a lot of difference in the code.

Oracle, go and F*** yourself!!! This is all nonsense.
  • Flagged
0 Votes
+ -
@prof123
Bruizer 28th Oct 2010
If you look closely, you can see it looks like a poor job of refactoring and little more.

Do you think Google should be able to simply steal others work? This goes for Apple, MS or any large company. Not knowing the licensing of the specific files (but knowing Oracle knows IP law 100 times better than Google...) there is no way this is a clean room implementation.
@Jeremy-UK
What some are forgetting is that the Oracle license of GPL is more restrictive than the Android licenses which some are Apache license. With open source, you cannot change the license of the code unless you are the author. With GPL all the code is linked together therefore it must all be GPL. Since Oracle via Sun wrote the code, they are the only ones who can add a license to it other than GPL. Oracle previously Sun would allow commercial licence for those who did not want to release under GPL. They charged for this of course. This ability to change the license is available to the author only. Using GPL for android would mean the companies which want to distribute their own code with Android would have to release that code under GPL and make it difficult to charge for it as anyone could take the code and make their own version. Also, it's hard to keep your special user interface if you have to give away the code for it under GPL. Given the classpath exception, code not put into the same file (e.g. jar/shared library) as the GPL code might be OK. Stealing the code but not using the GPL license for it is a game changer. This is clearly illegal and against the open source philosophy.

I disagree with Oracle about the patents since it would be impossible to have open source if someone accused you of violating the patents for using the open source contains. Enforcing the patents makes open source meaningless.
@prof123, bruizer:

This is an obvious decompiling of Oracle code. That's why field names are kept, that's why parameter and variable names are generated, loops and conditionals transformed, private constant always inlined (but declaration nevertheless kept) and some gratuituous return statements appear where a human programmer would be very unlikely to use them.
0 Votes
+ -
Refactored
rbethell 8th Jun
@tk_77 Yes, this code of Google's is just a refactoring of the code in the original. It is plainly obvious.

That said, the original code is under a GPL license... who would think that above copying if the intent was another open source project?
Sun actually open sourced Java years ago, so yes they can change the code for their own use. As long as they give it back to the community.
0 Votes
+ -
"Community source", not open source
ptcruisergt Updated - 28th Oct 2010
Their "Community Source" license does not grant the right to distribute a modified version of the code.
@ptcruisergt

Sun actually open sourced Java years ago, so yes they can change the code for their own use. As long as they give it back to the community.
0 Votes
+ -
No...
snoop0x7b 28th Oct 2010
@ptcruisergt OpenJDK is GPL...
@ptcruisergt

Which is a 100% contradiction to the GPL v2, which the code was simultaneously licensed under...so which one counts?
@eddyrox1@... Suns license says that you can basically use Java anyway you want as long as:

1. It meets the Java standard set by Sun.

2. That you use the Sun Java Run Time.

Google meets nether of those standards.

Google will say that hey we are not actually using Java, that they are just allowing people to write in Java and then convert it to run in Dalvik. But with this evidence it looks as if Google is using more Java then they let on.
@tymiles Exactly - the whole point of Oracle's argument. It's not adhering to the specification of the platform, you aren't allowed to do use Java as a springboard to creating an incompatible new platform. This is EXACTLY what Microsoft tried to do with Visual J++ back in the day. Nobody thinks Sun was about to allow that do they?

At least Microsoft's implementation allowed Sun's Java implementation to run, it defined incompatible extensions (a deliberate ploy to fracture Java in those early days).

Google's implementation utterly incompatible, Oracle's (formally Sun's) implementation of Java doesn't run, and code produced for Dalvik doesn't run on a bona fide JRE. Why anyone is surprised Oracle have taken exception I cannot understand. Sun took Microsoft to court to protect Java. Oracle have to take Google to court to protect Java now.

It seems so simple.
@Jeremy-UK Is right on point. If it was wrong for Microsoft to do it with Visual J++ why would anyone say that it's OK for Google to do it wuth Dalvik?
@tymiles

Microsoft made the mistake of calling their incompatible stuff: JRE and JVM. That is the reason Sun won. And Google is never used these terms. But it seems hard to exempt from patents...
@eddyrox1@...

It isn't a copyright issue. Its a patent issue. The code being the same goes to proving that the algorithm is the same.

GPL 1& 2 have no patent protection clauses.
0 Votes
+ -
@jeffpk:
Oracle claims both types of infringement. From the titles of the patents, some might fail to be enforceable. (Either patenting things are are obvious, or patenting things which were already done by others. For example, IBM S/38 had a memory protection scheme performed by executive software, not hardware.... many years before Java was implemented.)

But I think that both types of claims are doomed to failure, for the exact reason you just pointed out. Oracle's predecessor in "ownership", Sun, released J2SE source code under the GPL. If any of that code IMPLEMENTS "IP" which is covered in these patents, then it is open for re-use under those license terms.... and the terms are generous, and it looks like Google is complying with them (i.e., releasing their modified source code under the GPL as well).

The code is in the wild; so is the algorithm, and any patent-covered "IP" which the algorithm expresses.
0 Votes
+ -
OpenOffice??
Tom6 28th Oct 2010
Oracle seems quite happy to throw away it's assets while making a fuss about a few dubious claims.
@eddyrox1@...
Sorry you can't see it. However, Ray Charles has been dead for about 6 years and blind all of his life. He tells me he see it. Just a thought.
0 Votes
+ -
Language vs Platform
General C# 28th Oct 2010
@eddyrox1@... The issue here isn't the language, but Dalvik vs Java Runtime Environment. While the language maybe licensed under GPL, JRE is not.
@eddyrox1@... yes I don't understand either. This shouldn't apply because everything about java was open source. So Google made its own version of java (although its basically normal java) for android and now that Oracle changed the rules they want to sue Google? It's open source for god sakes. It's not like Google is selling android or even not providing the complete source for it. So I don't see this going anywhere.
Not surprised, Google's whole business is based around copying others. Why do you think they have so many toys in the office? To keep the employees occupied until some other company comes out with something innovative, then Google copies it. You don't have to be smart to work there, you just have to know what to copy.
@Loverock Davidson

What he said.
@Loverock Davidson Well said!
@Loverock Davidson

For once, you actually said something sensible. Everything Google does is based on using other people's information or their intellectual property.

It started with the search engine, where they learned to build profiles of people based on their searches, and expanded to everything else they offer.

But, you do have to be smart to work there. There are many very smart people there. It is just the business model which is corrupt.
@Loverock Davidson
Wow, you are right about Microsoft. Oh you were talking about 'Google'. My bad... =-)
@cybr2th@...

Hey, about MS, what ? They already had MSN search, Yahoo had search. Do you know they partnered with Google, they Google launched their own search. So, who copied. What's Google Buzz, didn't they copied. What's Google Video, they copied like youtube, didn't clicked, so they acquired youtube. They copied picasa web like flicker from yahoo, didnt' Google copied. They copied Android like iPhone UI, they copied. MS re-invented the UI in WP7 with Metro UI which they tried and tested with other products like Zune, Mediaceter. What not, Google copied everything. It's not a s/w company, it's a copying company. PERIOD.
@Loverock Davidson,

The code for the class on the left is marked final. Google probably copied the code because they needed to add to the functionality of the class, but couldn't inherit from it. I'm guessing that's why they copied the code.
@bmonsterman they still need to get the license. PERIOD
@jinishans,

I'm not a lawyer. I'm a programmer. I can't really speak to the legality of it. It wouldn't have been an issue if Sun/Oracle had made the class extendable happy.
@bmonsterman

But I thought that the idea of Dalvik is that its "not" Java, whereas Oracle is saying/complaining that it basically is? Dalvik was supposed to use the same syntax and same/similar class naming for compatibility with Java code, but that's where it was supposed to end.

Assuming this is true, and Dalvik is NOT Java, then why would Google ever even want to inherit the Java version of the Class? Rather then using the Java version, they are actually creating their own version of the class (presumably for compatibility with existing developer Java code). They would have been better off duplicating the functionality based on what the Java version of the class was supposed to do, not how it actually did it. The "copying" part of it was their mistake.

Having the class not being final in the Java version would be irrelevant since Dalvik is not Java.
@Loverock Davidson Wow! you just described Microsoft to a 'T' and applied it to Google. How is it bad when Google does it, but you still worship Microsoft given their blatant history for doing the same thing?
0 Votes
+ -
@I12BPhil.
A classic! wink
@Loverock Davidson

Thank-you. Now that you've expressed your clear opinion that Google is in fact guilty, I can rest secure in my initial evaluation that Oracle's complaints are laughable.
>> Why do you think they have so many toys in the office? To keep the employees occupied until some other company comes out with something innovative.

I liked that statement !
0 Votes
+ -
The code presented looks copied to me
JohnVoter 28th Oct 2010
I've argued that the Google code is a clean room implementation, but this is contradicted by what I've just seen. This could be devastating to Google, in that I could see the judge ordering Google to cancel the license (permission) Google has granted to handset developers to use the Android platform.

Remaining questions: 1) Is the code Oracle presenting actually Oracle property, or is it 3rd party library code?
2) Is the copied code a small portion of the code (say 0.5%) or is it a substantial portion of the code. 3) Is the affected code still part of the Android software suite or has it been replaced?

I would take issue with those who say that Google just copies other people's work. Apple and Google are the only two computer/software companies who are doing any innovation.
@JohnVoter

>>> I would take issue with those who say that Google just copies other people's work. Apple and Google are the only two computer/software companies who are doing any innovation. >>>

Well considering the original direction for Android (when Google bought it) was along the lines of WinMobile and Blackberry of the day (ie, functionality, look and feel, physical keyboard, etc) but changed drastically to mimic the iPhone once it was introduced and demoed proves how Google has become a great imitator... the new Microsoft, maybe even more evil despite Google's denials.

Having Eric Schmidt sit on Apple's BoG during iPhone development certainly didn't hurt.
0 Votes
+ -
Google innovation
JohnVoter 28th Oct 2010
@MacCanuck
I don't have an Android or iPhone, so you can take that into account with regard to the following. What are we seeing come out of Google?

Google Voice, with a single phone number for your home/office/cell/vacation home. Also, transcription of phone messages. Also, free VOIP anywhere you have a WiFi connection. Also, free calls to any US and Canadian phone, apparently utilizing the nationwide dark fiber they bought a while ago.

How about augmented video, with street locations floating in front of the scene in front of you? How about Google translation, which does a good enough job -- utilizing a words in context translation -- that some non-English blogs to provide instant translation of all their articles and even online comments? As far as I know they haven't done it yet, but it can't be too long before augmented video with translation of signs into English (or French, Spanish, etc).

Imagine pointing your camera phone at a scene, say a store in Paris, and seeing that scene with instant translation of French to English done in the context of the scene in front of your eyes?

How about virtually unlimited space for email? Plus grouping sent messages and replies together. Plus changing the paradigm to use a search box, rather than the old way of manually sorting things into folders.

How about the way that I can use Google search to find that word I can't quite remember, again by using words in context to associate wrongly spelled words with the correct word? How about the way they integrated math and unit conversion into the search without breaking a sweat?

How about Google books, where we can locate information in millions of books, not just what has been put on web pages?

How about youTube? Forget the pets and would be singers and type in something you would like to learn, like how to use Apple's sprout core programming system. It's there!

I could make a list at least as long, for Apple. These 2 companies are bringing so much innovation to the table that they seem to lap every other company out there again and again. And no, I don't own their stock.
@JohnVoter,

"Apple and Google are the only two computer/software companies who are doing any innovation"

Wow...bold statement. So NOBODY ELSE is doing any innovation in the area of software or computers....Just Google and Apple. An you know this...how? Computer/Software...that's a pretty broad sector. You know that much about all of the types of computer devices, software applications being developed/made to make that statement?
@bmonsterman
That's not quite what I said. I said that these two companies *seem* to be lapping other companies in the field again and again in terms of innovation.
@JohnVoter

You do know that Google did not make most of those technologies, but implemented them after others did? Not to mention, youtube was purchased, not founded by Google.
@PlayFair The same way Oracle did not write Java, but purchased it from Sun? All this crap is moot. Would Sun be suing Google if they had the reins right now? Google Android gets popular, and all the other giants want a cut. They are spending day in and day out looking for the few pieces of code and the right angle to get a cut of the action. This has nothing to do with I.P. and everything to do with money. I'm not saying Google doesn't acquire ideas from other places. We all do. But Google (as an O.S.) is eating up the iPhone in market share and just like every other company, are going to be sued by every company that can find an angle. It's the price you pay when you become a "big dog" in any industry. As far as the code is concerned, I'm concerned about the "content removed for comparison." With the right amount of removal and tweaking, you could probably argue my code was stolen from something else. This may be a case of Google using JRE as a model, but this also brings to the forefront the complete bastardization of the Open Source licensing model. I can't wait for the day that I get sued because my "for loop" looks like someone elses. Our I.P. laws are broken, and the Open Source model is being attacked by big conglomerations. Anyone making Oracle out to be a victim is kidding themselves.
@JohnVoter can you name 1 invention Google made..., not already existed...?
very interesting, need to know google perspective as well.

Thanks
String vs StringBuffer vs StringBuilder in Java

Join the conversation!

Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]
ie8 fix

The best of ZDNet, delivered

ZDNet Newsletters

Get the best of ZDNet delivered straight to your inbox

Facebook Activity

White Papers, Webcasts, & Resources
ie8 fix