You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Emmanuel Lecharny (JIRA)" <ji...@apache.org> on 2014/10/28 18:05:34 UTC

[jira] [Created] (FC-28) The safeText method is probably not useful, and can be faster

Emmanuel Lecharny created FC-28:
-----------------------------------

             Summary: The safeText method is probably not useful, and can be faster
                 Key: FC-28
                 URL: https://issues.apache.org/jira/browse/FC-28
             Project: FORTRESS-CORE
          Issue Type: Improvement
    Affects Versions: 1.0-RC35
            Reporter: Emmanuel Lecharny
             Fix For: 1.0.0




When we want to validate an entity before injecting it in the server, we call the RegExUtil.safeText() method.

It's checking something the server will already check (each value injected in the server will be controlled). Of course, we can set limits like the max length, but this can be done when defining the AttributeType (using the
{NNN}

notation).

Otherwise, the way the regexp is evaluated is costly : we compile the gexep every time, when it could be done only once.

Pattern safeTextPattern = Pattern.compile(safeTextPatternStr);

can be done globally.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)