Bug 49554 - Clean up Functions
Summary: Clean up Functions
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.2.0
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-05 15:51 UTC by Jeremy Boynes
Modified: 2010-07-06 02:47 UTC (History)
0 users



Attachments
Patch to clean up Functions (22.25 KB, patch)
2010-07-05 16:01 UTC, Jeremy Boynes
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.