Merge HADOOP-10248. Property name should be included in the exception where property value is null. Contributed by Akira AJISAKA.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1560907 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uma Maheswara Rao G 2014-01-24 06:28:50 +00:00
parent f3136cd6b9
commit ad41e7a1c9
3 changed files with 7 additions and 1 deletions

View File

@ -260,6 +260,9 @@ Release 2.3.0 - UNRELEASED
HADOOP-10132. RPC#stopProxy() should log the class of proxy when IllegalArgumentException
is encountered (Ted yu via umamahesh)
HADOOP-10248. Property name should be included in the exception where property value
is null (Akira AJISAKA via umamahesh)
OPTIMIZATIONS
HADOOP-10142. Avoid groups lookup for unprivileged users such as "dr.who"

View File

@ -957,7 +957,7 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
"Property name must not be null");
Preconditions.checkArgument(
value != null,
"Property value must not be null");
"The value of property " + name + " must not be null");
DeprecationContext deprecations = deprecationContext.get();
if (deprecations.getDeprecatedKeyMap().isEmpty()) {
getProps();

View File

@ -1162,6 +1162,8 @@ public class TestConfiguration extends TestCase {
fail("Should throw an IllegalArgumentException exception ");
} catch (Exception e) {
assertTrue(e instanceof IllegalArgumentException);
assertEquals(e.getMessage(),
"The value of property testClassName must not be null");
}
}
@ -1172,6 +1174,7 @@ public class TestConfiguration extends TestCase {
fail("Should throw an IllegalArgumentException exception ");
} catch (Exception e) {
assertTrue(e instanceof IllegalArgumentException);
assertEquals(e.getMessage(), "Property name must not be null");
}
}