Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!multikabel.net!newsfeed20.multikabel.net!post40.multikabel.net!cache80.multikabel.net!not-for-mail From: "Skybuck Flying" Newsgroups: alt.comp.lang.borland-delphi,comp.lang.c,comp.lang.java.programmer References: <29308868.1994.1337265697084.JavaMail.geo-discussion-forums@pbcuc6> <84131$4fb54067$5419acc3$20839@cache90.multikabel.net> <4e980$4fb56cac$5419acc3$13190@cache60.multikabel.net> In-Reply-To: Subject: Re: Oracle/Google demonstrate human beings cannot write 10 lines of code without making a mistake ;) Date: Fri, 18 May 2012 01:18:00 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3538.513 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3538.513 Message-ID: X-Complaints-To: abuse@ziggo.nl Organization: Ziggo Lines: 56 NNTP-Posting-Host: 84.25.172.195 (84.25.172.195) NNTP-Posting-Date: Fri, 18 May 2012 01:17:51 +0200 X-Trace: ce6934fb5871ff1bc096619177 Xref: csiph.com comp.lang.c:20958 comp.lang.java.programmer:14607 "Heikki Kallasjoki" wrote in message news:slrnjrau0n.f5o.fis@iris.zem.fi... On 2012-05-17, Joshua Cranmer wrote: > On 5/17/2012 5:25 PM, Skybuck Flying wrote: >> One such concept is "range". >> >> It's pretty clearly defined: >> >> http://en.wikipedia.org/wiki/Range_(computer_programming) >> >> Any computer language deviating from the standard/common meaning of >> range should clearly state so. > > In 0-based array indexes, the standard interpretation of a range is the > half-open model: start <= value < end. Note in particular things like > the standard STL idioms, JavaScript slice, python's methods. " And, most relevantly in this context, the standard methods in java.util.Arrays (binarySearch, copyOfRange, fill, sort), all of which accept ranges using the half-open "inclusive start, exclusive end" way. Most of them even have parameters called "fromIndex" and "toIndex", identically to rangeCheck. Surely it would be strange and unexpected to deviate from this "standard/common meaning" used by the system libraries. (Not to mention that the code in question, in its generated-documentation comments quoted elsethread, does clearly state what the arguments mean.) " There is no "rangeCheck" function for java.util.Arrays: http://docs.oracle.com/javase/6/docs/api/java/util/Arrays.html To me it appears as if rangeCheck is some low level operating system code or memory management code to try and prevent the os or applications from crashing or exploits from taking over the system. It would be interesting to know where this "rangeCheck" function is from. I would not be surprised that the functions you mentioned would be the cause of many bugs in java programs. Almost seems like a deliberate design to make java programs crash... perhaps a nice test for the "sand boxing" which after many years has proven to be a failure, google for java exploits ;) One of the reasons why java will not be installed onto my computers now and in the future. Seeing these functions only re-assures me of my decision to do so. Bye, Skybuck.