[infinispan-issues] [JBoss JIRA] (ISPN-1727) ComponentMetadataPersister is using dangerous characters in regular expression replacement

Sanne Grinovero (JIRA) jira-events at lists.jboss.org
Wed Jan 18 05:49:18 EST 2012


     [ https://issues.jboss.org/browse/ISPN-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sanne Grinovero updated ISPN-1727:
----------------------------------

        Status: Resolved  (was: Pull Request Sent)
    Resolution: Done

    
> ComponentMetadataPersister is using dangerous characters in regular expression replacement
> ------------------------------------------------------------------------------------------
>
>                 Key: ISPN-1727
>                 URL: https://issues.jboss.org/browse/ISPN-1727
>             Project: Infinispan
>          Issue Type: Bug
>    Affects Versions: 5.1.0.CR3
>            Reporter: Sanne Grinovero
>            Assignee: Manik Surtani
>             Fix For: 5.1.0.FINAL
>
>
> {code}
> private static String extractFqcn(String path, File f) {
>       return f.getAbsolutePath().replace(path, "").replace(File.separator, ".").replace(".class", "").replaceFirst(".", "");
>    }
> {code}
> A problem is here - at least I think so as I've not seen any complaints; while "replace" is expecting a literal, "replaceFirst" is taking first argument as a regex pattern to match; and "." is a wildcard..
> This method is a good candidate for a *unit test* but I'm not understanding what the purpose is - if someone could plase add examples of intended functionality.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list