tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r708185 - in /tomcat/trunk/java/org/apache/tomcat/util: IntrospectionUtils.java digester/Digester.java
Date Mon, 27 Oct 2008 14:04:08 GMT
Author: markt
Date: Mon Oct 27 07:04:07 2008
New Revision: 708185

URL: http://svn.apache.org/viewvc?rev=708185&view=rev
Log:
Apply Remy's alternative fix for the String comparison bugs found by Find Bugs. Note FB still
complains but it is a false positive.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java?rev=708185&r1=708184&r2=708185&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/IntrospectionUtils.java Mon Oct 27 07:04:07 2008
@@ -489,6 +489,9 @@
      */
     public static String replaceProperties(String value, Hashtable staticProp,
             PropertySource dynamicProp[]) {
+        if (value.indexOf("$") < 0) {
+            return value;
+        }
         StringBuffer sb = new StringBuffer();
         int prev = 0;
         // assert value!=nil

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java?rev=708185&r1=708184&r2=708185&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java Mon Oct 27 07:04:07 2008
@@ -2866,7 +2866,7 @@
             try {
                 String newValue = 
                     IntrospectionUtils.replaceProperties(value, null, source);
-                if (!value.equals(newValue)) {
+                if (value != newValue) {
                     newAttrs.setValue(i, newValue);
                 }
             }
@@ -2894,7 +2894,7 @@
             return bodyText; // return unchanged data
         }
 
-        if (out.equals(in))  {
+        if (out == in)  {
             // No substitutions required. Don't waste memory creating
             // a new buffer
             return bodyText;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message