--- old/./src/share/classes/java/lang/String.java 2012-08-20 20:17:00.195084220 -0400 +++ new/./src/share/classes/java/lang/String.java 2012-08-20 20:17:00.083084223 -0400 @@ -2362,6 +2362,22 @@ } /** + * Set the value of this {@code String} to {@code n} concatenated copies of the + * current value. If {@code n == 0}, then set the value to the empty string. + * + * @param n the number of times to add the current value + * @return a reference to this String + * @throws IllegalArgumentException if n < 0 + * @since 1.8 + */ + public String repeat( int n ) { + if (n < 0) { + throw new IllegalArgumentException( "n < 0"); + } + return new StringBuilder().append(n, this).toString(); + } + + /** * Converts all of the characters in this {@code String} to lower * case using the rules of the given {@code Locale}. Case mapping is based * on the Unicode Standard version specified by the {@link java.lang.Character Character}