You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2017/06/21 17:45:11 UTC

incubator-juneau git commit: Code cleanup.

Repository: incubator-juneau
Updated Branches:
  refs/heads/master e05e2a996 -> a03704b21


Code cleanup.

Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/a03704b2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/a03704b2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/a03704b2

Branch: refs/heads/master
Commit: a03704b21dc4261b351d038bf36f2c6fed7fdfb7
Parents: e05e2a9
Author: JamesBognar <ja...@apache.org>
Authored: Wed Jun 21 13:45:07 2017 -0400
Committer: JamesBognar <ja...@apache.org>
Committed: Wed Jun 21 13:45:07 2017 -0400

----------------------------------------------------------------------
 .../test/java/org/apache/juneau/TestUtils.java  |  9 ++--
 .../a/rttests/RoundTripLargeObjectsTest.java    |  8 ++--
 .../juneau/json/JsonParserEdgeCasesTest.java    |  2 +-
 .../java/org/apache/juneau/BeanContext.java     |  4 +-
 .../main/java/org/apache/juneau/ClassMeta.java  | 13 +++++-
 .../org/apache/juneau/FormattedException.java   |  4 +-
 .../FormattedIllegalArgumentException.java      | 47 ++++++++++++++++++++
 .../juneau/FormattedRuntimeException.java       |  4 +-
 .../juneau/InvalidDataConversionException.java  |  8 ++--
 .../main/java/org/apache/juneau/Session.java    |  5 ++-
 .../main/java/org/apache/juneau/UriContext.java |  4 +-
 .../main/java/org/apache/juneau/dto/Link.java   |  4 +-
 .../juneau/html/HtmlDocSerializerContext.java   |  4 +-
 .../apache/juneau/internal/JuneauLogger.java    |  3 +-
 .../org/apache/juneau/internal/SimpleMap.java   |  5 ++-
 .../org/apache/juneau/internal/StringUtils.java | 35 +++++++++++++++
 .../apache/juneau/internal/ThrowableUtils.java  | 12 ++---
 .../apache/juneau/parser/ParseException.java    |  4 +-
 .../java/org/apache/juneau/parser/Parser.java   |  3 +-
 .../apache/juneau/parser/ParserListener.java    |  4 +-
 .../juneau/serializer/SerializeException.java   |  5 ++-
 .../apache/juneau/serializer/Serializer.java    |  3 +-
 .../juneau/serializer/SerializerListener.java   |  4 +-
 .../juneau/serializer/SerializerSession.java    |  2 +-
 .../apache/juneau/svl/VarResolverSession.java   |  7 +--
 .../org/apache/juneau/utils/MessageBundle.java  |  5 +--
 .../apache/juneau/utils/PojoRestException.java  |  6 ++-
 .../org/apache/juneau/utils/StringMessage.java  |  4 +-
 .../apache/juneau/xml/XmlSchemaSerializer.java  |  3 +-
 .../apache/juneau/examples/rest/TestUtils.java  |  4 +-
 .../juneau/rest/client/RestCallLogger.java      |  7 +--
 .../org/apache/juneau/rest/test/TestUtils.java  | 13 +++---
 .../rest/test/DefaultContentTypesTest.java      | 42 ++++++++---------
 .../org/apache/juneau/rest/test/GroupsTest.java | 12 ++---
 .../org/apache/juneau/rest/test/GzipTest.java   | 22 ++++-----
 .../apache/juneau/rest/test/ParsersTest.java    |  8 ++--
 .../juneau/rest/test/SerializersTest.java       |  8 ++--
 .../java/org/apache/juneau/rest/Redirect.java   |  8 ++--
 .../org/apache/juneau/rest/RestException.java   | 12 +++--
 .../java/org/apache/juneau/rest/RestLogger.java |  4 +-
 .../org/apache/juneau/rest/RestServlet.java     |  3 +-
 .../juneau/rest/RestServletException.java       |  4 +-
 42 files changed, 240 insertions(+), 128 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java b/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java
index 13ff54f..ad9d826 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/TestUtils.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.internal.IOUtils.*;
 
 import java.io.*;
 import java.lang.reflect.*;
-import java.text.*;
 import java.util.*;
 import java.util.regex.*;
 
@@ -196,7 +195,7 @@ public class TestUtils {
 
 						String schema = schemas.get(namespaceURI);
 						if (schema == null)
-							throw new RuntimeException(MessageFormat.format("No schema found for namespaceURI ''{0}''", namespaceURI));
+							throw new FormattedRuntimeException("No schema found for namespaceURI ''{0}''", namespaceURI);
 
 						try {
 							DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
@@ -485,14 +484,14 @@ public class TestUtils {
 		String[] e = expected.trim().split("\n"), a = actual.trim().split("\n");
 		
 		if (e.length != a.length)
-			throw new ComparisonFailure(MessageFormat.format(msg, args), expected, actual);
+			throw new ComparisonFailure(format(msg, args), expected, actual);
 		
 		Arrays.sort(e);
 		Arrays.sort(a);
 		
 		for (int i = 0; i < e.length; i++)
 			if (! e[i].equals(a[i]))
-				throw new ComparisonFailure(MessageFormat.format(msg, args), expected, actual);
+				throw new ComparisonFailure(format(msg, args), expected, actual);
 	}
 
 	/**
@@ -502,7 +501,7 @@ public class TestUtils {
 		if ("xxx".equals(expected))
 			System.err.println("actual=["+actual+"]");
 		if (! isEquals(expected, actual))
-			throw new ComparisonFailure(MessageFormat.format(msg, args), toString(expected), toString(actual));			
+			throw new ComparisonFailure(format(msg, args), toString(expected), toString(actual));			
 	}
 	
 	/**

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
index 139f03c..c4f11ba 100755
--- a/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/a/rttests/RoundTripLargeObjectsTest.java
@@ -13,8 +13,8 @@
 package org.apache.juneau.a.rttests;
 
 import static org.apache.juneau.a.rttests.RoundTripTest.Flags.*;
+import static org.apache.juneau.internal.StringUtils.*;
 
-import java.text.*;
 import java.util.*;
 
 import org.apache.juneau.html.*;
@@ -150,17 +150,17 @@ public class RoundTripLargeObjectsTest extends RoundTripTest {
 
 		// Initialization run.
 		r = s.serialize(a);
-		System.err.println(MessageFormat.format("Serialized size: {0,number} ", (r instanceof String ? r.toString().length() : ((byte[])r).length))); // NOT DEBUG
+		System.err.println(format("Serialized size: {0,number} ", (r instanceof String ? r.toString().length() : ((byte[])r).length))); // NOT DEBUG
 		p.parse(r, A.class);
 
 		startTime = System.currentTimeMillis();
 		for (int i = 0; i < numRuns; i++)
 			r = s.serialize(a);
-		System.err.println(MessageFormat.format("Average serialize time: {0,number}ms", (System.currentTimeMillis()-startTime)/numRuns)); // NOT DEBUG
+		System.err.println(format("Average serialize time: {0,number}ms", (System.currentTimeMillis()-startTime)/numRuns)); // NOT DEBUG
 		startTime = System.currentTimeMillis();
 		for (int i = 0; i < numRuns; i++)
 			a = p.parse(r, A.class);
-		System.err.println(MessageFormat.format("Average parsed time: {0,number}ms", (System.currentTimeMillis()-startTime)/numRuns)); // NOT DEBUG
+		System.err.println(format("Average parsed time: {0,number}ms", (System.currentTimeMillis()-startTime)/numRuns)); // NOT DEBUG
 	}
 
 	public static class A {

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
----------------------------------------------------------------------
diff --git a/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java b/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
index b5ab64b..3b0b7cc 100644
--- a/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
+++ b/juneau-core-test/src/test/java/org/apache/juneau/json/JsonParserEdgeCasesTest.java
@@ -464,7 +464,7 @@ public class JsonParserEdgeCasesTest {
 				String errorText = errors.get(n);
 				if (errorText != null)
 					errorText = '"' + errorText + '"';
-				sb.append(java.text.MessageFormat.format(pattern, i++, fc.getName().replace(".json", ""), contents, errorText));
+				sb.append(format(pattern, i++, fc.getName().replace(".json", ""), contents, errorText));
 			}
 		}
 		System.err.println(sb); // NOT DEBUG

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/BeanContext.java b/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
index 43e3b93..b289ea7 100644
--- a/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/BeanContext.java
@@ -14,11 +14,11 @@ package org.apache.juneau;
 
 import static org.apache.juneau.Visibility.*;
 import static org.apache.juneau.internal.ClassUtils.*;
+import static org.apache.juneau.internal.StringUtils.*;
 
 import java.beans.*;
 import java.io.*;
 import java.lang.reflect.*;
-import java.text.*;
 import java.util.*;
 import java.util.concurrent.*;
 
@@ -1074,7 +1074,7 @@ public class BeanContext extends Context {
 			int ctCount = 0;
 			for (Map<Class,ClassMeta> cm : cmCacheCache.values())
 				ctCount += cm.size();
-			System.out.println(MessageFormat.format("ClassMeta cache: {0} instances in {1} caches", ctCount, cmCacheCache.size())); // NOT DEBUG
+			System.out.println(format("ClassMeta cache: {0} instances in {1} caches", ctCount, cmCacheCache.size())); // NOT DEBUG
 		} catch (Exception e) {
 			e.printStackTrace();
 		}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java b/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
index 1545511..c63c3e9 100644
--- a/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
+++ b/juneau-core/src/main/java/org/apache/juneau/ClassMeta.java
@@ -57,7 +57,7 @@ public final class ClassMeta<T> implements Type {
 
 	/** Class categories. */
 	enum ClassCategory {
-		MAP, COLLECTION, CLASS, NUMBER, DECIMAL, BOOLEAN, CHAR, DATE, ARRAY, ENUM, OTHER, CHARSEQ, STR, OBJ, URI, BEANMAP, READER, INPUTSTREAM, VOID, ARGS
+		MAP, COLLECTION, CLASS, METHOD, NUMBER, DECIMAL, BOOLEAN, CHAR, DATE, ARRAY, ENUM, OTHER, CHARSEQ, STR, OBJ, URI, BEANMAP, READER, INPUTSTREAM, VOID, ARGS
 	}
 
 	final Class<T> innerClass;                              // The class being wrapped.
@@ -367,6 +367,8 @@ public final class ClassMeta<T> implements Type {
 					cc = ENUM;
 				else if (c.equals(Class.class))
 					cc = CLASS;
+				else if (isParentClass(Method.class, c))
+					cc = METHOD;
 				else if (isParentClass(CharSequence.class, c)) {
 					if (c.equals(String.class))
 						cc = STR;
@@ -945,6 +947,15 @@ public final class ClassMeta<T> implements Type {
 	}
 
 	/**
+	 * Returns <jk>true</jk> if this class is {@link Method}.
+	 *
+	 * @return <jk>true</jk> if this class is {@link Method}.
+	 */
+	public boolean isMethod() {
+		return cc == METHOD;
+	}
+
+	/**
 	 * Returns <jk>true</jk> if this class is an {@link Enum}.
 	 *
 	 * @return <jk>true</jk> if this class is an {@link Enum}.

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/FormattedException.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/FormattedException.java b/juneau-core/src/main/java/org/apache/juneau/FormattedException.java
index 7dae895..11096f1 100644
--- a/juneau-core/src/main/java/org/apache/juneau/FormattedException.java
+++ b/juneau-core/src/main/java/org/apache/juneau/FormattedException.java
@@ -12,6 +12,8 @@
 // ***************************************************************************************************************************
 package org.apache.juneau;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.text.*;
 
 /**
@@ -28,7 +30,7 @@ public class FormattedException extends Exception {
 	 * @param args Optional {@link MessageFormat}-style arguments.
 	 */
 	public FormattedException(String message, Object...args) {
-		super(args.length == 0 ? message : MessageFormat.format(message, args));
+		super(format(message, args));
 	}
 
 	/**

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/FormattedIllegalArgumentException.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/FormattedIllegalArgumentException.java b/juneau-core/src/main/java/org/apache/juneau/FormattedIllegalArgumentException.java
new file mode 100644
index 0000000..4922968
--- /dev/null
+++ b/juneau-core/src/main/java/org/apache/juneau/FormattedIllegalArgumentException.java
@@ -0,0 +1,47 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
+// * with the License.  You may obtain a copy of the License at                                                              *
+// *                                                                                                                         *
+// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
+// *                                                                                                                         *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
+// * specific language governing permissions and limitations under the License.                                              *
+// ***************************************************************************************************************************
+package org.apache.juneau;
+
+import static org.apache.juneau.internal.StringUtils.*;
+
+import java.text.*;
+
+/**
+ * Subclass of illegal-argument exceptions that take in a message and zero or more arguments.
+ */
+public class FormattedIllegalArgumentException extends IllegalArgumentException {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Constructor.
+	 *
+	 * @param message The {@link MessageFormat}-style message.
+	 * @param args Optional {@link MessageFormat}-style arguments.
+	 */
+	public FormattedIllegalArgumentException(String message, Object...args) {
+		super(format(message, args));
+	}
+
+	/**
+	 * Constructor.
+	 *
+	 * @param causedBy The cause of this exception.
+	 * @param message The {@link MessageFormat}-style message.
+	 * @param args Optional {@link MessageFormat}-style arguments.
+	 */
+	public FormattedIllegalArgumentException(Throwable causedBy, String message, Object...args) {
+		this(message, args);
+		initCause(causedBy);
+	}
+}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/FormattedRuntimeException.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/FormattedRuntimeException.java b/juneau-core/src/main/java/org/apache/juneau/FormattedRuntimeException.java
index bf5e9d6..ce929a2 100644
--- a/juneau-core/src/main/java/org/apache/juneau/FormattedRuntimeException.java
+++ b/juneau-core/src/main/java/org/apache/juneau/FormattedRuntimeException.java
@@ -14,6 +14,8 @@ package org.apache.juneau;
 
 import java.text.*;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 /**
  * Subclass of runtime exceptions that take in a message and zero or more arguments.
  */
@@ -28,7 +30,7 @@ public class FormattedRuntimeException extends RuntimeException {
 	 * @param args Optional {@link MessageFormat}-style arguments.
 	 */
 	public FormattedRuntimeException(String message, Object...args) {
-		super(args.length == 0 ? message : MessageFormat.format(message, args));
+		super(format(message, args));
 	}
 
 	/**

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/InvalidDataConversionException.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/InvalidDataConversionException.java b/juneau-core/src/main/java/org/apache/juneau/InvalidDataConversionException.java
index 2b4a0a1..9d640a3 100644
--- a/juneau-core/src/main/java/org/apache/juneau/InvalidDataConversionException.java
+++ b/juneau-core/src/main/java/org/apache/juneau/InvalidDataConversionException.java
@@ -14,8 +14,6 @@ package org.apache.juneau;
 
 import static org.apache.juneau.internal.ClassUtils.*;
 
-import java.text.*;
-
 import org.apache.juneau.json.*;
 
 /**
@@ -23,7 +21,7 @@ import org.apache.juneau.json.*;
  * <p>
  * Exception that gets thrown if you try to perform an invalid conversion, such as when calling {@code ObjectMap.getInt(...)} on a non-numeric <code>String</code>.
  */
-public final class InvalidDataConversionException extends RuntimeException {
+public final class InvalidDataConversionException extends FormattedRuntimeException {
 
 	private static final long serialVersionUID = 1L;
 
@@ -33,7 +31,7 @@ public final class InvalidDataConversionException extends RuntimeException {
 	 * @param value The value being converted.
 	 */
 	public InvalidDataConversionException(Object value, Class<?> toType, Exception cause) {
-		super(MessageFormat.format("Invalid data conversion from type ''{0}'' to type ''{1}''.  Value={2}.", getReadableClassNameForObject(value), getReadableClassName(toType), getValue(value)), cause);
+		super(cause, "Invalid data conversion from type ''{0}'' to type ''{1}''.  Value={2}.", getReadableClassNameForObject(value), getReadableClassName(toType), getValue(value));
 	}
 
 	/**
@@ -42,7 +40,7 @@ public final class InvalidDataConversionException extends RuntimeException {
 	 * @param value The value being converted.
 	 */
 	public InvalidDataConversionException(Object value, ClassMeta<?> toType, Exception cause) {
-		super(MessageFormat.format("Invalid data conversion from type ''{0}'' to type ''{1}''.  Value={2}.", getReadableClassNameForObject(value), toType.toString(), getValue(value)), cause);
+		super(cause, "Invalid data conversion from type ''{0}'' to type ''{1}''.  Value={2}.", getReadableClassNameForObject(value), toType.toString(), getValue(value));
 	}
 
 	private static String getValue(Object o) {

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/Session.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/Session.java b/juneau-core/src/main/java/org/apache/juneau/Session.java
index d9bbfc8..4f253d4 100644
--- a/juneau-core/src/main/java/org/apache/juneau/Session.java
+++ b/juneau-core/src/main/java/org/apache/juneau/Session.java
@@ -12,6 +12,8 @@
 // ***************************************************************************************************************************
 package org.apache.juneau;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.text.*;
 import java.util.*;
 
@@ -159,8 +161,7 @@ public abstract class Session {
 		if (warnings == null)
 			warnings = new LinkedList<String>();
 		getLogger().warning(msg, args);
-		msg = args.length == 0 ? msg : MessageFormat.format(msg, args);
-		warnings.add((warnings.size() + 1) + ": " + msg);
+		warnings.add((warnings.size() + 1) + ": " + format(msg, args));
 	}
 
 	/**

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/UriContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/UriContext.java b/juneau-core/src/main/java/org/apache/juneau/UriContext.java
index 9b7c497..0401230 100644
--- a/juneau-core/src/main/java/org/apache/juneau/UriContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/UriContext.java
@@ -23,7 +23,7 @@ import org.apache.juneau.annotation.*;
  * <p class='bcode'>
  * 	http://host:port/context-root/servlet-path/path-info
  * 	|   authority   |  context   |  resource  |  path  |
- *  +--------------------------------------------------+
+ * 	+--------------------------------------------------+
  * </p>
  * <p>
  * This class allows you to convert URL strings to absolute (e.g. <js>"http://host:port/foo/bar"</js>) or root-relative
@@ -71,7 +71,7 @@ public class UriContext {
 	public UriContext() {
 		this(null, null, null, null);
 	}
-	
+
 	/**
 	 * Returns the absolute URI of just the authority portion of this URI context.
 	 * <p>

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/dto/Link.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/Link.java b/juneau-core/src/main/java/org/apache/juneau/dto/Link.java
index ce22d0d..478a621 100644
--- a/juneau-core/src/main/java/org/apache/juneau/dto/Link.java
+++ b/juneau-core/src/main/java/org/apache/juneau/dto/Link.java
@@ -12,6 +12,8 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.dto;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.text.*;
 
 import org.apache.juneau.*;
@@ -106,7 +108,7 @@ public class Link implements Comparable<Link> {
 	public Link setHref(String href, Object...args) {
 		for (int i = 0; i < args.length; i++)
 			args[i] = UrlEncodingSerializer.DEFAULT.serialize(PartType.PATH, args[i]);
-		this.href = (args.length > 0 ? MessageFormat.format(href, args) : href);
+		this.href = format(href, args);
 		return this;
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java b/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java
index 2078811..94e9665 100644
--- a/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java
+++ b/juneau-core/src/main/java/org/apache/juneau/html/HtmlDocSerializerContext.java
@@ -278,7 +278,7 @@ public final class HtmlDocSerializerContext extends HtmlSerializerContext {
 	 * 	<jk>public class</jk> AddressBookResource <jk>extends</jk> RestServletJenaDefault {
 	 * </p>
 	 * <p>
-	 * Values that start with <js>'&lt;'</js> are assumed to be HTML and rendered as-is. 
+	 * Values that start with <js>'&lt;'</js> are assumed to be HTML and rendered as-is.
 	 */
 	public static final String HTMLDOC_links = "HtmlDocSerializer.links.map";
 
@@ -391,7 +391,7 @@ public final class HtmlDocSerializerContext extends HtmlSerializerContext {
 	 * <p class='bcode'>
 	 * 	<ja>@RestResource</ja>(
 	 * 		htmldoc=<ja>@HtmlDoc</ja>(
-	 * 			=<js>"&lt;b&gt;This interface is great!&lt;/b&gt;"</js>
+	 * 			noResultsMessage=<js>"&lt;b&gt;This interface is great!&lt;/b&gt;"</js>
 	 * 		)
 	 * 	)
 	 * </p>

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/internal/JuneauLogger.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/internal/JuneauLogger.java b/juneau-core/src/main/java/org/apache/juneau/internal/JuneauLogger.java
index fe391b3..23f92a6 100644
--- a/juneau-core/src/main/java/org/apache/juneau/internal/JuneauLogger.java
+++ b/juneau-core/src/main/java/org/apache/juneau/internal/JuneauLogger.java
@@ -13,6 +13,7 @@
 package org.apache.juneau.internal;
 
 import static java.util.logging.Level.*;
+import static org.apache.juneau.internal.StringUtils.*;
 
 import java.text.*;
 import java.util.*;
@@ -263,7 +264,7 @@ public class JuneauLogger extends java.util.logging.Logger {
 			return msg;
 		if (rb != null && rb.containsKey(msg))
 			msg = rb.getString(msg);
-		return MessageFormat.format(msg, args);
+		return format(msg, args);
 	}
 
 	private static String resolveResourceBundleName(Class<?> forClass, String path) {

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/internal/SimpleMap.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/internal/SimpleMap.java b/juneau-core/src/main/java/org/apache/juneau/internal/SimpleMap.java
index 93d9b74..34fc0bd 100644
--- a/juneau-core/src/main/java/org/apache/juneau/internal/SimpleMap.java
+++ b/juneau-core/src/main/java/org/apache/juneau/internal/SimpleMap.java
@@ -15,9 +15,10 @@ package org.apache.juneau.internal;
 import static org.apache.juneau.internal.ArrayUtils.*;
 import static org.apache.juneau.internal.ThrowableUtils.*;
 
-import java.text.*;
 import java.util.*;
 
+import org.apache.juneau.*;
+
 /**
  * An instance of a <code>Map</code> where the keys and values
  * 	are simple <code>String[]</code> and <code>Object[]</code> arrays.
@@ -83,7 +84,7 @@ public final class SimpleMap extends AbstractMap<String,Object> {
 				return v;
 			}
 		}
-		throw new IllegalArgumentException(MessageFormat.format("No key ''{0}'' defined in map", key));
+		throw new FormattedIllegalArgumentException("No key ''{0}'' defined in map", key);
 	}
 
 	private class SimpleMapEntry implements Map.Entry<String,Object> {

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/internal/StringUtils.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/internal/StringUtils.java b/juneau-core/src/main/java/org/apache/juneau/internal/StringUtils.java
index 4e78fd0..b63875f 100644
--- a/juneau-core/src/main/java/org/apache/juneau/internal/StringUtils.java
+++ b/juneau-core/src/main/java/org/apache/juneau/internal/StringUtils.java
@@ -15,17 +15,22 @@ package org.apache.juneau.internal;
 import static org.apache.juneau.internal.ThrowableUtils.*;
 
 import java.io.*;
+import java.lang.reflect.*;
 import java.math.*;
 import java.net.*;
 import java.nio.*;
 import java.nio.charset.*;
+import java.text.*;
 import java.util.*;
 import java.util.concurrent.atomic.*;
 import java.util.regex.*;
 
 import javax.xml.bind.*;
 
+import org.apache.juneau.*;
+import org.apache.juneau.json.*;
 import org.apache.juneau.parser.*;
+import org.apache.juneau.parser.ParseException;
 
 /**
  * Reusable string utility methods.
@@ -1571,4 +1576,34 @@ public final class StringUtils {
 		}
 		return -1;
 	}
+
+	/**
+	 * Similar to {@link MessageFormat#format(String, Object...)} except allows you to specify POJO arguments.
+	 *
+	 * @param pattern The string pattern.
+	 * @param args The arguments.
+	 * @return The formatted string.
+	 */
+	public static String format(String pattern, Object...args) {
+		if (args.length == 0)
+			return pattern;
+		for (int i = 0; i < args.length; i++)
+			args[i] = convertToReadable(args[i]);
+		return MessageFormat.format(pattern, args);
+	}
+
+	private static Object convertToReadable(Object o) {
+		if (o == null)
+			return null;
+		if (o instanceof ClassMeta)
+			return ((ClassMeta<?>)o).getReadableName();
+		ClassMeta<?> cm = BeanContext.DEFAULT.getClassMetaForObject(o);
+		if (cm.isMapOrBean() || cm.isCollectionOrArray())
+			return JsonSerializer.DEFAULT_LAX.toString(o);
+		if (cm.isClass())
+			return ((Class<?>)o).getName();
+		if (cm.isMethod())
+			return ((Method)o).toGenericString();
+		return o.toString();
+	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/internal/ThrowableUtils.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/internal/ThrowableUtils.java b/juneau-core/src/main/java/org/apache/juneau/internal/ThrowableUtils.java
index 84d6f19..b5199cc 100644
--- a/juneau-core/src/main/java/org/apache/juneau/internal/ThrowableUtils.java
+++ b/juneau-core/src/main/java/org/apache/juneau/internal/ThrowableUtils.java
@@ -14,6 +14,8 @@ package org.apache.juneau.internal;
 
 import java.text.*;
 
+import org.apache.juneau.*;
+
 /**
  * Various utility methods for creating and working with throwables.
  */
@@ -29,7 +31,7 @@ public class ThrowableUtils {
 	 */
 	public static void assertNotNull(Object o, String msg, Object...args) throws IllegalArgumentException {
 		if (o == null)
-			throw new IllegalArgumentException(MessageFormat.format(msg, args));
+			throw new FormattedIllegalArgumentException(msg, args);
 	}
 
 	/**
@@ -41,7 +43,7 @@ public class ThrowableUtils {
 	 */
 	public static void assertFieldNotNull(Object fieldValue, String fieldName) throws IllegalArgumentException {
 		if (fieldValue == null)
-			throw new IllegalArgumentException("Field '" + fieldName + "' cannot be null.");
+			throw new FormattedIllegalArgumentException("Field ''{0}'' cannot be null.", fieldName);
 	}
 
 	/**
@@ -53,7 +55,7 @@ public class ThrowableUtils {
 	 */
 	public static void assertFieldPositive(int fieldValue, String fieldName) throws IllegalArgumentException {
 		if (fieldValue <= 0)
-			throw new IllegalArgumentException("Field '" + fieldName + "' must be a positive integer.");
+			throw new FormattedIllegalArgumentException("Field ''{0}'' must be a positive integer.", fieldName);
 	}
 
 	/**
@@ -64,7 +66,7 @@ public class ThrowableUtils {
 	 * @throws IllegalArgumentException
 	 */
 	public static void illegalArg(String msg, Object...args) throws IllegalArgumentException {
-		throw new IllegalArgumentException(MessageFormat.format(msg, args));
+		throw new FormattedIllegalArgumentException(msg, args);
 	}
 
 	/**
@@ -77,6 +79,6 @@ public class ThrowableUtils {
 	 */
 	public static void assertSameThread(long threadId, String msg, Object...args) throws IllegalStateException {
 		if (Thread.currentThread().getId() != threadId)
-			throw new IllegalArgumentException(MessageFormat.format(msg, args));
+			throw new FormattedIllegalArgumentException(msg, args);
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/parser/ParseException.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/parser/ParseException.java b/juneau-core/src/main/java/org/apache/juneau/parser/ParseException.java
index 6e98c2a..8c27221 100644
--- a/juneau-core/src/main/java/org/apache/juneau/parser/ParseException.java
+++ b/juneau-core/src/main/java/org/apache/juneau/parser/ParseException.java
@@ -12,6 +12,8 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.parser;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.text.*;
 import java.util.*;
 
@@ -67,7 +69,7 @@ public final class ParseException extends FormattedException {
 
 	private static String getMessage(ParserSession session, String msg, Object... args) {
 		if (args.length != 0)
-			msg = MessageFormat.format(msg, args);
+			msg = format(msg, args);
 		if (session != null) {
 			Map<String,Object> m = session.getLastLocation();
 			if (m != null && ! m.isEmpty())

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java b/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java
index 2eb4a5f..2e3bfa4 100644
--- a/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java
+++ b/juneau-core/src/main/java/org/apache/juneau/parser/Parser.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.internal.ReflectionUtils.*;
 
 import java.io.*;
 import java.lang.reflect.*;
-import java.text.*;
 import java.util.*;
 
 import org.apache.juneau.*;
@@ -144,7 +143,7 @@ public abstract class Parser extends CoreObject {
 
 		Consumes c = getAnnotation(Consumes.class, getClass());
 		if (c == null)
-			throw new RuntimeException(MessageFormat.format("Class ''{0}'' is missing the @Consumes annotation", getClass().getName()));
+			throw new FormattedRuntimeException("Class ''{0}'' is missing the @Consumes annotation", c);
 
 		String[] mt = split(c.value());
 		this.mediaTypes = new MediaType[mt.length];

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/parser/ParserListener.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/parser/ParserListener.java b/juneau-core/src/main/java/org/apache/juneau/parser/ParserListener.java
index dd1989d..dacc587 100644
--- a/juneau-core/src/main/java/org/apache/juneau/parser/ParserListener.java
+++ b/juneau-core/src/main/java/org/apache/juneau/parser/ParserListener.java
@@ -12,7 +12,7 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.parser;
 
-import java.text.*;
+import static org.apache.juneau.internal.StringUtils.*;
 
 import org.apache.juneau.*;
 
@@ -38,7 +38,7 @@ public class ParserListener {
 	 * @param col The column number where the unknown property was found (-1 if parser doesn't support line/column indicators).
 	 */
 	public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean, int line, int col) {
-		onError(session, null, MessageFormat.format("Unknown property ''{0}'' encountered while trying to parse into class ''{1}'' at line {2} column {3}", propertyName, beanClass, line, col));
+		onError(session, null, format("Unknown property ''{0}'' encountered while trying to parse into class ''{1}'' at line {2} column {3}", propertyName, beanClass, line, col));
 	}
 
 	/**

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/serializer/SerializeException.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializeException.java b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializeException.java
index 5f974dc..9666d49 100644
--- a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializeException.java
+++ b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializeException.java
@@ -12,6 +12,8 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.serializer;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.text.*;
 import java.util.*;
 
@@ -66,8 +68,7 @@ public final class SerializeException extends FormattedException {
 	}
 
 	private static String getMessage(SerializerSession session, String msg, Object... args) {
-		if (args.length != 0)
-			msg = MessageFormat.format(msg, args);
+		msg = format(msg, args);
 		if (session != null) {
 			Map<String,Object> m = session.getLastLocation();
 			if (m != null && ! m.isEmpty())

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java b/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java
index 5e6e5a5..655ec0c 100644
--- a/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/serializer/Serializer.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.internal.ReflectionUtils.*;
 
 import java.io.*;
 import java.lang.reflect.*;
-import java.text.*;
 import java.util.*;
 
 import org.apache.juneau.*;
@@ -54,7 +53,7 @@ public abstract class Serializer extends CoreObject {
 
 		Produces p = getAnnotation(Produces.class, getClass());
 		if (p == null)
-			throw new RuntimeException(MessageFormat.format("Class ''{0}'' is missing the @Produces annotation", getClass().getName()));
+			throw new FormattedRuntimeException("Class ''{0}'' is missing the @Produces annotation", getClass());
 
 		String[] mt = split(p.value());
 		this.mediaTypes = new MediaType[mt.length];

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerListener.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerListener.java b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerListener.java
index 9125063..50b967c 100644
--- a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerListener.java
+++ b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerListener.java
@@ -12,7 +12,7 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.serializer;
 
-import java.text.*;
+import static org.apache.juneau.internal.StringUtils.*;
 
 import org.apache.juneau.*;
 
@@ -30,7 +30,7 @@ public class SerializerListener {
 	 * @param p The bean property we had an issue on.
 	 */
 	public void onBeanGetterException(SerializerSession session, Throwable t, BeanPropertyMeta p) {
-		onError(session, t, MessageFormat.format("Could not call getValue() on property ''{1}'' of class ''{2}'', exception = {3}", p.getName(), p.getBeanMeta().getClassMeta(), t.getLocalizedMessage()));
+		onError(session, t, format("Could not call getValue() on property ''{0}'' of class ''{1}'', exception = {2}", p.getName(), p.getBeanMeta().getClassMeta(), t.getLocalizedMessage()));
 	}
 
 	/**

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerSession.java b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerSession.java
index a103f86..357ccd2 100644
--- a/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerSession.java
+++ b/juneau-core/src/main/java/org/apache/juneau/serializer/SerializerSession.java
@@ -490,7 +490,7 @@ public class SerializerSession extends BeanSession {
 	 */
 	public final void onError(Throwable t, String msg, Object... args) {
 		if (listener != null)
-			listener.onError(this, t, MessageFormat.format(msg, args));
+			listener.onError(this, t, format(msg, args));
 		super.addWarning(msg, args);
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/svl/VarResolverSession.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/svl/VarResolverSession.java b/juneau-core/src/main/java/org/apache/juneau/svl/VarResolverSession.java
index fc7e7c6..8f7540b 100644
--- a/juneau-core/src/main/java/org/apache/juneau/svl/VarResolverSession.java
+++ b/juneau-core/src/main/java/org/apache/juneau/svl/VarResolverSession.java
@@ -12,12 +12,13 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.svl;
 
-import static java.text.MessageFormat.*;
 import static org.apache.juneau.internal.StringUtils.*;
 
 import java.io.*;
 import java.util.*;
 
+import org.apache.juneau.*;
+
 /**
  * A var resolver session that combines a {@link VarResolver} with one or more session objects.
  * <p>
@@ -275,10 +276,10 @@ public class VarResolverSession {
 				t = (T)sessionObjects.get(name);
 			}
 		} catch (Exception e) {
-			throw new RuntimeException(format("Session object ''{0}'' or context object ''SvlContext.{0}'' could not be converted to type ''{1}''.", name, c.getName()), e);
+			throw new FormattedRuntimeException(e, "Session object ''{0}'' or context object ''SvlContext.{0}'' could not be converted to type ''{1}''.", name, c);
 		}
 		if (t == null)
-			throw new RuntimeException(format("Session object ''{0}'' or context object ''SvlContext.{0}'' not found.", name));
+			throw new FormattedRuntimeException("Session object ''{0}'' or context object ''SvlContext.{0}'' not found.", name);
 		return t;
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java b/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java
index 2feef38..5b22725 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/MessageBundle.java
@@ -13,6 +13,7 @@
 package org.apache.juneau.utils;
 
 import static org.apache.juneau.internal.ThrowableUtils.*;
+import static org.apache.juneau.internal.StringUtils.*;
 
 import java.text.*;
 import java.util.*;
@@ -162,9 +163,7 @@ public class MessageBundle extends ResourceBundle {
 		String s = getString(key);
 		if (s.length() > 0 && s.charAt(0) == '{')
 			return s;
-		if (args.length > 0)
-			return MessageFormat.format(s, args);
-		return s;
+		return format(s, args);
 	}
 
 	/**

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java b/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java
index 451878c..318ec02 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/PojoRestException.java
@@ -15,6 +15,8 @@ package org.apache.juneau.utils;
 import java.net.*;
 import java.text.*;
 
+import org.apache.juneau.*;
+
 /**
  * Generic exception thrown from the {@link PojoRest} class.
  * <p>
@@ -27,7 +29,7 @@ import java.text.*;
  * 	<li>{@link HttpURLConnection#HTTP_FORBIDDEN HTTP_FORBIDDEN} - Attempting to overwrite the root object.
  * </ul>
  */
-public final class PojoRestException extends RuntimeException {
+public final class PojoRestException extends FormattedRuntimeException {
 
 	private static final long serialVersionUID = 1L;
 
@@ -41,7 +43,7 @@ public final class PojoRestException extends RuntimeException {
 	 * @param args Optional {@link MessageFormat}-style arguments.
 	 */
 	public PojoRestException(int status, String message, Object...args) {
-		super(args.length == 0 ? message : MessageFormat.format(message, args));
+		super(message, args);
 		this.status = status;
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/utils/StringMessage.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/utils/StringMessage.java b/juneau-core/src/main/java/org/apache/juneau/utils/StringMessage.java
index 72e3d1e..1a553d1 100644
--- a/juneau-core/src/main/java/org/apache/juneau/utils/StringMessage.java
+++ b/juneau-core/src/main/java/org/apache/juneau/utils/StringMessage.java
@@ -12,6 +12,8 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.utils;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.io.*;
 import java.text.*;
 
@@ -71,7 +73,7 @@ public class StringMessage implements CharSequence, Writable {
 	@Override /* Object */
 	public String toString() {
 		if (results == null)
-			results = (args.length == 0 ? pattern : MessageFormat.format(pattern, args));
+			results = format(pattern, args);
 		return results;
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
----------------------------------------------------------------------
diff --git a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
index 71179fd..8a06047 100644
--- a/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
+++ b/juneau-core/src/main/java/org/apache/juneau/xml/XmlSchemaSerializer.java
@@ -18,7 +18,6 @@ import static org.apache.juneau.internal.ArrayUtils.*;
 
 import java.io.*;
 import java.lang.reflect.*;
-import java.text.*;
 import java.util.*;
 import java.util.regex.*;
 
@@ -130,7 +129,7 @@ public class XmlSchemaSerializer extends XmlSerializer {
 
 						String schema = schemas.get(namespaceURI);
 						if (schema == null)
-							throw new RuntimeException(MessageFormat.format("No schema found for namespaceURI ''{0}''", namespaceURI));
+							throw new FormattedRuntimeException("No schema found for namespaceURI ''{0}''", namespaceURI);
 
 						try {
 							DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
----------------------------------------------------------------------
diff --git a/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java b/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
index 8c79cf7..a38e4ed 100644
--- a/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
+++ b/juneau-examples-rest/src/test/java/org/apache/juneau/examples/rest/TestUtils.java
@@ -17,7 +17,6 @@ import static org.apache.juneau.internal.StringUtils.*;
 import static org.apache.juneau.internal.IOUtils.*;
 
 import java.io.*;
-import java.text.*;
 import java.util.*;
 import java.util.regex.*;
 
@@ -28,6 +27,7 @@ import javax.xml.transform.dom.*;
 import javax.xml.transform.stream.*;
 import javax.xml.validation.*;
 
+import org.apache.juneau.*;
 import org.apache.juneau.json.*;
 import org.apache.juneau.serializer.*;
 import org.apache.juneau.transforms.*;
@@ -193,7 +193,7 @@ public class TestUtils {
 
 						String schema = schemas.get(namespaceURI);
 						if (schema == null)
-							throw new RuntimeException(MessageFormat.format("No schema found for namespaceURI ''{0}''", namespaceURI));
+							throw new FormattedRuntimeException("No schema found for namespaceURI ''{0}''", namespaceURI);
 
 						try {
 							DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java
----------------------------------------------------------------------
diff --git a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java
index 03e8735..a1621ac 100644
--- a/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java
+++ b/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCallLogger.java
@@ -12,8 +12,9 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.rest.client;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.io.*;
-import java.text.*;
 import java.util.logging.*;
 
 import org.apache.http.*;
@@ -67,9 +68,9 @@ public class RestCallLogger extends RestCallInterceptor {
 	public void onRetry(RestCall restCall, int statusCode, HttpRequest req, HttpResponse res, Exception ex) {
 		if (log.isLoggable(level)) {
 			if (ex == null)
-			log.log(level, MessageFormat.format("Call to {0} returned {1}.  Will retry.", req.getRequestLine().getUri(), statusCode)); //$NON-NLS-1$
+			log.log(level, format("Call to {0} returned {1}.  Will retry.", req.getRequestLine().getUri(), statusCode)); //$NON-NLS-1$
 			else
-				log.log(level, MessageFormat.format("Call to {0} caused exception {1}.  Will retry.", req.getRequestLine().getUri(), ex.getLocalizedMessage()), ex); //$NON-NLS-1$
+				log.log(level, format("Call to {0} caused exception {1}.  Will retry.", req.getRequestLine().getUri(), ex.getLocalizedMessage()), ex); //$NON-NLS-1$
 		}
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/TestUtils.java
----------------------------------------------------------------------
diff --git a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/TestUtils.java b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/TestUtils.java
index a25626c..638acda 100644
--- a/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/TestUtils.java
+++ b/juneau-rest-test/src/main/java/org/apache/juneau/rest/test/TestUtils.java
@@ -12,7 +12,8 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.rest.test;
 
-import java.text.*;
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.util.*;
 
 import org.apache.juneau.json.*;
@@ -60,20 +61,20 @@ public class TestUtils {
 		}
 		if (status != e.getResponseCode()) {
 			dumpResponse(r, "Response status code was not correct.  Expected: ''{0}''.  Actual: ''{1}''", status, e.getResponseCode());
-			throw new AssertionFailedError(MessageFormat.format("Response status code was not correct.  Expected: ''{0}''.  Actual: ''{1}''", status, e.getResponseCode()));
+			throw new AssertionFailedError(format("Response status code was not correct.  Expected: ''{0}''.  Actual: ''{1}''", status, e.getResponseCode()));
 		}
 		for (String s : contains) {
 			if (r == null || ! r.contains(s)) {
 				if (! debug)
 					dumpResponse(r, "Response did not have the following expected text: ''{0}''", s);
-				throw new AssertionFailedError(MessageFormat.format("Response did not have the following expected text: ''{0}''", s));
+				throw new AssertionFailedError(format("Response did not have the following expected text: ''{0}''", s));
 			}
 		}
 	}
 
 	private static void dumpResponse(String r, String msg, Object...args) {
 		System.err.println("*** Failure ****************************************************************************************"); // NOT DEBUG
-		System.err.println(MessageFormat.format(msg, args));
+		System.err.println(format(msg, args));
 		System.err.println("*** Response-Start *********************************************************************************"); // NOT DEBUG
 		System.err.println(r); // NOT DEBUG
 		System.err.println("*** Response-End ***********************************************************************************"); // NOT DEBUG
@@ -83,13 +84,13 @@ public class TestUtils {
 		String[] e = expected.trim().split("\n"), a = actual.trim().split("\n");
 
 		if (e.length != a.length)
-			throw new ComparisonFailure(MessageFormat.format(msg, args), expected, actual);
+			throw new ComparisonFailure(format(msg, args), expected, actual);
 
 		Arrays.sort(e);
 		Arrays.sort(a);
 
 		for (int i = 0; i < e.length; i++)
 			if (! e[i].equals(a[i]))
-				throw new ComparisonFailure(MessageFormat.format(msg, args), expected, actual);
+				throw new ComparisonFailure(format(msg, args), expected, actual);
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/DefaultContentTypesTest.java
----------------------------------------------------------------------
diff --git a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/DefaultContentTypesTest.java b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/DefaultContentTypesTest.java
index 99a7c9b..57199ce 100644
--- a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/DefaultContentTypesTest.java
+++ b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/DefaultContentTypesTest.java
@@ -62,7 +62,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/s3'",
-				"Supported media-types: [text/s1, text/s2]"
+				"Supported media-types: ['text/s1','text/s2']"
 			);
 		}
 
@@ -72,7 +72,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p3'",
-				"Supported media-types: [text/p1, text/p2]"
+				"Supported media-types: ['text/p1','text/p2']"
 			);
 		}
 
@@ -82,7 +82,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p3'",
-				"Supported media-types: [text/p1, text/p2]"
+				"Supported media-types: ['text/p1','text/p2']"
 			);
 		}
 	}
@@ -104,7 +104,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p2'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -114,7 +114,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p2'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -124,7 +124,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p1'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -134,7 +134,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p1'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -144,7 +144,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p2'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -154,7 +154,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p2'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -164,7 +164,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p2'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -174,7 +174,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p2'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -184,7 +184,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/s2'",
-				"Supported media-types: [text/s3]"
+				"Supported media-types: ['text/s3']"
 			);
 		}
 
@@ -240,7 +240,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 			// Note that parsers defined on method are listed before parsers defined on class.
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p4'",
-				"Supported media-types: [text/p3, text/p1, text/p2]"
+				"Supported media-types: ['text/p3','text/p1','text/p2']"
 			);
 		}
 
@@ -251,7 +251,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 			// Note that serializers defined on method are listed before serializers defined on class.
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/s4'",
-				"Supported media-types: [text/s3, text/s1, text/s2]"
+				"Supported media-types: ['text/s3','text/s1','text/s2']"
 			);
 		}
 	}
@@ -280,7 +280,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'bad/*'",
-				"Supported media-types: [text/s1, text/s2]"
+				"Supported media-types: ['text/s1','text/s2']"
 			);
 		}
 
@@ -319,7 +319,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/s1'",
-				"Supported media-types: [text/s3]"
+				"Supported media-types: ['text/s3']"
 			);
 		}
 
@@ -329,7 +329,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p1'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -339,7 +339,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p1'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -349,7 +349,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/s2'",
-				"Supported media-types: [text/s3]"
+				"Supported media-types: ['text/s3']"
 			);
 		}
 
@@ -359,7 +359,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p2'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 
@@ -369,7 +369,7 @@ public class DefaultContentTypesTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p2'",
-				"Supported media-types: [text/p3]"
+				"Supported media-types: ['text/p3']"
 			);
 		}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GroupsTest.java
----------------------------------------------------------------------
diff --git a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GroupsTest.java b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GroupsTest.java
index 0429449..874b0da 100644
--- a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GroupsTest.java
+++ b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GroupsTest.java
@@ -42,7 +42,7 @@ public class GroupsTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'application/json'",
-				"Supported media-types: [text/s1, text/s2]"
+				"Supported media-types: ['text/s1','text/s2']"
 			);
 		}
 
@@ -58,7 +58,7 @@ public class GroupsTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/s3'",
-				"Supported media-types: [text/s1, text/s2]"
+				"Supported media-types: ['text/s1','text/s2']"
 			);
 		}
 
@@ -68,7 +68,7 @@ public class GroupsTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/json'",
-				"Supported media-types: [text/s1, text/s2]"
+				"Supported media-types: ['text/s1','text/s2']"
 			);
 		}
 
@@ -78,7 +78,7 @@ public class GroupsTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/json'",
-				"Supported media-types: [text/p1, text/p2]"
+				"Supported media-types: ['text/p1','text/p2']"
 			);
 		}
 
@@ -93,7 +93,7 @@ public class GroupsTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/s3'",
-				"Supported media-types: [text/s1, text/s2]"
+				"Supported media-types: ['text/s1','text/s2']"
 			);
 		}
 
@@ -102,7 +102,7 @@ public class GroupsTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/p3'",
-				"Supported media-types: [text/p1, text/p2]"
+				"Supported media-types: ['text/p1','text/p2']"
 			);
 		}
 	}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GzipTest.java
----------------------------------------------------------------------
diff --git a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GzipTest.java b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GzipTest.java
index 22cb80f..2df12fd 100644
--- a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GzipTest.java
+++ b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/GzipTest.java
@@ -85,7 +85,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': 'mycoding,identity;q=0'",
-				"Supported codings: [identity]"
+				"Supported codings: ['identity']"
 			);
 		}
 
@@ -96,7 +96,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': 'mycoding,*;q=0'",
-				"Supported codings: [identity]"
+				"Supported codings: ['identity']"
 			);
 		}
 
@@ -123,7 +123,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': 'identity;q=0'",
-				"Supported codings: [identity]"
+				"Supported codings: ['identity']"
 			);
 		}
 
@@ -134,7 +134,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': 'identity;q=0.0'",
-				"Supported codings: [identity]"
+				"Supported codings: ['identity']"
 			);
 		}
 
@@ -145,7 +145,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': '*;q=0'",
-				"Supported codings: [identity]"
+				"Supported codings: ['identity']"
 			);
 		}
 
@@ -156,7 +156,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': '*;q=0.0'",
-				"Supported codings: [identity]"
+				"Supported codings: ['identity']"
 			);
 		}
 
@@ -178,7 +178,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported encoding in request header 'Content-Encoding': 'mycoding'",
-				"Supported codings: [identity]"
+				"Supported codings: ['identity']"
 			);
 		}
 
@@ -241,7 +241,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': 'identity;q=0'",
-				"Supported codings: [mycoding, identity]"
+				"Supported codings: ['mycoding','identity']"
 			);
 		}
 
@@ -252,7 +252,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': 'identity;q=0.0'",
-				"Supported codings: [mycoding, identity]"
+				"Supported codings: ['mycoding','identity']"
 			);
 		}
 
@@ -263,7 +263,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': '*;q=0'",
-				"Supported codings: [mycoding, identity]"
+				"Supported codings: ['mycoding','identity']"
 			);
 		}
 
@@ -274,7 +274,7 @@ public class GzipTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported encoding in request header 'Accept-Encoding': '*;q=0.0'",
-				"Supported codings: [mycoding, identity]"
+				"Supported codings: ['mycoding','identity']"
 			);
 		}
 

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/ParsersTest.java
----------------------------------------------------------------------
diff --git a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/ParsersTest.java b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/ParsersTest.java
index 95482a4..9e11659 100644
--- a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/ParsersTest.java
+++ b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/ParsersTest.java
@@ -41,7 +41,7 @@ public class ParsersTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/b'",
-				"Supported media-types: [text/a"
+				"Supported media-types: ['text/a"
 			);
 		}
 
@@ -66,7 +66,7 @@ public class ParsersTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/a'",
-				"Supported media-types: [text/b]"
+				"Supported media-types: ['text/b']"
 			);
 		}
 
@@ -76,7 +76,7 @@ public class ParsersTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/json'",
-				"Supported media-types: [text/b]"
+				"Supported media-types: ['text/b']"
 			);
 		}
 	}
@@ -131,7 +131,7 @@ public class ParsersTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_UNSUPPORTED_MEDIA_TYPE,
 				"Unsupported media-type in request header 'Content-Type': 'text/bad'",
-				"Supported media-types: [text/a"
+				"Supported media-types: ['text/a"
 			);
 		}
 	}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/SerializersTest.java
----------------------------------------------------------------------
diff --git a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/SerializersTest.java b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/SerializersTest.java
index b7947f0..ec17178 100644
--- a/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/SerializersTest.java
+++ b/juneau-rest-test/src/test/java/org/apache/juneau/rest/test/SerializersTest.java
@@ -42,7 +42,7 @@ public class SerializersTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/b'",
-				"Supported media-types: [text/a, ");
+				"Supported media-types: ['text/a',");
 		}
 
 		r = client.doGet(url).accept("text/json").getResponseAsString();
@@ -62,7 +62,7 @@ public class SerializersTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/a'",
-				"Supported media-types: [text/b]"
+				"Supported media-types: ['text/b']"
 			);
 		}
 
@@ -72,7 +72,7 @@ public class SerializersTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/json'",
-				"Supported media-types: [text/b]"
+				"Supported media-types: ['text/b']"
 			);
 		}
 	}
@@ -124,7 +124,7 @@ public class SerializersTest extends RestTestcase {
 		} catch (RestCallException e) {
 			checkErrorResponse(debug, e, SC_NOT_ACCEPTABLE,
 				"Unsupported media-type in request header 'Accept': 'text/bad'",
-				"Supported media-types: [text/a");
+				"Supported media-types: ['text/a");
 		}
 	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java b/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java
index e4d7f83..ad81006 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/Redirect.java
@@ -12,10 +12,11 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.rest;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.net.*;
 import java.text.*;
 
-import org.apache.juneau.internal.*;
 import org.apache.juneau.urlencoding.*;
 
 /**
@@ -120,10 +121,7 @@ public final class Redirect {
 		this.httpResponseCode = httpResponseCode;
 		if (url == null)
 			url = "";
-		if (args != null && args.length > 0)
-			this.uri = StringUtils.toURI(MessageFormat.format(url.toString(), args));
-		else
-			this.uri = StringUtils.toURI(url);
+		this.uri = toURI(format(url.toString(), args));
 	}
 
 	/**

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java
index c9a9a5c..05fbd33 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestException.java
@@ -12,9 +12,13 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.rest;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.lang.reflect.*;
 import java.text.*;
 
+import org.apache.juneau.*;
+
 /**
  * Exception thrown to trigger an error HTTP status.
  * <p>
@@ -22,7 +26,7 @@ import java.text.*;
  * 	this exception to trigger an HTTP status other than the automatically-generated
  * 	<code>404</code>, <code>405</code>, and <code>500</code> statuses.
  */
-public class RestException extends RuntimeException {
+public class RestException extends FormattedRuntimeException {
 
 	private static final long serialVersionUID = 1L;
 
@@ -37,7 +41,7 @@ public class RestException extends RuntimeException {
 	 * @param args Optional {@link MessageFormat}-style arguments.
 	 */
 	public RestException(int status, String msg, Object...args) {
-		super(args.length == 0 ? msg : MessageFormat.format(msg, args));
+		super(msg, args);
 		this.status = status;
 	}
 
@@ -108,9 +112,9 @@ public class RestException extends RuntimeException {
 				msg = msg.replace('<', ' ').replace('>', ' ').replace('&', ' ');
 			String cls = e.getClass().getSimpleName();
 			if (msg == null)
-				sb.append(MessageFormat.format("\nCaused by ({0})", cls));
+				sb.append(format("\nCaused by ({0})", cls));
 			else
-				sb.append(MessageFormat.format("\nCaused by ({0}): {1}", cls, msg));
+				sb.append(format("\nCaused by ({0}): {1}", cls, msg));
 			e = e.getCause();
 		}
 		return sb.toString();

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java
index aa713b3..e9810d6 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestLogger.java
@@ -13,6 +13,7 @@
 package org.apache.juneau.rest;
 
 import static javax.servlet.http.HttpServletResponse.*;
+import static org.apache.juneau.internal.StringUtils.*;
 
 import java.text.*;
 import java.util.logging.*;
@@ -235,8 +236,7 @@ public abstract class RestLogger {
 
 		@Override /* RestLogger */
 		protected void log(Level level, Throwable cause, String msg, Object...args) {
-			if (args.length > 0)
-				msg = MessageFormat.format(msg, args);
+			msg = format(msg, args);
 			getLogger().log(level, msg, cause);
 		}
 	}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java
index 52d01b4..1cd2506 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServlet.java
@@ -14,6 +14,7 @@ package org.apache.juneau.rest;
 
 import static java.util.logging.Level.*;
 import static javax.servlet.http.HttpServletResponse.*;
+import static org.apache.juneau.internal.StringUtils.*;
 
 import java.io.*;
 import java.text.*;
@@ -242,7 +243,7 @@ public abstract class RestServlet extends HttpServlet {
 			context.getLogger().log(level, cause, msg, args);
 		else {
 			// If context failed to initialize, log to the console.
-			System.err.println(MessageFormat.format(msg, args));
+			System.err.println(format(msg, args));
 			if (cause != null)
 				cause.printStackTrace();
 		}

http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/a03704b2/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletException.java
----------------------------------------------------------------------
diff --git a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletException.java b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletException.java
index 61295fc..7e9735d 100644
--- a/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletException.java
+++ b/juneau-rest/src/main/java/org/apache/juneau/rest/RestServletException.java
@@ -12,6 +12,8 @@
 // ***************************************************************************************************************************
 package org.apache.juneau.rest;
 
+import static org.apache.juneau.internal.StringUtils.*;
+
 import java.text.*;
 
 import javax.servlet.*;
@@ -30,7 +32,7 @@ public class RestServletException extends ServletException {
 	 * @param args Optional {@link MessageFormat}-style arguments.
 	 */
 	public RestServletException(String message, Object...args) {
-		super(args.length == 0 ? message : MessageFormat.format(message, args));
+		super(format(message, args));
 	}
 
 	/**