Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java?view=diff&rev=559578&r1=559577&r2=559578 ============================================================================== --- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java (original) +++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/StringUtil.java Wed Jul 25 13:12:56 2007 @@ -191,6 +191,9 @@ /** * Like [EMAIL PROTECTED] #escape(String)} but puts a double quote character (<tt>'\"'</tt>) * around the escaped string. + * + * @param string The string to protect. + * @return The escaped string. */ public static String protect( String string ) { @@ -220,6 +223,15 @@ return buffer.toString(); } + /** + * Dumps the specified string with all non-ASCII characters and + * non-printable ASCII characters replaced by the corresponding Java + * escape sequences (that is <tt>'\n'</tt>, <tt>'\u00E9'</tt>, etc), + * into the given StringBuffer. + * + * @param string the String to be escaped. + * @param buffer the StringBuffer to hold the result. + */ private static void escape( String string, StringBuffer buffer ) { int length = string.length(); @@ -288,6 +300,9 @@ /** * Like [EMAIL PROTECTED] #unescape(String)} but removes the double quote characters * (<tt>'\"'</tt>), if any, before unescaping the string. + * + * @param string The string to escape. + * @return The escaped string. */ public static String unprotect( String string ) { @@ -317,6 +332,17 @@ return unescape( string, 0, string.length() ); } + /** + * Returns the specified string with Java escape sequences (that is + * <tt>'\n'</tt>, <tt>'\u00E9'</tt>, etc) replaced by the corresponding + * character. + * + * @param string the String to be unescaped + * @param offset The offset to start with. + * @param length The length of the string to escape. + * @return the specified string with Java escape sequences replaced by the + * corresponding character + */ private static String unescape( String string, int offset, int length ) { StringBuffer buffer = new StringBuffer(); @@ -399,6 +425,8 @@ /** * A simple test for [EMAIL PROTECTED] #escape(String)} and [EMAIL PROTECTED] #unescape(String)}. + * + * @param args An array of Strings to test. */ public static final void main( String[] args ) {
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/WrappedException.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/WrappedException.java?view=diff&rev=559578&r1=559577&r2=559578 ============================================================================== --- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/WrappedException.java (original) +++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/util/WrappedException.java Wed Jul 25 13:12:56 2007 @@ -27,6 +27,7 @@ public abstract class WrappedException extends Exception { + /** The <em>original</em> exception. */ private Exception rootException; /** @@ -85,12 +86,25 @@ return rootException; } + /** + * Returns the message of the original exception. + * + * @param e The Exception. + * @return the original exception message, or <code>null</code> + * if the root exception is null. + */ private static String makeMessage( Exception e ) { Exception rootEx = findRootException( e ); return ( rootEx == null ) ? null : rootEx.getMessage(); } + /** + * Returns the original exception. + * + * @param e The Exception. + * @return the original exception, or <code>null</code> if there is none. + */ private static Exception findRootException( Exception e ) { Exception rootEx = null;
