diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index b31c4984c0..ba0824141b 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -361,6 +361,9 @@ Release 2.5.0 - UNRELEASED HADOOP-10322. Add ability to read principal names from a keytab. (Benoy Antony and Daryn Sharp via kihwal) + HADOOP-10549. MAX_SUBST and varPat should be final in Configuration.java. + (Gera Shegalov via cnauroth) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java index dc39629348..af345c27cc 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java @@ -797,14 +797,16 @@ private synchronized void addResourceObject(Resource resource) { reloadConfiguration(); } - private static Pattern varPat = Pattern.compile("\\$\\{[^\\}\\$\u0020]+\\}"); - private static int MAX_SUBST = 20; + private static final Pattern VAR_PATTERN = + Pattern.compile("\\$\\{[^\\}\\$\u0020]+\\}"); + + private static final int MAX_SUBST = 20; private String substituteVars(String expr) { if (expr == null) { return null; } - Matcher match = varPat.matcher(""); + Matcher match = VAR_PATTERN.matcher(""); String eval = expr; Set evalSet = new HashSet(); for(int s=0; s