Author: bayard Date: Wed May 20 04:48:19 2009 New Revision: 776546 URL: http://svn.apache.org/viewvc?rev=776546&view=rev Log: Removing tabs
Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/keyvalue/MultiKey.java commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestIteratorUtils.java commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestNullComparator.java commons/proper/collections/trunk/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java commons/proper/collections/trunk/src/test/org/apache/commons/collections/keyvalue/TestMultiKey.java commons/proper/collections/trunk/src/test/org/apache/commons/collections/list/TestTreeList.java Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/keyvalue/MultiKey.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/keyvalue/MultiKey.java?rev=776546&r1=776545&r2=776546&view=diff ============================================================================== --- commons/proper/collections/trunk/src/java/org/apache/commons/collections/keyvalue/MultiKey.java (original) +++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/keyvalue/MultiKey.java Wed May 20 04:48:19 2009 @@ -249,29 +249,29 @@ return "MultiKey" + Arrays.asList(keys).toString(); } - /** - * Calculate the hash code of the instance using the provided keys. - * @param keys - */ - private void calculateHashCode(Object[] keys) - { - int total = 0; + /** + * Calculate the hash code of the instance using the provided keys. + * @param keys + */ + private void calculateHashCode(Object[] keys) + { + int total = 0; for (int i = 0; i < keys.length; i++) { if (keys[i] != null) { total ^= keys[i].hashCode(); } } hashCode = total; - } - - /** - * Recalculate the hash code after deserialization. The hash code of some - * keys might have change (hash codes based on the system hash code are - * only stable for the same process). - * @return the instance with recalculated hash code - */ - private Object readResolve() { - calculateHashCode(keys); - return this; - } + } + + /** + * Recalculate the hash code after deserialization. The hash code of some + * keys might have change (hash codes based on the system hash code are + * only stable for the same process). + * @return the instance with recalculated hash code + */ + private Object readResolve() { + calculateHashCode(keys); + return this; + } } Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestIteratorUtils.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestIteratorUtils.java?rev=776546&r1=776545&r2=776546&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestIteratorUtils.java (original) +++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/TestIteratorUtils.java Wed May 20 04:48:19 2009 @@ -563,9 +563,9 @@ } //----------------------------------------------------------------------- - /** - * Test next() and hasNext() for an immutable Iterator. - */ + /** + * Test next() and hasNext() for an immutable Iterator. + */ public void testUnmodifiableIteratorIteration() { Iterator iterator = getImmutableIterator(); @@ -669,7 +669,7 @@ * Test remove() for an immutable ListIterator. */ public void testUnmodifiableListIteratorImmutability() { - ListIterator listIterator = getImmutableListIterator(); + ListIterator listIterator = getImmutableListIterator(); try { listIterator.remove(); Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java?rev=776546&r1=776545&r2=776546&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java (original) +++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/AbstractTestComparator.java Wed May 20 04:48:19 2009 @@ -202,16 +202,16 @@ // test to make sure the canonical form has been preserved try { comparator = (Comparator) readExternalFormFromDisk(getCanonicalComparatorName(makeComparator())); - } catch (FileNotFoundException exception) { + } catch (FileNotFoundException exception) { boolean autoCreateSerialized = false; - if(autoCreateSerialized) { - comparator = makeComparator(); - String fileName = getCanonicalComparatorName(comparator); - writeExternalFormToDisk((Serializable) comparator, fileName); - fail("Serialized form could not be found. A serialized version " + - "has now been written (and should be added to SVN): " + fileName); + if(autoCreateSerialized) { + comparator = makeComparator(); + String fileName = getCanonicalComparatorName(comparator); + writeExternalFormToDisk((Serializable) comparator, fileName); + fail("Serialized form could not be found. A serialized version " + + "has now been written (and should be added to SVN): " + fileName); } else { fail("The Serialized form could be located to test serialization " + "compatibility: " + exception.getMessage()); Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestNullComparator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestNullComparator.java?rev=776546&r1=776545&r2=776546&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestNullComparator.java (original) +++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/comparators/TestNullComparator.java Wed May 20 04:48:19 2009 @@ -48,28 +48,28 @@ **/ public static class TestNullComparator1 extends TestNullComparator { - public TestNullComparator1(String testName) { - super(testName); - } + public TestNullComparator1(String testName) { + super(testName); + } public Comparator makeComparator() { - return new NullComparator(); - } - + return new NullComparator(); + } + public List getComparableObjectsOrdered() { List list = new LinkedList(); - list.add(new Integer(1)); - list.add(new Integer(2)); - list.add(new Integer(3)); - list.add(new Integer(4)); - list.add(new Integer(5)); - list.add(null); - return list; - } + list.add(new Integer(1)); + list.add(new Integer(2)); + list.add(new Integer(3)); + list.add(new Integer(4)); + list.add(new Integer(5)); + list.add(null); + return list; + } - public String getCanonicalComparatorName(Object object) { - return super.getCanonicalComparatorName(object) + "1"; - } + public String getCanonicalComparatorName(Object object) { + return super.getCanonicalComparatorName(object) + "1"; + } } /** Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java?rev=776546&r1=776545&r2=776546&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java (original) +++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java Wed May 20 04:48:19 2009 @@ -102,12 +102,12 @@ assertEquals( "Iteration next index", 1, iter.nextIndex() ); assertEquals( "Iteration previous index", 0, iter.previousIndex() ); - try { - iter.next(); - } catch (Exception e) { - assertTrue("NoSuchElementException must be thrown", - e.getClass().equals((new NoSuchElementException()).getClass())); - } + try { + iter.next(); + } catch (Exception e) { + assertTrue("NoSuchElementException must be thrown", + e.getClass().equals((new NoSuchElementException()).getClass())); + } iter.previous(); try { iter.previous(); Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/keyvalue/TestMultiKey.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/keyvalue/TestMultiKey.java?rev=776546&r1=776545&r2=776546&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/org/apache/commons/collections/keyvalue/TestMultiKey.java (original) +++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/keyvalue/TestMultiKey.java Wed May 20 04:48:19 2009 @@ -215,37 +215,37 @@ } static class SystemHashCodeSimulatingKey implements Serializable { - - private static final long serialVersionUID = 1L; - private final String name; - private int hashCode = 1; - - public SystemHashCodeSimulatingKey(String name) - { - this.name = name; - } - - public boolean equals(Object obj) - { - return obj instanceof SystemHashCodeSimulatingKey - && name.equals(((SystemHashCodeSimulatingKey)obj).name); - } - - public int hashCode() - { - return hashCode; - } - - private Object readResolve() { - hashCode=2; // simulate different hashCode after deserialization in another process - return this; - } + + private static final long serialVersionUID = 1L; + private final String name; + private int hashCode = 1; + + public SystemHashCodeSimulatingKey(String name) + { + this.name = name; + } + + public boolean equals(Object obj) + { + return obj instanceof SystemHashCodeSimulatingKey + && name.equals(((SystemHashCodeSimulatingKey)obj).name); + } + + public int hashCode() + { + return hashCode; + } + + private Object readResolve() { + hashCode=2; // simulate different hashCode after deserialization in another process + return this; + } } public void testEqualsAfterSerialization() throws IOException, ClassNotFoundException - { + { SystemHashCodeSimulatingKey sysKey = new SystemHashCodeSimulatingKey("test"); - MultiKey mk = new MultiKey(ONE, sysKey); + MultiKey mk = new MultiKey(ONE, sysKey); Map map = new HashMap(); map.put(mk, TWO); @@ -266,6 +266,6 @@ assertEquals(2, sysKey.hashCode()); // different hashCode now MultiKey mk2 = new MultiKey(ONE, sysKey); - assertEquals(TWO, map2.get(mk2)); - } + assertEquals(TWO, map2.get(mk2)); + } } Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/list/TestTreeList.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/list/TestTreeList.java?rev=776546&r1=776545&r2=776546&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/org/apache/commons/collections/list/TestTreeList.java (original) +++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/list/TestTreeList.java Wed May 20 04:48:19 2009 @@ -33,9 +33,9 @@ */ public class TestTreeList extends AbstractTestList { - public TestTreeList(String name) { - super(name); - } + public TestTreeList(String name) { + super(name); + } public static void main(String[] args) { junit.textui.TestRunner.run(suite()); @@ -105,72 +105,72 @@ } //----------------------------------------------------------------------- - public List makeEmptyList() { - return new TreeList(); - } + public List makeEmptyList() { + return new TreeList(); + } //----------------------------------------------------------------------- - public void testAddMultiple() { - List l = makeEmptyList(); - l.add("hugo"); - l.add("erna"); - l.add("daniel"); - l.add("andres"); - l.add("harald"); - l.add(0, null); - assertEquals(null, l.get(0)); - assertEquals("hugo", l.get(1)); - assertEquals("erna", l.get(2)); - assertEquals("daniel", l.get(3)); - assertEquals("andres", l.get(4)); - assertEquals("harald", l.get(5)); - } - - public void testRemove() { - List l = makeEmptyList(); - l.add("hugo"); - l.add("erna"); - l.add("daniel"); - l.add("andres"); - l.add("harald"); - l.add(0, null); - int i = 0; - assertEquals(null, l.get(i++)); - assertEquals("hugo", l.get(i++)); - assertEquals("erna", l.get(i++)); - assertEquals("daniel", l.get(i++)); - assertEquals("andres", l.get(i++)); - assertEquals("harald", l.get(i++)); - - l.remove(0); - i = 0; - assertEquals("hugo", l.get(i++)); - assertEquals("erna", l.get(i++)); - assertEquals("daniel", l.get(i++)); - assertEquals("andres", l.get(i++)); - assertEquals("harald", l.get(i++)); - - i = 0; - l.remove(1); - assertEquals("hugo", l.get(i++)); - assertEquals("daniel", l.get(i++)); - assertEquals("andres", l.get(i++)); - assertEquals("harald", l.get(i++)); - - i = 0; - l.remove(2); - assertEquals("hugo", l.get(i++)); - assertEquals("daniel", l.get(i++)); - assertEquals("harald", l.get(i++)); - } - - public void testInsertBefore() { - List l = makeEmptyList(); - l.add("erna"); - l.add(0, "hugo"); - assertEquals("hugo", l.get(0)); - assertEquals("erna", l.get(1)); - } + public void testAddMultiple() { + List l = makeEmptyList(); + l.add("hugo"); + l.add("erna"); + l.add("daniel"); + l.add("andres"); + l.add("harald"); + l.add(0, null); + assertEquals(null, l.get(0)); + assertEquals("hugo", l.get(1)); + assertEquals("erna", l.get(2)); + assertEquals("daniel", l.get(3)); + assertEquals("andres", l.get(4)); + assertEquals("harald", l.get(5)); + } + + public void testRemove() { + List l = makeEmptyList(); + l.add("hugo"); + l.add("erna"); + l.add("daniel"); + l.add("andres"); + l.add("harald"); + l.add(0, null); + int i = 0; + assertEquals(null, l.get(i++)); + assertEquals("hugo", l.get(i++)); + assertEquals("erna", l.get(i++)); + assertEquals("daniel", l.get(i++)); + assertEquals("andres", l.get(i++)); + assertEquals("harald", l.get(i++)); + + l.remove(0); + i = 0; + assertEquals("hugo", l.get(i++)); + assertEquals("erna", l.get(i++)); + assertEquals("daniel", l.get(i++)); + assertEquals("andres", l.get(i++)); + assertEquals("harald", l.get(i++)); + + i = 0; + l.remove(1); + assertEquals("hugo", l.get(i++)); + assertEquals("daniel", l.get(i++)); + assertEquals("andres", l.get(i++)); + assertEquals("harald", l.get(i++)); + + i = 0; + l.remove(2); + assertEquals("hugo", l.get(i++)); + assertEquals("daniel", l.get(i++)); + assertEquals("harald", l.get(i++)); + } + + public void testInsertBefore() { + List l = makeEmptyList(); + l.add("erna"); + l.add(0, "hugo"); + assertEquals("hugo", l.get(0)); + assertEquals("erna", l.get(1)); + } public void testIndexOf() { List l = makeEmptyList();