Skip to content

Commit

Permalink
Finish configuration error messages conversion/improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Francis Galiegue <[email protected]>
  • Loading branch information
fge committed Jun 14, 2013
1 parent 308e0ab commit c522aea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ private static Constructor<? extends KeywordValidator> getConstructor(

private static NodeType checkType(final NodeType type)
{
BUNDLE.checkNotNull(type, "nullType");
return type;
return BUNDLE.checkNotNull(type, "nullType");
}

private static NodeType[] checkTypes(final NodeType... types)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public LibraryBuilder addFormatAttribute(final String name,
final FormatAttribute attribute)
{
removeFormatAttribute(name);
BUNDLE.checkNotNull(attribute, "nullAttribute");
BUNDLE.checkNotNullPrintf(attribute, "nullAttribute", name);
formatAttributes.addEntry(name, attribute);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ noChecker = attempt to build keyword "%s" without a syntax checker
malformedKeyword = attempt to build keyword "%s" with a validator but no \
digester
nullFormat = format attribute name cannot be null
nullAttribute = format attribute cannot be null
nullKeyword = keyword cannot be null
nullType = type must not be null
nullAttribute = attempt to register null implementation of format attribute "%s"
nullKeyword = attempt to add null keyword to library
nullType = null type argument to digester constructor
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ public void cannotAddNullFormatAttribute()
Library.newBuilder().addFormatAttribute("foo", null);
fail("No exception thrown!!");
} catch (NullPointerException e) {
assertEquals(e.getMessage(), BUNDLE.getMessage("nullAttribute"));
assertEquals(e.getMessage(),
BUNDLE.printf("nullAttribute", "foo"));
}
}

Expand Down

0 comments on commit c522aea

Please sign in to comment.