logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1396003 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java
Date Tue, 09 Oct 2012 12:48:08 GMT
Author: ggregory
Date: Tue Oct  9 12:48:07 2012
New Revision: 1396003

URL: http://svn.apache.org/viewvc?rev=1396003&view=rev
Log:
Use Java style declarations (not C-like style).

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java?rev=1396003&r1=1396002&r2=1396003&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/helpers/Loader.java
Tue Oct  9 12:48:07 2012
@@ -69,15 +69,12 @@ public final class Loader {
      * @return A URL to the resource.
      */
     public static URL getResource(String resource, ClassLoader defaultLoader) {
-        ClassLoader classLoader;
-        URL url;
-
         try {
-            classLoader = getTCL();
+            ClassLoader classLoader = getTCL();
             if (classLoader != null) {
                 LOGGER.trace("Trying to find [" + resource + "] using context classloader
"
                         + classLoader + ".");
-                url = classLoader.getResource(resource);
+                URL url = classLoader.getResource(resource);
                 if (url != null) {
                     return url;
                 }
@@ -87,7 +84,7 @@ public final class Loader {
             classLoader = Loader.class.getClassLoader();
             if (classLoader != null) {
                 LOGGER.trace("Trying to find [" + resource + "] using " + classLoader + "
class loader.");
-                url = classLoader.getResource(resource);
+                URL url = classLoader.getResource(resource);
                 if (url != null) {
                     return url;
                 }
@@ -95,7 +92,7 @@ public final class Loader {
             // We could not find resource. Finally try with the default ClassLoader.
             if (defaultLoader != null) {
                 LOGGER.trace("Trying to find [" + resource + "] using " + defaultLoader +
" class loader.");
-                url = defaultLoader.getResource(resource);
+                URL url = defaultLoader.getResource(resource);
                 if (url != null) {
                     return url;
                 }



Mime
View raw message