You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2016/11/04 03:01:48 UTC

logging-log4j2 git commit: No need to scan string twice.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 4a76057d2 -> 71cec25ee


No need to scan string twice.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/71cec25e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/71cec25e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/71cec25e

Branch: refs/heads/master
Commit: 71cec25ee33830799fd9f489a821cec562fe655f
Parents: 4a76057
Author: Gary Gregory <gg...@apache.org>
Authored: Thu Nov 3 20:01:42 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Thu Nov 3 20:01:42 2016 -0700

----------------------------------------------------------------------
 .../logging/log4j/core/config/plugins/util/ResolverUtil.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/71cec25e/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
index a353228..d9e3594 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/util/ResolverUtil.java
@@ -236,8 +236,9 @@ public class ResolverUtil {
             urlPath = urlPath.substring(5);
         }
         // If it was in a JAR, grab the path to the jar
-        if (urlPath.indexOf('!') > 0) {
-            urlPath = urlPath.substring(0, urlPath.indexOf('!'));
+        final int bangIndex = urlPath.indexOf('!');
+        if (bangIndex > 0) {
+            urlPath = urlPath.substring(0, bangIndex);
         }
 
         // LOG4J2-445