decoration decoration
Stories

GROKLAW
When you want to know more...
decoration
For layout only
Home
Archives
Site Map
Search
About Groklaw
Awards
Legal Research
Timelines
ApplevSamsung
ApplevSamsung p.2
ArchiveExplorer
Autozone
Bilski
Cases
Cast: Lawyers
Comes v. MS
Contracts/Documents
Courts
DRM
Gordon v MS
GPL
Grokdoc
HTML How To
IPI v RH
IV v. Google
Legal Docs
Lodsys
MS Litigations
MSvB&N
News Picks
Novell v. MS
Novell-MS Deal
ODF/OOXML
OOXML Appeals
OraclevGoogle
Patents
ProjectMonterey
Psystar
Quote Database
Red Hat v SCO
Salus Book
SCEA v Hotz
SCO Appeals
SCO Bankruptcy
SCO Financials
SCO Overview
SCO v IBM
SCO v Novell
SCO:Soup2Nuts
SCOsource
Sean Daly
Software Patents
Switch to Linux
Transcripts
Unix Books

Gear

Groklaw Gear

Click here to send an email to the editor of this weblog.


You won't find me on Facebook


Donate

Donate Paypal


No Legal Advice

The information on Groklaw is not intended to constitute legal advice. While Mark is a lawyer and he has asked other lawyers and law students to contribute articles, all of these articles are offered to help educate, not to provide specific legal advice. They are not your lawyers.

Here's Groklaw's comments policy.


What's New

STORIES
No new stories

COMMENTS last 48 hrs
No new comments


Sponsors

Hosting:
hosted by ibiblio

On servers donated to ibiblio by AMD.

Webmaster
But who wrote java.util.arraylist? | 402 comments | Create New Account
Comments belong to whoever posts them. Please notify us of inappropriate comments.
But who wrote java.util.arraylist?
Authored by: Wol on Thursday, May 17 2012 @ 01:56 PM EDT
Joshua Bloch.

At least the rangeCheck part of it.

(Oh - and THAT was copied from Python)

Cheers,
Wol

[ Reply to This | Parent | # ]

er? Google should get a JOML on this.
Authored by: bugstomper on Thursday, May 17 2012 @ 03:38 PM EDT
No, the sequence is really simple, which by Muphry's Law (and no, that's not a
typo, look it up in Wikipedia) I am bound to get wrong when I say it here:

Joshua Bloch wrote the class java.util.Arrays (not arraylist or ArrayList or
Array, but java.util.Arrays which I will now refer to as Arrays) while an
employee at Sun, therefore as a work for hire Sun owned the copyright.

Arrays is a class that contains several public static methods that do useful
things with objects in the Array class, including sort and fill methods. A few
of those methods take as arguments a start and end index parameter and are
specified as throwing certain exceptions if those parameters are out of the
proper range for an index for the Array object that is passed in.

Bloch wrote, as part of the Arrays class, a private method called rangeCheck
that was called by each of those methods that had to check for valid start and
end index arguments, because all had to do the same chack and throw the same
exception in the case of error.

Later, while a Google employee not yet on the Android team and on his own time
he wrote a new class called TimSort by translating the algorithm of a very fast
python sort routine into Java that he wrote to contribute to OpenJDK. The python
version did not have the range checking and exception handling in it, so he
wrote the rangeCheck method again for TimSort, making it produce the identical
exception messages in the identical circumstances as did the one used by the
sort method in Arrays. The behavior was meant to be identical because
TimSort.sort was supposed to be a drop-in replacement for Arrays.sort that
behaves the same only much faster. Bloch testified that he did not recall if he
copied rangeCheck by having the 3-statement function memorized or if he looked
it up, but either way he copied it. That was no problem because he wrote TimSort
to donate to OpenJDK, where it was going to be part of Sun's GPL release along
with the original java.util.Arrays which contained his original rangeCheck.
Also, he intended for the OpenJDK developers to eventually change Arrays to
declare the rangeCheck method public and then remove the none lines from
TimSort, replacing the calls in TimSort that used that private method to instead
call the newly public Arrays.rangeCheck().

Some time after contributing TimSort to OpenJDK, he also contributed it to
Android. The terms of the contributer agreements of both projects left him
owning the copyright to TimSort, so Sun had rights to use but did not own
TimSort itself, and allowed him to release it under the different licenses of
the two projects.

However he forgot about rangeCheck copyright in regards to Android. Near the end
of 2010, I think even before Oracle identified the copying and told Google about
it, rangeCheck was removed from the Android version of TimSort as originally
planned, replaced with a call into Arrays.

[ Reply to This | Parent | # ]

Groklaw © Copyright 2003-2013 Pamela Jones.
All trademarks and copyrights on this page are owned by their respective owners.
Comments are owned by the individual posters.

PJ's articles are licensed under a Creative Commons License. ( Details )