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

Sanne Grinovero (JIRA) jira-events at lists.jboss.org
Fri Jan 13 12:08:21 EST 2012


Sanne Grinovero created ISPN-1727:
-------------------------------------

             Summary: 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}
Some problems here - at least I think so as I've not seen any complaints:
 - File.separator is the escape character in windows
 - "." means any character, and is used twice without escaping.

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