tolerate null arguments, just return them

This commit is contained in:
Maxim.Mossienko
2011-04-01 18:04:07 +04:00
parent cf50d5328b
commit 4cdca13f77
2 changed files with 2 additions and 0 deletions
@@ -76,6 +76,7 @@ public class ReplacePathToMacroMap extends PathMacroMap {
}
public String substitute(String text, boolean caseSensitive) {
if (text == null) return null;
for (final String path : getPathIndex()) {
final String macro = get(path);
text = replacePathMacro(text, path, macro, caseSensitive);
@@ -34,6 +34,7 @@ public class ExpandMacroToPathMap extends PathMacroMap {
}
public String substitute(String text, boolean caseSensitive) {
if (text == null) return null;
for (Map.Entry<String, String> entry : entries()) {
// when replacing macros with actual paths the replace utility may be used as always 'case-sensitive'
// for case-insensitive file systems there will be no unnecesary toLowerCase() transforms.