--- old/src/share/classes/java/lang/String.java 2013-01-22 14:36:34.010644504 -0500 +++ new/src/share/classes/java/lang/String.java 2013-01-22 14:36:33.850647952 -0500 @@ -33,6 +33,7 @@ import java.util.Comparator; import java.util.Formatter; import java.util.Locale; +import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @@ -871,6 +872,8 @@ if (srcBegin > srcEnd) { throw new StringIndexOutOfBoundsException(srcEnd - srcBegin); } + Objects.requireNonNull(dst); + int j = dstBegin; int n = srcEnd; int i = srcBegin; @@ -2112,7 +2115,6 @@ * * @param s the sequence to search for * @return true if this string contains {@code s}, false otherwise - * @throws NullPointerException if {@code s} is {@code null} * @since 1.5 */ public boolean contains(CharSequence s) { @@ -2219,8 +2221,6 @@ * @param target The sequence of char values to be replaced * @param replacement The replacement sequence of char values * @return The resulting string - * @throws NullPointerException if {@code target} or - * {@code replacement} is {@code null}. * @since 1.5 */ public String replace(CharSequence target, CharSequence replacement) { @@ -2833,9 +2833,6 @@ * href="../util/Formatter.html#detail">Details section of the * formatter class specification. * - * @throws NullPointerException - * If the {@code format} is {@code null} - * * @return A formatted string * * @see java.util.Formatter @@ -2865,8 +2862,8 @@ * limited by the maximum dimension of a Java array as defined by * The Java™ Virtual Machine Specification. * The behaviour on a - * {@code null} argument depends on the conversion. + * {@code null} argument depends on the + * conversion. * * @throws java.util.IllegalFormatException * If a format string contains an illegal syntax, a format @@ -2877,9 +2874,6 @@ * href="../util/Formatter.html#detail">Details section of the * formatter class specification * - * @throws NullPointerException - * If the {@code format} is {@code null} - * * @return A formatted string * * @see java.util.Formatter