From dcf7c356ce6284ab8e957cd025f3ab79bd77a137 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Fri, 2 May 2014 19:15:39 +0000 Subject: [PATCH] HADOOP-10549. Merging change r1592011 from trunk to branch-2. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1592012 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../main/java/org/apache/hadoop/conf/Configuration.java | 8 +++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 3a7ebb80c36..868297f3e49 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -33,6 +33,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 18d4666ce06..a6243250ee1 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 @@ public class Configuration implements Iterable>, 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; for(int s=0; s