Bug 49554

Summary: Clean up Functions
Product: Taglibs Reporter: Jeremy Boynes <jboynes>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Severity: enhancement    
Priority: P2    
Version: 1.2.0   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Patch to clean up Functions

Description Jeremy Boynes 2010-07-05 15:51:41 UTC
The implementation of Functions has checks for null parameters that are redundant given coercion required by the Engine. As discussed on the mailing list, these checks can be removed.

Functions should have JavaDoc.

Some function implementations, such as replace, are now available in the JRE allowing this class to be simplified. Also usage of StringBuffer can be replaced with StringBuilder avoiding unneeded synchronization.
Comment 1 Jeremy Boynes 2010-07-05 16:01:53 UTC
Created attachment 25711 [details]
Patch to clean up Functions

pom.xml also includes changes from attachment 25694 [details] for SetSupport
Comment 2 Henri Yandell 2010-07-06 02:47:41 UTC
I was a bit concerned about substring's:

-        if (beginIndex >= input.length()) return "";

and substringAfter's:

-        if (substring.length() == 0) return input;

However you have unit tests for both and they pass before the Functions.java change is applied and afterwards.

Committed as r960814.