Skip to main content

Nov 25, 15

"JarClassLoader jcl = new JarClassLoader();"

Nov 20, 15

The 9 lines themselves

So let’s take a closer look at how these 9 lines got there. After a couple of days in court Joshua Bloch was called as a witness by Oracle. Bloch used to work for Sun as a developer on the Java API’s. In 2004 he joined Google and in 2008 he started working on Android. However, while working for Google, he still contributed to the OpenJDK, an open implementation of the Java SE platform, controlled by Sun at the time. One of the things he contributed was a much faster implementation for sorting arrays, based on the algorithm TimSort used in Python. Both the old and new algorithm had the rangeCheck method in common, so he just copied it from the old implementation, as “a temporary measure”. And some way or other this same rangeCheck method ended up in Android.

Arrays are as common as dirt in programming languages, and range checking is inherent to collections, such as arrays, list, dictionaries. It basically checks whether a data element is within a certain range before performing operations with it. For example, you always want to check if y is different from zero before dividing x by y, or if i is between 0 and 11 before retrieving the ith element of a 10-element list. If you don’t, or more aptly, if your programming environment doesn’t, your software fails.

And here are the famous 9 lines:

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);

Nov 19, 15



  • 当前可用分期额度:¥11630.94分期总额度:¥12000.00
Nov 09, 15

"The default setting is defined in the file jvm.cfg. A content like

-client KNOWN
-server KNOWN
defines the client as the default.

-server KNOWN
-client KNOWN
sets the server as the default."

Nov 06, 15

"dssh() {
PID=$(docker inspect --format {{.State.Pid}} $1)
sudo /usr/bin/nsenter --target $PID --mount --uts --ipc --net --pid env -i - $(sudo cat /proc/$PID/environ | xargs -0) bash

Nov 03, 15

kenan3kid  潜力级手机控 发表于10-31 13:44:40只看该作者6#

小米安全玲珑  潜力级手机控 发表于11-01 00:15:24只看该作者7#
在该情况下,请关闭wifi,然后前往 设置->其他应用管理->全部->网络助手(蓝色的图标)->清理数据,即可解决此问题

Nov 03, 15

"<property name= "timeBetweenEvictionRunsMillis" value="30000" />  
        <property name= "numTestsPerEvictionRun" value="30" />  
        <property name="minEvictableIdleTimeMillis" value="1800000" />  "

1 - 20 of 3670 Next › Last »
20 items/page

Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »

Join Diigo