back to article Google's 'copied Java code' disowned by Apache

When Oracle sued Google over Android, many assumed the database giant would target code Google lifted from the Apache Foundation's open source Java incarnation, Project Harmony. But Oracle just pinpointed six pages of Google code, claiming they were "directly copied" from copyrighted Oracle material, and according to Apache, …


This topic is closed for new posts.


  1. Anonymous Coward

    Deja vu...

    When The Google Mega-Corporation says "We will strongly defend open-source standards" is it me or it really sounds like when Bush & Cheney said that the United States of America were going to war with Iraq to defend democracy?

    Not that it makes Oracle the good guys, just as Saddam was not the good guy either, but Google's self-righteousness and breathtaking hypocrisy is nauseating.

  2. David Hicks

    This is why real FOSS is good

    Because if java was a real open source, patent free, unencumbered language, this nonsense couldn't happen.

    Whilst I do find it entertaining to watch the giants slug it out once in a while, I'd rather we had a world without this nonsense.

    1. Giles Jones Gold badge

      Open not always good

      If Java was real open source, patent free then there would be about 10 different versions all incompatible and with their own extensions. Some would even allow access to native APIs like Microsoft tried to do.

      There would be Microsoft Java, Apple Java, IBM Java, Oracle Java, Apache Java and so on.

      There's a lot more people complaining now it is under the control of Oracle. Less people were complaining when it was Sun in control.

      Obviously all the litigation is about money and control, Larry didn't get as rich as Bill Gates by being a charity.

      1. Anonymous Coward

        Re: Open not always good

        Open not always good? Thanks for the management memo from the walled garden! Meanwhile...

        "If Java was real open source, patent free then there would be about 10 different versions all incompatible and with their own extensions."

        Yes, but people wouldn't be getting sued over patents in addition to these copyright infringement claims. That was the thrust of the comment you were responding to. And 10 different incompatible versions, unlike Java, eh? Have you not seen the plethora of Java-inspired languages out there? In fact, the strongest protection against platform fragmentation is the Java trademark, not weird "field of use" restrictions on the platform and whether people are able to use various conformance suites.

        And with this latest legal action, Java becomes even more like old school Unix, not less: a pseudo-open platform mired in legal uncertainty and with large corporate players trying to have the winning hand and control over everyone else. Just as GNU/Linux revived the whole Unix show by providing an equivalent, open source alternative, the act of GPL-licensing Java revived Java's wider credibility (outside "me too" enterprise shops) for a time, and even Android gave the wider Java scene some new life.

        But hey, Larry's not too old to make another strategic mistake around whatever "big play" he has going down. Must... own... all... of... incredible... shrinking... pie! Well done Larry!

      2. JEDIDIAH

        The nature of open forks.

        > If Java was real open source, patent free then there

        > would be about 10 different versions all incompatible

        > and with their own extensions. Some

        Not necessarily.

        It all depends on how you do it.

        This is one of the great advantages of copyleft licenses. Such forks CAN'T be put under anyone's thumb. If you create a fork then anyone else can take your changes and re-integrate them with the original project.

        This is why Oracle making noises about it's own version of Linux are so absurd. Anything it improves, it has to give back to the users.

  3. amanfromMars 1 Silver badge

    Larry's Oracle exposed and revealed to have no future items, or fabulous programs, in stock?

    "With its initial suit, Oracle backed its infringement claims with few details. It merely alleged that Google was infringing with Android's Dalvik virtual machine and the Android software development kit, and perhaps additional portions of the OS." ...... That is so typical of a dodgy phishing expedition from a crumbling empire with nothing new to offer, in fields which are offering everything for free to those who can build upon and distribute and mentor the Novel See.

    And re: "Deja vu..." ... Anonymous Coward Posted Monday 1st November 2010 01:57 GMT

    It is ambulance chasing lawyers justifying their existence with parasitic filings who are running the Oracle pantomime against the Google show?

  4. This post has been deleted by its author

    1. Anonymous Coward
      Anonymous Coward

      "metrics bullshit"

      Quite agree - the metrics are bullshit. Trouble is, what do you use to define the amount of code involved? I don't know, and my memory goes back more than 15 years. It was simpler when a line of code was an assembler code statement - but that is so last century.

      Best just to say "X lifted a blob of Code from Y" and not bother trying to say how much.

      By the way, what is a "cuddled if/else" - it certainly does sound cute?

      1. Just Thinking

        Not completely

        If you take out the comments and blank lines (for those of you that use them) the number of lines of code is going to give you an idea of the order of magnitude of the amount of code. Or at least, if you format code so as to be ten times "bigger" than typical code it will be obvious from a quick glance.

        Not perfect but not completely useless. 10 lines of code or 10,000 lines of code are definitely different.

      2. heyrick Silver badge

        Cuddled else

        Just means hugging the "else" with the braces, like:


        } else {


        See? Cute, cuddled, and snug-as-a-bug. ;-)

    2. Ian Yates

      Not sure I understand...

      While I get your point about the usual management reference to "how many lines of code is that?", I believe in this instance "pages" was of a document.

      However, I can't access the link from work, so I'm not 100% sure.

    3. Ian Michael Gumby

      Its irrelevant.

      Did you bother to take a look at the code itself?

      I think that Oracle is making their case. (Not that I'm a fan of either company.)

      Larry doesn't pretend to 'do no evil'. He's just in it for the money.

      1. Cynic


        The code presented by Oracle for comparison looks very much like a decompile to me. When you decompile Java, you can get the name of private, protected and public variables, but you can't get the name of method parameters. Hence, the structure is almost 100% identical, but the variables that rely on method parameters are truncated to simple names.

        So, this "proof" is not a copy - it is a decompile.

  5. MacroRodent

    Not convincing

    The code sample might look quite damning to laymen, but as a programmer, I would say the similarity is such that two independently developed bits of code that implement the same specification may well end up looking as similar as this. Note how this fairly short function is just checking some conditions and setting status variables in a particular order, and it is quite possible that to work according to the spec, the order must be precisely the same. The Java API specification also enforces particular names for anything that may be accessible from other classes.

    Oracle also admits reformatting the code for easier comparison. In other words, to look as similar as possible.

    Of course it is also possible Google has taken Sun Java code and run it through some obfuscator, but it is hard to believe they would be so stupid as to expect to get away with it.

    1. Anton Ivanov

      I was going to say the same

      Java is not C, C++ or even Perl for that matter. It is not a language where you can hang yourself by a thousand of different, artistic and inventive ways.

      Given the same simple problem in Java, two different software engineers would produce nearly identical pieces of code.

      That is exactly why Java is the preferred in-house development tool nowdays.

      This example produced by Oracle is a proof of Java's power to shoehorn programmers thinking into a standard compliant mold where it is no longer an art or a science but a trade. It is not a convincing example of code being lifted or copied. For that you need a _NON_ _TRIVIAL_ piece of code.

    2. Mark 125


      Could just be some tided up de-compiled code...

    3. Ian Michael Gumby

      You must not be a good coder.


      If I saw this on a class assignment from two different students, I'd haul their arses in to my office to explain how this happened.

      Too many similarities in the code. Its easier to suggest that they cut n pasted the code and then tried to make it look different.

      And you also make Oracle's point. The Java API is copyrighted material. ;-)

      Like I said, Oracle's got Google by the short hairs on this one. The only question is how much is it going to cost Google to get out of it.

      1. MacroRodent

        @Ian Michael Gumby

        After a second look, I think you are absolutely right! Mainly because of the identically named private fields that are not mandated by the class interface, and therefore should exhibit at least some variation in a good-faith reimplementation. (I guess I did not pay proper attention to the "private" keyword the first time).

        On the question of Java API, if we take that interpretation, then any reimplementation of Java would be illegal, whether done in a proper clean-room fashion or not. It seems this is Oracle's position, and this makes Java more proprietary than just about any other language.

  6. Kevin McMurtrie Silver badge

    "Cracked open" source

    Field names are exactly preserved but temporary variables have names matching their data type. The redundant initial value of 'isImmutable' is gone. That's clearly decompiled code.

    1. Destroy All Monsters Silver badge
      IT Angle


      So, someone decompiled this and slapped an Apache OSS license header onto it.

      Well, assuming that all the "infringing code" is like that and given the stinking boring tediousness of said code, I wonder what kind of court would even bother to get out of bed in the morning to discuss copyright infringement of this.

      It's like copying the pronouns of 6 first pages of Harry Potter. Hello??

      Where is that Nazi Larry Icon, btw?

    2. The Other Steve

      +1 That's clearly decompiled code

      What he said.

      "PolicyNodeImpl policynodeimpl, Boolean flag, Boolean flag1, Set set, Set set1, String s ..."

      That's automated variable naming based on type, output from a decompiler filling in information lost during the compilation to bytecode. And they didn't even bother to clean it up.

      You can also see where the decompiler has added curlies around some conditionals because it doesn't (and almost certainly can't*) know that they're one liners.

      On the extremely slim chance that the Android code was generated by a human being, they should be beaten with a cluestick until the fail comes out for using variable names like flag1.

      Sorry fandroids, but given that code sample, Oracle has a case. It's got big greasy decompiler fingerprints all over it. It's about as far from a clean room implementation as you're going to get.

      *because when it sees bytecode if_* ops, it only knows that the code is going to branch, it doesn't know how many instructions it will find when it reads the bytecode at the branch offsets. I say "almost" certainly, because you could probably avoid this by doing a bit of read-ahead in your bytecode decompiler and counting the output instructions for each branch, but why bother ?

      1. Gav

        Decompiled Definite

        The Android version is nasty because it was either written by a decompiler, or by a programmer who was was slavishly copying the Oracle source code, but hated legible code and variable naming that explained itself. My money is on the decompiler.

        It does the same steps in the same order, when there's no need for them be done in that exact order. Too much of a coincy-dink, I think.

        It's also notable that the Oracle version had comments (removed), but the Android had none. Decompilers don't comment on what the code is doing because they really have no idea.

        Where the code came from, or whether it was open source or not aside, no-one can seriously claim this isn't a copy.

  7. duncan campbell

    A Rose

    by any other name

    I'm not a big java fan, its a little too much like c re-written by Grace Hopper for my

    tastes. Be that as it may, who gives a @$# what Gewgle calls their VM? Just rename

    it to ASDF, put the whole damn thing under a BSD license, and to hell with Oracle.


  8. nobby

    original code horrendous!

    Well, I glad that when they copied the code they added the curly-brackets in that any sensible programmer would have put there in the first place.

    That "original" code made me shiver and think "i'd sack that programmer"


    1. The Other Steve


      "Well, I glad that when they copied the code they added the curly-brackets in that any sensible programmer would have put there in the first place."

      There is no OTBS. This argument got old in the 1970s. Troll something modern.

  9. TeeCee Gold badge

    "....accused Ellison and company of attacking the open source community."

    Hmm, it would appear that Google don't even know what "open source" means then.

    Just 'cos you can read the code, doesn't necessarily mean you get to copy it or reuse it. That would depend on the license associated with it.

    Saying: "you opened the code, it's everyone's to do with as they like now", *that's* an attack on the open source community.........

  10. Anonymous Coward
    Gates Halo

    @"not convincing" 05:42

    Hmmmm... maybe not as unconvincing as you thought?

    I entirely agree the CODE is (a) likely to be similar if it does the same simple thing (b) even more likely to be similar if fed through a deformatter/reformatter as this has been.

    However: can readers offer any suggestion as to why the DATA is all declared in the same order? Or has that been prettyprinted too?

    There are 10 variables. Hence there are 10x9x8x7x6... er, 10 factorial ie LOTS of different permutations (different sequences) in which the variables could be declared (assuming there are no logical ordering requirements here).

    Of those LOTS of different ways of ordering the variables, the listing (but maybe not the unprettified source?) shows the variables are declared in identical order.

    Hmmm. If that was student homework with a "no copying" rule, it wouldn't get a good mark.

    But there are lawyers in this picture, worse still, patent lawyers, so all may not be what it seems.

    1. Tom 13

      I suspect that in any code sample taken from real human beings,

      you will not find anything even closely approximating 10! listings of variables. Humans inherently tend to order things, and even will this effect will be even more pronounced when engaging in logic exercises. So I expect that unless the initial instructions indicate a need to try to randomize the order of declaration, you will find a few ordering techniques that greatly reduce the randomness, perhaps something on the order of 4!*3!*3! possibly even as little as 2!*2!*2!*2!*2!

    2. Destroy All Monsters Silver badge

      Not patent lawyers

      Copyright lawyers. Different areas.

  11. Tron Silver badge

    There are only so many ways to say 'Hello World'.

    If these guys got their heads together, grew up and played nicely, think how much they could save in lawyers' fees, and think how many lawyers might become unemployed as a consequence.

    Two good things and all they have to do is get along.

  12. Velv

    The first rule of copying....

    ... is making sure it doesn't look the same.

    Did none of these programmers go to University - the very place you learn to plagiarise without getting caught. :)

  13. Alexander Dean

    boolean flag1

    The smoking gun in that code sample is boolean flag, and boolean flag1. No way that a Google programmer writing this by hand would use those variable names.

  14. Chris Pearson

    "Portions of the OS are closed"

    How are the market place and Gmail part of the OS, they are apps running on top of it just like say iTunes store (not a 1:1 example granted) and Outlook are on PC or the new Mac Store and on a mac. Okay they may ship with the OS in most cases of android but they aren't part of the OS and can be removed with no impact on OS function.

    Every time some one wants to show how closed the OS is they wheel out these two apps, which are APPS not OS code. The reality is the code may be open sourced but the development is closed and controlled by Google.

  15. Anonymous Coward

    No proof at all

    It's highly likely that given an interface or set of public method signatures to code to, two independent coders (of any competence) would arrive at a pretty much line-for-line identical implementation. The only way to pick out 'copying' in code as simple as that illustrated, is if a more efficient implementation would have been possible but missed for some reason, or if an unlikely bug is replicated (though in that case, the spec they were working to might have pointed out the bug in the official Java version, and made pains to ensure it was reproduced). Prove it with more complex examples, or gtfo.

    1. Rolf Howarth

      No proof at all?

      Of course it's proof, utterly damning 100% incontrovertible proof that that file (at least) was copied. The Google version is line for line, character for character, what the jad decompiler will produce from PolicyNodeImpl.class.

      1. vic 4

        Not quite 100%

        Probably 99%. Ever had to make changes to a class you wrote yourself and only had the class file handy? Possibly deleted it by mistake or or 500 miles away without remote access to your code?

  16. Kebabbert


    it looks weird. In how many ways can you declare 10 variables? In 10! ways, which is 3,6 million different ways, almost 4 million.

    The probability that Googles version would declare the variables exactly the same order, would be 1 in 4 million. Not very likely.

    Maybe Oracle is the victim here again? Just like SAP vs Oracle case - where SAP recently declared SAP did wrong to Oracle.

  17. Anonymous Coward
    Anonymous Coward

    I am not a programmer* so some help please?

    I assume that the variable declaring order is part of the tidy up by Oracle to prove their point. Copyright would surely still count if the order of words / sentences was changed unless the change materially altered the composition (at its most basis level everything would be made up of 26 letters and a handful of punctuation marks so clearly you couldn't claim copyright because your code used the letter "x" somewhere and so did someone else's for example).

    Anyway, that aside, surely the ways to prove if the code is infringing is to do something like statistically prove that there are so few ways of accomplishing the task in question that it is inevitable that independent developers would produce materially similar code, or by showing other examples of production java code from different sources that matches - thus demonstrating that this is common and a result of the language/task combination rather than code thievery.

    *I do not have a goatee beard and ponytail, I do not wear white socks with sandals and I have actually had sex with more than just me present.

    1. multipharious


      Good question. In this we are all armchair generals.

      The question I have is regarding the specification that led to the name selection in the declaration section. In this I will keep watching. Using a consistent naming convention and order doesn't put the final nail anywhere in my book.

      I frequently included things (C++) in exactly the same order back in my days of having a ponytail and having sex with just myself...please spare heaping the insults upon the folks from whom you need help understanding what you cannot read. Not hitting hard, just pointing this out. Cool?

    2. Anonymous Coward


      "I do not have a goatee beard and ponytail, I do not wear white socks with sandals and I have actually had sex with more than just me present."

      This describes me to a tee, except that I AM a programmer. In fact, I don't think I've ever met a programmer as you described it. A few happy clappy bible-bashers maybe, but no coders.

      Troll, because I must assume that was your intention.

  18. Peter 39

    Java not actually open-source

    Sun granted a licence for Java on the desktop but not for mobile use so it's not really "open", is it.

    They wanted to collect license fees for mobile, by forcing people to license J2ME rather than "regular Java".

    Quite a sorry mess.

    1. Anonymous Coward
      Anonymous Coward

      Not true

      License that you talk about (one that is limited on desktop) is for 3rd party implementations that are not derived from OpenJDK code. Look for patent license, it clearly states that is only for clean room implementations. Like Dalvik for example (that is why they are getting sued).

      OpenJDK is fully open source under GPL which has implicit patent grant.

  19. Nathan 6

    This is Google Fault!

    Google should have done the smart business thing and just license J2ME and build their API on top of that. There would be no difference to developers or users. This is basically what RIM does. I can code a J2Me app on RIM or use their APIs.

    Now they will just have to end up paying Oracle for patent violation and must get a licence. Moreover, any company that's shipping an Android device can also be sued by Oracle.

    In short, I wouldn't be investing in Android long term unless a settlement is reach fast since any company using Andriod would be liable. And the more devices shipped the more liable you become.

    Now, some of you may say why not just do a clean room implementation. It really doesn't matter they will still be liable for all Devices shipped with Andriod until the clean room ships. It's actually much cheaper just license J2ME.

    1. c 1

      You must be joking

      @ nathan B,

      Your kidding right? J2ME is a dogs breakfast of partially implemented, dodgy designed garbage that has stymied the progression of mobile computing by a decade or more. Anyone, and I mean anyone, that suggests that J2ME has any place other than the rubbish bin has exactly no credence whatsoever in any discussion around OS choices for future devices. Period.

      1. Nathan 6

        You clearly don't get my point about J2ME!

        Since J2ME in just a subset of the standard Java 2 API, then anyone who license J2ME simple have to implement those APIs as part of their stack. What ever else they choose to build on top of that and how they implement it that's there business. Hence, Google simple had to provide J2ME API (like RIM) and continue pushing their own API (like RIM).

        And about j2ME, I can guarantee you that their are more devices running that than iOS and Andriod combined. It's just that the network operators locked down their phones to a point they made it very hard for small developers to target those devices without paying them somewhere along the line.

  20. Anonymous Coward
    Gates Halo

    Google will win because it is richer

    As with all such disputes, it will be settled out of court. Google has the upper hand on the business front. Google could make it difficult for Oracle to appear in its search results and advertising. Google's moto maybe "do no evil", but at it's heart, Google is a business.

    Microsoft and the .Net engineering team must be loving this.

    1. Anonymous Coward
      Thumb Down

      Which just goes to show...

      ...that Larry, greedy bastard that he is, at least has the balls to go for it. Besides I am not sure that the business model of Oracle is waiting for people that need a DB for 10,000 users to google "big relational database" and click on the ads...

  21. Wang N Staines

    All evil

    Java is evil and owns by the devil.

    Google deserves to be kicked in the balls for using Java.

    1. Destroy All Monsters Silver badge
      Thumb Down

      Your kind of troll is not welcome here

      That is all.

      1. The Other Steve

        I, for one, welcome our sub-bridge dwelling overlords

        I reject your reality and substitute it with my own.


This topic is closed for new posts.

Other stories you might like