diff --git a/src/java/org/apache/commons/lang/ClassUtils.java b/src/java/org/apache/commons/lang/ClassUtils.java index 8deb06f01..63a17cfdb 100644 --- a/src/java/org/apache/commons/lang/ClassUtils.java +++ b/src/java/org/apache/commons/lang/ClassUtils.java @@ -170,7 +170,7 @@ public class ClassUtils { *

Gets the package name from a String.

* *

The string passed in is assumed to be a class name - it is not checked.

- *

If the class is unpackaged, return an empty string.

+ *

If the class is unpackaged, return an empty string.

* * @param className the className to get the package name for, may be null * @return the package name or an empty string diff --git a/src/java/org/apache/commons/lang/Validate.java b/src/java/org/apache/commons/lang/Validate.java index 62ed3b482..added2a49 100644 --- a/src/java/org/apache/commons/lang/Validate.java +++ b/src/java/org/apache/commons/lang/Validate.java @@ -35,7 +35,7 @@ import java.util.Map; * @author Gary Gregory * @author Norm Deane * @since 2.0 - * @version $Id: Validate.java,v 1.13 2004/10/08 21:44:41 scolebourne Exp $ + * @version $Id$ */ public class Validate { // Validate has no dependencies on other classes in Commons Lang at present @@ -508,13 +508,13 @@ public class Validate { * @since 2.1 */ public static void allElementsOfType(Collection collection, Class clazz, String message) { - Validate.notNull(collection); + Validate.notNull(collection); Validate.notNull(clazz); - for (Iterator it = collection.iterator(); it.hasNext(); ) { - if (clazz.isInstance(it.next()) == false) { - throw new IllegalArgumentException(message); - } - } + for (Iterator it = collection.iterator(); it.hasNext(); ) { + if (clazz.isInstance(it.next()) == false) { + throw new IllegalArgumentException(message); + } + } } /** @@ -533,15 +533,15 @@ public class Validate { * @since 2.1 */ public static void allElementsOfType(Collection collection, Class clazz) { - Validate.notNull(collection); + Validate.notNull(collection); Validate.notNull(clazz); - int i = 0; - for (Iterator it = collection.iterator(); it.hasNext(); i++) { + int i = 0; + for (Iterator it = collection.iterator(); it.hasNext(); i++) { if (clazz.isInstance(it.next()) == false) { - throw new IllegalArgumentException("The validated collection contains an element not of type " + throw new IllegalArgumentException("The validated collection contains an element not of type " + clazz.getName() + " at index: " + i); - } - } + } + } } } diff --git a/src/java/org/apache/commons/lang/text/StrTokenizer.java b/src/java/org/apache/commons/lang/text/StrTokenizer.java index be290928d..7d9054b5d 100644 --- a/src/java/org/apache/commons/lang/text/StrTokenizer.java +++ b/src/java/org/apache/commons/lang/text/StrTokenizer.java @@ -73,7 +73,7 @@ import java.util.ListIterator; * @author Stephen Colebourne * @author Gary D. Gregory * @since 2.1 - * @version $Id: StrTokenizer.java,v 1.6 2004/12/25 21:02:20 bayard Exp $ + * @version $Id$ */ public class StrTokenizer implements ListIterator, Cloneable { @@ -839,20 +839,20 @@ public class StrTokenizer implements ListIterator, Cloneable { /* Trim string based on the trimmer matcher */ while (trimmer.isMatch(chars, 1, start) > 0) { - start++; - } + start++; + } - int length = Math.min(pos, len) - start; + int length = Math.min(pos, len) - start; while (trimmer.isMatch(chars, 1, start + length - 1) > 0) { - length--; - } + length--; + } for (int i=0;iChristopher Elkins * @author Ringo De Smet * @author Tim O'Brien - * @version $Revision: 1.8 $ $Date: 2004/02/18 23:22:29 $ + * @version $Revision: 1.8 $ $Date$ */ public final class NumberRangeTest extends TestCase { @@ -183,28 +183,28 @@ public final class NumberRangeTest extends TestCase { assertEquals("Unexpected max on NumberRange", 2.0, nr.getMaximum().doubleValue(), Double.MIN_VALUE); } - public void testConstructorNullParameters() { - try { - NumberRange nr = new NumberRange(null); - fail("NumberRange(null) did not throw an exception."); - } catch (Exception e) { - assertTrue( "NumberRange(null)", e instanceof NullPointerException); - } + public void testConstructorNullParameters() { + try { + NumberRange nr = new NumberRange(null); + fail("NumberRange(null) did not throw an exception."); + } catch (Exception e) { + assertTrue( "NumberRange(null)", e instanceof NullPointerException); + } - try { - NumberRange nr = new NumberRange(five, null); - fail("NumberRange(five, null) did not throw an exception."); - } catch (Exception e) { - assertTrue("NumberRange(five, null)", e instanceof NullPointerException); - } + try { + NumberRange nr = new NumberRange(five, null); + fail("NumberRange(five, null) did not throw an exception."); + } catch (Exception e) { + assertTrue("NumberRange(five, null)", e instanceof NullPointerException); + } - try { - NumberRange nr = new NumberRange(null, five); - fail("NumberRange(null, five) did not throw an exception."); - } catch (Exception e) { - assertTrue("NumberRange(null, five)", e instanceof NullPointerException); - } - } + try { + NumberRange nr = new NumberRange(null, five); + fail("NumberRange(null, five) did not throw an exception."); + } catch (Exception e) { + assertTrue("NumberRange(null, five)", e instanceof NullPointerException); + } + } public void testConstructorWithMaxLessThanMin() { NumberRange nr = new NumberRange( new Double(2.0), new Double(1.0)); diff --git a/src/test/org/apache/commons/lang/RandomStringUtilsTest.java b/src/test/org/apache/commons/lang/RandomStringUtilsTest.java index 1a66e3b0c..2d184b65a 100644 --- a/src/test/org/apache/commons/lang/RandomStringUtilsTest.java +++ b/src/test/org/apache/commons/lang/RandomStringUtilsTest.java @@ -29,7 +29,7 @@ import junit.textui.TestRunner; * @author Steven Caswell * @author Ringo De Smet * @author Phil Steitz - * @version $Id: RandomStringUtilsTest.java,v 1.13 2004/02/18 23:06:19 ggregory Exp $ + * @version $Id$ */ public class RandomStringUtilsTest extends junit.framework.TestCase { /** @@ -40,8 +40,8 @@ public class RandomStringUtilsTest extends junit.framework.TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(RandomStringUtilsTest.class); - suite.setName("RandomStringUtils Tests"); + TestSuite suite = new TestSuite(RandomStringUtilsTest.class); + suite.setName("RandomStringUtils Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/SerializationUtilsTest.java b/src/test/org/apache/commons/lang/SerializationUtilsTest.java index e55bba784..c020377dc 100644 --- a/src/test/org/apache/commons/lang/SerializationUtilsTest.java +++ b/src/test/org/apache/commons/lang/SerializationUtilsTest.java @@ -33,7 +33,7 @@ import junit.textui.TestRunner; * * @author Stephen Colebourne * @author Ringo De Smet - * @version $Id: SerializationUtilsTest.java,v 1.6 2004/02/18 23:06:19 ggregory Exp $ + * @version $Id$ */ public class SerializationUtilsTest extends TestCase { private String iString; @@ -49,8 +49,8 @@ public class SerializationUtilsTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(SerializationUtilsTest.class); - suite.setName("SerializationUtils Tests"); + TestSuite suite = new TestSuite(SerializationUtilsTest.class); + suite.setName("SerializationUtils Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/StringUtilsEqualsIndexOfTest.java b/src/test/org/apache/commons/lang/StringUtilsEqualsIndexOfTest.java index b0ac1fec9..09831fdb6 100644 --- a/src/test/org/apache/commons/lang/StringUtilsEqualsIndexOfTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsEqualsIndexOfTest.java @@ -26,7 +26,7 @@ import junit.textui.TestRunner; * @author Stephen Colebourne * @author Ringo De Smet * @author Phil Steitz - * @version $Id: StringUtilsEqualsIndexOfTest.java,v 1.10 2004/02/18 23:06:19 ggregory Exp $ + * @version $Id$ */ public class StringUtilsEqualsIndexOfTest extends TestCase { private static final String FOO = "foo"; @@ -43,8 +43,8 @@ public class StringUtilsEqualsIndexOfTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(StringUtilsEqualsIndexOfTest.class); - suite.setName("StringUtilsEqualsIndexOf Tests"); + TestSuite suite = new TestSuite(StringUtilsEqualsIndexOfTest.class); + suite.setName("StringUtilsEqualsIndexOf Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/StringUtilsIsTest.java b/src/test/org/apache/commons/lang/StringUtilsIsTest.java index 501967b7f..d0964a3da 100644 --- a/src/test/org/apache/commons/lang/StringUtilsIsTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsIsTest.java @@ -25,7 +25,7 @@ import junit.textui.TestRunner; * * @author Stephen Colebourne * @author Michael Davey - * @version $Id: StringUtilsIsTest.java,v 1.9 2004/02/24 22:31:43 fredrik Exp $ + * @version $Id$ */ public class StringUtilsIsTest extends TestCase { @@ -38,8 +38,8 @@ public class StringUtilsIsTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(StringUtilsIsTest.class); - suite.setName("StringUtilsIsXxx Tests"); + TestSuite suite = new TestSuite(StringUtilsIsTest.class); + suite.setName("StringUtilsIsXxx Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/StringUtilsSubstringTest.java b/src/test/org/apache/commons/lang/StringUtilsSubstringTest.java index 3fd80c9b3..905121335 100644 --- a/src/test/org/apache/commons/lang/StringUtilsSubstringTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsSubstringTest.java @@ -26,7 +26,7 @@ import junit.textui.TestRunner; * @author Stephen Colebourne * @author Ringo De Smet * @author Phil Steitz - * @version $Id: StringUtilsSubstringTest.java,v 1.14 2004/02/18 23:06:19 ggregory Exp $ + * @version $Id$ */ public class StringUtilsSubstringTest extends TestCase { private static final String FOO = "foo"; @@ -44,8 +44,8 @@ public class StringUtilsSubstringTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(StringUtilsSubstringTest.class); - suite.setName("StringUtilsSubstring Tests"); + TestSuite suite = new TestSuite(StringUtilsSubstringTest.class); + suite.setName("StringUtilsSubstring Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/StringUtilsTest.java b/src/test/org/apache/commons/lang/StringUtilsTest.java index ebe0151cc..f5a8d1ea9 100644 --- a/src/test/org/apache/commons/lang/StringUtilsTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsTest.java @@ -98,8 +98,8 @@ public class StringUtilsTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(StringUtilsTest.class); - suite.setName("StringUtilsTest Tests"); + TestSuite suite = new TestSuite(StringUtilsTest.class); + suite.setName("StringUtilsTest Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/StringUtilsTrimEmptyTest.java b/src/test/org/apache/commons/lang/StringUtilsTrimEmptyTest.java index 4b688a341..090b3f409 100644 --- a/src/test/org/apache/commons/lang/StringUtilsTrimEmptyTest.java +++ b/src/test/org/apache/commons/lang/StringUtilsTrimEmptyTest.java @@ -25,7 +25,7 @@ import junit.textui.TestRunner; * * @author Stephen Colebourne * @author Ringo De Smet - * @version $Id: StringUtilsTrimEmptyTest.java,v 1.17 2004/02/18 23:06:19 ggregory Exp $ + * @version $Id$ */ public class StringUtilsTrimEmptyTest extends TestCase { private static final String FOO = "foo"; @@ -39,8 +39,8 @@ public class StringUtilsTrimEmptyTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(StringUtilsTrimEmptyTest.class); - suite.setName("StringUtilsTrimEmpty Tests"); + TestSuite suite = new TestSuite(StringUtilsTrimEmptyTest.class); + suite.setName("StringUtilsTrimEmpty Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/ValidateTest.java b/src/test/org/apache/commons/lang/ValidateTest.java index 1f70e42c0..07b9e8091 100644 --- a/src/test/org/apache/commons/lang/ValidateTest.java +++ b/src/test/org/apache/commons/lang/ValidateTest.java @@ -30,7 +30,7 @@ import junit.textui.TestRunner; * * @author Stephen Colebourne * @author Norm Deane - * @version $Id: ValidateTest.java,v 1.6 2004/10/08 21:44:41 scolebourne Exp $ + * @version $Id$ */ public class ValidateTest extends TestCase { @@ -43,8 +43,8 @@ public class ValidateTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(ValidateTest.class); - suite.setName("Validate Tests"); + TestSuite suite = new TestSuite(ValidateTest.class); + suite.setName("Validate Tests"); return suite; } @@ -359,23 +359,23 @@ public class ValidateTest extends TestCase { //----------------------------------------------------------------------- public void testAllElementsOfType() { - List coll = new ArrayList(); - coll.add("a"); - coll.add("b"); - Validate.allElementsOfType(coll, String.class, "MSG"); - try { - Validate.allElementsOfType(coll, Integer.class, "MSG"); - fail("Expecting IllegalArgumentException"); - } catch (IllegalArgumentException ex) { - assertEquals("MSG", ex.getMessage()); - } - coll.set(1, Boolean.FALSE); - try { - Validate.allElementsOfType(coll, String.class); - fail("Expecting IllegalArgumentException"); - } catch (IllegalArgumentException ex) { - assertEquals("The validated collection contains an element not of type java.lang.String at index: 1", ex.getMessage()); - } + List coll = new ArrayList(); + coll.add("a"); + coll.add("b"); + Validate.allElementsOfType(coll, String.class, "MSG"); + try { + Validate.allElementsOfType(coll, Integer.class, "MSG"); + fail("Expecting IllegalArgumentException"); + } catch (IllegalArgumentException ex) { + assertEquals("MSG", ex.getMessage()); + } + coll.set(1, Boolean.FALSE); + try { + Validate.allElementsOfType(coll, String.class); + fail("Expecting IllegalArgumentException"); + } catch (IllegalArgumentException ex) { + assertEquals("The validated collection contains an element not of type java.lang.String at index: 1", ex.getMessage()); + } coll = new ArrayList(); coll.add(new Integer(5)); diff --git a/src/test/org/apache/commons/lang/builder/CompareToBuilderTest.java b/src/test/org/apache/commons/lang/builder/CompareToBuilderTest.java index dd052c01c..57ba7e703 100644 --- a/src/test/org/apache/commons/lang/builder/CompareToBuilderTest.java +++ b/src/test/org/apache/commons/lang/builder/CompareToBuilderTest.java @@ -27,7 +27,7 @@ import junit.textui.TestRunner; * * @author Steve Downey * @author Stephen Colebourne - * @version $Id: CompareToBuilderTest.java,v 1.8 2004/02/18 23:00:51 ggregory Exp $ + * @version $Id$ */ public class CompareToBuilderTest extends TestCase { @@ -77,10 +77,10 @@ public class CompareToBuilderTest extends TestCase { public int getA() { return a; } - public int compareTo(Object o) { - TestObject rhs = (TestObject) o; - return (a < rhs.a) ? -1 : (a > rhs.a) ? +1 : 0; - } + public int compareTo(Object o) { + TestObject rhs = (TestObject) o; + return (a < rhs.a) ? -1 : (a > rhs.a) ? +1 : 0; + } } static class TestSubObject extends TestObject { diff --git a/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java b/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java index 6e4e5300f..fa080c48d 100644 --- a/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java +++ b/src/test/org/apache/commons/lang/builder/ToStringBuilderTest.java @@ -30,7 +30,7 @@ import junit.textui.TestRunner; * @author Stephen Colebourne * @author Gary Gregory * @author Alex Chaffee - * @version $Id: ToStringBuilderTest.java,v 1.16 2004/07/26 21:39:21 ggregory Exp $ + * @version $Id$ */ public class ToStringBuilderTest extends TestCase { @@ -355,15 +355,15 @@ public class ToStringBuilderTest extends TestCase { this.validateEmptyReflectionRegistry(); } - static class ReflectionTestFixtureA { - private char a='a'; + static class ReflectionTestFixtureA { + private char a='a'; private transient char transientA='t'; - } + } - static class ReflectionTestFixtureB extends ReflectionTestFixtureA { - private char b='b'; + static class ReflectionTestFixtureB extends ReflectionTestFixtureA { + private char b='b'; private transient char transientB='t'; - } + } public void testInnerClassReflection() { Outer outer = new Outer(); diff --git a/src/test/org/apache/commons/lang/enum/EnumTest.java b/src/test/org/apache/commons/lang/enum/EnumTest.java index c2ffa110a..20aae0af4 100644 --- a/src/test/org/apache/commons/lang/enum/EnumTest.java +++ b/src/test/org/apache/commons/lang/enum/EnumTest.java @@ -35,7 +35,7 @@ import org.apache.commons.lang.SerializationUtils; * * @author Stephen Colebourne * @author Gary D. Gregory - * @version $Id: EnumTest.java,v 1.17 2004/02/18 23:01:51 ggregory Exp $ + * @version $Id$ */ public final class EnumTest extends TestCase { @@ -105,7 +105,7 @@ public final class EnumTest extends TestCase { assertNotNull(list); assertEquals( list.size(), - ColorEnum.getEnumMap().keySet().size()); + ColorEnum.getEnumMap().keySet().size()); Iterator it = list.iterator(); assertSame(ColorEnum.RED, it.next()); diff --git a/src/test/org/apache/commons/lang/enum/ValuedEnumTest.java b/src/test/org/apache/commons/lang/enum/ValuedEnumTest.java index ff0d2f11d..f0f441598 100644 --- a/src/test/org/apache/commons/lang/enum/ValuedEnumTest.java +++ b/src/test/org/apache/commons/lang/enum/ValuedEnumTest.java @@ -28,7 +28,7 @@ import org.apache.commons.lang.SerializationUtils; * Test cases for the {@link Enum} class. * * @author Stephen Colebourne - * @version $Id: ValuedEnumTest.java,v 1.7 2004/02/18 23:22:29 ggregory Exp $ + * @version $Id$ */ public final class ValuedEnumTest extends TestCase { @@ -88,7 +88,7 @@ public final class ValuedEnumTest extends TestCase { assertNotNull(list); assertEquals( list.size(), - ValuedColorEnum.getEnumMap().keySet().size()); + ValuedColorEnum.getEnumMap().keySet().size()); Iterator it = list.iterator(); assertSame(ValuedColorEnum.RED, it.next()); @@ -102,8 +102,8 @@ public final class ValuedEnumTest extends TestCase { assertNotNull(map); assertEquals( map.keySet().size(), - ValuedColorEnum.getEnumList().size()); - + ValuedColorEnum.getEnumList().size()); + assertTrue(map.containsValue(ValuedColorEnum.RED)); assertTrue(map.containsValue(ValuedColorEnum.GREEN)); assertTrue(map.containsValue(ValuedColorEnum.BLUE)); diff --git a/src/test/org/apache/commons/lang/enums/EnumTest.java b/src/test/org/apache/commons/lang/enums/EnumTest.java index 1c8e2c4d3..4b4f737f9 100644 --- a/src/test/org/apache/commons/lang/enums/EnumTest.java +++ b/src/test/org/apache/commons/lang/enums/EnumTest.java @@ -35,7 +35,7 @@ import org.apache.commons.lang.SerializationUtils; * * @author Stephen Colebourne * @author Gary D. Gregory - * @version $Id: EnumTest.java,v 1.1 2004/02/23 04:34:20 ggregory Exp $ + * @version $Id$ */ public final class EnumTest extends TestCase { @@ -105,7 +105,7 @@ public final class EnumTest extends TestCase { assertNotNull(list); assertEquals( list.size(), - ColorEnum.getEnumMap().keySet().size()); + ColorEnum.getEnumMap().keySet().size()); Iterator it = list.iterator(); assertSame(ColorEnum.RED, it.next()); diff --git a/src/test/org/apache/commons/lang/enums/ValuedEnumTest.java b/src/test/org/apache/commons/lang/enums/ValuedEnumTest.java index 3e4551006..63a3cd399 100644 --- a/src/test/org/apache/commons/lang/enums/ValuedEnumTest.java +++ b/src/test/org/apache/commons/lang/enums/ValuedEnumTest.java @@ -28,7 +28,7 @@ import org.apache.commons.lang.SerializationUtils; * Test cases for the {@link Enum} class. * * @author Stephen Colebourne - * @version $Id: ValuedEnumTest.java,v 1.1 2004/02/23 04:34:20 ggregory Exp $ + * @version $Id$ */ public final class ValuedEnumTest extends TestCase { @@ -88,7 +88,7 @@ public final class ValuedEnumTest extends TestCase { assertNotNull(list); assertEquals( list.size(), - ValuedColorEnum.getEnumMap().keySet().size()); + ValuedColorEnum.getEnumMap().keySet().size()); Iterator it = list.iterator(); assertSame(ValuedColorEnum.RED, it.next()); @@ -102,8 +102,8 @@ public final class ValuedEnumTest extends TestCase { assertNotNull(map); assertEquals( map.keySet().size(), - ValuedColorEnum.getEnumList().size()); - + ValuedColorEnum.getEnumList().size()); + assertTrue(map.containsValue(ValuedColorEnum.RED)); assertTrue(map.containsValue(ValuedColorEnum.GREEN)); assertTrue(map.containsValue(ValuedColorEnum.BLUE)); diff --git a/src/test/org/apache/commons/lang/exception/NestableDelegateTestCase.java b/src/test/org/apache/commons/lang/exception/NestableDelegateTestCase.java index 4825611b5..1a0cad9d1 100644 --- a/src/test/org/apache/commons/lang/exception/NestableDelegateTestCase.java +++ b/src/test/org/apache/commons/lang/exception/NestableDelegateTestCase.java @@ -30,7 +30,7 @@ import junit.textui.TestRunner; * * @author Steven Caswell * @author Daniel Rall - * @version $Id: NestableDelegateTestCase.java,v 1.10 2004/12/25 19:50:09 bayard Exp $ + * @version $Id$ */ public class NestableDelegateTestCase extends junit.framework.TestCase { private static final String CONSTRUCTOR_FAILED_MSG = @@ -521,7 +521,7 @@ public class NestableDelegateTestCase extends junit.framework.TestCase { // Only testing the flags for jdk1.3 and below if (!ExceptionUtils.isThrowableNested()) { - NestableDelegate.topDown = true; NestableDelegate.trimStackFrames = true; + NestableDelegate.topDown = true; NestableDelegate.trimStackFrames = true; checkStackTrace(d, true, true, NestableDelegateTester1.class.getName()+": level 1", 24); NestableDelegate.topDown = true; NestableDelegate.trimStackFrames = false; checkStackTrace(d, true, false, NestableDelegateTester1.class.getName()+": level 1", 80); diff --git a/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java b/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java index 5ace943a6..bcbf4a44a 100644 --- a/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java +++ b/src/test/org/apache/commons/lang/exception/NestableExceptionTestCase.java @@ -30,7 +30,7 @@ import junit.textui.TestRunner; * Tests the org.apache.commons.lang.exception.NestableException class. * * @author Steven Caswell - * @version $Id: NestableExceptionTestCase.java,v 1.12 2004/10/09 10:45:24 scolebourne Exp $ + * @version $Id$ */ public class NestableExceptionTestCase extends AbstractNestableTestCase { @@ -252,61 +252,61 @@ public class NestableExceptionTestCase extends AbstractNestableTestCase { } public void testSerialization() - throws java.io.IOException, ClassNotFoundException + throws java.io.IOException, ClassNotFoundException { - RuntimeException nestedEx = new RuntimeException("nested exception message"); - NestableExceptionTester1 ex = new NestableExceptionTester1("serialization test", nestedEx); + RuntimeException nestedEx = new RuntimeException("nested exception message"); + NestableExceptionTester1 ex = new NestableExceptionTester1("serialization test", nestedEx); - assertTrue( "implements java.io.Serializable", nestedEx instanceof java.io.Serializable); - - assertTrue( "implements java.io.Serializable", ex instanceof java.io.Serializable); - - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ByteArrayInputStream bais = null; - ObjectOutputStream oos = null; - ObjectInputStream ois = null; + assertTrue( "implements java.io.Serializable", nestedEx instanceof java.io.Serializable); + + assertTrue( "implements java.io.Serializable", ex instanceof java.io.Serializable); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ByteArrayInputStream bais = null; + ObjectOutputStream oos = null; + ObjectInputStream ois = null; - try - { - oos = new ObjectOutputStream(baos); - oos.writeObject(ex); - oos.flush(); - bais = new ByteArrayInputStream(baos.toByteArray()); - ois = new ObjectInputStream(bais); - NestableExceptionTester1 deserializedEx = (NestableExceptionTester1) ois.readObject(); - assertEquals( - "getThrowableCount() return value", - ex.getThrowableCount(), - deserializedEx.getThrowableCount()); - - for (int i = 0; i < ex.getThrowableCount(); i++) - { - Throwable t = ex.getThrowable(i); - Throwable deserializedThrowable = deserializedEx.getThrowable(i); - - assertEquals( t.getClass(), - deserializedThrowable.getClass()); - - assertEquals( - t.getMessage(), - deserializedThrowable.getMessage()); - } - } - finally - { - if (null != oos) - { - try - { - oos.close(); - } - catch (Exception ignored) - { - // intentionally empty - } - } - } - + try + { + oos = new ObjectOutputStream(baos); + oos.writeObject(ex); + oos.flush(); + bais = new ByteArrayInputStream(baos.toByteArray()); + ois = new ObjectInputStream(bais); + NestableExceptionTester1 deserializedEx = (NestableExceptionTester1) ois.readObject(); + assertEquals( + "getThrowableCount() return value", + ex.getThrowableCount(), + deserializedEx.getThrowableCount()); + + for (int i = 0; i < ex.getThrowableCount(); i++) + { + Throwable t = ex.getThrowable(i); + Throwable deserializedThrowable = deserializedEx.getThrowable(i); + + assertEquals( t.getClass(), + deserializedThrowable.getClass()); + + assertEquals( + t.getMessage(), + deserializedThrowable.getMessage()); + } + } + finally + { + if (null != oos) + { + try + { + oos.close(); + } + catch (Exception ignored) + { + // intentionally empty + } + } + } + } } diff --git a/src/test/org/apache/commons/lang/text/InterpolationTest.java b/src/test/org/apache/commons/lang/text/InterpolationTest.java index 0086e8671..805393558 100644 --- a/src/test/org/apache/commons/lang/text/InterpolationTest.java +++ b/src/test/org/apache/commons/lang/text/InterpolationTest.java @@ -28,7 +28,7 @@ import java.util.HashMap; * * @author Henri Yandell * @author Ken Fitzpatrick - * @version $Id: InterpolationTest.java,v 1.1 2004/09/05 00:56:31 bayard Exp $ + * @version $Id$ */ public class InterpolationTest extends TestCase { @@ -45,8 +45,8 @@ public class InterpolationTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(InterpolationTest.class); - suite.setName("Interpolation Tests"); + TestSuite suite = new TestSuite(InterpolationTest.class); + suite.setName("Interpolation Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java b/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java index b46d8d3bd..9c6e4b1ac 100644 --- a/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java +++ b/src/test/org/apache/commons/lang/time/DateFormatUtilsTest.java @@ -41,8 +41,8 @@ public class DateFormatUtilsTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(DateFormatUtilsTest.class); - suite.setName("DateFormatUtils Tests"); + TestSuite suite = new TestSuite(DateFormatUtilsTest.class); + suite.setName("DateFormatUtils Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/time/DateUtilsTest.java b/src/test/org/apache/commons/lang/time/DateUtilsTest.java index 09ab77a4e..d17a3201d 100644 --- a/src/test/org/apache/commons/lang/time/DateUtilsTest.java +++ b/src/test/org/apache/commons/lang/time/DateUtilsTest.java @@ -81,8 +81,8 @@ public class DateUtilsTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(DateUtilsTest.class); - suite.setName("DateUtils Tests"); + TestSuite suite = new TestSuite(DateUtilsTest.class); + suite.setName("DateUtils Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java b/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java index b95c26e08..cccc6e4e5 100644 --- a/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java +++ b/src/test/org/apache/commons/lang/time/DurationFormatUtilsTest.java @@ -42,8 +42,8 @@ public class DurationFormatUtilsTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(DurationFormatUtilsTest.class); - suite.setName("DurationFormatUtils Tests"); + TestSuite suite = new TestSuite(DurationFormatUtilsTest.class); + suite.setName("DurationFormatUtils Tests"); return suite; } diff --git a/src/test/org/apache/commons/lang/time/StopWatchTest.java b/src/test/org/apache/commons/lang/time/StopWatchTest.java index 40f6d4bef..a8157e435 100644 --- a/src/test/org/apache/commons/lang/time/StopWatchTest.java +++ b/src/test/org/apache/commons/lang/time/StopWatchTest.java @@ -33,8 +33,8 @@ public class StopWatchTest extends TestCase { } public static Test suite() { - TestSuite suite = new TestSuite(StopWatchTest.class); - suite.setName("StopWatch Tests"); + TestSuite suite = new TestSuite(StopWatchTest.class); + suite.setName("StopWatch Tests"); return suite; }