@@ -1184,7 +1184,7 @@ static String decodeUrl(final String url) {
11841184 i += 3 ;
11851185 } while (i < n && url .charAt (i ) == '%' );
11861186 continue ;
1187- } catch (final RuntimeException ignored ) {
1187+ } catch (final IndexOutOfBoundsException | NumberFormatException ignored ) {
11881188 // malformed percent-encoded octet, fall through and
11891189 // append characters literally
11901190 } finally {
@@ -2690,8 +2690,7 @@ public static String readFileToString(final File file, final Charset charsetName
26902690 * @throws NullPointerException if file is {@code null}.
26912691 * @throws IOException if an I/O error occurs, including when the file does not exist, is a directory rather than a
26922692 * regular file, or for some other reason why the file cannot be opened for reading.
2693- * @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link java.io
2694- * .UnsupportedEncodingException} in version 2.2 if the named charset is unavailable.
2693+ * @throws java.nio.charset.UnsupportedCharsetException if the named charset is unavailable.
26952694 * @since 2.3
26962695 */
26972696 public static String readFileToString (final File file , final String charsetName ) throws IOException {
@@ -2740,8 +2739,7 @@ public static List<String> readLines(final File file, final Charset charset) thr
27402739 * @throws NullPointerException if file is {@code null}.
27412740 * @throws IOException if an I/O error occurs, including when the file does not exist, is a directory rather than a
27422741 * regular file, or for some other reason why the file cannot be opened for reading.
2743- * @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link java.io
2744- * .UnsupportedEncodingException} in version 2.2 if the named charset is unavailable.
2742+ * @throws java.nio.charset.UnsupportedCharsetException if the named charset is unavailable.
27452743 * @since 1.1
27462744 */
27472745 public static List <String > readLines (final File file , final String charsetName ) throws IOException {
@@ -3058,11 +3056,8 @@ private static String[] toSuffixes(final String... extensions) {
30583056
30593057 /**
30603058 * Implements behavior similar to the Unix "touch" utility. Creates a new file with size 0, or, if the file exists, just
3061- * updates the file's modified time.
3062- * <p>
3063- * NOTE: As from v1.3, this method throws an IOException if the last modified date of the file cannot be set. Also, as
3064- * from v1.3 this method creates parent directories if they do not exist.
3065- * </p>
3059+ * updates the file's modified time. This method throws an IOException if the last modified date
3060+ * of the file cannot be set. It creates parent directories if they do not exist.
30663061 *
30673062 * @param file the File to touch.
30683063 * @throws NullPointerException if the parameter is {@code null}.
@@ -3211,8 +3206,7 @@ public static void write(final File file, final CharSequence data, final String
32113206 * @param append if {@code true}, then the data will be added to the
32123207 * end of the file rather than overwriting
32133208 * @throws IOException in case of an I/O error
3214- * @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link java.io
3215- * .UnsupportedEncodingException} in version 2.2 if the encoding is not supported by the VM
3209+ * @throws java.nio.charset.UnsupportedCharsetException if the encoding is not supported by the VM
32163210 * @since 2.1
32173211 */
32183212 public static void write (final File file , final CharSequence data , final String charsetName , final boolean append ) throws IOException {
@@ -3223,10 +3217,7 @@ public static void write(final File file, final CharSequence data, final String
32233217
32243218 /**
32253219 * Writes a byte array to a file creating the file if it does not exist.
3226- * <p>
3227- * NOTE: As from v1.3, the parent directories of the file will be created
3228- * if they do not exist.
3229- * </p>
3220+ * The parent directories of the file will be created if they do not exist.
32303221 *
32313222 * @param file the file to write to
32323223 * @param data the content to write to the file
@@ -3353,10 +3344,7 @@ public static void writeLines(final File file, final Collection<?> lines, final
33533344 * Writes the {@code toString()} value of each item in a collection to
33543345 * the specified {@link File} line by line.
33553346 * The specified character encoding and the default line ending will be used.
3356- * <p>
3357- * NOTE: As from v1.3, the parent directories of the file will be created
3358- * if they do not exist.
3359- * </p>
3347+ * The parent directories of the file will be created if they do not exist.
33603348 *
33613349 * @param file the file to write to
33623350 * @param charsetName the name of the requested charset, {@code null} means platform default
@@ -3391,10 +3379,7 @@ public static void writeLines(final File file, final String charsetName, final C
33913379 * Writes the {@code toString()} value of each item in a collection to
33923380 * the specified {@link File} line by line.
33933381 * The specified character encoding and the line ending will be used.
3394- * <p>
3395- * NOTE: As from v1.3, the parent directories of the file will be created
3396- * if they do not exist.
3397- * </p>
3382+ * The parent directories of the file will be created if they do not exist.
33983383 *
33993384 * @param file the file to write to
34003385 * @param charsetName the name of the requested charset, {@code null} means platform default
@@ -3461,10 +3446,7 @@ public static void writeStringToFile(final File file, final String data, final b
34613446
34623447 /**
34633448 * Writes a String to a file creating the file if it does not exist.
3464- * <p>
3465- * NOTE: As from v1.3, the parent directories of the file will be created
3466- * if they do not exist.
3467- * </p>
3449+ * The parent directories of the file will be created if they do not exist.
34683450 *
34693451 * @param file the file to write
34703452 * @param data the content to write to the file
@@ -3478,7 +3460,8 @@ public static void writeStringToFile(final File file, final String data, final C
34783460 }
34793461
34803462 /**
3481- * Writes a String to a file creating the file if it does not exist.
3463+ * Writes a String to a file, creating the file if it does not exist.
3464+ * The parent directories of the file are created if they do not exist.
34823465 *
34833466 * @param file the file to write
34843467 * @param data the content to write to the file
@@ -3495,11 +3478,8 @@ public static void writeStringToFile(final File file, final String data, final C
34953478 }
34963479
34973480 /**
3498- * Writes a String to a file creating the file if it does not exist.
3499- * <p>
3500- * NOTE: As from v1.3, the parent directories of the file will be created
3501- * if they do not exist.
3502- * </p>
3481+ * Writes a String to a file, creating the file if it does not exist.
3482+ * The parent directories of the file are created if they do not exist.
35033483 *
35043484 * @param file the file to write
35053485 * @param data the content to write to the file
@@ -3512,16 +3492,16 @@ public static void writeStringToFile(final File file, final String data, final S
35123492 }
35133493
35143494 /**
3515- * Writes a String to a file creating the file if it does not exist.
3495+ * Writes a String to a file, creating the file if it does not exist.
3496+ * The parent directories of the file are created if they do not exist.
35163497 *
35173498 * @param file the file to write
35183499 * @param data the content to write to the file
35193500 * @param charsetName the name of the requested charset, {@code null} means platform default
35203501 * @param append if {@code true}, then the String will be added to the
35213502 * end of the file rather than overwriting
35223503 * @throws IOException in case of an I/O error
3523- * @throws java.nio.charset.UnsupportedCharsetException thrown instead of {@link java.io
3524- * .UnsupportedEncodingException} in version 2.2 if the encoding is not supported by the VM
3504+ * @throws java.nio.charset.UnsupportedCharsetException if the encoding is not supported by the VM
35253505 * @since 2.1
35263506 */
35273507 public static void writeStringToFile (final File file , final String data , final String charsetName , final boolean append ) throws IOException {
0 commit comments