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 7ea97b34 Internal refactoring
7ea97b34 is described below

commit 7ea97b34f0f75e88773947e71120e8e75165f781
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Dec 28 08:41:21 2023 -0500

    Internal refactoring
---
 src/main/java/org/apache/commons/io/build/AbstractOrigin.java | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/build/AbstractOrigin.java 
b/src/main/java/org/apache/commons/io/build/AbstractOrigin.java
index e0c574eb..281edca5 100644
--- a/src/main/java/org/apache/commons/io/build/AbstractOrigin.java
+++ b/src/main/java/org/apache/commons/io/build/AbstractOrigin.java
@@ -525,7 +525,7 @@ public abstract class AbstractOrigin<T, B extends 
AbstractOrigin<T, B>> extends
      */
     public File getFile() {
         throw new UnsupportedOperationException(
-                String.format("%s#getFile() for %s origin %s", 
getClass().getSimpleName(), origin.getClass().getSimpleName(), origin));
+                String.format("%s#getFile() for %s origin %s", 
getSimpleName(), origin.getClass().getSimpleName(), origin));
     }
 
     /**
@@ -560,7 +560,7 @@ public abstract class AbstractOrigin<T, B extends 
AbstractOrigin<T, B>> extends
      */
     public Path getPath() {
         throw new UnsupportedOperationException(
-                String.format("%s#getPath() for %s origin %s", 
getClass().getSimpleName(), origin.getClass().getSimpleName(), origin));
+                String.format("%s#getPath() for %s origin %s", 
getSimpleName(), origin.getClass().getSimpleName(), origin));
     }
 
     /**
@@ -574,6 +574,10 @@ public abstract class AbstractOrigin<T, B extends 
AbstractOrigin<T, B>> extends
         return Files.newBufferedReader(getPath(), charset);
     }
 
+    private String getSimpleName() {
+        return getClass().getSimpleName();
+    }
+
     /**
      * Gets a new Writer on the origin, buffered by default.
      *
@@ -600,6 +604,6 @@ public abstract class AbstractOrigin<T, B extends 
AbstractOrigin<T, B>> extends
 
     @Override
     public String toString() {
-        return getClass().getSimpleName() + "[" + origin.toString() + "]";
+        return getSimpleName() + "[" + origin.toString() + "]";
     }
 }

Reply via email to