The Artima Developer Community
Sponsored Link

Java Buzz Forum
Joshua Bloch Shocking Confession: java.util.Arrays Is Broken

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Joshua Bloch Shocking Confession: java.util.Arrays Is Broken Posted: Jun 3, 2006 4:09 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Joshua Bloch Shocking Confession: java.util.Arrays Is Broken
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

(This should be all over the net by now. I first saw it here.)

Joshua Bloch: I was shocked to learn that the binary search program that Bentley proved correct and subsequently tested in Chapter 5 of Programming Pearls contains a bug. Once I tell you what the it is, you will understand why it escaped detection for two decades. Lest you think I'm picking on Bentley, let me tell you how I discovered the bug: The version of binary search that I wrote for the JDK contained the same bug.

The bug is in this line:

 6:             int mid = (low + high) / 2;

Once pointed out, it's obvious what the problem is. Joshua called on everybody to fix such broken code before they blow up.

The question is: how? The scope could be huge—it includes every line of code ever written and put into production. If you are thinking "That's the scope of the Y2K problem," you are exactly right.

Fellow programmers, we have a "Low+High" problem at our hands. Somebody better mobilize an army of "Low+High" special forces and get working.

Are your product "Low+High" compliant? :)

Read: Joshua Bloch Shocking Confession: java.util.Arrays Is Broken

Topic: The Rails Development Pattern Previous Topic   Next Topic Topic: SCJP 5 - Autoboxing, Regular expressions and serialization articles

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use