You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/01/04 13:42:18 UTC
[commons-io] branch master updated: Local var not needed.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push:
new 956eabc Local var not needed.
956eabc is described below
commit 956eabc0b1a16051d8b362256a7a084105499d00
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jan 4 08:42:13 2021 -0500
Local var not needed.
---
src/main/java/org/apache/commons/io/FileUtils.java | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java b/src/main/java/org/apache/commons/io/FileUtils.java
index 0944471..49d87d0 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -1366,21 +1366,17 @@ public class FileUtils {
public static void forceMkdir(final File directory) throws IOException {
if (directory.exists()) {
if (!directory.isDirectory()) {
- final String message =
- "File "
- + directory
- + " exists and is "
- + "not a directory. Unable to create directory.";
- throw new IOException(message);
+ throw new IOException("File "
+ + directory
+ + " exists and is "
+ + "not a directory. Unable to create directory.");
}
} else {
if (!directory.mkdirs()) {
// Double-check that some other thread or process hasn't made
// the directory in the background
if (!directory.isDirectory()) {
- final String message =
- "Unable to create directory " + directory;
- throw new IOException(message);
+ throw new IOException("Unable to create directory " + directory);
}
}
}