Program: 186938
Project: 186938
Buggy source:
/** 
 * Parse the specified <code>String</code> as a <code>double</code>. The extended BNF grammar is as follows:<br> <pre> <em>DecodableString</em>: ( [ <code>-</code> | <code>+</code> ] <code>NaN</code> ) | ( [ <code>-</code> | <code>+</code> ] <code>Infinity</code> ) | ( [ <code>-</code> | <code>+</code> ] <em>FloatingPoint</em> [ <code>f</code> | <code>F</code> | <code>d</code> | <code>D</code>] ) <em>FloatingPoint</em>: ( { <em>Digit</em> }+ [ <code>.</code> { <em>Digit</em> } ] [ <em>Exponent</em> ] ) | ( <code>.</code> { <em>Digit</em> }+ [ <em>Exponent</em> ] ) <em>Exponent</em>: ( ( <code>e</code> | <code>E</code> ) [ <code>-</code> | <code>+</code> ] { <em>Digit</em> }+ ) <em>Digit</em>: <em><code>'0'</code> through <code>'9'</code></em> </pre> <p>NaN and infinity are special cases, to allow parsing of the output of toString.  Otherwise, the result is determined by calculating <em>n * 10<sup>exponent</sup></em> to infinite precision, then rounding to the nearest double. Remember that many numbers cannot be precisely represented in floating point. In case of overflow, infinity is used, and in case of underflow, signed zero is used. Unlike Integer.parseInt, this does not accept Unicode digits outside the ASCII range. <p>If an unexpected character is found in the <code>String</code>, a <code>NumberFormatException</code> will be thrown.  Leading and trailing 'whitespace' is ignored via <code>String.trim()</code>, but spaces internal to the actual number are not allowed. <p>To parse numbers according to another format, consider using  {@link java.text.NumberFormat}.
 * @XXX specify where/how we are not in accord with the spec.
 * @param str the <code>String</code> to convert
 * @return the <code>double</code> value of <code>s</code>
 * @throws NumberFormatException if <code>s</code> cannot be parsed as a<code>double</code>
 * @throws NullPointerException if <code>s</code> is null
 * @see #MIN_VALUE
 * @see #MAX_VALUE
 * @see #POSITIVE_INFINITY
 * @see #NEGATIVE_INFINITY
 * @since 1.2
 */
public static double parseDouble(String str){
  return FloatingDecimal.readJavaFormatString(str).doubleValue();
}

Fixed version (ground truth):
/** 
 * Parse the specified <code>String</code> as a <code>double</code>. The extended BNF grammar is as follows:<br> <pre> <em>DecodableString</em>: ( [ <code>-</code> | <code>+</code> ] <code>NaN</code> ) | ( [ <code>-</code> | <code>+</code> ] <code>Infinity</code> ) | ( [ <code>-</code> | <code>+</code> ] <em>FloatingPoint</em> [ <code>f</code> | <code>F</code> | <code>d</code> | <code>D</code>] ) <em>FloatingPoint</em>: ( { <em>Digit</em> }+ [ <code>.</code> { <em>Digit</em> } ] [ <em>Exponent</em> ] ) | ( <code>.</code> { <em>Digit</em> }+ [ <em>Exponent</em> ] ) <em>Exponent</em>: ( ( <code>e</code> | <code>E</code> ) [ <code>-</code> | <code>+</code> ] { <em>Digit</em> }+ ) <em>Digit</em>: <em><code>'0'</code> through <code>'9'</code></em> </pre> <p>NaN and infinity are special cases, to allow parsing of the output of toString.  Otherwise, the result is determined by calculating <em>n * 10<sup>exponent</sup></em> to infinite precision, then rounding to the nearest double. Remember that many numbers cannot be precisely represented in floating point. In case of overflow, infinity is used, and in case of underflow, signed zero is used. Unlike Integer.parseInt, this does not accept Unicode digits outside the ASCII range. <p>If an unexpected character is found in the <code>String</code>, a <code>NumberFormatException</code> will be thrown.  Leading and trailing 'whitespace' is ignored via <code>String.trim()</code>, but spaces internal to the actual number are not allowed. <p>To parse numbers according to another format, consider using  {@link java.text.NumberFormat}.
 * @XXX specify where/how we are not in accord with the spec.
 * @param str the <code>String</code> to convert
 * @return the <code>double</code> value of <code>s</code>
 * @throws NumberFormatException if <code>s</code> cannot be parsed as a<code>double</code>
 * @throws NullPointerException if <code>s</code> is null
 * @see #MIN_VALUE
 * @see #MAX_VALUE
 * @see #POSITIVE_INFINITY
 * @see #NEGATIVE_INFINITY
 * @since 1.2
 */
public static double parseDouble(String str){
  return VMFloatingDecimal.readJavaFormatString(str).doubleValue();
}