logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1501221 - /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java
Date Tue, 09 Jul 2013 12:32:01 GMT
Author: ggregory
Date: Tue Jul  9 12:32:00 2013
New Revision: 1501221

URL: http://svn.apache.org/r1501221
Log:
Refactor String pattern 'foo == null || foo.length() == 0' into a new helper API Strings.isEmpty(CharSequence)
copied from Apache Commons Lang.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java?rev=1501221&r1=1501220&r2=1501221&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/db/jdbc/DriverManagerConnectionSource.java
Tue Jul  9 12:32:00 2013
@@ -77,7 +77,7 @@ public final class DriverManagerConnecti
     public static DriverManagerConnectionSource createConnectionSource(@PluginAttr("url")
final String url,
                                                                        @PluginAttr("username")
String username,
                                                                        @PluginAttr("password")
String password) {
-        if (url == null || url.length() == 0) {
+        if (Strings.isEmpty(url)) {
             LOGGER.error("No JDBC URL specified for the database.", url);
             return null;
         }



Mime
View raw message