svn commit: r553012 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java
Author: ggregory Date: Tue Jul 3 16:01:07 2007 New Revision: 553012 URL: http://svn.apache.org/viewvc?view=revrev=553012 Log: Javadoc: Missing tag for return type. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java?view=diffrev=553012r1=553011r2=553012 == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileCleaner.java Tue Jul 3 16:01:07 2007 @@ -145,6 +145,8 @@ * This is mainly useful for code, which wants to support the new * [EMAIL PROTECTED] FileCleaningTracker} class while maintain compatibility with the * deprecated [EMAIL PROTECTED] FileCleaner}. + * + * @return the singleton instance */ public static FileCleaningTracker getInstance() { return theInstance; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r503497 - in /jakarta/commons/proper/io/trunk/src: java/org/apache/commons/io/FileUtils.java test/org/apache/commons/io/FileUtilsTestCase.java test/org/apache/commons/io/testtools/FileBase
Author: ggregory Date: Sun Feb 4 14:15:11 2007 New Revision: 503497 URL: http://svn.apache.org/viewvc?view=revrev=503497 Log: [IO-112] NPE in FileUtils.openOutputStream(File) when file has no parent in path. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/testtools/FileBasedTestCase.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?view=diffrev=503497r1=503496r2=503497 == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Sun Feb 4 14:15:11 2007 @@ -169,7 +169,7 @@ } } else { File parent = file.getParentFile(); -if (parent.exists() == false) { +if (parent != null parent.exists() == false) { if (parent.mkdirs() == false) { throw new IOException(File ' + file + ' could not be created); } Modified: jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java?view=diffrev=503497r1=503496r2=503497 == --- jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java (original) +++ jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/FileUtilsTestCase.java Sun Feb 4 14:15:11 2007 @@ -143,6 +143,36 @@ } //--- +void openOutputStream_noParent(boolean createFile) throws Exception { +File file = new File(test.txt); +assertNull(file.getParentFile()); +try { +if (createFile) { +createLineBasedFile(file, new String[]{Hello});} +FileOutputStream out = null; +try { +out = FileUtils.openOutputStream(file); +out.write(0); +} finally { +IOUtils.closeQuietly(out); +} +assertEquals(true, file.exists()); +} finally { +if (file.delete() == false) { +file.deleteOnExit(); +} +} +} + +public void test_openOutputStream_noParentCreateFile() throws Exception { +openOutputStream_noParent(true); +} + +public void test_openOutputStream_noParentNoFile() throws Exception { +openOutputStream_noParent(false); +} + + public void test_openOutputStream_exists() throws Exception { File file = new File(getTestDirectory(), test.txt); createLineBasedFile(file, new String[] {Hello}); Modified: jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/testtools/FileBasedTestCase.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/testtools/FileBasedTestCase.java?view=diffrev=503497r1=503496r2=503497 == --- jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/testtools/FileBasedTestCase.java (original) +++ jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/testtools/FileBasedTestCase.java Sun Feb 4 14:15:11 2007 @@ -93,12 +93,10 @@ } protected void createLineBasedFile(File file, String[] data) throws IOException { -if (!file.getParentFile().exists()) { -throw new IOException(Cannot create file + file -+ as the parent directory does not exist); +if (file.getParentFile() != null !file.getParentFile().exists()) { +throw new IOException(Cannot create file + file + as the parent directory does not exist); } -PrintWriter output = new PrintWriter( -new OutputStreamWriter(new FileOutputStream(file), UTF-8)); +PrintWriter output = new PrintWriter(new OutputStreamWriter(new FileOutputStream(file), UTF-8)); try { for (int i = 0; i data.length; i++) { output.println(data[i]); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r501951 - /jakarta/commons/proper/httpclient/trunk/release_notes.txt
Author: ggregory Date: Wed Jan 31 11:18:18 2007 New Revision: 501951 URL: http://svn.apache.org/viewvc?view=revrev=501951 Log: Add missing entries from Release 2.0.2. Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt Modified: jakarta/commons/proper/httpclient/trunk/release_notes.txt URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/release_notes.txt?view=diffrev=501951r1=501950r2=501951 == --- jakarta/commons/proper/httpclient/trunk/release_notes.txt (original) +++ jakarta/commons/proper/httpclient/trunk/release_notes.txt Wed Jan 31 11:18:18 2007 @@ -1,4 +1,4 @@ -Changes since Release 3.1 Beta 1: +Changes since Release 3.1 Beta 1: * [HTTPCLIENT-622] - Leak in MultiThreadedHttpConnectionManager.ConnectionPool.mapHosts Contributed by Michael Becke mbecke at apache.org and Ortwin Glueck oglueck at apache.org @@ -2331,6 +2331,14 @@ * 21210 - Header parser completely rewritten. Improved handling of Netscape draft compatible cookies Contributed by Oleg Kalnichevski olegk at apache.org + +Release 2.0.2 +--- +Changes since Release 2.0.1 + + * ContentLengthInputStream no longer supports mark() reset() methods. + + * 21329 - Added input buffering to improve performance Release 2.0.1 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491645 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java
Author: ggregory Date: Mon Jan 1 13:51:30 2007 New Revision: 491645 URL: http://svn.apache.org/viewvc?view=revrev=491645 Log: Add missing Javadoc tags. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java?view=diffrev=491645r1=491644r2=491645 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java Mon Jan 1 13:51:30 2007 @@ -118,6 +118,9 @@ /** * pForwards to codeReflectionToStringBuilder/code./p * + * @param object + *the Object to be output + * @return the String result * @see ReflectionToStringBuilder#toString(Object) */ public static String reflectionToString(Object object) { @@ -127,6 +130,11 @@ /** * pForwards to codeReflectionToStringBuilder/code./p * + * @param object + *the Object to be output + * @param style + *the style of the codetoString/code to create, may be codenull/code + * @return the String result * @see ReflectionToStringBuilder#toString(Object,ToStringStyle) */ public static String reflectionToString(Object object, ToStringStyle style) { @@ -136,6 +144,13 @@ /** * pForwards to codeReflectionToStringBuilder/code./p * + * @param object + *the Object to be output + * @param style + *the style of the codetoString/code to create, may be codenull/code + * @param outputTransients + *whether to include transient fields + * @return the String result * @see ReflectionToStringBuilder#toString(Object,ToStringStyle,boolean) */ public static String reflectionToString(Object object, ToStringStyle style, boolean outputTransients) { @@ -145,6 +160,15 @@ /** * pForwards to codeReflectionToStringBuilder/code./p * + * @param object + *the Object to be output + * @param style + *the style of the codetoString/code to create, may be codenull/code + * @param outputTransients + *whether to include transient fields + * @param reflectUpToClass + *the superclass to reflect up to (inclusive), may be codenull/code + * @return the String result * @see ReflectionToStringBuilder#toString(Object,ToStringStyle,boolean,boolean,Class) * @since 2.0 */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491646 - /jakarta/commons/proper/lang/trunk/NOTICE.txt
Author: ggregory Date: Mon Jan 1 13:54:23 2007 New Revision: 491646 URL: http://svn.apache.org/viewvc?view=revrev=491646 Log: Update Copyright for 2007. Modified: jakarta/commons/proper/lang/trunk/NOTICE.txt Modified: jakarta/commons/proper/lang/trunk/NOTICE.txt URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/NOTICE.txt?view=diffrev=491646r1=491645r2=491646 == --- jakarta/commons/proper/lang/trunk/NOTICE.txt (original) +++ jakarta/commons/proper/lang/trunk/NOTICE.txt Mon Jan 1 13:54:23 2007 @@ -1,5 +1,5 @@ Apache Jakarta Commons Lang -Copyright 2001-2006 The Apache Software Foundation +Copyright 2001-2007 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491647 - /jakarta/commons/proper/io/trunk/NOTICE.txt
Author: ggregory Date: Mon Jan 1 13:54:57 2007 New Revision: 491647 URL: http://svn.apache.org/viewvc?view=revrev=491647 Log: Update Copyright for 2007. Modified: jakarta/commons/proper/io/trunk/NOTICE.txt Modified: jakarta/commons/proper/io/trunk/NOTICE.txt URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/NOTICE.txt?view=diffrev=491647r1=491646r2=491647 == --- jakarta/commons/proper/io/trunk/NOTICE.txt (original) +++ jakarta/commons/proper/io/trunk/NOTICE.txt Mon Jan 1 13:54:57 2007 @@ -1,5 +1,5 @@ Apache Jakarta Commons IO -Copyright 2001-2006 The Apache Software Foundation +Copyright 2001-2007 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491648 - /jakarta/commons/proper/codec/trunk/NOTICE.txt
Author: ggregory Date: Mon Jan 1 13:55:23 2007 New Revision: 491648 URL: http://svn.apache.org/viewvc?view=revrev=491648 Log: Update Copyright for 2007. Modified: jakarta/commons/proper/codec/trunk/NOTICE.txt Modified: jakarta/commons/proper/codec/trunk/NOTICE.txt URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/NOTICE.txt?view=diffrev=491648r1=491647r2=491648 == --- jakarta/commons/proper/codec/trunk/NOTICE.txt (original) +++ jakarta/commons/proper/codec/trunk/NOTICE.txt Mon Jan 1 13:55:23 2007 @@ -1,5 +1,5 @@ Apache Jakarta Commons Codec -Copyright 2001-2006 The Apache Software Foundation +Copyright 2001-2007 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491650 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java
Author: ggregory Date: Mon Jan 1 14:00:14 2007 New Revision: 491650 URL: http://svn.apache.org/viewvc?view=revrev=491650 Log: Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java?view=diffrev=491650r1=491649r2=491650 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java Mon Jan 1 14:00:14 2007 @@ -121,9 +121,8 @@ public String getMessage(int index) { if (index == 0) { return super.getMessage(); -} else { -return delegate.getMessage(index); } +return delegate.getMessage(index); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491651 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java
Author: ggregory Date: Mon Jan 1 14:01:32 2007 New Revision: 491651 URL: http://svn.apache.org/viewvc?view=revrev=491651 Log: Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java?view=diffrev=491651r1=491650r2=491651 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java Mon Jan 1 14:01:32 2007 @@ -181,9 +181,8 @@ public String getMessage(int index) { if (index == 0) { return super.getMessage(); -} else { -return delegate.getMessage(index); } +return delegate.getMessage(index); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491652 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java
Author: ggregory Date: Mon Jan 1 14:01:57 2007 New Revision: 491652 URL: http://svn.apache.org/viewvc?view=revrev=491652 Log: Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java?view=diffrev=491652r1=491651r2=491652 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java Mon Jan 1 14:01:57 2007 @@ -125,9 +125,8 @@ public String getMessage(int index) { if (index == 0) { return super.getMessage(); -} else { -return delegate.getMessage(index); } +return delegate.getMessage(index); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491653 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java
Author: ggregory Date: Mon Jan 1 14:03:58 2007 New Revision: 491653 URL: http://svn.apache.org/viewvc?view=revrev=491653 Log: Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java?view=diffrev=491653r1=491652r2=491653 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Mon Jan 1 14:03:58 2007 @@ -1117,9 +1117,8 @@ public String toString() { if (tokens == null) { return StrTokenizer[not tokenized yet]; -} else { -return StrTokenizer + getTokenList(); } +return StrTokenizer + getTokenList(); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491654 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java
Author: ggregory Date: Mon Jan 1 14:04:34 2007 New Revision: 491654 URL: http://svn.apache.org/viewvc?view=revrev=491654 Log: Statement unnecessarily nested within else clause. The corresponding then clause does not complete normally. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java?view=diffrev=491654r1=491653r2=491654 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java Mon Jan 1 14:04:34 2007 @@ -637,9 +637,8 @@ } else { return this.value == tok2.value; } -} else { -return false; } +return false; } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491660 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
Author: ggregory Date: Mon Jan 1 14:21:06 2007 New Revision: 491660 URL: http://svn.apache.org/viewvc?view=revrev=491660 Log: Javadoc: Fix ambiguous method references. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?view=diffrev=491660r1=491659r2=491660 == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Mon Jan 1 14:21:06 2007 @@ -598,7 +598,7 @@ * @throws NullPointerException if source or destination is null * @throws IOException if source or destination is invalid * @throws IOException if an IO error occurs during copying - * @see #copyFileToDirectory + * @see #copyFileToDirectory(File, File) */ public static void copyFile(File srcFile, File destFile) throws IOException { copyFile(srcFile, destFile, true); @@ -620,7 +620,7 @@ * @throws NullPointerException if source or destination is null * @throws IOException if source or destination is invalid * @throws IOException if an IO error occurs during copying - * @see #copyFileToDirectory + * @see #copyFileToDirectory(File, File, boolean) */ public static void copyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491662 - /jakarta/commons/proper/io/trunk/build.xml
Author: ggregory Date: Mon Jan 1 14:30:13 2007 New Revision: 491662 URL: http://svn.apache.org/viewvc?view=revrev=491662 Log: Fix these warnings: [javadoc] C:\svn-store\jakarta\commons\io\src\java\org\apache\commons\io\filefilter\package.html: warning - Tag @link: reference not found: java.awt.FileDialog [javadoc] C:\svn-store\jakarta\commons\io\src\java\org\apache\commons\io\FileCleaner.java:43: warning - Tag @link: reference not found: javax.servlet.ServletContextListener#contextDestroyed [javadoc] C:\svn-store\jakarta\commons\io\src\java\org\apache\commons\io\FileCleaner.java:174: warning - Tag @link: reference not found: javax.servlet.ServletContextListener#contextDestroyed Modified: jakarta/commons/proper/io/trunk/build.xml Modified: jakarta/commons/proper/io/trunk/build.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/build.xml?view=diffrev=491662r1=491661r2=491662 == --- jakarta/commons/proper/io/trunk/build.xml (original) +++ jakarta/commons/proper/io/trunk/build.xml Mon Jan 1 14:30:13 2007 @@ -274,6 +274,8 @@ path refid=build.classpath /path /classpath + link href=http://java.sun.com/j2se/1.4/docs/api/; / + link href=http://java.sun.com/webservices/docs/1.5/api/; / /javadoc /target target name=get-deps unless=noget - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491668 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
Author: ggregory Date: Mon Jan 1 14:45:49 2007 New Revision: 491668 URL: http://svn.apache.org/viewvc?view=revrev=491668 Log: Add missing Javadoc tags. Use null is code format (codenull/code) Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?view=diffrev=491668r1=491667r2=491668 == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Mon Jan 1 14:45:49 2007 @@ -117,7 +117,8 @@ * An exception is thrown if the file object exists but is a directory. * An exception is thrown if the file exists but cannot be read. * - * @param file the file to open for input, not null + * @param file the file to open for input, must not be codenull/code + * @return a new [EMAIL PROTECTED] FileInputStream} for the specified file * @throws FileNotFoundException if the file does not exist * @throws IOException if the file object is a directory * @throws IOException if the file cannot be read @@ -151,7 +152,8 @@ * An exception is thrown if the file exists but cannot be written to. * An exception is thrown if the parent directory cannot be created. * - * @param file the file to open for output, not null + * @param file the file to open for output, must not be codenull/code + * @return a new [EMAIL PROTECTED] FileOutputStream} for the specified file * @throws IOException if the file object is a directory * @throws IOException if the file cannot be written to * @throws IOException if a parent directory needs creating but that fails @@ -278,7 +280,7 @@ * @param directory the directory to search in * @param fileFilter filter to apply when finding files. * @param dirFilter optional filter to apply when finding subdirectories. - * If this parameter is null, subdirectories will not be included in the + * If this parameter is codenull/code, subdirectories will not be included in the * search. Use TrueFileFilter.INSTANCE to match all directories. * @return an collection of java.io.File with the matching files * @see org.apache.commons.io.filefilter.FileFilterUtils @@ -324,7 +326,7 @@ * @param directory the directory to search in * @param fileFilter filter to apply when finding files. * @param dirFilter optional filter to apply when finding subdirectories. - * If this parameter is null, subdirectories will not be included in the + * If this parameter is codenull/code, subdirectories will not be included in the * search. Use TrueFileFilter.INSTANCE to match all directories. * @return an iterator of java.io.File for the matching files * @see org.apache.commons.io.filefilter.FileFilterUtils @@ -359,7 +361,7 @@ * * @param directory the directory to search in * @param extensions an array of extensions, ex. {java,xml}. If this - * parameter is null, all files are returned. + * parameter is codenull/code, all files are returned. * @param recursive if true all subdirectories are searched as well * @return an collection of java.io.File with the matching files */ @@ -383,7 +385,7 @@ * * @param directory the directory to search in * @param extensions an array of extensions, ex. {java,xml}. If this - * parameter is null, all files are returned. + * parameter is codenull/code, all files are returned. * @param recursive if true all subdirectories are searched as well * @return an iterator of java.io.File with the matching files * @since Commons IO 1.2 @@ -456,7 +458,7 @@ * Syntax such as codefile:///my%20docs/file.txt/code will be * correctly decoded to code/my docs/file.txt/code. * - * @param url the file URL to convert, null returns null + * @param url the file URL to convert, codenull/code returns codenull/code * @return the equivalent codeFile/code object, or codenull/code * if the URL's protocol is not codefile/code * @throws IllegalArgumentException if the file is incorrectly encoded @@ -482,17 +484,17 @@ * Converts each of an array of codeURL/code to a codeFile/code. * p * Returns an array of the same size as the input. - * If the input is null, an empty array is returned. - * If the input contains null, the output array contains null at the same + * If the input is codenull/code, an empty array is returned. + * If the input contains codenull/code, the output array contains codenull/code at the same * index. * p
svn commit: r491695 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java
Author: ggregory Date: Mon Jan 1 15:24:27 2007 New Revision: 491695 URL: http://svn.apache.org/viewvc?view=revrev=491695 Log: [LANG-102] [lang] Refactor Entities methods. http://issues.apache.org/jira/browse/LANG-102. Refactored escape and unescape methods to remove code duplication. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java?view=diffrev=491695r1=491694r2=491695 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/Entities.java Mon Jan 1 15:24:27 2007 @@ -14,23 +14,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.commons.lang; import java.io.IOException; +import java.io.StringWriter; import java.io.Writer; import java.util.HashMap; import java.util.Map; import java.util.TreeMap; /** - * pProvides HTML and XML entity utilities./p - * + * p + * Provides HTML and XML entity utilities. + * /p + * * @see a href=http://hotwired.lycos.com/webmonkey/reference/special_characters/;ISO Entities/a * @see a href=http://www.w3.org/TR/REC-html32#latin1;HTML 3.2 Character Entities for ISO Latin-1/a * @see a href=http://www.w3.org/TR/REC-html40/sgml/entities.html;HTML 4.0 Character entity references/a * @see a href=http://www.w3.org/TR/html401/charset.html#h-5.3;HTML 4.01 Character References/a * @see a href=http://www.w3.org/TR/html401/charset.html#code-position;HTML 4.01 Code positions/a - * + * * @author a href=mailto:[EMAIL PROTECTED]Alexander Day Chaffee/a * @author a href=mailto:[EMAIL PROTECTED]Gary Gregory/a * @since 2.0 @@ -38,51 +42,48 @@ */ class Entities { -private static final String[][] BASIC_ARRAY = { -{quot, 34}, // - double-quote +private static final String[][] BASIC_ARRAY = {{quot, 34}, // - double-quote {amp, 38}, // - ampersand {lt, 60}, // - less-than {gt, 62}, // - greater-than }; -private static final String[][] APOS_ARRAY = { -{apos, 39}, // XML apostrophe +private static final String[][] APOS_ARRAY = {{apos, 39}, // XML apostrophe }; // package scoped for testing -static final String[][] ISO8859_1_ARRAY = { -{nbsp, 160}, // non-breaking space -{iexcl, 161}, //inverted exclamation mark -{cent, 162}, //cent sign -{pound, 163}, //pound sign -{curren, 164}, //currency sign -{yen, 165}, //yen sign = yuan sign -{brvbar, 166}, //broken bar = broken vertical bar -{sect, 167}, //section sign -{uml, 168}, //diaeresis = spacing diaeresis +static final String[][] ISO8859_1_ARRAY = {{nbsp, 160}, // non-breaking space +{iexcl, 161}, // inverted exclamation mark +{cent, 162}, // cent sign +{pound, 163}, // pound sign +{curren, 164}, // currency sign +{yen, 165}, // yen sign = yuan sign +{brvbar, 166}, // broken bar = broken vertical bar +{sect, 167}, // section sign +{uml, 168}, // diaeresis = spacing diaeresis {copy, 169}, // © - copyright sign -{ordf, 170}, //feminine ordinal indicator -{laquo, 171}, //left-pointing double angle quotation mark = left pointing guillemet -{not, 172}, //not sign -{shy, 173}, //soft hyphen = discretionary hyphen +{ordf, 170}, // feminine ordinal indicator +{laquo, 171}, // left-pointing double angle quotation mark = left pointing guillemet +{not, 172}, // not sign +{shy, 173}, // soft hyphen = discretionary hyphen {reg, 174}, // ® - registered trademark sign -{macr, 175}, //macron = spacing macron = overline = APL overbar -{deg, 176}, //degree sign -{plusmn, 177}, //plus-minus sign = plus-or-minus sign -{sup2, 178}, //superscript two = superscript digit two = squared -{sup3, 179}, //superscript three = superscript digit three = cubed -{acute, 180}, //acute accent = spacing acute -{micro, 181}, //micro sign -{para, 182}, //pilcrow sign = paragraph sign -{middot, 183}, //middle dot = Georgian comma = Greek middle dot -{cedil, 184}, //cedilla = spacing cedilla -{sup1, 185}, //superscript one = superscript digit one -{ordm, 186}, //masculine ordinal indicator -{raquo, 187}, //right-pointing double angle quotation mark = right pointing guillemet -{frac14, 188}, //vulgar fraction one quarter = fraction one quarter -{frac12, 189}, //vulgar fraction one half = fraction one half
svn commit: r491359 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java
Author: ggregory Date: Sat Dec 30 17:08:34 2006 New Revision: 491359 URL: http://svn.apache.org/viewvc?view=revrev=491359 Log: Remove unnecessary cast from long to long. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java?view=diffrev=491359r1=491358r2=491359 == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java Sat Dec 30 17:08:34 2006 @@ -224,7 +224,7 @@ ( ( data[ offset + 5 ] 0xff ) 8 ) + ( ( data[ offset + 6 ] 0xff ) 16 ) + ( ( data[ offset + 7 ] 0xff ) 24 ); -return ((long) high 32) + (0xL low); +return (high 32) + (0xL low); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491360 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
Author: ggregory Date: Sat Dec 30 17:15:01 2006 New Revision: 491360 URL: http://svn.apache.org/viewvc?view=revrev=491360 Log: Fix Javadoc warning - Tag @see: missing #: lineIterator(File, String) Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?view=diffrev=491360r1=491359r2=491360 == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Sat Dec 30 17:15:01 2006 @@ -1079,7 +1079,7 @@ * Return an Iterator for the lines in a codeFile/code using the default encoding for the VM. * * @since Commons IO 1.3 - * @see lineIterator(File, String) + * @see #lineIterator(File, String) */ public static LineIterator lineIterator(File file) throws IOException { return lineIterator(file, null); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r491361 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
Author: ggregory Date: Sat Dec 30 17:17:09 2006 New Revision: 491361 URL: http://svn.apache.org/viewvc?view=revrev=491361 Log: Fix Javadoc warning - @param argument file is not a parameter name. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?view=diffrev=491361r1=491360r2=491361 == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Sat Dec 30 17:17:09 2006 @@ -973,8 +973,8 @@ * @throws IOException in case of an I/O error * @since Commons IO 1.3 */ -public String readFileToString(File f) throws IOException { -return readFileToString(f, null); +public String readFileToString(File file) throws IOException { +return readFileToString(file, null); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r484839 - /jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java
Author: ggregory Date: Fri Dec 8 15:12:09 2006 New Revision: 484839 URL: http://svn.apache.org/viewvc?view=revrev=484839 Log: For some reason, the directory .svn is NOT hidden on my machine. Makes hidden filter tests take this into account. (Microsoft Windows XP [Version 5.1.2600] SP2 + current patches) Modified: jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java Modified: jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java?view=diffrev=484839r1=484838r2=484839 == --- jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java (original) +++ jakarta/commons/proper/io/trunk/src/test/org/apache/commons/io/filefilter/FileFilterTestCase.java Fri Dec 8 15:12:09 2006 @@ -36,6 +36,11 @@ */ public class FileFilterTestCase extends FileBasedTestCase { +/** + * The subversion directory name. + */ +static final String SVN_DIR_NAME = .svn; + private static final boolean WINDOWS = (File.separatorChar == '\\'); public FileFilterTestCase(String name) { @@ -558,7 +563,7 @@ IOFileFilter filter2 = FileFilterUtils.makeSVNAware(FileFilterUtils .nameFileFilter(test-file1.txt)); -File file = new File(getTestDirectory(), .svn); +File file = new File(getTestDirectory(), SVN_DIR_NAME); file.mkdirs(); assertFiltering(filter1, file, false); assertFiltering(filter2, file, false); @@ -574,7 +579,7 @@ assertFiltering(filter1, file, true); assertFiltering(filter2, file, false); -file = new File(getTestDirectory(), .svn); +file = new File(getTestDirectory(), SVN_DIR_NAME); createFile(file, 0); assertFiltering(filter1, file, true); assertFiltering(filter2, file, false); @@ -680,10 +685,10 @@ } public void testHidden() throws Exception { -File hiddenDir = new File(.svn); +File hiddenDir = new File(SVN_DIR_NAME); if (hiddenDir.exists()) { -assertFiltering(HiddenFileFilter.HIDDEN, hiddenDir, true); -assertFiltering(HiddenFileFilter.VISIBLE, hiddenDir, false); +assertFiltering(HiddenFileFilter.HIDDEN, hiddenDir, hiddenDir.isHidden()); +assertFiltering(HiddenFileFilter.VISIBLE, hiddenDir, !hiddenDir.isHidden()); } assertFiltering(HiddenFileFilter.HIDDEN, getTestDirectory(), false); assertFiltering(HiddenFileFilter.VISIBLE, getTestDirectory(), true); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r484844 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/IOCase.java
Author: ggregory Date: Fri Dec 8 15:27:18 2006 New Revision: 484844 URL: http://svn.apache.org/viewvc?view=revrev=484844 Log: 2 Javadoc fixes. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/IOCase.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/IOCase.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/IOCase.java?view=diffrev=484844r1=484843r2=484844 == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/IOCase.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/IOCase.java Fri Dec 8 15:27:18 2006 @@ -146,7 +146,7 @@ /** * Checks if one string starts with another using the case-sensitivity rule. * p - * This method mimics [EMAIL PROTECTED] String#startsWith} but takes case-sensitivity + * This method mimics [EMAIL PROTECTED] String#startsWith(String)} but takes case-sensitivity * into account. * * @param str the string to check, not null @@ -177,8 +177,8 @@ /** * Checks if one string contains another at a specific index using the case-sensitivity rule. * p - * This method mimics parts of [EMAIL PROTECTED] String#regionMatches} but takes case-sensitivity - * into account. + * This method mimics parts of [EMAIL PROTECTED] String#regionMatches(boolean, int, String, int, int)} + * but takes case-sensitivity into account. * * @param str the string to check, not null * @param strStartIndex the index to start at in str - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r451406 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java
Author: ggregory Date: Fri Sep 29 12:56:41 2006 New Revision: 451406 URL: http://svn.apache.org/viewvc?view=revrev=451406 Log: // comments. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java?view=diffrev=451406r1=451405r2=451406 == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java Fri Sep 29 12:56:41 2006 @@ -514,7 +514,8 @@ ReflectionTestCycleB b = new ReflectionTestCycleB(); a.b = b; b.a = a; -// Causes: + +// Used to caused: // java.lang.StackOverflowError // at java.lang.ClassLoader.getCallerClassLoader(Native Method) // at java.lang.Class.getDeclaredFields(Class.java:992) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r448263 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java
Author: ggregory Date: Wed Sep 20 09:53:53 2006 New Revision: 448263 URL: http://svn.apache.org/viewvc?view=revrev=448263 Log: The parameter object is hiding a field from type ToStringBuilder. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java?view=diffrev=448263r1=448262r2=448263 == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringBuilder.java Wed Sep 20 09:53:53 2006 @@ -443,11 +443,11 @@ * pAppend to the codetoString/code an codeObject/code * value./p * - * @param object the value to add to the codetoString/code + * @param obj the value to add to the codetoString/code * @return this */ -public ToStringBuilder append(Object object) { -style.append(buffer, null, object, null); +public ToStringBuilder append(Object obj) { +style.append(buffer, null, obj, null); return this; } @@ -819,11 +819,11 @@ * value./p * * @param fieldName the field name - * @param object the value to add to the codetoString/code + * @param obj the value to add to the codetoString/code * @return this */ -public ToStringBuilder append(String fieldName, Object object) { -style.append(buffer, fieldName, object, null); +public ToStringBuilder append(String fieldName, Object obj) { +style.append(buffer, fieldName, obj, null); return this; } @@ -832,13 +832,13 @@ * value./p * * @param fieldName the field name - * @param object the value to add to the codetoString/code + * @param obj the value to add to the codetoString/code * @param fullDetail codetrue/code for detail, * codefalse/code for summary info * @return this */ -public ToStringBuilder append(String fieldName, Object object, boolean fullDetail) { -style.append(buffer, fieldName, object, BooleanUtils.toBooleanObject(fullDetail)); +public ToStringBuilder append(String fieldName, Object obj, boolean fullDetail) { +style.append(buffer, fieldName, obj, BooleanUtils.toBooleanObject(fullDetail)); return this; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r447947 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java
Author: ggregory Date: Tue Sep 19 13:20:06 2006 New Revision: 447947 URL: http://svn.apache.org/viewvc?view=revrev=447947 Log: https://issues.apache.org/jira/browse/LANG-279 HashCodeBuilder throws java.lang.StackOverflowError when an object contains a cycle. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java?view=diffrev=447947r1=447946r2=447947 == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/HashCodeBuilderTest.java Tue Sep 19 13:20:06 2006 @@ -16,6 +16,9 @@ */ package org.apache.commons.lang.builder; +import org.apache.commons.lang.builder.ToStringBuilderTest.ReflectionTestCycleA; +import org.apache.commons.lang.builder.ToStringBuilderTest.ReflectionTestCycleB; + import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -29,6 +32,28 @@ */ public class HashCodeBuilderTest extends TestCase { +/** + * A reflection test fixture. + */ +static class ReflectionTestCycleA { +ReflectionTestCycleB b; + +public int hashCode() { +return HashCodeBuilder.reflectionHashCode(this); +} +} + +/** + * A reflection test fixture. + */ +static class ReflectionTestCycleB { +ReflectionTestCycleA a; + +public int hashCode() { +return HashCodeBuilder.reflectionHashCode(this); +} +} + public HashCodeBuilderTest(String name) { super(name); } @@ -467,4 +492,34 @@ this.three = three; } } + +/** + * Test Objects pointing to each other. + */ +public void testReflectionObjectCycle() { +ReflectionTestCycleA a = new ReflectionTestCycleA(); +ReflectionTestCycleB b = new ReflectionTestCycleB(); +a.b = b; +b.a = a; +// Causes: +// java.lang.StackOverflowError +// at java.lang.ClassLoader.getCallerClassLoader(Native Method) +// at java.lang.Class.getDeclaredFields(Class.java:992) +// at org.apache.commons.lang.builder.HashCodeBuilder.reflectionAppend(HashCodeBuilder.java:373) +// at org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(HashCodeBuilder.java:349) +// at org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(HashCodeBuilder.java:155) +// at +// org.apache.commons.lang.builder.HashCodeBuilderTest$ReflectionTestCycleB.hashCode(HashCodeBuilderTest.java:53) +// at org.apache.commons.lang.builder.HashCodeBuilder.append(HashCodeBuilder.java:422) +// at org.apache.commons.lang.builder.HashCodeBuilder.reflectionAppend(HashCodeBuilder.java:383) +// at org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(HashCodeBuilder.java:349) +// at org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(HashCodeBuilder.java:155) +// at +// org.apache.commons.lang.builder.HashCodeBuilderTest$ReflectionTestCycleA.hashCode(HashCodeBuilderTest.java:42) +// at org.apache.commons.lang.builder.HashCodeBuilder.append(HashCodeBuilder.java:422) + +// a.hashCode(); +// b.hashCode(); +} + } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r437756 - /jakarta/commons/proper/lang/trunk/build.xml
Author: ggregory Date: Mon Aug 28 10:20:17 2006 New Revision: 437756 URL: http://svn.apache.org/viewvc?rev=437756view=rev Log: Fix XML comment from a previous commit. Modified: jakarta/commons/proper/lang/trunk/build.xml Modified: jakarta/commons/proper/lang/trunk/build.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/build.xml?rev=437756r1=437755r2=437756view=diff == --- jakarta/commons/proper/lang/trunk/build.xml (original) +++ jakarta/commons/proper/lang/trunk/build.xml Mon Aug 28 10:20:17 2006 @@ -1,3 +1,4 @@ +!-- /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -16,11 +17,12 @@ * specific language governing permissions and limitations * under the License. */ + -- +!-- + Lang component of the Jakarta Commons Subproject + $Id$ +-- project name=Lang default=compile basedir=. - !-- -Lang component of the Jakarta Commons Subproject -$Id$ --- !-- == Initialize Properties = -- property file=${user.home}/${component.name}.build.properties/ property file=${user.home}/build.properties/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r437230 - /jakarta/commons/proper/codec/trunk/LICENSE-header.txt
Author: ggregory Date: Sat Aug 26 14:26:17 2006 New Revision: 437230 URL: http://svn.apache.org/viewvc?rev=437230view=rev Log: Change Copyright 2001-2005 to Copyright 2001-2006 Modified: jakarta/commons/proper/codec/trunk/LICENSE-header.txt Modified: jakarta/commons/proper/codec/trunk/LICENSE-header.txt URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/LICENSE-header.txt?rev=437230r1=437229r2=437230view=diff == --- jakarta/commons/proper/codec/trunk/LICENSE-header.txt (original) +++ jakarta/commons/proper/codec/trunk/LICENSE-header.txt Sat Aug 26 14:26:17 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r437231 - /jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/
Author: ggregory Date: Sat Aug 26 14:26:32 2006 New Revision: 437231 URL: http://svn.apache.org/viewvc?rev=437231view=rev Log: Change Copyright 2001-2005 to Copyright 2001-2006 Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryDecoder.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryEncoder.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Decoder.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/DecoderException.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/EncoderException.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/StringDecoder.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/StringEncoder.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/StringEncoderComparator.java Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryDecoder.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryDecoder.java?rev=437231r1=437230r2=437231view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryDecoder.java (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryDecoder.java Sat Aug 26 14:26:32 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryEncoder.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryEncoder.java?rev=437231r1=437230r2=437231view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryEncoder.java (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/BinaryEncoder.java Sat Aug 26 14:26:32 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Decoder.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Decoder.java?rev=437231r1=437230r2=437231view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Decoder.java (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Decoder.java Sat Aug 26 14:26:32 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/DecoderException.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/DecoderException.java?rev=437231r1=437230r2=437231view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/DecoderException.java (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/DecoderException.java Sat Aug 26 14:26:32 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java?rev=437231r1=437230r2=437231view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/Encoder.java Sat Aug 26 14:26:32 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001
svn commit: r437232 - in /jakarta/commons/proper/codec/trunk/src: java/org/apache/commons/codec/binary/ java/org/apache/commons/codec/digest/ java/org/apache/commons/codec/language/ java/org/apache/co
Author: ggregory Date: Sat Aug 26 14:27:08 2006 New Revision: 437232 URL: http://svn.apache.org/viewvc?rev=437232view=rev Log: Change Copyright 2001-2005 to Copyright 2001-2006 Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/BinaryCodec.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Hex.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/digest/DigestUtils.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/DoubleMetaphone.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Metaphone.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/RefinedSoundex.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/Soundex.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/SoundexUtils.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/BCodec.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/CharacterEncodingNames.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QCodec.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/QuotedPrintableCodec.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/RFC1522Codec.java jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/URLCodec.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/BinaryEncoderAbstractTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/StringEncoderAbstractTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/StringEncoderComparatorTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/Base64Test.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/BinaryCodecTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/binary/HexTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/digest/DigestUtilsTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/AllTests.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/DoubleMetaphoneTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/MetaphoneTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/RefinedSoundexTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/language/SoundexTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/net/BCodecTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/net/QCodecTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/net/QuotedPrintableCodecTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/net/RFC1522CodecTest.java jakarta/commons/proper/codec/trunk/src/test/org/apache/commons/codec/net/URLCodecTest.java Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java?rev=437232r1=437231r2=437232view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java Sat Aug 26 14:27:08 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/BinaryCodec.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/BinaryCodec.java?rev=437232r1=437231r2=437232view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/BinaryCodec.java (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/BinaryCodec.java Sat Aug 26 14:27:08 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005 The Apache Software Foundation. + * Copyright 2001-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you
svn commit: r437233 - in /jakarta/commons/proper/codec/trunk: PROPOSAL.html build.properties.sample build.xml checkstyle.xml default.properties maven.xml project.properties
Author: ggregory Date: Sat Aug 26 14:29:14 2006 New Revision: 437233 URL: http://svn.apache.org/viewvc?rev=437233view=rev Log: Change Copyright -2005 to Copyright -2006 Modified: jakarta/commons/proper/codec/trunk/PROPOSAL.html jakarta/commons/proper/codec/trunk/build.properties.sample jakarta/commons/proper/codec/trunk/build.xml jakarta/commons/proper/codec/trunk/checkstyle.xml jakarta/commons/proper/codec/trunk/default.properties jakarta/commons/proper/codec/trunk/maven.xml jakarta/commons/proper/codec/trunk/project.properties Modified: jakarta/commons/proper/codec/trunk/PROPOSAL.html URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/PROPOSAL.html?rev=437233r1=437232r2=437233view=diff == --- jakarta/commons/proper/codec/trunk/PROPOSAL.html (original) +++ jakarta/commons/proper/codec/trunk/PROPOSAL.html Sat Aug 26 14:29:14 2006 @@ -1,6 +1,6 @@ ?xml version=1.0? !-- -Copyright 2002-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/build.properties.sample URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/build.properties.sample?rev=437233r1=437232r2=437233view=diff == --- jakarta/commons/proper/codec/trunk/build.properties.sample (original) +++ jakarta/commons/proper/codec/trunk/build.properties.sample Sat Aug 26 14:29:14 2006 @@ -1,5 +1,5 @@ # -# Copyright 2002-2005 The Apache Software Foundation. +# Copyright 2001-2006 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/build.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/build.xml?rev=437233r1=437232r2=437233view=diff == --- jakarta/commons/proper/codec/trunk/build.xml (original) +++ jakarta/commons/proper/codec/trunk/build.xml Sat Aug 26 14:29:14 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2002-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/checkstyle.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/checkstyle.xml?rev=437233r1=437232r2=437233view=diff == --- jakarta/commons/proper/codec/trunk/checkstyle.xml (original) +++ jakarta/commons/proper/codec/trunk/checkstyle.xml Sat Aug 26 14:29:14 2006 @@ -1,6 +1,6 @@ ?xml version=1.0? !-- -Copyright 2002-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/default.properties URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/default.properties?rev=437233r1=437232r2=437233view=diff == --- jakarta/commons/proper/codec/trunk/default.properties (original) +++ jakarta/commons/proper/codec/trunk/default.properties Sat Aug 26 14:29:14 2006 @@ -1,5 +1,5 @@ # -# Copyright 2002-2005 The Apache Software Foundation. +# Copyright 2001-2006 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/maven.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/maven.xml?rev=437233r1=437232r2=437233view=diff == --- jakarta/commons/proper/codec/trunk/maven.xml (original) +++ jakarta/commons/proper/codec/trunk/maven.xml Sat Aug 26 14:29:14 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2002-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/project.properties URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/project.properties?rev=437233r1=437232r2=437233view=diff == --- jakarta/commons/proper/codec/trunk/project.properties (original) +++ jakarta/commons/proper
svn commit: r437234 - in /jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec: overview.html package.html
Author: ggregory Date: Sat Aug 26 14:29:25 2006 New Revision: 437234 URL: http://svn.apache.org/viewvc?rev=437234view=rev Log: Change Copyright -2005 to Copyright -2006 Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/overview.html jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/package.html Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/overview.html URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/overview.html?rev=437234r1=437233r2=437234view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/overview.html (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/overview.html Sat Aug 26 14:29:25 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2003-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/package.html URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/package.html?rev=437234r1=437233r2=437234view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/package.html (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/package.html Sat Aug 26 14:29:25 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2003-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r437236 - in /jakarta/commons/proper/codec/trunk: src/java/org/apache/commons/codec/binary/ src/java/org/apache/commons/codec/digest/ src/java/org/apache/commons/codec/language/ src/java/o
Author: ggregory Date: Sat Aug 26 14:29:45 2006 New Revision: 437236 URL: http://svn.apache.org/viewvc?rev=437236view=rev Log: Change Copyright -2005 to Copyright -2006 Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/package.html jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/digest/package.html jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/package.html jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/package.html jakarta/commons/proper/codec/trunk/xdocs/changes.xml jakarta/commons/proper/codec/trunk/xdocs/proposal.xml Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/package.html URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/package.html?rev=437236r1=437235r2=437236view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/package.html (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/package.html Sat Aug 26 14:29:45 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2003-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/digest/package.html URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/digest/package.html?rev=437236r1=437235r2=437236view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/digest/package.html (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/digest/package.html Sat Aug 26 14:29:45 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2003-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/package.html URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/package.html?rev=437236r1=437235r2=437236view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/package.html (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/package.html Sat Aug 26 14:29:45 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2003-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/package.html URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/package.html?rev=437236r1=437235r2=437236view=diff == --- jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/package.html (original) +++ jakarta/commons/proper/codec/trunk/src/java/org/apache/commons/codec/net/package.html Sat Aug 26 14:29:45 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2003-2005 The Apache Software Foundation. +Copyright 2001-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/xdocs/changes.xml?rev=437236r1=437235r2=437236view=diff == --- jakarta/commons/proper/codec/trunk/xdocs/changes.xml (original) +++ jakarta/commons/proper/codec/trunk/xdocs/changes.xml Sat Aug 26 14:29:45 2006 @@ -1,6 +1,6 @@ ?xml version=1.0? !-- - Copyright 2003-2005 The Apache Software Foundation + Copyright 2001-2006 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/codec/trunk/xdocs/proposal.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/codec/trunk/xdocs/proposal.xml?rev=437236r1=437235r2=437236view=diff == --- jakarta/commons/proper/codec
svn commit: r437238 - in /jakarta/commons/proper/lang/trunk: PROPOSAL.html STATUS.html build.xml checkstyle.xml default.properties maven.xml
Author: ggregory Date: Sat Aug 26 14:54:21 2006 New Revision: 437238 URL: http://svn.apache.org/viewvc?rev=437238view=rev Log: Change Copyright -2005 to Copyright -2006 Modified: jakarta/commons/proper/lang/trunk/PROPOSAL.html jakarta/commons/proper/lang/trunk/STATUS.html jakarta/commons/proper/lang/trunk/build.xml jakarta/commons/proper/lang/trunk/checkstyle.xml jakarta/commons/proper/lang/trunk/default.properties jakarta/commons/proper/lang/trunk/maven.xml Modified: jakarta/commons/proper/lang/trunk/PROPOSAL.html URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/PROPOSAL.html?rev=437238r1=437237r2=437238view=diff == --- jakarta/commons/proper/lang/trunk/PROPOSAL.html (original) +++ jakarta/commons/proper/lang/trunk/PROPOSAL.html Sat Aug 26 14:54:21 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2002-2005 The Apache Software Foundation. +Copyright 2002-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/lang/trunk/STATUS.html URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/STATUS.html?rev=437238r1=437237r2=437238view=diff == --- jakarta/commons/proper/lang/trunk/STATUS.html (original) +++ jakarta/commons/proper/lang/trunk/STATUS.html Sat Aug 26 14:54:21 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2002-2005 The Apache Software Foundation. +Copyright 2002-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/lang/trunk/build.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/build.xml?rev=437238r1=437237r2=437238view=diff == --- jakarta/commons/proper/lang/trunk/build.xml (original) +++ jakarta/commons/proper/lang/trunk/build.xml Sat Aug 26 14:54:21 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2002-2005 The Apache Software Foundation. +Copyright 2002-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/lang/trunk/checkstyle.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/checkstyle.xml?rev=437238r1=437237r2=437238view=diff == --- jakarta/commons/proper/lang/trunk/checkstyle.xml (original) +++ jakarta/commons/proper/lang/trunk/checkstyle.xml Sat Aug 26 14:54:21 2006 @@ -1,6 +1,6 @@ ?xml version=1.0? !-- -Copyright 2003-2005 The Apache Software Foundation. +Copyright 2003-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/lang/trunk/default.properties URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/default.properties?rev=437238r1=437237r2=437238view=diff == --- jakarta/commons/proper/lang/trunk/default.properties (original) +++ jakarta/commons/proper/lang/trunk/default.properties Sat Aug 26 14:54:21 2006 @@ -1,5 +1,5 @@ # -# Copyright 2002-2005 The Apache Software Foundation. +# Copyright 2002-2006 The Apache Software Foundation. # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/lang/trunk/maven.xml URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/maven.xml?rev=437238r1=437237r2=437238view=diff == --- jakarta/commons/proper/lang/trunk/maven.xml (original) +++ jakarta/commons/proper/lang/trunk/maven.xml Sat Aug 26 14:54:21 2006 @@ -1,5 +1,5 @@ !-- -Copyright 2002-2005 The Apache Software Foundation. +Copyright 2002-2006 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r437239 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/ test/org/apache/commons/lang/ test/org/apache/commons/lang/builder/ test/org/apache/commons/lang/text/
Author: ggregory Date: Sat Aug 26 15:07:15 2006 New Revision: 437239 URL: http://svn.apache.org/viewvc?rev=437239view=rev Log: Updated Copyrights to 2006. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderAppendInsertTest.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrMatcherTest.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java?rev=437239r1=437238r2=437239view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java Sat Aug 26 15:07:15 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2005 The Apache Software Foundation. + * Copyright 2005-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java?rev=437239r1=437238r2=437239view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/IntHashMapTest.java Sat Aug 26 15:07:15 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2005 The Apache Software Foundation. + * Copyright 2005-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java?rev=437239r1=437238r2=437239view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java Sat Aug 26 15:07:15 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2005 The Apache Software Foundation. + * Copyright 2005-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ * * @author Chris Hyzer * @author Stephen Colebourne - * @version $Id: LocaleUtilsTest.java 307282 2005-10-08 10:04:20Z scolebourne $ + * @version $Id$ */ public class LocaleUtilsTest extends TestCase { Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java?rev=437239r1=437238r2=437239view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java Sat Aug 26 15:07:15 2006 @@ -1,5 +1,5 @@ /* - * Copyright 2005 The Apache Software Foundation. + * Copyright 2005-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderAppendInsertTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderAppendInsertTest.java?rev=437239r1=437238r2=437239view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderAppendInsertTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text
svn commit: r432024 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java
Author: ggregory Date: Wed Aug 16 13:34:01 2006 New Revision: 432024 URL: http://svn.apache.org/viewvc?rev=432024view=rev Log: Make sure this exception code does not depend on Java 1.4 nested exceptions. SVN revision 38990 does not compile with Java 1.3.1. Compiled with Sun Java 1.3.1_15 Tested with Sun Java 1.3.1_15 Tested with Sun Java 1.4.2_12 Tested with Sun Java 1.5.0_08 All of the above on Windows XP SP2 + patches. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java?rev=432024r1=432023r2=432024view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java Wed Aug 16 13:34:01 2006 @@ -32,7 +32,23 @@ /** * Tests [EMAIL PROTECTED] org.apache.commons.lang.exception.ExceptionUtils}. - * + * + * h3Notes/h3 + * p + * Make sure this exception code does not depend on Java 1.4 nested exceptions. SVN revision 38990 does not compile with + * Java 1.3.1. + * /p + * ul + * liCompiled with Sun Java 1.3.1_15/li + * liTested with Sun Java 1.3.1_15/li + * liTested with Sun Java 1.4.2_12/li + * liTested with Sun Java 1.5.0_08/li + * liAll of the above on Windows XP SP2 + patches./li + * /ul + * p + * Gary Gregory; August 16, 2006. + * /p + * * @author a href=mailto:dlr@finemaltcoding.com;Daniel Rall/a * @author a href=mailto:[EMAIL PROTECTED]Steven Caswell/a * @author Stephen Colebourne @@ -46,7 +62,7 @@ private Throwable withoutCause; private Throwable jdkNoCause; private ExceptionWithCause selfCause; -private ExceptionWithCause recursiveCause; +private ExceptionWithCause cyclicCause; public ExceptionUtilsTestCase(String name) { super(name); @@ -66,7 +82,7 @@ ExceptionWithCause a = new ExceptionWithCause(null); ExceptionWithCause b = new ExceptionWithCause(a); a.setCause(b); -recursiveCause = new ExceptionWithCause(a); +cyclicCause = new ExceptionWithCause(a); } protected void tearDown() throws Exception { @@ -75,7 +91,7 @@ withCause = null; jdkNoCause = null; selfCause = null; -recursiveCause = null; +cyclicCause = null; } //--- @@ -131,9 +147,9 @@ assertSame(nested, ExceptionUtils.getCause(withCause)); assertSame(null, ExceptionUtils.getCause(jdkNoCause)); assertSame(selfCause, ExceptionUtils.getCause(selfCause)); -assertSame(recursiveCause.getCause(), ExceptionUtils.getCause(recursiveCause)); -assertSame(recursiveCause.getCause().getCause(), ExceptionUtils.getCause(recursiveCause.getCause())); -assertSame(recursiveCause.getCause(), ExceptionUtils.getCause(recursiveCause.getCause().getCause())); +assertSame(cyclicCause.getCause(), ExceptionUtils.getCause(cyclicCause)); +assertSame(((ExceptionWithCause) cyclicCause.getCause()).getCause(), ExceptionUtils.getCause(cyclicCause.getCause())); +assertSame(cyclicCause.getCause(), ExceptionUtils.getCause(((ExceptionWithCause) cyclicCause.getCause()).getCause())); } public void testGetCause_ThrowableArray() { @@ -166,7 +182,7 @@ assertSame(withoutCause, ExceptionUtils.getRootCause(withCause)); assertSame(null, ExceptionUtils.getRootCause(jdkNoCause)); assertSame(null, ExceptionUtils.getRootCause(selfCause)); -assertSame(recursiveCause.getCause().getCause(), ExceptionUtils.getRootCause(recursiveCause)); +assertSame(((ExceptionWithCause) cyclicCause.getCause()).getCause(), ExceptionUtils.getRootCause(cyclicCause)); } public void testSetCause() { @@ -220,7 +236,7 @@ assertEquals(3, ExceptionUtils.getThrowableCount(withCause)); assertEquals(1, ExceptionUtils.getThrowableCount(jdkNoCause)); assertEquals(1, ExceptionUtils.getThrowableCount(selfCause)); -assertEquals(3, ExceptionUtils.getThrowableCount(recursiveCause)); +assertEquals(3, ExceptionUtils.getThrowableCount(cyclicCause)); } //--- @@ -262,11 +278,11 @@ } public void testGetThrowables_Throwable_recursiveCause() { -Throwable[] throwables = ExceptionUtils.getThrowables(recursiveCause); +Throwable[] throwables = ExceptionUtils.getThrowables(cyclicCause); assertEquals(3, throwables.length); -assertSame
svn commit: r432025 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java
Author: ggregory Date: Wed Aug 16 13:36:35 2006 New Revision: 432025 URL: http://svn.apache.org/viewvc?rev=432025view=rev Log: Access to enclosing constructors is emulated by a synthetic accessor methods. Increasing its visibility will improve your performance (Eclipse compiler). Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java?rev=432025r1=432024r2=432025view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java Wed Aug 16 13:36:35 2006 @@ -1993,7 +1993,7 @@ * * pUse the static constant rather than instantiating./p */ -private DefaultToStringStyle() { +protected DefaultToStringStyle() { super(); } @@ -2026,7 +2026,7 @@ * * pUse the static constant rather than instantiating./p */ -private NoFieldNameToStringStyle() { +protected NoFieldNameToStringStyle() { super(); this.setUseFieldNames(false); } @@ -2060,7 +2060,7 @@ * * pUse the static constant rather than instantiating./p */ -private ShortPrefixToStringStyle() { +protected ShortPrefixToStringStyle() { super(); this.setUseShortClassName(true); this.setUseIdentityHashCode(false); @@ -2092,7 +2092,7 @@ * * pUse the static constant rather than instantiating./p */ -private SimpleToStringStyle() { +protected SimpleToStringStyle() { super(); this.setUseClassName(false); this.setUseIdentityHashCode(false); @@ -2128,7 +2128,7 @@ * * pUse the static constant rather than instantiating./p */ -private MultiLineToStringStyle() { +protected MultiLineToStringStyle() { super(); this.setContentStart([); this.setFieldSeparator(SystemUtils.LINE_SEPARATOR + ); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430154 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java
Author: ggregory Date: Wed Aug 9 15:07:04 2006 New Revision: 430154 URL: http://svn.apache.org/viewvc?rev=430154view=rev Log: Unnecessary cast from Object to Enum. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java?rev=430154r1=430153r2=430154view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java Wed Aug 9 15:07:04 2006 @@ -372,7 +372,7 @@ if (entry == null) { return null; } -return (Enum) entry.map.get(getName()); +return entry.map.get(getName()); } // - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430156 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java
Author: ggregory Date: Wed Aug 9 15:08:34 2006 New Revision: 430156 URL: http://svn.apache.org/viewvc?rev=430156view=rev Log: Access to enclosing constructor Enum.Entry() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance (Eclipse compiler). Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java?rev=430156r1=430155r2=430156view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java Wed Aug 9 15:08:34 2006 @@ -296,7 +296,7 @@ /** * pRestrictive constructor./p */ -private Entry() { +protected Entry() { super(); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430157 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java
Author: ggregory Date: Wed Aug 9 15:09:11 2006 New Revision: 430157 URL: http://svn.apache.org/viewvc?rev=430157view=rev Log: Unnecessary cast from Object to Enum. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java?rev=430157r1=430156r2=430157view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java Wed Aug 9 15:09:11 2006 @@ -369,7 +369,7 @@ if (entry == null) { return null; } -return (Enum) entry.map.get(getName()); +return entry.map.get(getName()); } // - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430161 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java
Author: ggregory Date: Wed Aug 9 15:10:03 2006 New Revision: 430161 URL: http://svn.apache.org/viewvc?rev=430161view=rev Log: Access to enclosing constructor Enum.Entry() is emulated by a synthetic accessor method. Increasing its visibility will improve your performance (Eclipse compiler). Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java?rev=430161r1=430160r2=430161view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java Wed Aug 9 15:10:03 2006 @@ -293,7 +293,7 @@ /** * pRestrictive constructor./p */ -private Entry() { +protected Entry() { super(); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430163 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java
Author: ggregory Date: Wed Aug 9 15:11:03 2006 New Revision: 430163 URL: http://svn.apache.org/viewvc?rev=430163view=rev Log: Unnecessary cast from String[] to String[] Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java?rev=430163r1=430162r2=430163view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java Wed Aug 9 15:11:03 2006 @@ -833,7 +833,7 @@ if (excludeFieldNamesParam == null) { this.excludeFieldNames = null; } else { -this.excludeFieldNames = (String[])toNoNullStringArray(excludeFieldNamesParam); +this.excludeFieldNames = toNoNullStringArray(excludeFieldNamesParam); Arrays.sort(this.excludeFieldNames); } return this; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430164 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java
Author: ggregory Date: Wed Aug 9 15:14:15 2006 New Revision: 430164 URL: http://svn.apache.org/viewvc?rev=430164view=rev Log: Remove unused import java.lang.reflect.Field Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java?rev=430164r1=430163r2=430164view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/EqualsBuilderTest.java Wed Aug 9 15:14:15 2006 @@ -15,7 +15,6 @@ */ package org.apache.commons.lang.builder; -import java.lang.reflect.Field; import java.util.Arrays; import junit.framework.Test; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430165 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java
Author: ggregory Date: Wed Aug 9 15:14:51 2006 New Revision: 430165 URL: http://svn.apache.org/viewvc?rev=430165view=rev Log: Remove unused import java.util.Date Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java?rev=430165r1=430164r2=430165view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java Wed Aug 9 15:14:51 2006 @@ -19,7 +19,6 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.util.Calendar; -import java.util.Date; import java.util.TimeZone; import junit.framework.Test; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430166 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java
Author: ggregory Date: Wed Aug 9 15:16:21 2006 New Revision: 430166 URL: http://svn.apache.org/viewvc?rev=430166view=rev Log: Unnecessary cast from char to int Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java?rev=430166r1=430165r2=430166view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java Wed Aug 9 15:16:21 2006 @@ -81,7 +81,7 @@ r1 = RandomStringUtils.randomAscii(50); assertEquals(randomAscii(50) length, 50, r1.length()); for(int i = 0; i r1.length(); i++) { -assertTrue(char between 32 and 127, (int) r1.charAt(i) = 32 (int) r1.charAt(i) = 127); +assertTrue(char between 32 and 127, r1.charAt(i) = 32 r1.charAt(i) = 127); } r2 = RandomStringUtils.randomAscii(50); assertTrue(!r1.equals(r2), !r1.equals(r2)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430167 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java
Author: ggregory Date: Wed Aug 9 15:18:43 2006 New Revision: 430167 URL: http://svn.apache.org/viewvc?rev=430167view=rev Log: Format method for legibility (added some spaces in expressions.) Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java?rev=430167r1=430166r2=430167view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/RandomStringUtilsTest.java Wed Aug 9 15:18:43 2006 @@ -309,9 +309,9 @@ private double chiSquare(int[] expected, int[] observed) { double sumSq = 0.0d; double dev = 0.0d; -for (int i = 0; i observed.length; i++) { -dev = (double)(observed[i] - expected[i]); -sumSq += dev*dev/(double)expected[i]; +for (int i = 0; i observed.length; i++) { +dev = (double) (observed[i] - expected[i]); +sumSq += dev * dev / (double) expected[i]; } return sumSq; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r430168 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java
Author: ggregory Date: Wed Aug 9 15:21:38 2006 New Revision: 430168 URL: http://svn.apache.org/viewvc?rev=430168view=rev Log: Unnecessary cast from char to int Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java?rev=430168r1=430167r2=430168view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringEscapeUtilsTest.java Wed Aug 9 15:21:38 2006 @@ -256,8 +256,8 @@ Character c1 = new Character(i); Character c2 = new Character((char)(i+1)); String expected = c1.toString() + c2.toString(); -String escapedC1 = #x + Integer.toHexString((int)(c1.charValue())) + ;; -String escapedC2 = #x + Integer.toHexString((int)(c2.charValue())) + ;; +String escapedC1 = #x + Integer.toHexString((c1.charValue())) + ;; +String escapedC2 = #x + Integer.toHexString((c2.charValue())) + ;; assertEquals(hex number unescape index + (int)i, expected, StringEscapeUtils.unescapeHtml(escapedC1 + escapedC2)); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r429413 - in /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang: builder/ exception/ math/ time/
Author: ggregory Date: Mon Aug 7 10:57:25 2006 New Revision: 429413 URL: http://svn.apache.org/viewvc?rev=429413view=rev Log: Adds missing serialVersionUID to Serializable classes. A note from http://wiki.eclipse.org/index.php/FAQ_Why_does_the_Eclipse_compiler_create_a_different_serialVersionUID_from_javac%3F: If you don’t explicitly define a serialVersionUID, the language requires that the VM generate one, using some function of all field and method names in the class. The problem is, the compiler generates some synthetic methods that you never see in your source file, and there is no clear specification for how these synthetic method names are generated. Any two compilers are likely to generate different method names, and so the serialVersionUID will be different. Bottom line: Always define the serialVersionUID explicitly in your source files. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/JVMRandom.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java?rev=429413r1=429412r2=429413view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java Mon Aug 7 10:57:25 2006 @@ -32,6 +32,8 @@ */ public class StandardToStringStyle extends ToStringStyle { +private static final long serialVersionUID = 1L; + /** * pConstructor./p */ Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java?rev=429413r1=429412r2=429413view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java Mon Aug 7 10:57:25 2006 @@ -1981,6 +1981,8 @@ */ private static final class DefaultToStringStyle extends ToStringStyle { +private static final long serialVersionUID = 1L; + /** * pConstructor./p * @@ -2012,6 +2014,8 @@ */ private static final class NoFieldNameToStringStyle extends ToStringStyle { +private static final long serialVersionUID = 1L; + /** * pConstructor./p * @@ -2044,6 +2048,8 @@ */ private static final class ShortPrefixToStringStyle extends ToStringStyle { +private static final long serialVersionUID = 1L; + /** * pConstructor./p * @@ -2074,6 +2080,8 @@ */ private static final class SimpleToStringStyle extends ToStringStyle { +private static final long serialVersionUID = 1L; + /** * pConstructor./p * @@ -2107,6 +2115,8 @@ * codeStandardToStringStyle/code to ensure its immutability./p */ private static final class MultiLineToStringStyle extends ToStringStyle { + +private static final long serialVersionUID = 1L; /** * pConstructor./p Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java?rev=429413r1=429412r2=429413view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java Mon Aug 7 10:57:25 2006 @@ -45,6 +45,8 @@ */ public class NestableDelegate implements Serializable { +private static final long
svn commit: r429421 - in /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums: Enum.java ValuedEnum.java
Author: ggregory Date: Mon Aug 7 11:14:27 2006 New Revision: 429421 URL: http://svn.apache.org/viewvc?rev=429421view=rev Log: The Javadoc comment Lang version 1.0.1 serial compatibility is incorrect since these classes came into existance in version 2.1. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java?rev=429421r1=429420r2=429421view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/Enum.java Mon Aug 7 11:14:27 2006 @@ -234,7 +234,11 @@ */ public abstract class Enum implements Comparable, Serializable { -/** Lang version 1.0.1 serial compatibility */ +/** + * Required for serialization support. + * + * @see java.io.Serializable + */ private static final long serialVersionUID = -487045951170455942L; // After discussion, the default size for HashMaps is used, as the Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java?rev=429421r1=429420r2=429421view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enums/ValuedEnum.java Mon Aug 7 11:14:27 2006 @@ -102,7 +102,11 @@ */ public abstract class ValuedEnum extends Enum { -/** Lang version 1.0.1 serial compatibility */ +/** + * Required for serialization support. + * + * @see java.io.Serializable + */ private static final long serialVersionUID = -7129650521543789085L; /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r429439 - in /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang: ./ builder/ enum/ exception/ math/ mutable/ text/ time/
Author: ggregory Date: Mon Aug 7 12:14:31 2006 New Revision: 429439 URL: http://svn.apache.org/viewvc?rev=429439view=rev Log: Javadoc comments for serialVersionUID. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/IllegalClassException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/IncompleteArgumentException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NotImplementedException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NullArgumentException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ObjectUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SerializationException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/UnhandledException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/StandardToStringStyle.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ToStringStyle.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/Enum.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/enum/ValuedEnum.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableError.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableRuntimeException.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/DoubleRange.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/FloatRange.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/Fraction.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/IntRange.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/JVMRandom.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/LongRange.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/math/NumberRange.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableBoolean.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableByte.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableDouble.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableFloat.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableInt.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableLong.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableObject.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableShort.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/CompositeFormat.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java?rev=429439r1=429438r2=429439view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharRange.java Mon Aug 7 12:14:31 2006 @@ -31,7 +31,11 @@ */ public final class CharRange implements Serializable { -/** Serialization lock, Lang version 2.0. */ +/** + * Required for serialization support. Lang version 2.0. + * + * @see java.io.Serializable + */ private static final long serialVersionUID = 8270183163158333422L; /** The first character, inclusive, in the range. */ Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java?rev=429439r1=429438r2=429439view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharSet.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang
svn commit: r398808 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java
Author: ggregory Date: Mon May 1 21:56:12 2006 New Revision: 398808 URL: http://svn.apache.org/viewcvs?rev=398808view=rev Log: Fix Javadoc nits. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java?rev=398808r1=398807r2=398808view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/FastDateFormat.java Mon May 1 21:56:12 2006 @@ -545,7 +545,7 @@ } /** - * pInitialise the instance for first use./p + * pInitializes the instance for first use./p */ protected void init() { List rulesList = parsePattern(); @@ -887,7 +887,7 @@ // Parsing //--- /** - * pParsing not supported./p + * pParsing is not supported./p * * @param source the string to parse * @param pos the parsing position @@ -945,7 +945,7 @@ } /** - * pGets an estimate for the maximum string length that the + * pGets an estimate for the maximum string length that the * formatter will produce./p * * pThe actual formatted length will almost always be less than or @@ -960,7 +960,7 @@ // Basics //--- /** - * pCompare two objects for equality./p + * pCompares two objects for equality./p * * @param obj the object to compare to * @return codetrue/code if equal @@ -983,7 +983,7 @@ } /** - * pA suitable hashcode./p + * pReturns a hashcode compatible with equals./p * * @return a hashcode compatible with equals */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r398809 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java
Author: ggregory Date: Mon May 1 21:58:09 2006 New Revision: 398809 URL: http://svn.apache.org/viewcvs?rev=398809view=rev Log: Fix Javadoc nit: use the active voice. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java?rev=398809r1=398808r2=398809view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DateFormatUtils.java Mon May 1 21:58:09 2006 @@ -116,7 +116,7 @@ } /** - * pFormat a date/time into a specific pattern using the UTC time zone./p + * pFormats a date/time into a specific pattern using the UTC time zone./p * * @param millis the date to format expressed in milliseconds * @param pattern the pattern to use to format the date @@ -127,7 +127,7 @@ } /** - * pFormat a date/time into a specific pattern using the UTC time zone./p + * pFormats a date/time into a specific pattern using the UTC time zone./p * * @param date the date to format * @param pattern the pattern to use to format the date @@ -138,7 +138,7 @@ } /** - * pFormat a date/time into a specific pattern using the UTC time zone./p + * pFormats a date/time into a specific pattern using the UTC time zone./p * * @param millis the date to format expressed in milliseconds * @param pattern the pattern to use to format the date @@ -150,7 +150,7 @@ } /** - * pFormat a date/time into a specific pattern using the UTC time zone./p + * pFormats a date/time into a specific pattern using the UTC time zone./p * * @param date the date to format * @param pattern the pattern to use to format the date @@ -162,7 +162,7 @@ } /** - * pFormat a date/time into a specific pattern./p + * pFormats a date/time into a specific pattern./p * * @param millis the date to format expressed in milliseconds * @param pattern the pattern to use to format the date @@ -173,7 +173,7 @@ } /** - * pFormat a date/time into a specific pattern./p + * pFormats a date/time into a specific pattern./p * * @param date the date to format * @param pattern the pattern to use to format the date @@ -184,7 +184,7 @@ } /** - * pFormat a date/time into a specific pattern in a time zone./p + * pFormats a date/time into a specific pattern in a time zone./p * * @param millis the time expressed in milliseconds * @param pattern the pattern to use to format the date @@ -196,7 +196,7 @@ } /** - * pFormat a date/time into a specific pattern in a time zone./p + * pFormats a date/time into a specific pattern in a time zone./p * * @param date the date to format * @param pattern the pattern to use to format the date @@ -208,7 +208,7 @@ } /** - * pFormat a date/time into a specific pattern in a locale./p + * pFormats a date/time into a specific pattern in a locale./p * * @param millis the date to format expressed in milliseconds * @param pattern the pattern to use to format the date @@ -220,7 +220,7 @@ } /** - * pFormat a date/time into a specific pattern in a locale./p + * pFormats a date/time into a specific pattern in a locale./p * * @param date the date to format * @param pattern the pattern to use to format the date @@ -232,7 +232,7 @@ } /** - * pFormat a date/time into a specific pattern in a time zone and locale./p + * pFormats a date/time into a specific pattern in a time zone and locale./p * * @param millis the date to format expressed in milliseconds * @param pattern the pattern to use to format the date @@ -245,7 +245,7 @@ } /** - * pFormat a date/time into a specific pattern in a time zone and locale./p + * pFormats a date/time into a specific pattern in a time zone and locale./p * * @param date the date to format * @param pattern the pattern to use to format the date - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r394614 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java
Author: ggregory Date: Sun Apr 16 23:18:07 2006 New Revision: 394614 URL: http://svn.apache.org/viewcvs?rev=394614view=rev Log: [lang] Using ReflectionToStringBuilder and excluding secure fields. ASF Bugzilla Bug 36925. http://issues.apache.org/bugzilla/show_bug.cgi?id=36925 Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java?rev=394614r1=394613r2=394614view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java Sun Apr 16 23:18:07 2006 @@ -19,10 +19,15 @@ import java.lang.reflect.AccessibleObject; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashSet; +import java.util.Iterator; +import java.util.List; import java.util.Set; +import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.ClassUtils; /** @@ -395,7 +400,57 @@ } /** - * Builds a String for a toString method excluding the given field name. + * Builds a String for a toString method excluding the given field names. + * + * @param object + *The object to toString. + * @param excludeFieldNames + *The field names to exclude. Null excludes nothing. + * @return The toString value. + */ +public static String toStringExclude(Object object, Collection excludeFieldNames) { +return toStringExclude(object, toNoNullStringArray(excludeFieldNames)); +} + +/** + * Converts the given Collection into an array of Strings. The returned array does not contain codenull/code + * entries. Note that [EMAIL PROTECTED] Arrays#sort(Object[])} will throw an [EMAIL PROTECTED] NullPointerException} if an array element + * is codenull/code. + * + * @param collection + *The collection to convert + * @return A new array of Strings. + */ +private static String[] toNoNullStringArray(Collection collection) { +if (collection == null) { +return ArrayUtils.EMPTY_STRING_ARRAY; +} +return toNoNullStringArray(collection.toArray()); +} + +/** + * Returns a new array of Strings without null elements. Internal method used to normalize exclude lists + * (arrays and collections). Note that [EMAIL PROTECTED] Arrays#sort(Object[])} will throw an [EMAIL PROTECTED] NullPointerException} + * if an array element is codenull/code. + * + * @param array + *The array to check + * @return The given array or a new array without null. + */ +private static String[] toNoNullStringArray(Object[] array) { +ArrayList list = new ArrayList(array.length); +for (int i = 0; i array.length; i++) { +Object e = array[i]; +if (e != null) { +list.add(e.toString()); +} +} +return (String[]) list.toArray(ArrayUtils.EMPTY_STRING_ARRAY); +} + + +/** + * Builds a String for a toString method excluding the given field names. * * @param object *The object to toString. @@ -772,15 +827,16 @@ * Sets the field names to exclude. * * @param excludeFieldNamesParam - *The excludeFieldNames to set. + *The excludeFieldNames to excluding from toString or codenull/code. * @return codethis/code */ public ReflectionToStringBuilder setExcludeFieldNames(String[] excludeFieldNamesParam) { if (excludeFieldNamesParam == null) { this.excludeFieldNames = null; +} else { +this.excludeFieldNames = (String[])toNoNullStringArray(excludeFieldNamesParam); +Arrays.sort(this.excludeFieldNames); } -this.excludeFieldNames = (String[]) excludeFieldNamesParam.clone(); -Arrays.sort(this.excludeFieldNames); return this; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r394615 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java
Author: ggregory Date: Sun Apr 16 23:18:22 2006 New Revision: 394615 URL: http://svn.apache.org/viewcvs?rev=394615view=rev Log: [lang] Using ReflectionToStringBuilder and excluding secure fields. ASF Bugzilla Bug 36925. http://issues.apache.org/bugzilla/show_bug.cgi?id=36925 Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java?rev=394615r1=394614r2=394615view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java Sun Apr 16 23:18:22 2006 @@ -16,9 +16,15 @@ package org.apache.commons.lang.builder; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + import junit.framework.Assert; import junit.framework.TestCase; +import org.apache.commons.lang.ArrayUtils; + /** * @author a href=mailto:[EMAIL PROTECTED]ggregory/a * @version $Id$ @@ -31,8 +37,6 @@ private String showField = NOT_SECRET_VALUE; } -private static final int INDEX_NOT_FOUND = -1; - private static final String NOT_SECRET_FIELD = showField; private static final String NOT_SECRET_VALUE = Hello World!; @@ -41,19 +45,80 @@ private static final String SECRET_VALUE = secret value; -public void test_toStringExcluding() { +public void test_toStringExclude() { String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), SECRET_FIELD); -this.validateToStringValue(toString); +this.validateSecretFieldAbsent(toString); } -public void test_toStringExcludingArray() { +public void test_toStringExcludeArray() { String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), new String[]{SECRET_FIELD}); -this.validateToStringValue(toString); +this.validateSecretFieldAbsent(toString); +} + +public void test_toStringExcludeArrayWithNull() { +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), new String[]{null}); +this.validateSecretFieldPresent(toString); +} + +public void test_toStringExcludeArrayWithNulls() { +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), new String[]{null, null}); +this.validateSecretFieldPresent(toString); +} + +public void test_toStringExcludeCollection() { +List excludeList = new ArrayList(); +excludeList.add(SECRET_FIELD); +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), excludeList); +this.validateSecretFieldAbsent(toString); +} + +public void test_toStringExcludeCollectionWithNull() { +List excludeList = new ArrayList(); +excludeList.add(null); +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), excludeList); +this.validateSecretFieldPresent(toString); +} + +public void test_toStringExcludeCollectionWithNulls() { +List excludeList = new ArrayList(); +excludeList.add(null); +excludeList.add(null); +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), excludeList); +this.validateSecretFieldPresent(toString); +} + +public void test_toStringExcludeEmptyArray() { +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), ArrayUtils.EMPTY_STRING_ARRAY); +this.validateSecretFieldPresent(toString); +} + +public void test_toStringExcludeEmptyCollection() { +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), new ArrayList()); +this.validateSecretFieldPresent(toString); +} + +public void test_toStringExcludeNullArray() { +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), (String[]) null); +this.validateSecretFieldPresent(toString); +} + +public void test_toStringExcludeNullCollection() { +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), (Collection) null); +this.validateSecretFieldPresent(toString); +} + +private void validateNonSecretField(String toString) { +Assert.assertTrue(toString.indexOf(NOT_SECRET_FIELD) ArrayUtils.INDEX_NOT_FOUND); +Assert.assertTrue(toString.indexOf(NOT_SECRET_VALUE) ArrayUtils.INDEX_NOT_FOUND); +} + +private void validateSecretFieldAbsent
svn commit: r389310 - in /jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl: GenericKeyedObjectPool.java GenericObjectPool.java
Author: ggregory Date: Mon Mar 27 14:18:24 2006 New Revision: 389310 URL: http://svn.apache.org/viewcvs?rev=389310view=rev Log: Fixed 18 instances of the misspelled word eligible (was eligable) in Javadocs. Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericObjectPool.java Modified: jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java?rev=389310r1=389309r2=389310view=diff == --- jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java (original) +++ jakarta/commons/proper/pool/trunk/src/java/org/apache/commons/pool/impl/GenericKeyedObjectPool.java Mon Mar 27 14:18:24 2006 @@ -108,7 +108,7 @@ * li * [EMAIL PROTECTED] #setMinEvictableIdleTimeMillis minEvictableIdleTimeMillis} * specifies the minimum amount of time that an object may sit idle in the pool - * before it is eligable for eviction due to idle time. When non-positive, no object + * before it is eligible for eviction due to idle time. When non-positive, no object * will be dropped from the pool due to idle time alone. * /li * li @@ -365,7 +365,7 @@ * @param testOnReturn whether or not to validate objects after they are returned to the [EMAIL PROTECTED] #returnObject} method (see [EMAIL PROTECTED] #setTestOnReturn}) * @param timeBetweenEvictionRunsMillis the amount of time (in milliseconds) to sleep between examining idle objects for eviction (see [EMAIL PROTECTED] #setTimeBetweenEvictionRunsMillis}) * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread (if any) (see [EMAIL PROTECTED] #setNumTestsPerEvictionRun}) - * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligable for evcition (see [EMAIL PROTECTED] #setMinEvictableIdleTimeMillis}) + * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for evcition (see [EMAIL PROTECTED] #setMinEvictableIdleTimeMillis}) * @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any (see [EMAIL PROTECTED] #setTestWhileIdle}) */ public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) { @@ -384,7 +384,7 @@ * @param testOnReturn whether or not to validate objects after they are returned to the [EMAIL PROTECTED] #returnObject} method (see [EMAIL PROTECTED] #setTestOnReturn}) * @param timeBetweenEvictionRunsMillis the amount of time (in milliseconds) to sleep between examining idle objects for eviction (see [EMAIL PROTECTED] #setTimeBetweenEvictionRunsMillis}) * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread (if any) (see [EMAIL PROTECTED] #setNumTestsPerEvictionRun}) - * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligable for evcition (see [EMAIL PROTECTED] #setMinEvictableIdleTimeMillis}) + * @param minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for evcition (see [EMAIL PROTECTED] #setMinEvictableIdleTimeMillis}) * @param testWhileIdle whether or not to validate objects in the idle object eviction thread, if any (see [EMAIL PROTECTED] #setTestWhileIdle}) */ public GenericKeyedObjectPool(KeyedPoolableObjectFactory factory, int maxActive, byte whenExhaustedAction, long maxWait, int maxIdle, int maxTotal, boolean testOnBorrow, boolean testOnReturn, long timeBetweenEvictionRunsMillis, int numTestsPerEvictionRun, long minEvictableIdleTimeMillis, boolean testWhileIdle) { @@ -404,7 +404,7 @@ * @param testOnReturn whether or not to validate objects after they are returned to the [EMAIL PROTECTED] #returnObject} method (see [EMAIL PROTECTED] #setTestOnReturn}) * @param timeBetweenEvictionRunsMillis the amount of time (in milliseconds) to sleep between examining idle objects for eviction (see [EMAIL PROTECTED] #setTimeBetweenEvictionRunsMillis}) * @param numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread (if any) (see [EMAIL PROTECTED
svn commit: r387337 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java
Author: ggregory Date: Mon Mar 20 15:12:50 2006 New Revision: 387337 URL: http://svn.apache.org/viewcvs?rev=387337view=rev Log: Remove unnecessary semicolon. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java?rev=387337r1=387336r2=387337view=diff == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/FileUtils.java Mon Mar 20 15:12:50 2006 @@ -844,7 +844,7 @@ try { Thread.sleep(100); } catch (InterruptedException ignore) { -; +// ignore exception } catch (Exception ex) { break; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r387353 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java
Author: ggregory Date: Mon Mar 20 16:09:47 2006 New Revision: 387353 URL: http://svn.apache.org/viewcvs?rev=387353view=rev Log: Remove unnecessary casts from int to int. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java?rev=387353r1=387352r2=387353view=diff == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java Mon Mar 20 16:09:47 2006 @@ -140,7 +140,7 @@ * @return the value read */ public static int readSwappedUnsignedShort(byte[] data, int offset) { -return (int)( ( ( data[ offset + 0 ] 0xff ) 0 ) + +return ( ( ( data[ offset + 0 ] 0xff ) 0 ) + ( ( data[ offset + 1 ] 0xff ) 8 ) ); } @@ -166,7 +166,7 @@ * @return the value read */ public static int readSwappedInteger(byte[] data, int offset) { -return (int)( ( ( data[ offset + 0 ] 0xff ) 0 ) + +return ( ( ( data[ offset + 0 ] 0xff ) 0 ) + ( ( data[ offset + 1 ] 0xff ) 8 ) + ( ( data[ offset + 2 ] 0xff ) 16 ) + ( ( data[ offset + 3 ] 0xff ) 24 ) ); @@ -311,7 +311,7 @@ int value1 = read( input ); int value2 = read( input ); -return (int)( ( ( value1 0xff ) 0 ) + +return ( ( ( value1 0xff ) 0 ) + ( ( value2 0xff ) 8 ) ); } @@ -346,7 +346,7 @@ int value3 = read( input ); int value4 = read( input ); -return (int)( ( ( value1 0xff ) 0 ) + +return ( ( ( value1 0xff ) 0 ) + ( ( value2 0xff ) 8 ) + ( ( value3 0xff ) 16 ) + ( ( value4 0xff ) 24 ) ); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r387355 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ByteArrayOutputStream.java
Author: ggregory Date: Mon Mar 20 16:15:55 2006 New Revision: 387355 URL: http://svn.apache.org/viewcvs?rev=387355view=rev Log: Javadoc exceptions. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ByteArrayOutputStream.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ByteArrayOutputStream.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ByteArrayOutputStream.java?rev=387355r1=387354r2=387355view=diff == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ByteArrayOutputStream.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ByteArrayOutputStream.java Mon Mar 20 16:15:55 2006 @@ -183,6 +183,9 @@ } /** + * @exception IOException + *if an I/O error occurs. In particular, an codeIOException/code is thrown if the output + *stream is closed. * @see java.io.ByteArrayOutputStream#writeTo(OutputStream) */ public synchronized void writeTo(OutputStream out) throws IOException { @@ -226,6 +229,8 @@ } /** + * @exception UnsupportedEncodingException + *If the named charset is not supported * @see java.io.ByteArrayOutputStream#toString(String) */ public String toString(String enc) throws UnsupportedEncodingException { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r387356 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java
Author: ggregory Date: Mon Mar 20 16:21:17 2006 New Revision: 387356 URL: http://svn.apache.org/viewcvs?rev=387356view=rev Log: Remove unnecessary casts from int to long. Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java?rev=387356r1=387355r2=387356view=diff == --- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java (original) +++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java Mon Mar 20 16:21:17 2006 @@ -181,7 +181,7 @@ * @return the value read */ public static long readSwappedUnsignedInteger(byte[] data, int offset) { -return (long)( ( ( data[ offset + 0 ] 0xff ) 0 ) + +return ( ( ( data[ offset + 0 ] 0xff ) 0 ) + ( ( data[ offset + 1 ] 0xff ) 8 ) + ( ( data[ offset + 2 ] 0xff ) 16 ) + ( ( data[ offset + 3 ] 0xff ) 24 ) ); @@ -213,16 +213,16 @@ * @return the value read */ public static long readSwappedLong(byte[] data, int offset) { -long low = (long)( +long low = ( ( data[ offset + 0 ] 0xff ) 0 ) + ( ( data[ offset + 1 ] 0xff ) 8 ) + ( ( data[ offset + 2 ] 0xff ) 16 ) + -( ( data[ offset + 3 ] 0xff ) 24 ) ); -long high = (long)( +( ( data[ offset + 3 ] 0xff ) 24 ); +long high = ( ( data[ offset + 4 ] 0xff ) 0 ) + ( ( data[ offset + 5 ] 0xff ) 8 ) + ( ( data[ offset + 6 ] 0xff ) 16 ) + -( ( data[ offset + 7 ] 0xff ) 24 ) ); +( ( data[ offset + 7 ] 0xff ) 24 ); return low + (high 32); } @@ -346,10 +346,10 @@ int value3 = read( input ); int value4 = read( input ); -return ( ( ( value1 0xff ) 0 ) + +return ( ( value1 0xff ) 0 ) + ( ( value2 0xff ) 8 ) + ( ( value3 0xff ) 16 ) + -( ( value4 0xff ) 24 ) ); +( ( value4 0xff ) 24 ); } /** @@ -367,10 +367,10 @@ int value3 = read( input ); int value4 = read( input ); -return (long)( ( ( value1 0xff ) 0 ) + +return ( ( value1 0xff ) 0 ) + ( ( value2 0xff ) 8 ) + ( ( value3 0xff ) 16 ) + -( ( value4 0xff ) 24 ) ); +( ( value4 0xff ) 24 ); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r384095 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/CharEncodingTest.java
Author: ggregory Date: Tue Mar 7 18:25:50 2006 New Revision: 384095 URL: http://svn.apache.org/viewcvs?rev=384095view=rev Log: Cobertura unit test coverage is now 100%. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/CharEncodingTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/CharEncodingTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/CharEncodingTest.java?rev=384095r1=384094r2=384095view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/CharEncodingTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/CharEncodingTest.java Tue Mar 7 18:25:50 2006 @@ -44,6 +44,13 @@ assertTrue(Encoding should be supported: + name, CharEncoding.isSupported(name)); } +/** + * The class can be instantiated. + */ +public void testConstructor() { +new CharEncoding(); +} + public void testMustBeSupportedJava1_3_1() { if (SystemUtils.isJavaVersionAtLeast(1.3f)) { this.assertSupportedEncoding(CharEncoding.ISO_8859_1); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r378403 - /jakarta/commons/proper/codec/trunk/project.properties
Author: ggregory Date: Thu Feb 16 16:15:40 2006 New Revision: 378403 URL: http://svn.apache.org/viewcvs?rev=378403view=rev Log: Following instructions in: https://svn.apache.org/repos/private/committers/donated-licenses/clover/README.txt Modified: jakarta/commons/proper/codec/trunk/project.properties Modified: jakarta/commons/proper/codec/trunk/project.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/codec/trunk/project.properties?rev=378403r1=378402r2=378403view=diff == --- jakarta/commons/proper/codec/trunk/project.properties (original) +++ jakarta/commons/proper/codec/trunk/project.properties Thu Feb 16 16:15:40 2006 @@ -60,3 +60,7 @@ # Corresponds to the source attribute for the ant javac task. # Valid values are 1.3, 1.4, 1.5. maven.compile.source = 1.3 + +# See https://svn.apache.org/repos/private/committers/donated-licenses/clover/README.txt +maven.jar.override=on +maven.jar.clover=1.3.2 \ No newline at end of file - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r366980 - /jakarta/commons/proper/codec/trunk/xdocs/changes.xml
Author: ggregory Date: Sat Jan 7 19:25:20 2006 New Revision: 366980 URL: http://svn.apache.org/viewcvs?rev=366980view=rev Log: From version 1.3 to 1.4-dev. Modified: jakarta/commons/proper/codec/trunk/xdocs/changes.xml Modified: jakarta/commons/proper/codec/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/codec/trunk/xdocs/changes.xml?rev=366980r1=366979r2=366980view=diff == --- jakarta/commons/proper/codec/trunk/xdocs/changes.xml (original) +++ jakarta/commons/proper/codec/trunk/xdocs/changes.xml Sat Jan 7 19:25:20 2006 @@ -16,84 +16,90 @@ -- !-- $Id$ -- document -properties -titleChanges/title -authorGary D. Gregory/author -/properties -body -release version=1.3 date=10 July 2004 description=Feature and fix release. -action dev=ggregory, tobrien type=add issue=27813 due-to=Alex Karasulu + properties + titleChanges/title + authorGary D. Gregory/author + /properties + body + release version=1.4-dev date=4 May 2005 description=Feature and fix release. + action dev=ggregory, type=add issue=34157 due-to=Jamie Flournoy due-to-email=[EMAIL PROTECTED] + DigestUtils: Add methods for SHA-256, SHA-384, and SHA-512./action + action dev=ggregory, type=fix issue=30825 due-to=Piero Ottuzzi due-to-email=[EMAIL PROTECTED] + Base64.isArrayByteBase64() throws an ArrayIndexOutOfBoundsException for negative octets./action + /release + release version=1.3 date=10 July 2004 description=Feature and fix release. + action dev=ggregory, tobrien type=add issue=27813 due-to=Alex Karasulu BinaryCodec: Encodes and decodes binary to and from Strings of 0s and 1s. /action -action dev=ggregory type=add issue=26617 due-to=Oleg Kalnichevski due-to-email=[EMAIL PROTECTED] + action dev=ggregory type=add issue=26617 due-to=Oleg Kalnichevski due-to-email=[EMAIL PROTECTED] QuotedPrintableCodec: Codec for RFC 1521 MIME (Multipurpose Internet Mail Extensions) Part One. Rules #3, #4, and #5 of the quoted-printable spec are not implemented yet. See also issue 27789. /action -action dev=ggregory type=add issue=26617 due-to=Oleg Kalnichevski due-to-email=[EMAIL PROTECTED] + action dev=ggregory type=add issue=26617 due-to=Oleg Kalnichevski due-to-email=[EMAIL PROTECTED] BCodec: Identical to the Base64 encoding defined by RFC 1521 and allows a character set to be specified. /action -action dev=ggregory type=add issue=26617 due-to=Oleg Kalnichevski due-to-email=[EMAIL PROTECTED] + action dev=ggregory type=add issue=26617 due-to=Oleg Kalnichevski due-to-email=[EMAIL PROTECTED] QCodec: Similar to the Quoted-Printable content-transfer-encoding defined in RFC 1521 and designed to allow text containing mostly ASCII characters to be decipherable on an ASCII terminal without decoding. /action -action dev=ggregory type=add issue=25243 due-to=Matthew Inger due-to-email=[EMAIL PROTECTED] + action dev=ggregory type=add issue=25243 due-to=Matthew Inger due-to-email=[EMAIL PROTECTED] Soundex: Implemented the DIFFERENCE algorithm. /action -action dev=ggregory type=add issue=25243 due-to=Matthew Inger due-to-email=[EMAIL PROTECTED] + action dev=ggregory type=add issue=25243 due-to=Matthew Inger due-to-email=[EMAIL PROTECTED] RefinedSoundex: Implemented the DIFFERENCE algorithm. /action -action dev=ggregory type=update + action dev=ggregory type=update This version is relesed under the a href=http://www.apache.org/licenses/LICENSE-2.0;Apache License 2.0/a , please see LICENSE.txt. Previous versions were released under the Apache License 1.1. /action -action dev=ggregory type=update + action dev=ggregory type=update The Board recommendation to remove Javadoc author tags has been implemented. All author tags are now Apache Software Foundation. /action -action dev=ggregory type=fix issue=25995 due-to=Oleg Kalnichevski due-to-email=[EMAIL PROTECTED] + action dev=ggregory type=fix issue=25995 due-to=Oleg Kalnichevski due-to-email=[EMAIL PROTECTED] The default URL encoding logic was broken. /action -action dev=ggregory type=fix issue=27781 due-to=Gary D. Gregory
svn commit: r366981 - /jakarta/commons/proper/lang/trunk/project.xml
Author: ggregory Date: Sat Jan 7 19:45:55 2006 New Revision: 366981 URL: http://svn.apache.org/viewcvs?rev=366981view=rev Log: Added: dependency groupIdmaven-plugins/groupId artifactIdmaven-cobertura-plugin/artifactId version1.1.1/version typeplugin/type /dependency Modified: jakarta/commons/proper/lang/trunk/project.xml Modified: jakarta/commons/proper/lang/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/project.xml?rev=366981r1=366980r2=366981view=diff == --- jakarta/commons/proper/lang/trunk/project.xml (original) +++ jakarta/commons/proper/lang/trunk/project.xml Sat Jan 7 19:45:55 2006 @@ -367,6 +367,12 @@ artifactIdjunit/artifactId version3.8.1/version /dependency + dependency + groupIdmaven-plugins/groupId + artifactIdmaven-cobertura-plugin/artifactId + version1.1.1/version + typeplugin/type + /dependency !-- dependency groupIdmaven-plugins/groupId - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r366225 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/exception/ExceptionUtils.java test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java
Author: ggregory Date: Thu Jan 5 09:35:43 2006 New Revision: 366225 URL: http://svn.apache.org/viewcvs?rev=366225view=rev Log: http://issues.apache.org/bugzilla/show_bug.cgi?id=37574 [lang] [PATCH] new ExceptionUtils.setCause() method Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java?rev=366225r1=366224r2=366225view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/ExceptionUtils.java Thu Jan 5 09:35:43 2006 @@ -31,10 +31,11 @@ import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.SystemUtils; +import org.apache.commons.lang.NullArgumentException; /** * pProvides utilities for manipulating and examining - * codeThrowable/code objects./p +codeThrowable/code objects./p * * @author a href=mailto:dlr@finemaltcoding.com;Daniel Rall/a * @author Dmitri Plotnikov @@ -73,22 +74,40 @@ }; /** - * pThe Method object for JDK1.4 getCause./p + * p + * The Method object for Java 1.4 getCause. + * /p */ private static final Method THROWABLE_CAUSE_METHOD; + +/** + * p + * The Method object for Java 1.4 initCause. + * /p + */ +private static final Method THROWABLE_INITCAUSE_METHOD; + static { -Method getCauseMethod; +Method causeMethod; try { -getCauseMethod = Throwable.class.getMethod(getCause, null); +causeMethod = Throwable.class.getMethod(getCause, null); } catch (Exception e) { -getCauseMethod = null; +causeMethod = null; } -THROWABLE_CAUSE_METHOD = getCauseMethod; +THROWABLE_CAUSE_METHOD = causeMethod; +try { +causeMethod = Throwable.class.getMethod(initCause, new Class[]{Throwable.class}); +} catch (Exception e) { +causeMethod = null; +} +THROWABLE_INITCAUSE_METHOD = causeMethod; } /** - * pPublic constructor allows an instance of codeExceptionUtils/code - * to be created, although that is not normally necessary./p + * p + * Public constructor allows an instance of codeExceptionUtils/code to be created, although that is not + * normally necessary. + * /p */ public ExceptionUtils() { super(); @@ -130,6 +149,72 @@ } /** + * p + * Sets the cause of a codeThrowable/code using introspection, allowing source code compatibility between + * pre-1.4 and post-1.4 Java releases. + * /p + * + * p + * The typical use of this method is inside a constructor as in the following example: + * /p + * + * p + * pre + * import org.apache.commons.lang.exception.ExceptionUtils; + * + * public class MyException extends Exception { + * + *public MyException(String msg) { + * super(msg); + *} + * + *public MyException(String msg, Throwable cause) { + * super(msg); + * ExceptionUtils.setCause(this, cause); + *} + * + * } + * /pre + * /p + * + * @param target + *the target codeThrowable/code + * @param cause + *the codeThrowable/code to set in the target + * @return a codetrue/code if the target has been modified + * @since 2.2 + */ +public static boolean setCause(Throwable target, Throwable cause) { +if (target == null) { +throw new NullArgumentException(target); +} +Object[] causeArgs = new Object[]{cause}; +boolean modifiedTarget = false; +if (THROWABLE_INITCAUSE_METHOD != null) { +try { +THROWABLE_INITCAUSE_METHOD.invoke(target, causeArgs); +modifiedTarget = true; +} catch (IllegalAccessException ignored) { +// Exception ignored. +} catch (InvocationTargetException ignored) { +// Exception ignored. +} +} +try { +Method setCauseMethod = target.getClass().getMethod(setCause, new Class[]{Throwable.class}); +setCauseMethod.invoke(target, causeArgs); +modifiedTarget = true; +} catch (NoSuchMethodException ignored) { +// Exception ignored. +} catch
svn commit: r366227 - /jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt
Author: ggregory Date: Thu Jan 5 09:39:55 2006 New Revision: 366227 URL: http://svn.apache.org/viewcvs?rev=366227view=rev Log: http://issues.apache.org/bugzilla/show_bug.cgi?id=37574 [lang] [PATCH] new ExceptionUtils.setCause() method Modified: jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt Modified: jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt?rev=366227r1=366226r2=366227view=diff == --- jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt (original) +++ jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt Thu Jan 5 09:39:55 2006 @@ -85,6 +85,7 @@ - ExceptionUtils - added indexOfType methods that check subclasses, thus leaving the existing indexOfThrowable method untouched (see incompatible changes section) +-- new ExceptionUtils method setCause() - NumberUtils - various string to number parsing methods added @@ -100,6 +101,7 @@ 37111 Request for MutableBoolean implementation 36512 Enhanced Class.forName version 37596 DurationFormatUtils.formatDurationWords 11 units gets converted to 11 unit +37574 New ExceptionUtils method setCause() BUG FIXES IN 2.1: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r348311 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/time/DurationFormatUtils.java test/org/apache/commons/lang/time/DurationFormatUtilsTest.java
Author: ggregory Date: Tue Nov 22 16:19:44 2005 New Revision: 348311 URL: http://svn.apache.org/viewcvs?rev=348311view=rev Log: http://issues.apache.org/bugzilla/show_bug.cgi?id=37596 The method DurationFormatUtils.formatDurationWords incorrectly outputs numbers ending in 1 without a plural s postfix for the time unit. Added a fix and tests that 1 units gets converted to 1 unit but that 11 units is left alone. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java?rev=348311r1=348310r2=348311view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java Tue Nov 22 16:19:44 2005 @@ -211,11 +211,12 @@ } } // handle plurals -duration = StringUtils.replaceOnce(duration, 1 seconds, 1 second); -duration = StringUtils.replaceOnce(duration, 1 minutes, 1 minute); -duration = StringUtils.replaceOnce(duration, 1 hours, 1 hour); -duration = StringUtils.replaceOnce(duration, 1 days, 1 day); -return duration; +duration = + duration; +duration = StringUtils.replaceOnce(duration, 1 seconds, 1 second); +duration = StringUtils.replaceOnce(duration, 1 minutes, 1 minute); +duration = StringUtils.replaceOnce(duration, 1 hours, 1 hour); +duration = StringUtils.replaceOnce(duration, 1 days, 1 day); +return duration.trim(); } //--- Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java?rev=348311r1=348310r2=348311view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java Tue Nov 22 16:19:44 2005 @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.commons.lang.time; import java.lang.reflect.Constructor; @@ -27,7 +28,7 @@ /** * TestCase for DurationFormatUtils. - * + * * @author Apache Ant - DateUtilsTest * @author a href=mailto:[EMAIL PROTECTED]Stephane Bailliez/a * @author a href=mailto:[EMAIL PROTECTED]Stefan Bodewig/a @@ -51,7 +52,7 @@ super(s); } -//--- +// --- public void testConstructor() { assertNotNull(new DurationFormatUtils()); Constructor[] cons = DurationFormatUtils.class.getDeclaredConstructors(); @@ -60,89 +61,162 @@ assertEquals(true, Modifier.isPublic(DurationFormatUtils.class.getModifiers())); assertEquals(false, Modifier.isFinal(DurationFormatUtils.class.getModifiers())); } - -//--- -public void testFormatDurationWords(){ + +// --- +public void testFormatDurationWords() { String text = null; - -text = DurationFormatUtils.formatDurationWords(50*1000, true, false); + +text = DurationFormatUtils.formatDurationWords(50 * 1000, true, false); assertEquals(50 seconds, text); -text = DurationFormatUtils.formatDurationWords(65*1000, true, false); +text = DurationFormatUtils.formatDurationWords(65 * 1000, true, false); assertEquals(1 minute 5 seconds, text); -text = DurationFormatUtils.formatDurationWords(120*1000, true, false); +text = DurationFormatUtils.formatDurationWords(120 * 1000, true, false); assertEquals(2 minutes 0 seconds, text); -text = DurationFormatUtils.formatDurationWords(121*1000, true, false); +text = DurationFormatUtils.formatDurationWords(121 * 1000, true, false); assertEquals(2 minutes 1 second, text); -text = DurationFormatUtils.formatDurationWords(72*60*1000, true, false); +text
svn commit: r348313 - /jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt
Author: ggregory Date: Tue Nov 22 16:22:07 2005 New Revision: 348313 URL: http://svn.apache.org/viewcvs?rev=348313view=rev Log: 37596 DurationFormatUtils.formatDurationWords 11 units gets converted to 11 unit Modified: jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt Modified: jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt?rev=348313r1=348312r2=348313view=diff == --- jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt (original) +++ jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt Tue Nov 22 16:22:07 2005 @@ -99,6 +99,7 @@ 37111 Request for MutableBoolean implementation 36512 Enhanced Class.forName version +37596 DurationFormatUtils.formatDurationWords 11 units gets converted to 11 unit BUG FIXES IN 2.1: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r329277 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java
Author: ggregory Date: Fri Oct 28 12:49:47 2005 New Revision: 329277 URL: http://svn.apache.org/viewcvs?rev=329277view=rev Log: Minor Javadoc (style.) Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java?rev=329277r1=329276r2=329277view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/time/DurationFormatUtils.java Fri Oct 28 12:49:47 2005 @@ -67,7 +67,7 @@ //--- /** - * pGet the time gap as a string./p + * pFormats the time gap as a string./p * * pThe format used is ISO8601-like: * iH/i:im/i:is/i.iS/i./p @@ -80,7 +80,7 @@ } /** - * pGet the time gap as a string./p + * pFormats the time gap as a string./p * * pThe format used is the ISO8601 period format./p * @@ -95,7 +95,7 @@ } /** - * pGet the time gap as a string, using the specified format, and padding with zeros and + * pFormats the time gap as a string, using the specified format, and padding with zeros and * using the default timezone./p * * pThis method formats durations using the days and lower fields of the @@ -110,7 +110,7 @@ } /** - * pGet the time gap as a string, using the specified format. + * pFormats the time gap as a string, using the specified format. * Padding the left hand side of numbers with zeroes is optional and * the timezone may be specified./p * @@ -156,7 +156,7 @@ } /** - * pFormat an elapsed time into a plurialization correct string./p + * pFormats an elapsed time into a plurialization correct string./p * * pThis method formats durations using the days and lower fields of the * format pattern. Months and larger are not used./p @@ -220,7 +220,7 @@ //--- /** - * pGet the time gap as a string./p + * pFormats the time gap as a string./p * * pThe format used is the ISO8601 period format./p * @@ -233,7 +233,7 @@ } /** - * pGet the time gap as a string, using the specified format. + * pFormats the time gap as a string, using the specified format. * Padding the left hand side of numbers with zeroes is optional. * * @param startMillis the start of the duration @@ -246,7 +246,7 @@ } /** - * pGet the time gap as a string, using the specified format. + * pFormats the time gap as a string, using the specified format. * Padding the left hand side of numbers with zeroes is optional and * the timezone may be specified. * @@ -456,7 +456,7 @@ static final Object S = S; /** - * Parse a classic date format string into Tokens + * Parses a classic date format string into Tokens * * @param format to parse * @return Token[] of tokens @@ -543,7 +543,7 @@ private int count; /** - * Wrap a token around a value. A value would be something like a 'Y'. + * Wraps a token around a value. A value would be something like a 'Y'. * * @param value to wrap */ @@ -553,7 +553,7 @@ } /** - * Wrap a token around a repeated number of a value, for example it would + * Wraps a token around a repeated number of a value, for example it would * store '' as a value for y and a count of 4. * * @param value to wrap @@ -565,14 +565,14 @@ } /** - * Add another one of the value + * Adds another one of the value */ void increment() { count++; } /** - * Get the current number of values represented + * Gets the current number of values represented * * @return int number of values represented */ @@ -581,7 +581,7 @@ } /** - * Get the particular value this token represents. + * Gets the particular value this token represents. * * @return Object value */ @@ -617,7 +617,7 @@ } /** - * Represent this token as a String. + * Represents this token as a String. * * @return String representation of the token
svn commit: r327700 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/mutable/MutableBoolean.java test/org/apache/commons/lang/mutable/MutableBooleanTest.java test/org/apache/c
Author: ggregory Date: Sat Oct 22 15:03:23 2005 New Revision: 327700 URL: http://svn.apache.org/viewcvs?rev=327700view=rev Log: [lang] Request for MutableBoolean implementation. http://issues.apache.org/bugzilla/show_bug.cgi?id=37111. Added: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableBoolean.java (with props) jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/mutable/MutableBooleanTest.java (with props) Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/mutable/MutableTestSuite.java Added: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableBoolean.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableBoolean.java?rev=327700view=auto == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableBoolean.java (added) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/mutable/MutableBoolean.java Sat Oct 22 15:03:23 2005 @@ -0,0 +1,165 @@ +/* + * Copyright 2004-2005 The Apache Software Foundation. + * + * Licensed 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.commons.lang.mutable; + +import java.io.Serializable; + +/** + * A mutable codeboolean/code wrapper. + * + * @see Boolean + * @since 2.2 + * @author Apache Software Foundation + * @version $Id$ + */ +public class MutableBoolean implements Mutable, Serializable, Comparable { + +/** Serialization lock. */ +private static final long serialVersionUID = -4830728138360036487L; + +/** The mutable value. */ +private boolean value; + +/** + * Constructs a new MutableBoolean with the default value of false. + */ +public MutableBoolean() { +super(); +} + +/** + * Constructs a new MutableBoolean with the specified value. + * + * @param value + *a value. + */ +public MutableBoolean(boolean value) { +super(); +this.value = value; +} + +/** + * Constructs a new MutableBoolean with the specified value. + * + * @param value + *a value. + * @throws NullPointerException + * if the object is null + */ +public MutableBoolean(Boolean value) { +super(); +this.value = value.booleanValue(); +} + +// --- +/** + * Returns the value of this MutableBoolean as a boolean. + * + * @return the boolean value represented by this object. + */ +public boolean booleanValue() { +return value; +} + +/** + * Compares this mutable to another in ascending order. + * + * @param obj + *the mutable to compare to + * @return zero if this object represents the same boolean value as the argument; a positive value if this object + * represents true and the argument represents false; and a negative value if this object represents false + * and the argument represents true + * @throws ClassCastException + * if the argument is not a MutableInt + */ +public int compareTo(Object obj) { +MutableBoolean other = (MutableBoolean) obj; +boolean anotherVal = other.value; +return value == anotherVal ? 0 : (value ? 1 : -1); +} + +// --- +/** + * Compares this object to the specified object. The result is codetrue/code if and only if the argument is + * not codenull/code and is an codeMutableBoolean/code object that contains the same + * codeboolean/code value as this object. + * + * @param obj + *the object to compare with. + * @return codetrue/code if the objects are the same; codefalse/code otherwise. + */ +public boolean equals(Object obj) { +if (obj instanceof MutableBoolean) { +return value == ((MutableBoolean) obj).booleanValue(); +} +return false; +} + +// --- +/** + * Gets the value as a Boolean instance. + * + * @return the value as a Boolean + */ +public Object getValue() { +return
svn commit: r327707 - in /jakarta/commons/proper/lang/trunk: RELEASE-NOTES-2.1.txt RELEASE-NOTES.txt
Author: ggregory Date: Sat Oct 22 15:11:24 2005 New Revision: 327707 URL: http://svn.apache.org/viewcvs?rev=327707view=rev Log: Planned 2.2 leg work. Added: jakarta/commons/proper/lang/trunk/RELEASE-NOTES-2.1.txt (with props) Modified: jakarta/commons/proper/lang/trunk/RELEASE-NOTES.txt Added: jakarta/commons/proper/lang/trunk/RELEASE-NOTES-2.1.txt URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/RELEASE-NOTES-2.1.txt?rev=327707view=auto == --- jakarta/commons/proper/lang/trunk/RELEASE-NOTES-2.1.txt (added) +++ jakarta/commons/proper/lang/trunk/RELEASE-NOTES-2.1.txt Sat Oct 22 15:11:24 2005 @@ -0,0 +1,135 @@ +$Id$ + +Commons Lang Package +Version 2.1 + Release Notes + + +INTRODUCTION: + +This document contains the release notes for the 2.1 version of Apache Jakarta Commons Lang. +Commons Lang is a set of utility functions and reusable components that +should be of use in any Java environment. + + +INCOMPATIBLE CHANGES: + +- The Nestable interface defines the method indexOfThrowable(Class). +Previously the implementations checked only for a specific Class. +Now they check for subclasses of that Class as well. +For most situations this will be the expected behaviour (ie. its a bug fix). +If it causes problems, please use the ExceptionUtils.indexOfThrowable(Class) method instead. +Note that the ExceptionUtils method is available in v1.0 and v2.0 of commons-lang and has not been changed. +(An alternative to this is to change the public static matchSubclasses flag on NestableDelegate. +However, we don't recommend that as a long-term solution.) + +- The StopWatch class has had much extra validation added. +If your code previously relied on unusual aspects, it may no longer work. + +- Starting with version 2.1, Ant version 1.6.x is required to build. Copy +junit.jar to ANT_HOME/lib. You can get JUnit from http://www.junit.org. See the developer's guide +for more details. + + +DEPRECATIONS: + +- The enum package has been renamed to enums for JDK1.5 compilance. +All functionality is identical, just the package has changed. +This package will be removed in v3.0. + +- NumberUtils.stringToInt - renamed to toInt + +- DateUtils - four constants, MILLIS_IN_* have been deprecated as they were defined +as int not long. The replacements are MILLIS_PER_*. + + +NEW FEATURES: + +New: +- Mutable package - contains basic classes that hold an Object or primitive +and provide both get and set methods. +- DurationFormatUtils - provides various methods for formatting durations +- CharEncoding - definitions of constants for character encoding work +- CharUtils - utilities for working with characters + +Updated: +- ArrayUtils - many more methods, especially List-like methods +- BooleanUtils - isTrue and isFalse methods that handle null +- ClassUtils - primitive to wrapper class conversion methods +- ClassUtils - class name comparator +- IllegalClassException - extra constructor for common instanceof case +- NotImplementedException - supports nested exceptions +- ObjectUtils - hashcode method handling null +- StringUtils - isAsciiPrintable to check the contents of a string + -- ordinalIndexOf to find the nth index of a string + -- various remove methods to remove parts of a string + -- various split methods to provide more control over splitting a string + -- defaultIfEmpty to default a string if null or empty +- SystemUtils - methods to get system properties as File objects + -- extra constants representing system properties +- Validate - new methods to check whether all elements in a collection are of a specific type +- WordUtils - new methods to capitalize based on a set of specified delimiters + +- EqualsBuilder - now provides setter to internal state +- ToStringStyle - new style, short prefix style +- ReflectionToStringBuilder - more flags to control the output with regards to statics + +- ExceptionUtils - added indexOfType methods that check subclasses, thus leaving the existing +indexOfThrowable method untouched (see incompatible changes section) + +- NumberUtils - various string to number parsing methods added + +- DateUtils - methods added to compare dates in various ways + -- method to parse a date string using multiple patterns +- FastDateFormat - extra formatting methods that take in a millisecond long value +-- additional static factory methods +- StopWatch - new methods for split behaviour + + +BUG FIXES: + +19331 General case: infinite loop: ToStringBuilder.reflectionToString +23174 EqualsBuilder.append(Object[], Object[]) throws NPE +23356 Make DurationFormatUtils public! +23557 WordUtils.capitalizeFully(String str) should take a delimiters +23683 New method for converting a primitive Class to its corresponding wrapper +23430
svn commit: r294934 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java
Author: ggregory Date: Tue Oct 4 15:21:40 2005 New Revision: 294934 URL: http://svn.apache.org/viewcvs?rev=294934view=rev Log: Tsk, tsk: This class did not compile with Java 1.3.1. The test also fails on 1.3.1_15 but works on 1.4.2_09. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java?rev=294934r1=294933r2=294934view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/LocaleUtilsTest.java Tue Oct 4 15:21:40 2005 @@ -272,7 +272,7 @@ new Locale[] { LOCALE_EN_US_, LOCALE_EN_US, -new Locale(en)}); +new Locale(en, )}); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r294935 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java
Author: ggregory Date: Tue Oct 4 15:23:01 2005 New Revision: 294935 URL: http://svn.apache.org/viewcvs?rev=294935view=rev Log: More code that does not compile 1.3.1. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java?rev=294935r1=294934r2=294935view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java Tue Oct 4 15:23:01 2005 @@ -111,19 +111,19 @@ assertEquals(Code is not implemented in class java.lang.String, ex.getMessage()); } -public void testGetMessage_Indexed() { -NotImplementedException ex = new NotImplementedException(new Exception(nested 1, new Exception(nested 2))); -assertEquals(Code is not implemented, ex.getMessage()); -assertEquals(Code is not implemented, ex.getMessage(0)); -assertEquals(nested 1, ex.getMessage(1)); -assertEquals(nested 2, ex.getMessage(2)); - -String[] messages = ex.getMessages(); -assertEquals(3, messages.length); -assertEquals(Code is not implemented, messages[0]); -assertEquals(nested 1, messages[1]); -assertEquals(nested 2, messages[2]); -} +//public void testGetMessage_Indexed() { +//NotImplementedException ex = new NotImplementedException(new Exception(nested 1, new Exception(nested 2))); +//assertEquals(Code is not implemented, ex.getMessage()); +//assertEquals(Code is not implemented, ex.getMessage(0)); +//assertEquals(nested 1, ex.getMessage(1)); +//assertEquals(nested 2, ex.getMessage(2)); +// +//String[] messages = ex.getMessages(); +//assertEquals(3, messages.length); +//assertEquals(Code is not implemented, messages[0]); +//assertEquals(nested 1, messages[1]); +//assertEquals(nested 2, messages[2]); +//} public void testGetThrowable() { NotImplementedException ex = new NotImplementedException(new NestableException(nested 1, new NestableException(nested 2))); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r294936 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java
Author: ggregory Date: Tue Oct 4 15:23:54 2005 New Revision: 294936 URL: http://svn.apache.org/viewcvs?rev=294936view=rev Log: // comment. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java?rev=294936r1=294935r2=294936view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/NotImplementedExceptionTest.java Tue Oct 4 15:23:54 2005 @@ -111,6 +111,7 @@ assertEquals(Code is not implemented in class java.lang.String, ex.getMessage()); } +// Does not compile on Java 1.3.1: //public void testGetMessage_Indexed() { //NotImplementedException ex = new NotImplementedException(new Exception(nested 1, new Exception(nested 2))); //assertEquals(Code is not implemented, ex.getMessage()); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r294949 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java test/org/apache/commons/lang/builder/BuilderTestSuite.java
Author: ggregory Date: Tue Oct 4 17:05:11 2005 New Revision: 294949 URL: http://svn.apache.org/viewcvs?rev=294949view=rev Log: A cut at http://issues.apache.org/bugzilla/show_bug.cgi?id=36925: Using ReflectionToStringBuilder and excluding secure fields. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/BuilderTestSuite.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java?rev=294949r1=294948r2=294949view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java Tue Oct 4 17:05:11 2005 @@ -13,11 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.apache.commons.lang.builder; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.Arrays; import java.util.HashSet; import java.util.Set; @@ -29,11 +31,10 @@ * /p * * p - * This class uses reflection to determine the fields to append. Because these - * fields are usually private, the class uses - * [EMAIL PROTECTED] java.lang.reflect.AccessibleObject#setAccessible(java.lang.reflect.AccessibleObject[], boolean)} - * to change the visibility of the fields. This will fail under a security - * manager, unless the appropriate permissions are set up correctly. + * This class uses reflection to determine the fields to append. Because these fields are usually private, the class + * uses [EMAIL PROTECTED] java.lang.reflect.AccessibleObject#setAccessible(java.lang.reflect.AccessibleObject[], boolean)} to + * change the visibility of the fields. This will fail under a security manager, unless the appropriate permissions are + * set up correctly. * /p * * p @@ -64,8 +65,8 @@ * /ul * /p * p - * For example, this method does inot/i include the codepassword/code - * field in the returned codeString/code: + * For example, this method does inot/i include the codepassword/code field in the returned + * codeString/code: * /p * * pre @@ -80,22 +81,21 @@ * * * p - * The exact format of the codetoString/code is determined by the - * [EMAIL PROTECTED] ToStringStyle} passed into the constructor. + * The exact format of the codetoString/code is determined by the [EMAIL PROTECTED] ToStringStyle} passed into the + * constructor. * /p * * @author Gary Gregory * @author Stephen Colebourne * @author Pete Gieser * @since 2.0 - * @version $Id: ReflectionToStringBuilder.java,v 1.15 2003/12/02 19:11:58 - * ggregory Exp $ + * @version $Id$ */ public class ReflectionToStringBuilder extends ToStringBuilder { /** * p - * A registry of objects used by codereflectionToString/code methods - * to detect cyclical object references and avoid infinite loops. + * A registry of objects used by codereflectionToString/code methods to detect cyclical object references and + * avoid infinite loops. * /p */ private static ThreadLocal registry = new ThreadLocal() { @@ -108,8 +108,8 @@ /** * p - * Returns the registry of objects being traversed by the codereflectionToString/code - * methods in the current thread. + * Returns the registry of objects being traversed by the codereflectionToString/code methods in the current + * thread. * /p * * @return Set the registry of objects being traversed @@ -120,14 +120,13 @@ /** * p - * Returns codetrue/code if the registry contains the given object. - * Used by the reflection methods to avoid infinite loops. + * Returns codetrue/code if the registry contains the given object. Used by the reflection methods to avoid + * infinite loops. * /p * * @param value - * The object to lookup in the registry. - * @return boolean codetrue/code if the registry contains the given - * object. + *The object to lookup in the registry. + * @return boolean codetrue/code if the registry contains the given object. */ static boolean isRegistered(Object value) { return getRegistry().contains(value); @@ -135,12 +134,11 @@ /** * p - * Registers the given object. Used by the reflection methods to avoid - * infinite loops. + * Registers the given object. Used by the reflection methods to avoid infinite
svn commit: r294950 - in /jakarta/commons/proper/lang/trunk: project.properties src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java
Author: ggregory Date: Tue Oct 4 17:06:11 2005 New Revision: 294950 URL: http://svn.apache.org/viewcvs?rev=294950view=rev Log: A cut at http://issues.apache.org/bugzilla/show_bug.cgi?id=36925: Using ReflectionToStringBuilder and excluding secure fields. Added: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java (with props) Modified: jakarta/commons/proper/lang/trunk/project.properties Modified: jakarta/commons/proper/lang/trunk/project.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/project.properties?rev=294950r1=294949r2=294950view=diff == --- jakarta/commons/proper/lang/trunk/project.properties (original) +++ jakarta/commons/proper/lang/trunk/project.properties Tue Oct 4 17:06:11 2005 @@ -48,6 +48,6 @@ # Valid values are 1.3, 1.4, 1.5. maven.compile.source = 1.3 -maven.jar.override=on -maven.jar.clover=1.3.2 -maven.clover.license.path=clover.license +#maven.jar.override=on +#maven.jar.clover=1.3.2 +#maven.clover.license.path=clover.license Added: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java?rev=294950view=auto == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java (added) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java Tue Oct 4 17:06:11 2005 @@ -0,0 +1,59 @@ +/* + * Copyright 2005 The Apache Software Foundation. + * + * Licensed 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.commons.lang.builder; + +import junit.framework.Assert; +import junit.framework.TestCase; + +/** + * @author a href=mailto:[EMAIL PROTECTED]ggregory/a + * @version $Id$ + */ +public class ReflectionToStringBuilderExcludeTest extends TestCase { + +class TestFixture { +private String secretField = SECRET_VALUE; + +private String showField = NOT_SECRET_VALUE; +} + +private static final int INDEX_NOT_FOUND = -1; + +private static final String NOT_SECRET_FIELD = showField; + +private static final String NOT_SECRET_VALUE = Hello World!; + +private static final String SECRET_FIELD = secretField; + +private static final String SECRET_VALUE = secret value; + +public void test_toStringExcluding() { +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), SECRET_FIELD); +this.validateToStringValue(toString); +} + +public void test_toStringExcludingArray() { +String toString = ReflectionToStringBuilder.toStringExclude(new TestFixture(), new String[]{SECRET_FIELD}); +this.validateToStringValue(toString); +} + +void validateToStringValue(String toString) { +Assert.assertEquals(INDEX_NOT_FOUND, toString.indexOf(SECRET_VALUE)); +Assert.assertTrue(toString.indexOf(NOT_SECRET_FIELD) INDEX_NOT_FOUND); +Assert.assertTrue(toString.indexOf(NOT_SECRET_VALUE) INDEX_NOT_FOUND); +} +} Propchange: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java -- svn:eol-style = native Propchange: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java -- --- svn:keywords (added) +++ svn:keywords Tue Oct 4 17:06:11 2005 @@ -0,0 +1 @@ +LastChangedDate Date LastChangedRevision Revision Rev LastChangedBy Author HeadURL URL Id Propchange: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/builder/ReflectionToStringBuilderExcludeTest.java -- svn:mime-type = text/plain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r294951 - /jakarta/commons/proper/lang/trunk/project.properties
Author: ggregory Date: Tue Oct 4 17:11:19 2005 New Revision: 294951 URL: http://svn.apache.org/viewcvs?rev=294951view=rev Log: Oops, go back to previous version. Modified: jakarta/commons/proper/lang/trunk/project.properties Modified: jakarta/commons/proper/lang/trunk/project.properties URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/project.properties?rev=294951r1=294950r2=294951view=diff == --- jakarta/commons/proper/lang/trunk/project.properties (original) +++ jakarta/commons/proper/lang/trunk/project.properties Tue Oct 4 17:11:19 2005 @@ -48,6 +48,6 @@ # Valid values are 1.3, 1.4, 1.5. maven.compile.source = 1.3 -#maven.jar.override=on -#maven.jar.clover=1.3.2 -#maven.clover.license.path=clover.license +maven.jar.override=on +maven.jar.clover=1.3.2 +maven.clover.license.path=clover.license - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r293464 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java
Author: ggregory Date: Mon Oct 3 15:44:08 2005 New Revision: 293464 URL: http://svn.apache.org/viewcvs?rev=293464view=rev Log: Javadoc. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java?rev=293464r1=293463r2=293464view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/builder/ReflectionToStringBuilder.java Mon Oct 3 15:44:08 2005 @@ -148,8 +148,8 @@ /** * p - * This method uses reflection to build a suitable codetoString/code - * using the default codeToStringStyle/code. + * Builds a codetoString/code value using the default codeToStringStyle/code through reflection. + * /p * * p * It uses codeAccessibleObject.setAccessible/code to gain access to @@ -175,7 +175,7 @@ /** * p - * This method uses reflection to build a suitable codetoString/code. + * Builds a codetoString/code value through reflection. * /p * * p @@ -210,7 +210,7 @@ /** * p - * This method uses reflection to build a suitable codetoString/code. + * Builds a codetoString/code value through reflection. * /p * * p @@ -252,7 +252,7 @@ /** * p - * This method uses reflection to build a suitable codetoString/code. + * Builds a codetoString/code value through reflection. * /p * * p @@ -302,7 +302,7 @@ /** * p - * This method uses reflection to build a suitable codetoString/code. + * Builds a codetoString/code value through reflection. * /p * * p @@ -357,7 +357,7 @@ /** * p - * This method uses reflection to build a suitable codetoString/code. + * Builds a codetoString/code value through reflection. * /p * * p - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r291996 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java
Author: ggregory Date: Tue Sep 27 10:37:38 2005 New Revision: 291996 URL: http://svn.apache.org/viewcvs?rev=291996view=rev Log: Made constants public for easier access from subclasses or wrappers. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java?rev=291996r1=291995r2=291996view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java Tue Sep 27 10:37:38 2005 @@ -465,13 +465,13 @@ } /** Constant for the default escape character. */ -static final char DEFAULT_ESCAPE = '$'; +public static final char DEFAULT_ESCAPE = '$'; /** Constant for the default variable prefix. */ -static final String DEFAULT_PREFIX = ${; +public static final String DEFAULT_PREFIX = ${; /** Constant for the default variable suffix. */ -static final String DEFAULT_SUFFIX = }; +public static final String DEFAULT_SUFFIX = }; /** * Replaces the occurrences of all variables in the given source data by their current values obtained from the - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r263903 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java
Author: ggregory Date: Sun Aug 28 12:02:31 2005 New Revision: 263903 URL: http://svn.apache.org/viewcvs?rev=263903view=rev Log: Increase unit test coverage %. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java?rev=263903r1=263902r2=263903view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrBuilderTest.java Sun Aug 28 12:02:31 2005 @@ -1615,7 +1615,9 @@ public void testEqualsIgnoreCase() { StrBuilder sb1 = new StrBuilder(); StrBuilder sb2 = new StrBuilder(); +assertEquals(true, sb1.equalsIgnoreCase(sb1)); assertEquals(true, sb1.equalsIgnoreCase(sb2)); +assertEquals(true, sb2.equalsIgnoreCase(sb2)); sb1.append(abc); assertEquals(false, sb1.equalsIgnoreCase(sb2)); @@ -1625,6 +1627,8 @@ sb2.clear().append(abc); assertEquals(true, sb1.equalsIgnoreCase(sb2)); +assertEquals(true, sb1.equalsIgnoreCase(sb1)); +assertEquals(true, sb2.equalsIgnoreCase(sb2)); sb2.clear().append(aBc); assertEquals(true, sb1.equalsIgnoreCase(sb2)); @@ -1634,19 +1638,21 @@ public void testEquals() { StrBuilder sb1 = new StrBuilder(); StrBuilder sb2 = new StrBuilder(); -assertEquals(true, sb1.equals((StrBuilder) sb2)); +assertEquals(true, sb1.equals(sb2)); +assertEquals(true, sb1.equals(sb1)); +assertEquals(true, sb2.equals(sb2)); assertEquals(true, sb1.equals((Object) sb2)); sb1.append(abc); -assertEquals(false, sb1.equals((StrBuilder) sb2)); +assertEquals(false, sb1.equals(sb2)); assertEquals(false, sb1.equals((Object) sb2)); sb2.append(ABC); -assertEquals(false, sb1.equals((StrBuilder) sb2)); +assertEquals(false, sb1.equals(sb2)); assertEquals(false, sb1.equals((Object) sb2)); sb2.clear().append(abc); -assertEquals(true, sb1.equals((StrBuilder) sb2)); +assertEquals(true, sb1.equals(sb2)); assertEquals(true, sb1.equals((Object) sb2)); assertEquals(false, sb1.equals(new Integer(1))); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r263912 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/text/StrTokenizer.java test/org/apache/commons/lang/text/StrTokenizerTest.java
Author: ggregory Date: Sun Aug 28 13:23:22 2005 New Revision: 263912 URL: http://svn.apache.org/viewcvs?rev=263912view=rev Log: clone method is now full covered in unit tests. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java?rev=263912r1=263911r2=263912view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Sun Aug 28 13:23:22 2005 @@ -1048,22 +1048,32 @@ //--- /** - * Creates a new instance of this Tokenizer. - * The new instance is reset so that it will be at the start of the token list. + * Creates a new instance of this Tokenizer. The new instance is reset so that it will be at the start of the token + * list. If a [EMAIL PROTECTED] CloneNotSupportedException} is caught, return codenull/code. + * * @return a new instance of this Tokenizer which has been reset. */ public Object clone() { try { -StrTokenizer cloned = (StrTokenizer) super.clone(); -if (cloned.chars != null) { -cloned.chars = (char[]) cloned.chars.clone(); -} -cloned.reset(); -return cloned; - +return cloneReset(); } catch (CloneNotSupportedException ex) { return null; } +} + +/** + * Creates a new instance of this Tokenizer. The new instance is reset so that it will be at the start of the token + * list. + * + * @return a new instance of this Tokenizer which has been reset. + */ +protected Object cloneReset() throws CloneNotSupportedException { +StrTokenizer cloned = (StrTokenizer) super.clone(); +if (cloned.chars != null) { +cloned.chars = (char[]) cloned.chars.clone(); +} +cloned.reset(); +return cloned; } } Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java?rev=263912r1=263911r2=263912view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java Sun Aug 28 13:23:22 2005 @@ -542,6 +542,19 @@ assertEquals(tok, tok.setIgnoreEmptyTokens(false)); } +/** + * Tests that the [EMAIL PROTECTED] StrTokenizer#clone()} clone method catches [EMAIL PROTECTED] CloneNotSupportedException} and returns + * codenull/code. + */ +public void testCloneNotSupportedException() { +Object notCloned = (new StrTokenizer() { +public Object cloneReset() throws CloneNotSupportedException { +throw new CloneNotSupportedException(test); +} +}).clone(); +assertNull(notCloned); +} + public void testCloneNull() { StrTokenizer tokenizer = new StrTokenizer((char[]) null); // Start sanity check - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r239739 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NotImplementedException.java
Author: ggregory Date: Wed Aug 24 12:37:48 2005 New Revision: 239739 URL: http://svn.apache.org/viewcvs?rev=239739view=rev Log: Refactor multiple instances of the same string literal into a default message string static. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NotImplementedException.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NotImplementedException.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NotImplementedException.java?rev=239739r1=239738r2=239739view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NotImplementedException.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/NotImplementedException.java Wed Aug 24 12:37:48 2005 @@ -51,6 +51,8 @@ public class NotImplementedException extends UnsupportedOperationException implements Nestable { +private static final String DEFAULT_MESSAGE = Code is not implemented; + /** Serialization version. */ private static final long serialVersionUID = -6894122266938754088L; @@ -72,7 +74,7 @@ * @since 2.1 */ public NotImplementedException() { -super(Code is not implemented); +super(DEFAULT_MESSAGE); } /** @@ -82,7 +84,7 @@ * @param msg the error message. */ public NotImplementedException(String msg) { -super(msg == null ? Code is not implemented : msg); +super(msg == null ? DEFAULT_MESSAGE : msg); } /** @@ -93,7 +95,7 @@ * @since 2.1 */ public NotImplementedException(Throwable cause) { -super(Code is not implemented); +super(DEFAULT_MESSAGE); this.cause = cause; } @@ -106,23 +108,21 @@ * @since 2.1 */ public NotImplementedException(String msg, Throwable cause) { -super(msg == null ? Code is not implemented : msg); +super(msg == null ? DEFAULT_MESSAGE : msg); this.cause = cause; } /** - * Constructs a new codeNotImplementedException/code referencing - * the specified class. + * Constructs a new codeNotImplementedException/code referencing the specified class. * - * @param clazz the codeClass/code that has not implemented the method + * @param clazz + *the codeClass/code that has not implemented the method */ public NotImplementedException(Class clazz) { -super((clazz == null ? -Code is not implemented : -Code is not implemented in + clazz)); +super(clazz == null ? DEFAULT_MESSAGE : DEFAULT_MESSAGE + in + clazz); } -//--- +// --- /** * Gets the root cause of this exception. * @return the root cause of this exception. @@ -163,9 +163,8 @@ public String getMessage(int index) { if (index == 0) { return super.getMessage(); -} else { -return delegate.getMessage(index); } +return delegate.getMessage(index); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r239741 - /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringUtilsTest.java
Author: ggregory Date: Wed Aug 24 12:38:21 2005 New Revision: 239741 URL: http://svn.apache.org/viewcvs?rev=239741view=rev Log: Comment out System.out call in unit test. Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringUtilsTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringUtilsTest.java?rev=239741r1=239740r2=239741view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/StringUtilsTest.java Wed Aug 24 12:38:21 2005 @@ -1354,7 +1354,7 @@ assertEquals(7, StringUtils.indexOfDifference(i am a machine, i am a robot)); assertEquals(-1, StringUtils.indexOfDifference(foo, foo)); assertEquals(0, StringUtils.indexOfDifference(i am a robot, you are a robot)); -System.out.println(indexOfDiff: + StringUtils.indexOfDifference(i am a robot, not machine)); +//System.out.println(indexOfDiff: + StringUtils.indexOfDifference(i am a robot, not machine)); } //--- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r234322 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java
Author: ggregory Date: Sun Aug 21 12:25:21 2005 New Revision: 234322 URL: http://svn.apache.org/viewcvs?rev=234322view=rev Log: Javadoc fix. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java?rev=234322r1=234321r2=234322view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java Sun Aug 21 12:25:21 2005 @@ -101,7 +101,6 @@ * /pre * * @param locale the locale to start from - * @param defaultLocale the default locale to use if no other is found * @return the list of Locale objects, 0 being locale */ public static List localeLookupList(Locale locale) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r234325 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java
Author: ggregory Date: Sun Aug 21 12:32:28 2005 New Revision: 234325 URL: http://svn.apache.org/viewcvs?rev=234325view=rev Log: Javadoc. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java?rev=234325r1=234324r2=234325view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/LocaleUtils.java Sun Aug 21 12:32:28 2005 @@ -22,7 +22,7 @@ import java.util.Set; /** - * pOperations to assist when working with a Locale./p + * pOperations to assist when working with a [EMAIL PROTECTED] Locale}./p * * pThis class tries to handle codenull/code input gracefully. * An exception will not be thrown for a codenull/code input. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r234327 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java
Author: ggregory Date: Sun Aug 21 12:38:56 2005 New Revision: 234327 URL: http://svn.apache.org/viewcvs?rev=234327view=rev Log: Unnecessary cast from char[] to char[]. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java?rev=234327r1=234326r2=234327view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Sun Aug 21 12:38:56 2005 @@ -1056,7 +1056,7 @@ try { StrTokenizer cloned = (StrTokenizer) super.clone(); if (cloned.chars != null) { -cloned.chars = (char[]) cloned.chars; +cloned.chars = cloned.chars; } cloned.reset(); return cloned; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r234360 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/text/StrTokenizer.java test/org/apache/commons/lang/text/StrTokenizerTest.java
Author: ggregory Date: Sun Aug 21 14:57:01 2005 New Revision: 234360 URL: http://svn.apache.org/viewcvs?rev=234360view=rev Log: Fix clone() and add a unit test. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java?rev=234360r1=234359r2=234360view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Sun Aug 21 14:57:01 2005 @@ -1056,7 +1056,7 @@ try { StrTokenizer cloned = (StrTokenizer) super.clone(); if (cloned.chars != null) { -cloned.chars = cloned.chars; +cloned.chars = (char[]) cloned.chars.clone(); } cloned.reset(); return cloned; Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java?rev=234360r1=234359r2=234360view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java Sun Aug 21 14:57:01 2005 @@ -542,7 +542,35 @@ assertEquals(tok, tok.setIgnoreEmptyTokens(false)); } -//--- +public void testCloneNull() { +StrTokenizer tokenizer = new StrTokenizer((char[]) null); +// Start sanity check +assertEquals(null, tokenizer.nextToken()); +tokenizer.reset(); +assertEquals(null, tokenizer.nextToken()); +// End sanity check +StrTokenizer clonedTokenizer = (StrTokenizer) tokenizer.clone(); +tokenizer.reset(); +assertEquals(null, tokenizer.nextToken()); +assertEquals(null, clonedTokenizer.nextToken()); +} + +public void testCloneReset() { +char[] input = new char[]{'a'}; +StrTokenizer tokenizer = new StrTokenizer(input); +// Start sanity check +assertEquals(a, tokenizer.nextToken()); +tokenizer.reset(); +assertEquals(a, tokenizer.nextToken()); +// End sanity check +StrTokenizer clonedTokenizer = (StrTokenizer) tokenizer.clone(); +input[0] = 'b'; +tokenizer.reset(); +assertEquals(b, tokenizer.nextToken()); +assertEquals(a, clonedTokenizer.nextToken()); +} + +// --- public void testConstructor_String() { StrTokenizer tok = new StrTokenizer(a b); assertEquals(a, tok.next()); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r234385 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java
Author: ggregory Date: Sun Aug 21 15:55:52 2005 New Revision: 234385 URL: http://svn.apache.org/viewcvs?rev=234385view=rev Log: Improve unit test coverage, eating own dog food. TODO: Missing tests for many constructors. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java?rev=234385r1=234384r2=234385view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Sun Aug 21 15:55:52 2005 @@ -115,13 +115,13 @@ private int tokenPos; /** The delimiter matcher */ -private StrMatcher delim = StrMatcher.splitMatcher(); +private StrMatcher delimMatcher = StrMatcher.splitMatcher(); /** The quote matcher */ -private StrMatcher quote = StrMatcher.noneMatcher(); +private StrMatcher quoteMatcher = StrMatcher.noneMatcher(); /** The ignored matcher */ -private StrMatcher ignored = StrMatcher.noneMatcher(); +private StrMatcher ignoredMatcher = StrMatcher.noneMatcher(); /** The trimmer matcher */ -private StrMatcher trimmer = StrMatcher.noneMatcher(); +private StrMatcher trimmerMatcher = StrMatcher.noneMatcher(); /** Whether to return empty tokens as null */ private boolean emptyAsNull = false; @@ -643,10 +643,10 @@ */ private void addToken(List list, String tok) { if (tok == null || tok.length() == 0) { -if (ignoreEmptyTokens) { +if (this.isIgnoreEmptyTokens()) { return; } -if (emptyAsNull) { +if (this.isEmptyTokenAsNull()) { tok = null; } } @@ -669,11 +669,11 @@ // field delimiter or the quote character while (start len) { int removeLen = Math.max( -ignored.isMatch(chars, start, start, len), -trimmer.isMatch(chars, start, start, len)); +this.getIgnoredMatcher().isMatch(chars, start, start, len), +this.getTrimmerMatcher().isMatch(chars, start, start, len)); if (removeLen == 0 || -delim.isMatch(chars, start, start, len) 0 || -quote.isMatch(chars, start, start, len) 0) { +this.getDelimiterMatcher().isMatch(chars, start, start, len) 0 || +this.getQuoteMatcher().isMatch(chars, start, start, len) 0) { break; } start += removeLen; @@ -686,14 +686,14 @@ } // handle empty token -int delimLen = delim.isMatch(chars, start, start, len); +int delimLen = this.getDelimiterMatcher().isMatch(chars, start, start, len); if (delimLen 0) { addToken(tokens, ); return start + delimLen; } // handle found token -int quoteLen = quote.isMatch(chars, start, start, len); +int quoteLen = this.getQuoteMatcher().isMatch(chars, start, start, len); if (quoteLen 0) { return readWithQuotes(chars, start + quoteLen, len, workArea, tokens, start, quoteLen); } @@ -756,7 +756,7 @@ // Not in quoting mode // check for delimiter, and thus end of token -int delimLen = delim.isMatch(chars, pos, start, len); +int delimLen = this.getDelimiterMatcher().isMatch(chars, pos, start, len); if (delimLen 0) { // return condition when end of token found addToken(tokens, workArea.substring(0, trimStart)); @@ -773,7 +773,7 @@ } // check for ignored (outside quotes), and ignore -int ignoredLen = ignored.isMatch(chars, pos, start, len); +int ignoredLen = this.getIgnoredMatcher().isMatch(chars, pos, start, len); if (ignoredLen 0) { pos += ignoredLen; continue; @@ -782,7 +782,7 @@ // check for trimmed character // don't yet know if its at the end, so copy to workArea // use trimStart to keep track of trim at the end -int trimmedLen = trimmer.isMatch(chars, pos, start, len); +int trimmedLen = this.getTrimmerMatcher().isMatch(chars, pos, start, len); if (trimmedLen 0) { workArea.append(chars, pos, trimmedLen); pos += trimmedLen; @@ -828,7 +828,7 @@ * @return
svn commit: r234412 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java
Author: ggregory Date: Sun Aug 21 18:20:12 2005 New Revision: 234412 URL: http://svn.apache.org/viewcvs?rev=234412view=rev Log: Removed extra () layer. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java?rev=234412r1=234411r2=234412view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/SystemUtils.java Sun Aug 21 18:20:12 2005 @@ -695,8 +695,8 @@ * @since Java 1.2 */ public static final String USER_COUNTRY = -(getSystemProperty(user.country) == null ? -getSystemProperty(user.region) : getSystemProperty(user.country)); +getSystemProperty(user.country) == null ? +getSystemProperty(user.region) : getSystemProperty(user.country); /** * pThe codeuser.dir/code System Property. User's current working - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r232202 - in /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time: DateFormatUtilsTest.java DateUtilsTest.java
Author: ggregory Date: Thu Aug 11 21:36:42 2005 New Revision: 232202 URL: http://svn.apache.org/viewcvs?rev=232202view=rev Log: Patches to increase test coverage from Nathan Beyer [EMAIL PROTECTED] Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java?rev=232202r1=232201r2=232202view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java Thu Aug 11 21:36:42 2005 @@ -18,6 +18,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Modifier; import java.util.Calendar; +import java.util.Locale; import java.util.TimeZone; import junit.framework.Test; @@ -61,6 +62,40 @@ } //--- +public void testFormat() { +Calendar c = Calendar.getInstance(TimeZone.getTimeZone(UTC)); +c.set(2005,0,1,12,0,0); +c.setTimeZone(TimeZone.getDefault()); +StringBuffer buffer = new StringBuffer (); +int year = c.get(Calendar.YEAR); +int month = c.get(Calendar.MONTH) + 1; +int day = c.get(Calendar.DAY_OF_MONTH); +int hour = c.get(Calendar.HOUR_OF_DAY); +buffer.append (year); +buffer.append(month); +buffer.append(day); +buffer.append(hour); +assertEquals(buffer.toString(), DateFormatUtils.format(c.getTime(), MdH)); + +assertEquals(buffer.toString(), DateFormatUtils.format(c.getTime().getTime(), MdH)); + +assertEquals(buffer.toString(), DateFormatUtils.format(c.getTime(), MdH, Locale.US)); + +assertEquals(buffer.toString(), DateFormatUtils.format(c.getTime().getTime(), MdH, Locale.US)); +} + +public void testFormatUTC() { +Calendar c = Calendar.getInstance(TimeZone.getTimeZone(UTC)); +c.set(2005,0,1,12,0,0); +assertEquals (2005-01-01T12:00:00, DateFormatUtils.formatUTC(c.getTime(), DateFormatUtils.ISO_DATETIME_FORMAT.getPattern())); + +assertEquals (2005-01-01T12:00:00, DateFormatUtils.formatUTC(c.getTime().getTime(), DateFormatUtils.ISO_DATETIME_FORMAT.getPattern())); + +assertEquals (2005-01-01T12:00:00, DateFormatUtils.formatUTC(c.getTime(), DateFormatUtils.ISO_DATETIME_FORMAT.getPattern(), Locale.US)); + +assertEquals (2005-01-01T12:00:00, DateFormatUtils.formatUTC(c.getTime().getTime(), DateFormatUtils.ISO_DATETIME_FORMAT.getPattern(), Locale.US)); +} + public void testDateTimeISO(){ TimeZone timeZone = TimeZone.getTimeZone(GMT-3); Calendar cal = Calendar.getInstance(timeZone); Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java?rev=232202r1=232201r2=232202view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/time/DateUtilsTest.java Thu Aug 11 21:36:42 2005 @@ -303,6 +303,8 @@ assertEquals(round semimonth-2 failed, dateParser.parse(November 16, 2001), DateUtils.round(date2, DateUtils.SEMI_MONTH)); + + assertEquals(round date-1 failed, dateParser.parse(February 13, 2002), DateUtils.round(date1, Calendar.DATE)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r232210 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java
Author: ggregory Date: Thu Aug 11 22:31:25 2005 New Revision: 232210 URL: http://svn.apache.org/viewcvs?rev=232210view=rev Log: Clean up of one method from Nathan Beyer [EMAIL PROTECTED] Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java?rev=232210r1=232209r2=232210view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java Thu Aug 11 22:31:25 2005 @@ -3210,11 +3210,7 @@ if (str.charAt(lastIdx - 1) == CharUtils.CR) { lastIdx--; } -} else if (last == CharUtils.CR) { -// why is this block empty? -// just to skip incrementing the index? - ; -} else { +} else if (last != CharUtils.CR) { lastIdx++; } return str.substring(0, lastIdx); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r231316 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/text/VariableFormatter.java test/org/apache/commons/lang/text/VariableFormatterTest.java
Author: ggregory Date: Wed Aug 10 13:36:26 2005 New Revision: 231316 URL: http://svn.apache.org/viewcvs?rev=231316view=rev Log: Integrate and tweak http://issues.apache.org/bugzilla/show_bug.cgi?id=35588. Next: Try and replace VariableFormatter.Token with java.text.FieldPosition. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/VariableFormatterTest.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java?rev=231316r1=231315r2=231316view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java Wed Aug 10 13:36:26 2005 @@ -18,23 +18,28 @@ import java.util.ArrayList; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; -import org.apache.commons.lang.StringUtils; - /** - * Candidate class to replace Interpolation and MappedMessageFormat? - * * p - * A class for variable interpolation (substitution). + * Replaces variables in text with other text. + * /p + * p + * This class can be given a text which can contain an arbitrary number of variables. The default notation for a + * variable in text is code${variableName}/code. However by calling the codesetVariablePrefix()/code and + * codesetVariableSuffix()/code methods it is possible to use a different prefix or suffix. Variable values are + * resolved from a map. * /p * p - * This class can be given a text which can contain an arbitrary number of variables. It will then try to replace all - * variables by their current values, which are obtained from a map. A variable per default is specified using the - * typical notation quot; code${lt;varnamegt;}/code quot;. However by calling the - * codesetVariablePrefix()/code and codesetVariableSuffix()/code methods it is possible to use a different - * prefix or suffix. + * The simplest example is to use this class to replace Java System properties. For example: + * + * pre + * VariableFormatter.replaceSystemProperties( + * You are running with java.version = ${java.version} and os.name = ${os.name}.); + * /pre + * * /p * p * Typical usage of this class follows the following pattern: First an instance is created and initialized with the map @@ -44,16 +49,22 @@ * their values are known) will be resolved. The following example demonstrates this: * /p * p - * codepre + * + * pre * Map valuesMap = HashMap(); * valuesMap.put(quot;animalquot;, quot;quick brown foxquot;); * valuesMap.put(quot;targetquot;, quot;lazy dogquot;); * String templateString = quot;The ${animal} jumped over the ${target}.quot;; * VariableFormat vf = new VariableVormat(valuesMap); * String resolvedString = cf.replace(templateString); - * /pre/code yielding: codepre - *The quick brown fox jumped over the lazy dog. - * /pre/code + * /pre + * + * yielding: + * + * pre + * The quick brown fox jumped over the lazy dog. + * /pre + * * /p * p * In addition to this usage pattern there are some static convenience methods that cover the most common use cases. @@ -82,12 +93,11 @@ * To achieve this effect there are two possibilities: Either set a different prefix and suffix for variables which do * not conflict with the result text you want to produce. The other possibility is to use the escape character that can * be set through the codesetEscapeCharacter()/code method. If this character is placed before a variable - * reference, this reference is ignored and won't be replaced. It can also be placed before a variable suffix, then this - * suffix will be ignored, too. Per default the escape character is set to the code$/code character, so that in - * the example above the text could have run: + * reference, this reference is ignored and won't be replaced. Per default the escape character is set to the + * code$/code character, so that in the example above the text could have run: * /p * p - * codeThe variable $${${name$}} must be used./code + * codeThe variable $${${name}} must be used./code * /p * * @@ -154,6 +164,368 @@ } /** + * A simple class representing a token detected by the codeVariableParser/code class. + */ +protected static class Token { +/** Constant for the token type ESCAPED_VAR. */ +static final short ESCAPED_VAR_TOKEN = 3; + +/** Constant for the token type TEXT. */ +static final short TEXT_TOKEN = 1; + +/** Constant for the token type VARIABLE. */ +static final short
svn commit: r231330 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java
Author: ggregory Date: Wed Aug 10 14:21:52 2005 New Revision: 231330 URL: http://svn.apache.org/viewcvs?rev=231330view=rev Log: Replaced VariableFormatter.Token with java.text.FieldPosition. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java?rev=231330r1=231329r2=231330view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/VariableFormatter.java Wed Aug 10 14:21:52 2005 @@ -16,6 +16,7 @@ package org.apache.commons.lang.text; +import java.text.FieldPosition; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; @@ -164,9 +165,10 @@ } /** - * A simple class representing a token detected by the codeVariableParser/code class. + * A helper class for detecting variables in the source text. This class provides simple tokenizer functionality. It + * splits input text into tokens for text, variables, and escaped variable start tokens. */ -protected static class Token { +protected static class VariableParser { /** Constant for the token type ESCAPED_VAR. */ static final short ESCAPED_VAR_TOKEN = 3; @@ -185,8 +187,8 @@ *The token length * @return a new token */ -public static Token newEscapedVariableToken(int aStartIndex, int aLength) { -return new Token(ESCAPED_VAR_TOKEN, aStartIndex, aLength); +public static FieldPosition newEscapedVariableToken(int aStartIndex, int aLength) { +return newToken(VariableParser.ESCAPED_VAR_TOKEN, aStartIndex, aLength); } /** @@ -198,116 +200,30 @@ *The token length * @return a new token */ -public static Token newTextToken(int aStartIndex, int aLength) { -return new Token(TEXT_TOKEN, aStartIndex, aLength); +public static FieldPosition newTextToken(int aStartIndex, int aLength) { +return newToken(VariableParser.TEXT_TOKEN, aStartIndex, aLength); } -/** - * Creates a new variable token. - * - * @param aStartIndex - *The token starting index - * @param aLength - *The token length - * @return a new token - */ -public static Token newVariableToken(int aStartIndex, int aLength) { -return new Token(VARIABLE_TOKEN, aStartIndex, aLength); +private static FieldPosition newToken(int type, int beginIndex, int length) { +FieldPosition fp = new FieldPosition(type); +fp.setBeginIndex(beginIndex); +fp.setEndIndex(beginIndex + length); +return fp; } -/** Stores the length of this token in characters. */ -private int length; - -/** Stores the token's start position in the source text. */ -private int startIndex; - -/** Stores the token type. */ -private short type; - /** - * Creates a new token. + * Creates a new variable token. * - * @param aType - *The token type * @param aStartIndex *The token starting index * @param aLength *The token length + * @return a new token */ -public Token(short aType, int aStartIndex, int aLength) { -this.setType(aType); -this.setStartIndex(aStartIndex); -this.setLength(aLength); -} - -/** - * Returns the token's length. - * - * @return the length of this token in characters - */ -public int getLength() { -return this.length; -} - -/** - * Returns the token's start index. - * - * @return this token's start index in the source data - */ -public int getStartIndex() { -return this.startIndex; -} - -/** - * Returns the text for this token from the passed in source array. - * - * @param data - *the array with the source data - * @return the text for this token - */ -public String getText(char[] data) { -return new String(data, getStartIndex(), getLength()); -} - -/** - * Returns this token's type. - * - * @return the type of this token - */ -public short getType
svn commit: r231331 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
Author: ggregory Date: Wed Aug 10 14:22:11 2005 New Revision: 231331 URL: http://svn.apache.org/viewcvs?rev=231331view=rev Log: Better exception messages. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java?rev=231331r1=231330r2=231331view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java Wed Aug 10 14:22:11 2005 @@ -556,10 +556,10 @@ return this; } if (startIndex 0 || startIndex chars.length) { -throw new StringIndexOutOfBoundsException(startIndex must be valid); +throw new StringIndexOutOfBoundsException(Invalid startIndex: + length); } if (length 0 || (startIndex + length) chars.length) { -throw new StringIndexOutOfBoundsException(length must be valid); +throw new StringIndexOutOfBoundsException(Invalid length: + length); } if (length 0) { int len = length(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r230836 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java
Author: ggregory Date: Mon Aug 8 11:20:13 2005 New Revision: 230836 URL: http://svn.apache.org/viewcvs?rev=230836view=rev Log: Statement unnecessarily nested within else clause. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java?rev=230836r1=230835r2=230836view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java Mon Aug 8 11:20:13 2005 @@ -85,9 +85,8 @@ public static Character toCharacterObject(char ch) { if (ch CHAR_ARRAY.length) { return CHAR_ARRAY[ch]; -} else { -return new Character(ch); } +return new Character(ch); } /** @@ -309,9 +308,8 @@ public static String toString(char ch) { if (ch 128) { return CHAR_STRING_ARRAY[ch]; -} else { -return new String(new char[] {ch}); } +return new String(new char[] {ch}); } /** @@ -334,9 +332,8 @@ public static String toString(Character ch) { if (ch == null) { return null; -} else { -return toString(ch.charValue()); } +return toString(ch.charValue()); } //-- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r230857 - in /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang: CharUtils.java StringUtils.java text/StrBuilder.java
Author: ggregory Date: Mon Aug 8 11:58:58 2005 New Revision: 230857 URL: http://svn.apache.org/viewcvs?rev=230857view=rev Log: Fix some Checkstyle and PMD warnings. Extract constants from in-lined '\n' and '\r' in StringUtils.java. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java?rev=230857r1=230856r2=230857view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/CharUtils.java Mon Aug 8 11:58:58 2005 @@ -49,13 +49,32 @@ private static final String[] CHAR_STRING_ARRAY = new String[128]; private static final Character[] CHAR_ARRAY = new Character[128]; +/** + * code\u000a/code linefeed LF ('\n'). + * + * @see a href=http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089;JLF: Escape Sequences + * for Character and String Literals/a + * @since 2.2 + */ +public static final char LF = '\n'; + +/** + * code\u000d/code carriage return CR ('\r'). + * + * @see a href=http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089;JLF: Escape Sequences + * for Character and String Literals/a + * @since 2.2 + */ +public static final char CR = '\r'; + + static { for (int i = 127; i = 0; i--) { CHAR_STRING_ARRAY[i] = CHAR_STRING.substring(i, i + 1); CHAR_ARRAY[i] = new Character((char) i); } } - + /** * pcodeCharUtils/code instances should NOT be constructed in standard programming. * Instead, the class should be used as codeCharUtils.toString('c');/code./p Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java?rev=230857r1=230856r2=230857view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java Mon Aug 8 11:58:58 2005 @@ -3196,7 +3196,7 @@ if (str.length() == 1) { char ch = str.charAt(0); -if (ch == '\r' || ch == '\n') { +if (ch == CharUtils.CR || ch == CharUtils.LF) { return EMPTY; } else { return str; @@ -3206,11 +3206,11 @@ int lastIdx = str.length() - 1; char last = str.charAt(lastIdx); -if (last == '\n') { -if (str.charAt(lastIdx - 1) == '\r') { +if (last == CharUtils.LF) { +if (str.charAt(lastIdx - 1) == CharUtils.CR) { lastIdx--; } -} else if (last == '\r') { +} else if (last == CharUtils.CR) { // why is this block empty? // just to skip incrementing the index? ; @@ -3392,8 +3392,8 @@ int lastIdx = strLen - 1; String ret = str.substring(0, lastIdx); char last = str.charAt(lastIdx); -if (last == '\n') { -if (ret.charAt(lastIdx - 1) == '\r') { +if (last == CharUtils.LF) { +if (ret.charAt(lastIdx - 1) == CharUtils.CR) { return ret.substring(0, lastIdx - 1); } } @@ -3416,8 +3416,8 @@ return EMPTY; } char last = str.charAt(lastIdx); -if (last == '\n') { -if (str.charAt(lastIdx - 1) == '\r') { +if (last == CharUtils.LF) { +if (str.charAt(lastIdx - 1) == CharUtils.CR) { lastIdx--; } } else { Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java?rev=230857r1=230856r2=230857view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java Mon Aug 8 11:58:58 2005 @@ -153,9 +153,7 @@ if (length 0) { throw new StringIndexOutOfBoundsException(length
svn commit: r230931 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java
Author: ggregory Date: Mon Aug 8 16:59:16 2005 New Revision: 230931 URL: http://svn.apache.org/viewcvs?rev=230931view=rev Log: Statement unnecessarily nested within else clause. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java?rev=230931r1=230930r2=230931view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Mon Aug 8 16:59:16 2005 @@ -498,9 +498,8 @@ public String nextToken() { if (hasNext()) { return tokens[tokenPos++]; -} else { -return null; } +return null; } /** @@ -511,9 +510,8 @@ public String previousToken() { if (hasPrevious()) { return tokens[--tokenPos]; -} else { -return null; } +return null; } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r230713 - /jakarta/commons/proper/lang/trunk/project.xml
Author: ggregory Date: Sun Aug 7 16:40:09 2005 New Revision: 230713 URL: http://svn.apache.org/viewcvs?rev=230713view=rev Log: Adds contributors Oliver Heger and Nathan Beyer. Modified: jakarta/commons/proper/lang/trunk/project.xml Modified: jakarta/commons/proper/lang/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/project.xml?rev=230713r1=230712r2=230713view=diff == --- jakarta/commons/proper/lang/trunk/project.xml (original) +++ jakarta/commons/proper/lang/trunk/project.xml Sun Aug 7 16:40:09 2005 @@ -15,345 +15,339 @@ limitations under the License. -- project - pomVersion3/pomVersion - - idcommons-lang/id - nameLang/name - currentVersion2.2-dev/currentVersion - inceptionYear2001/inceptionYear - shortDescriptionJava Common Components/shortDescription - description + pomVersion3/pomVersion + idcommons-lang/id + nameLang/name + currentVersion2.2-dev/currentVersion + inceptionYear2001/inceptionYear + shortDescriptionJava Common Components/shortDescription + description Commons.Lang, a package of Java utility classes for the classes that are in java.lang's hierarchy, or are considered to be so standard as to justify existence in java.lang. /description - - logo/images/logo.png/logo - - urlhttp://jakarta.apache.org/commons/${pom.artifactId.substring(8)}//url - packageorg.apache.commons.${pom.artifactId.substring(8)}/package - - organization -nameThe Apache Software Foundation/name -urlhttp://jakarta.apache.org/url -logohttp://jakarta.apache.org/images/original-jakarta-logo.gif/logo - /organization - - licenses - license - nameThe Apache Software License, Version 2.0/name - url/LICENSE.txt/url - distributionrepo/distribution - /license - /licenses - - gumpRepositoryIdjakarta/gumpRepositoryId - issueTrackingUrlhttp://issues.apache.org/bugzilla//issueTrackingUrl - siteAddressjakarta.apache.org/siteAddress - siteDirectory/www/jakarta.apache.org/commons/${pom.artifactId.substring(8)}//siteDirectory - distributionDirectory/www/jakarta.apache.org/builds/jakarta-commons/${pom.artifactId.substring(8)}//distributionDirectory - - repository - connectionscm:svn:http://svn.apache.org/repos/asf/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk/connection - urlhttp://svn.apache.org/viewcvs/jakarta/commons/proper/${pom.artifactId.substring(8)}/trunk/url - /repository - - mailingLists -mailingList - nameCommons Dev List/name - subscribe[EMAIL PROTECTED]/subscribe - unsubscribe[EMAIL PROTECTED]/unsubscribe - archivehttp://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]/archive -/mailingList -mailingList - nameCommons User List/name - subscribe[EMAIL PROTECTED]/subscribe - unsubscribe[EMAIL PROTECTED]/unsubscribe - archivehttp://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]/archive -/mailingList - /mailingLists - - - developers -developer - nameDaniel Rall/name - iddlr/id - emaildlr@finemaltcoding.com/email - organizationCollabNet, Inc./organization - roles -roleJava Developer/role - /roles -/developer -developer - nameStephen Colebourne/name - idscolebourne/id - email[EMAIL PROTECTED]/email - organizationSITA ATS Ltd/organization - timezone0/timezone - roles -roleJava Developer/role - /roles -/developer -developer - nameHenri Yandell/name - idbayard/id - email[EMAIL PROTECTED]/email - organization/organization - roles -roleJava Developer/role - /roles -/developer -developer - nameSteven Caswell/name - idscaswell/id - email[EMAIL PROTECTED]/email - organization/organization - roles -roleJava Developer/role - /roles - timezone-5/timezone -/developer -developer - nameRobert Burrell Donkin/name - idrdonkin/id - email[EMAIL PROTECTED]/email - organization/organization - roles -roleJava Developer/role - /roles -/developer -developer - nameGary D. Gregory/name - idggregory/id - email[EMAIL PROTECTED]/email - organizationSeagull Software/organization - timezone-8/timezone - roles -roleJava Developer/role - /roles - /developer -developer - namePhil Steitz/name - idpsteitz/id - email[EMAIL PROTECTED]/email - organization/organization - roles -roleJava Developer/role - /roles -/developer -developer - nameFredrik Westermarck/name - idfredrik/id - email/email - organization/organization - roles -roleJava Developer/role - /roles -/developer - /developers - - contributors -contributor - nameC. Scott
svn commit: r230715 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java
Author: ggregory Date: Sun Aug 7 17:05:21 2005 New Revision: 230715 URL: http://svn.apache.org/viewcvs?rev=230715view=rev Log: Fix PMD warning: Avoid instantiating Boolean objects; you can usually invoke Boolean.TRUE instead. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java?rev=230715r1=230714r2=230715view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java Sun Aug 7 17:05:21 2005 @@ -3463,7 +3463,7 @@ * (index 0 || index array.length). */ public static boolean[] add(boolean[] array, int index, boolean element) { -return (boolean[]) add( array, index, new Boolean(element), Boolean.TYPE ); +return (boolean[]) add( array, index, BooleanUtils.toBooleanObject(element), Boolean.TYPE ); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r230717 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java
Author: ggregory Date: Sun Aug 7 17:43:36 2005 New Revision: 230717 URL: http://svn.apache.org/viewcvs?rev=230717view=rev Log: Statement unnecessarily nested within else clause. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java?rev=230717r1=230716r2=230717view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/ArrayUtils.java Sun Aug 7 17:43:36 2005 @@ -952,9 +952,8 @@ public static int getLength(Object array) { if (array == null) { return 0; -} else { -return Array.getLength(array); } +return Array.getLength(array); } /** @@ -3389,9 +3388,8 @@ Object newArray = Array.newInstance(array.getClass().getComponentType(), arrayLength + 1); System.arraycopy(array, 0, newArray, 0, arrayLength); return newArray; -} else { -return Array.newInstance(newArrayComponentType, 1); } +return Array.newInstance(newArrayComponentType, 1); } /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r230565 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/text/StrTokenizer.java test/org/apache/commons/lang/text/StrTokenizerTest.java
Author: ggregory Date: Sat Aug 6 11:53:57 2005 New Revision: 230565 URL: http://svn.apache.org/viewcvs?rev=230565view=rev Log: [Bug 36059] [lang] Wrong length check in StrTokenizer.StringMatcher. From Oliver Heger [EMAIL PROTECTED]. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java?rev=230565r1=230564r2=230565view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrTokenizer.java Sat Aug 6 11:53:57 2005 @@ -1238,7 +1238,7 @@ */ public int isMatch(char[] text, int textLen, int pos) { int len = chars.length; -if (pos + len = textLen) { +if (pos + len textLen) { return 0; } for (int i = 0; i chars.length; i++, pos++) { Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java?rev=230565r1=230564r2=230565view=diff == --- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java (original) +++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/StrTokenizerTest.java Sat Aug 6 11:53:57 2005 @@ -379,6 +379,22 @@ assertEquals(f, tok.next()); assertEquals(g, tok.next()); } + +public void testStringMatcher() { +// build test fixture +char[] data = new char[26]; +for(int i = 0; i data.length; i++) { +data[i] = (char) (i + 'a'); +} +// perform tests +StrTokenizer.Matcher matcher = new StrTokenizer.StringMatcher(z); +for(int i = 0; i data.length - 1; i++) { +assertEquals(0, matcher.isMatch(data, data.length, i)); +} +assertEquals(1, matcher.isMatch(data, data.length, data.length - 1)); +// test bad pos argument. +assertEquals(0, matcher.isMatch(data, data.length, data.length +100)); +} public void testTSV() { this.testXSVAbc(StrTokenizer.getTSVInstance(TSV_SIMPLE_FIXTURE)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r230403 - in /jakarta/commons/proper/lang/trunk/src: java/org/apache/commons/lang/exception/NestableDelegate.java test/org/apache/commons/lang/exception/NestableDelegateTestCase.java
Author: ggregory Date: Thu Aug 4 23:16:19 2005 New Revision: 230403 URL: http://svn.apache.org/viewcvs?rev=230403view=rev Log: Slightly increments the test coverage for NestableDelegate. Includes a rework of the getMessage(String) method. Courtesy of Nathan Beyer [EMAIL PROTECTED] Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/exception/NestableDelegateTestCase.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java?rev=230403r1=230402r2=230403view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/exception/NestableDelegate.java Thu Aug 4 23:16:19 2005 @@ -106,68 +106,54 @@ } /** - * Returns the error message of the codeThrowable/code in the chain - * of codeThrowable/codes at the specified index, numbered from 0. - * - * @param index the index of the codeThrowable/code in the chain of - * codeThrowable/codes - * @return the error message, or null if the codeThrowable/code at the - * specified index in the chain does not contain a message - * @throws IndexOutOfBoundsException if the codeindex/code argument is - * negative or not less than the count of codeThrowable/codes in the - * chain + * Returns the error message of the codeThrowable/code in the chain of codeThrowable/codes at the + * specified index, numbered from 0. + * + * @param index + *the index of the codeThrowable/code in the chain of codeThrowable/codes + * @return the error message, or null if the codeThrowable/code at the specified index in the chain does not + * contain a message + * @throws IndexOutOfBoundsException + * if the codeindex/code argument is negative or not less than the count of codeThrowable/codes + * in the chain * @since 2.0 */ public String getMessage(int index) { Throwable t = this.getThrowable(index); if (Nestable.class.isInstance(t)) { return ((Nestable) t).getMessage(0); -} else { -return t.getMessage(); } +return t.getMessage(); } /** - * Returns the full message contained by the codeNestable/code - * and any nested codeThrowable/codes. - * - * @param baseMsg the base message to use when creating the full - * message. Should be generally be called via - * codenestableHelper.getMessage(super.getMessage())/code, - * where codesuper/code is an instance of [EMAIL PROTECTED] - * java.lang.Throwable}. - * @return The concatenated message for this and all nested - * codeThrowable/codes + * Returns the full message contained by the codeNestable/code and any nested codeThrowable/codes. + * + * @param baseMsg + *the base message to use when creating the full message. Should be generally be called via + *codenestableHelper.getMessage(super.getMessage())/code, where codesuper/code is an + *instance of [EMAIL PROTECTED] java.lang.Throwable}. + * @return The concatenated message for this and all nested codeThrowable/codes * @since 2.0 */ public String getMessage(String baseMsg) { -StringBuffer msg = new StringBuffer(); -if (baseMsg != null) { -msg.append(baseMsg); -} - Throwable nestedCause = ExceptionUtils.getCause(this.nestable); -if (nestedCause != null) { -String causeMsg = nestedCause.getMessage(); -if (causeMsg != null) { -if (baseMsg != null) { -msg.append(: ); -} -msg.append(causeMsg); -} - +String causeMsg = nestedCause == null ? null : nestedCause.getMessage(); +if (nestedCause == null || causeMsg == null) { +return baseMsg; // may be null, which is a valid result +} +if (baseMsg == null) { +return causeMsg; } -return msg.length() 0 ? msg.toString() : null; +return baseMsg + : + causeMsg; } /** - * Returns the error message of this and any nested codeThrowable/codes - * in an array of Strings, one element for each message. Any - * codeThrowable/code not containing a message is represented in the - * array by a null. This has the effect of cause the length of the returned - * array to be equal to the result of the [EMAIL PROTECTED
svn commit: r227239 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
Author: ggregory Date: Wed Aug 3 11:00:04 2005 New Revision: 227239 URL: http://svn.apache.org/viewcvs?rev=227239view=rev Log: Use CAPACITY, not literal magic number. Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java?rev=227239r1=227238r2=227239view=diff == --- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java (original) +++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java Wed Aug 3 11:00:04 2005 @@ -101,9 +101,9 @@ public StrBuilder(String str) { super(); if (str == null) { -buf = new char[32]; +buf = new char[CAPACITY]; } else { -buf = new char[str.length() + 32]; +buf = new char[str.length() + CAPACITY]; append(str); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]