News for hackers. Stuff that matters.
Re:Google’s copying of the Java SE API was fair use [pdf] by softwaredoug on Monday April 05, 2021 @11:20AM (#26700191)
Judge William Alsup learned to code for this case, and was therefore able to avoid a lot of the BS being peddled around the significance of some of the code:

> The argument centered on a function called rangeCheck. ... It was in Oracle’s interest to play up the significance of rangeCheck as much as possible, and David Boies, Oracle’s lawyer, began to argue that Google had copied rangeCheck so that it could take Android to market more quickly. Judge Alsup was not buying it.

> “I couldn't have told you the first thing about Java before this trial,” said the judge. “But, I have done and still do a lot of programming myself in other languages. I have written blocks of code like rangeCheck a hundred times or more. I could do it. You could do it. It is so simple.”

https://www.theverge.com/2017/10/19/16503076/oracle-vs-googl...

Re:Google’s copying of the Java SE API was fair use [pdf] by orangecat on Monday April 05, 2021 @11:44AM (#26700485)
Judge William Alsup learned to code for this case

He learned Java for the case, but he was already an accomplished developer: https://www.theverge.com/2017/10/19/16503076/oracle-vs-googl...

Re:Google’s copying of the Java SE API was fair use [pdf] by distribot on Monday April 05, 2021 @11:31AM (#26700350)
I just took a look at the rangeCheck:

https://majadhondt.wordpress.com/2012/05/16/googles-9-lines/

Is this example correct? Can someone explain to me how this: if (toIndex > arrayLen)

is correct?

If the array length is say 5, and toIndex is 5, that should still throw an index out of bounds exception, right? But it would be acceptable here.

Re:Google’s copying of the Java SE API was fair use [pdf] by Jabbles on Monday April 05, 2021 @11:47AM (#26700517)
The example is correct. toIndex is exclusive.

Here is Dijkstra's opinion on why:

https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/E...

Re:Google’s copying of the Java SE API was fair use [pdf] by tomsmeding on Monday April 05, 2021 @11:48AM (#26700537)
Aside from the questionable inequalities, there's a missing closing parenthesis after the arguments on the first line, too.

EDIT: as has been pointed out, the inequalities are correct. The original code can e.g. be found here, including doc comments showing the intended meaning of the arguments: http://www.groklaw.net/pdf3/OraGoogletrialexhibits/2012-04-2... (all the way at the end)

Re:Google’s copying of the Java SE API was fair use [pdf] by distribot on Monday April 05, 2021 @11:57AM (#26700629)
Thanks this makes sense. So the toIndex is literally defined as "the index after the last element in the range".
Re:Google’s copying of the Java SE API was fair use [pdf] by jameshart on Monday April 05, 2021 @11:53AM (#26700579)
The upper bound of the range is intended to be exclusive, while the lower bound is inclusive - basically, the same s array indexing convention. It allows the case where fromIndex == toIndex to represent the empty range (note that this check does permit fromIndex to equal toIndex, but never to exceed it), and the number of entries in a given range is always defined by toIndex - fromIndex.
Re:Google’s copying of the Java SE API was fair use [pdf] by asgeir on Monday April 05, 2021 @01:29PM (#26701898)
This is correct for a half-closed interval https://mathworld.wolfram.com/Half-ClosedInterval.html
Re:Google’s copying of the Java SE API was fair use [pdf] by mikevm on Monday April 05, 2021 @11:42AM (#26700472)
toIndex is defined to be the index after the last element of the range (a half-closed interval).
Re:Google’s copying of the Java SE API was fair use [pdf] by mlindner on Monday April 05, 2021 @12:08PM (#26700766)
That judge had no part of this decision though.
Re:Google’s copying of the Java SE API was fair use [pdf] by Spooky23 on Monday April 05, 2021 @12:32PM (#26701143)
This stuff is very nuanced, especially when the stakes are high.

SCOTUS rules on the legal and fundamental matter, not the subject. So if the attorneys for one side or the other are able to manipulate the judge into making a weak ruling (even one not in their favor), the appeals courts rulings will be impacted. In this case, the trial judge went above and beyond to avoid that kind of bullshit.

Re:Google’s copying of the Java SE API was fair use [pdf] by garaetjjte on Monday April 05, 2021 @02:38PM (#26702812)
>David Boies

That David Boies? I guess law firms will represent whoever will pay, but it seems somewhat funny that he also represented The SCO Group in their litigation against IBM...