r/Android • u/[deleted] • Jan 21 '11
Oops: Android contains directly copied Java code, strengthening Oracle's case -- Engadget
http://www.engadget.com/2011/01/21/oops-android-contains-directly-copied-java-code-strengthening/53
u/lyam23 Jan 21 '11
Wow, Engadget commenters are a bunch of vapid trolls.
28
u/nerex Jan 21 '11
my kingdom for a downvote button on engadget
9
u/Moeri Nexus 5X Jan 21 '11
You have a kingdom?
6
1
0
Jan 21 '11
[deleted]
8
u/tooclosetocall82 Jan 21 '11
They used to have one. I could stand reading the comments back then. Not anymore though.
2
u/nerex Jan 21 '11
yeah, that's why i'm offering my kingdom- i'll trade it to them if they put in a downvote button like they had before
6
u/neutralizer Samsung Galaxy S2, Cognition S2 v1.07 Jan 21 '11
Not as vapid as Gizmodo commenters but still vapid.
4
Jan 21 '11
I'M SORRY DID YOU SAY FRAGMENTATION??? HARHARHARHARHAR
1
Jan 21 '11
Well, the code in Exhibit J (though not the new code that the source article for the Engadget piece) is gone as of 2.2, so... sort of ;)
65
u/flossdaily LG G4 Verizon Stock 6.0 Jan 21 '11
Three weeks later in Oracle's main office:
Employee #1: Hey, that's weird.
Employee #2: What's weird?
Employee #1: Well, it's just that "oracle" isn't showing up in google's search results.
Employee #2: What? That can't be right... let me... huh.... whoa.. you're right.
Employee #1: Holy crap. "Java" isn't showing up either. it's just a bunch links to coffee places.
Employee #2: We should probably tell someone about this.
14
u/Snap65 Jan 21 '11
I thought Java was open source code and from what I hear Oracle changed the terms.
11
Jan 21 '11
No; Java was originally closed; it was released under a slightly odd license by Sun a while back.
1
Jan 21 '11
Source?
8
u/davidb_ Jan 21 '11
The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License.
That's from wikipedia. It doesn't really say much specifically about the JVM code that is the focus of the suit.
1
u/holloway Jan 21 '11
Of course Sun didn't use the plain GPL (because otherwise all Java apps would need to be GPL too) but they used the GPL + Classpath Exception.
2
u/DefaultPlayer Nexus 6P Jan 21 '11
I'm not sure about Oracle changing the terms, I know they were trying/implying that they were going to but I don't think they did.
I'm just wondering how open-source Java is. Should this be allowed? Has anyone ever read the T's & C's?
3
u/stealthmodeactive Pixel 6 Pro Jan 21 '11
My thoughts exactly. How can you sue over open source?
11
Jan 21 '11 edited Jan 21 '11
These days, Java is (mostly) GPLv2, Dalvik uses parts of the Apache Harmony classpath, and the disputed code is code that Google apparently allegedly put in the Android Harmony repo. The GPL is not a permissive license, and relicensing bits of a GPL application as Android without the copyright holder's permission would be infringement.
EDIT: Class library, not classpath. Brain not working today.
4
u/diamond Google Pixel 2 Jan 21 '11
What license does Android use? I thought it was GPL (apart from the proprietary bits like the Google Experience apps).
EDIT: Never mind. Just looked it up. Android is Apache licensed.
2
Jan 21 '11
I thought it was GPL (apart from the proprietary bits like the Google Experience apps).
If that were the case, then things like Sense would likely have to be released under the GPL. If you link against GPL code, you catch it, except in very limited circumstances.
1
u/diamond Google Pixel 2 Jan 21 '11
Yes, you're right. I was mistaken about that (see my update). Upvoted for adding information.
3
u/merreborn Jan 21 '11
Well, for example, it'd be a violation of the GPL to take some GPL code and rerelease it with an MIT license.
2
u/stealthmodeactive Pixel 6 Pro Jan 21 '11
Ah, this is true. I have no idea what license google licenses android under. I assume, from your comment, it's the MIT license?
5
11
u/python_boot Jan 21 '11
Ars Technica's analysis indicates this evidence isn't as damaging as it might seem.
23
u/reuvenb Amaze 4g Jan 21 '11
I'm going to take a wild guess before I click on this, and say it was written by Nilay Patel, who is a moron.
Look at that! I'm right!
7
u/flossdaily LG G4 Verizon Stock 6.0 Jan 21 '11
Could you elaborate, please?
I can't remember the last time I read an article stupid enough to make me take note of the author.
What's Nilay Patel's history?
15
u/reuvenb Amaze 4g Jan 21 '11
http://www.engadget.com/2010/09/23/editorial-the-dark-side-of-android-hacking/
There's this stellar post, where he complains that he screwed up his phone, and it's really google's fault. I especially like where he admits that he'd been drinking while trying to flash ROMs to his phone.
-1
u/flossdaily LG G4 Verizon Stock 6.0 Jan 21 '11
Entertaining, but not quite as damning as I was expecting.
I share his frustration about the difficulty of using custom ROMs, but I would never blame google for that.
His main problem seems to be that he is under the impression that google advocates the hacking of android devices- and that that is included in the definition of "open source". A bit naive, but not unforgivably so.
4
u/baby_kicker Jan 21 '11
the hacking of android devices- and that that is included in the definition of "open source". A bit naive, but not unforgivably so
For a tech writer for a major blog like Engadget - I think it is unforgivable. Either you are a geek and get tech or you're a mouth-breathing-consumer who gets drunk while you post "news" with copy and paste. Fact checking is part of the job.
1
u/RagingAtheist Jan 21 '11
Well you don't read MG Seiglers articles on tech crunch then. There are loads of people who write online stuff j have no time for.
3
Jan 21 '11
I had to set up a yahoo pipe to filter MG's articles out of the techcrunch feed. Every time I read one of his articles I became irrationally filled with rage.
2
Jan 21 '11
I have a similar system, it works by never reading techcrunch at all.
2
Jan 21 '11
That's a solid system you have. I'm getting there. The tech press/blogs are growing tiresome.
2
u/RagingAtheist Jan 21 '11
Sure are, more so with some of the jackasses on there. Plus 60% of what they write about is bullshit speculation.
19
u/parimm Redmi 1s Jan 21 '11 edited Mar 21 '18
<deleted>
4
1
u/ihahp Jan 21 '11
It's going to make them "change their procedures to correct this oversight."
It's actually pretty shocking, considering how strict google is about checking in code.
2
u/RagingAtheist Jan 21 '11
Why is it shocking this isn't the first accusation of copying code against Google nor is it, by a long shot, the first accusation of a major company using another major companies code.
0
Jan 21 '11
[deleted]
5
u/DefaultPlayer Nexus 6P Jan 21 '11
Whether or not it has been there for years doesn't really matter. It is coming up now, it is going to cost money now, probably going to leave a stain on Google's reputation and they may have to redo the whole Android system for the next implementation.
It is a bad for the dev if the higher-ups see it as lazy-coding.
0
Jan 21 '11
[deleted]
3
u/cosmando Galaxy Nexus, Stock 4.0.2 Jan 21 '11
I don't disagree with you, but I am curious: if you know them, do you have insight into why they would do something as IP stupid as copy-paste code from Java?
11
3
u/mothereffingteresa Jan 21 '11
What's very strange about this is that the Apache project claims they have clean equivalents of these files.
0
1
u/MacEWork Captivate, CM7; Viewsonic G-Tab, CM7 Jan 21 '11
and is written by a few highly skilled devs
Sounds to me like it was written by some skilled Sun devs ...
4
4
14
u/jstekl Jan 21 '11
Here's a nice analysis of it: http://www.androidpolice.com/2011/01/21/oracle-vs-google-its-not-looking-good-for-android/
7
Jan 21 '11
I'm not sure what was done here, but "decompiled" seems like the wrong term. When you decompile a binary, you don't get the exact source code, character by character. This looks more like copy/paste from the source.
7
u/omgwtfchill Jan 21 '11
For managed languages like Java, you do get something very close to the original source (variable names notwithstanding).
1
u/adrianmonk Jan 22 '11
This is more true for very simple code (in which there are very few variations on how a normal person would write it) and less true for more complex code.
Also, a decompiler could reconstruct not-unreasonable variable names based on type names or other heuristics. For example, a naive decompiler might do this:
HashMap a = new HashMap(); String b = "42"; ServerSocket c = new ServerSocket(); int d = 99;A smarter decompiler might do this instead:
HashMap hashMap = new HashMap(); String str = "42"; ServerSocket serverSocket = new ServerSocket(); int a = 99;Or maybe this:
HashMap hm = new HashMap(); String s = "42"; ServerSocket ss = new ServerSocket(); int i = 99;The point is, programmers often use guidelines to choose variable names. A decompiler could apply similar guidelines, and it might end up with similar variable names. A decompiler doesn't necessarily have to name things "a", "b", "c", "d", and so on.
11
Jan 21 '11
Having looked at the example code, it isn't obvious how a lot of it could be written differently, the requirements of the methods are fairly well-defined.
If google had copied something with more than one possible implementation, like a sort algorithm, that would be much more convincing. Suprise suprise, such code is very, very different.
6
u/Tobiaswk Developer - Kotori your friend! Jan 21 '11
When you're looking at the exact same variable names, structure and composition of the code it does seems odd that they match. It seems like a complete copy/paste. At least some parts of the code-structure would be different. I see your point, but as it is now, this looks like a complete ripoff.
4
u/LongUsername Jan 21 '11
In the copy of the exibit I saw (hosted by androidpolice) the top straight away says that Oracle edited the files to make them look more similar. Granted, they claim it was only stripping comments and changing whitespace, but if one of those comments was "taken from standard document XXX" that would be important.....
3
u/mccoyn Jan 21 '11
The code is an implementation of a interface that is part of Java (I assume). The variable names are predefined. The function names are predefined. The exact effects of each function is predefined. You would have to work hard to write that code and not make it look like that. In some of the later examples, where local variables are defined, different names are used and different loop structures are used.
1
u/joe0185 Moto G Stylus 2024 Jan 21 '11
Unless they are formatting their code in some way I am unfamiliar with - I am going to have to agree with you. Obviously things like casing and naming conventions are something that you could duplicate very easily. But why are the constructor parameters in the exact same order, why are the methods in the exact same order, ect ect.
1
u/adrianmonk Jan 22 '11
Obviously things like casing and naming conventions are something that you could duplicate very easily.
Especially since there are specific coding conventions for Java laying out naming conventions and casing, indentation, and so on. There's even a description of which class members should come first (class variables before instance variables, constructors before methods, etc.).
These are not descriptions of the syntax; they are recommendations of which syntactically-valid things you should prefer and which syntactically-valid things you should not normally use.
3
Jan 21 '11
This will certainly make for an interesting court case; I assume that Oracle will have to demonstrate that it is improbable that such code could be come up with so similar.
Note that this is just an exhibit designed to justify the general claim of copyright infringement; they can and probably will submit much, much more later.
0
u/davidb_ Jan 21 '11
I was thinking the same thing. How many different ways can you (reasonably) define toString().. but, I'm guessing there are more substantial claims than that method.
3
u/aqtrans AT&T HTC One X - CM10 Jan 21 '11
According to http://arstechnica.com/open-source/news/2011/01/new-alleged-evidence-of-android-infringement-isnt-a-smoking-gun.ars?utm_source=rss&utm_medium=rss&utm_campaign=rss, this code is part of a
third-party component supplied by SONiVOX
and that component isn't even actually used in current AOSP builds.
3
u/monolithdigital Jan 21 '11
This has already proven to be false and sensationalist. Can we please downvote it and not spread misinformation?
2
u/Ivashkin Jan 21 '11
I know it's early days, but if Google loses this case, anyone care to speculate as to what would happen next? Google paying a big fine? A royalty payment on every handset sold? Oracle seizes Android? Or just Google having to do a complete re-write of Android?
0
u/adrianmonk Jan 22 '11
A royalty payment on every handset sold?
If Google were to lose, more likely Google would remove the code from future versions of Android, then make a one-time settlement or something. From what has been out in the press about it, the code that Oracle alleges is infringing is not a core part of Android, so if there were infringement, rewriting would be pretty trivial.
2
u/NYkrinDC Pixel 9 and Pixel Tablet Jan 21 '11
Copied code not in Android source after all
http://www.androidcentral.com/copied-code-not-android-source-after-all
0
47
u/hanoverjames Jan 21 '11
Blogger from zdnet claims otherwise: blog post