jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r480670 - /jakarta/taglibs/proper/standard/trunk/src/org/apache/taglibs/standard/functions/Functions.java
Date Wed, 29 Nov 2006 18:32:38 GMT
Author: bayard
Date: Wed Nov 29 10:32:38 2006
New Revision: 480670

URL: http://svn.apache.org/viewvc?view=rev&rev=480670
Log:
Applying the fix from Jochen Metzinger in #39284 - the existing code was already fixed, but
this seems like a worthwhile simplification

Modified:
    jakarta/taglibs/proper/standard/trunk/src/org/apache/taglibs/standard/functions/Functions.java

Modified: jakarta/taglibs/proper/standard/trunk/src/org/apache/taglibs/standard/functions/Functions.java
URL: http://svn.apache.org/viewvc/jakarta/taglibs/proper/standard/trunk/src/org/apache/taglibs/standard/functions/Functions.java?view=diff&rev=480670&r1=480669&r2=480670
==============================================================================
--- jakarta/taglibs/proper/standard/trunk/src/org/apache/taglibs/standard/functions/Functions.java
(original)
+++ jakarta/taglibs/proper/standard/trunk/src/org/apache/taglibs/standard/functions/Functions.java
Wed Nov 29 10:32:38 2006
@@ -83,10 +83,7 @@
     public static boolean endsWith(String input, String substring) {
         if (input == null) input = "";
         if (substring == null) substring = "";
-        int index = input.lastIndexOf(substring);
-        if (index == -1) return false;
-        if (index == 0 && substring.length() == 0) return true;
-        return (index == input.length() - substring.length());
+        return input.endsWith(substring);
     }  
     
     public static String substring(String input, int beginIndex, int endIndex) {



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


Mime
View raw message