[infinispan-issues] [JBoss JIRA] (ISPN-1727) ComponentMetadataPersister is using dangerous characters in regular expression replacement
Galder Zamarreño (JIRA)
jira-events at lists.jboss.org
Mon Jan 16 11:32:20 EST 2012
[ https://issues.jboss.org/browse/ISPN-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Galder Zamarreño updated ISPN-1727:
-----------------------------------
Fix Version/s: 5.1.0.CR4
(was: 5.1.0.FINAL)
> 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.CR4
>
>
> {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