Note that backslashes () and dollar signs ($) in the replacement string may cause the results to be different than if it were being treated as a literal replacement string. Dollar signs may be treated as references to captured subsequences as described above, and backslashes are used to escape literal characters in the replacement string.
得知,在使用replaceAll时,如果替换的字符中包含''或者''是正则中的关键字,替换会造成混淆。
解决办法:使用Matcher.quoteReplacement(sep)转义。
classFilePathStr.replaceAll(Matcher.quoteReplacement(File.separator), '.')