From 7eada4cf4986828818393494ed3c9e9d27c5e698 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Wed, 18 Jul 2012 23:30:03 +0000 Subject: [PATCH] LOGGING-147 - SimpleLog.log - unsafe update of shortLogName git-svn-id: https://svn.apache.org/repos/asf/commons/proper/logging/trunk@1363173 13f79535-47bb-0310-9956-ffa450edef68 --- RELEASE-NOTES.txt | 1 + src/java/org/apache/commons/logging/impl/SimpleLog.java | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 79c0eaf..ae279c8 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -22,6 +22,7 @@ LOGGING-130 - Potential missing privileged block for class loader LOGGING-145 - LogFactoryImpl.setAttribute - possible NPE LOGGING-142 - Log4JLogger uses deprecated static members of Priority such as INFO LOGGING-128 - Static analysis suggests a number of potential improvements +LOGGING-147 - SimpleLog.log - unsafe update of shortLogName $Id$ diff --git a/src/java/org/apache/commons/logging/impl/SimpleLog.java b/src/java/org/apache/commons/logging/impl/SimpleLog.java index 4b800f2..76c6497 100644 --- a/src/java/org/apache/commons/logging/impl/SimpleLog.java +++ b/src/java/org/apache/commons/logging/impl/SimpleLog.java @@ -311,9 +311,8 @@ public class SimpleLog implements Log, Serializable { if( showShortName) { if( shortLogName==null ) { // Cut all but the last component of the name for both styles - shortLogName = logName.substring(logName.lastIndexOf(".") + 1); - shortLogName = - shortLogName.substring(shortLogName.lastIndexOf("/") + 1); + String slName = logName.substring(logName.lastIndexOf(".") + 1); + shortLogName = slName.substring(slName.lastIndexOf("/") + 1); } buf.append(String.valueOf(shortLogName)).append(" - "); } else if(showLogName) {