191 points · by grellas · 14y ago · 35 comments
The rangeCheck method in TimSort.java and ComparableTimSort.Java YES, infringing....
private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) {
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex(" + fromIndex +
") > toIndex(" + toIndex+")");
if (fromIndex < 0)
throw new ArrayIndexOutOfBoundsException(fromIndex);
if (toIndex > arrayLen)
throw new ArrayIndexOutOfBoundsException(toIndex);
}
From Google:private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) {
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex(" + fromIndex +
") > toIndex(" + toIndex+")");
if (fromIndex < 0)
throw new ArrayIndexOutOfBoundsException(fromIndex);
if (toIndex > arrayLen)
throw new ArrayIndexOutOfBoundsException(toIndex);
}
}Open and shut case. /s
The takeaway is write it yourself - don't copy it without permission, even if it's so obvious. (And if it's so obvious then there really is hardly a reason to even copy it in the first place.)
This is all pretty fucked up, but that's what the law is.
This sort of trial should be conducted in the modern style of civil law countries, but that would require a constitutional amendment.
That's what the lawyers are there for: to present the evidence and make the case (based on the testimony of experts) to a jury who doesn't get it.
I think there are arguments to be made in support of changing how we use juries in the courts, but this isn't one of them. I mean, this argument applies to just about every case that uses a jury, and it's simply not feasible to expect that jurors be knowledgeable in all the areas that a given case touches upon.
None of this applies to programming, which bears only the most tenuous of relationships to anything most people will learn or use in their lives.