hashCode = 1;
Iterator i = list.iterator();
while (i.hasNext())
@@ -591,7 +591,7 @@ while (i.hasNext())
/**
* Adds the supplied object before the element that would be returned
* by a call to next(), if the list supports addition.
- *
+ *
* @param o The object to add to the list.
* @throws UnsupportedOperationException if the list doesn't support
* the addition of new elements.
@@ -713,7 +713,7 @@ while (i.hasNext())
*
* All methods first check to see if the actual modCount of the backing
* list is equal to its expected value, and throw a
- * ConcurrentModificationException if it is not.
+ * ConcurrentModificationException if it is not.
*
* @param fromIndex the index that the returned list should start from
* (inclusive)
@@ -756,7 +756,7 @@ while (i.hasNext())
final int offset;
/** The size of the sublist. */
int size;
-
+
/**
* Construct the sublist.
*
@@ -771,7 +771,7 @@ while (i.hasNext())
offset = fromIndex;
size = toIndex - fromIndex;
}
-
+
/**
* This method checks the two modCount fields to ensure that there has
* not been a concurrent modification, returning if all is okay.
@@ -783,9 +783,9 @@ while (i.hasNext())
void checkMod()
{
if (modCount != backingList.modCount)
- throw new ConcurrentModificationException();
+ throw new ConcurrentModificationException();
}
-
+
/**
* This method checks that a value is between 0 and size (inclusive). If
* it is not, an exception is thrown.
@@ -797,10 +797,10 @@ while (i.hasNext())
private void checkBoundsInclusive(int index)
{
if (index < 0 || index > size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
+ throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
+ + size);
}
-
+
/**
* This method checks that a value is between 0 (inclusive) and size
* (exclusive). If it is not, an exception is thrown.
@@ -812,10 +812,10 @@ while (i.hasNext())
private void checkBoundsExclusive(int index)
{
if (index < 0 || index >= size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
- + size);
+ throw new IndexOutOfBoundsException("Index: " + index + ", Size:"
+ + size);
}
-
+
/**
* Specified by AbstractList.subList to return the private field size.
*
@@ -828,7 +828,7 @@ while (i.hasNext())
checkMod();
return size;
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -851,7 +851,7 @@ while (i.hasNext())
checkBoundsExclusive(index);
return backingList.set(index + offset, o);
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -867,7 +867,7 @@ while (i.hasNext())
checkBoundsExclusive(index);
return backingList.get(index + offset);
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -891,7 +891,7 @@ while (i.hasNext())
size++;
modCount = backingList.modCount;
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -912,7 +912,7 @@ while (i.hasNext())
modCount = backingList.modCount;
return o;
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
* This does no bounds checking, as it assumes it will only be called
@@ -928,12 +928,12 @@ while (i.hasNext())
protected void removeRange(int fromIndex, int toIndex)
{
checkMod();
-
+
backingList.removeRange(offset + fromIndex, offset + toIndex);
size -= toIndex - fromIndex;
modCount = backingList.modCount;
}
-
+
/**
* Specified by AbstractList.subList to delegate to the backing list.
*
@@ -961,7 +961,7 @@ while (i.hasNext())
modCount = backingList.modCount;
return result;
}
-
+
/**
* Specified by AbstractList.subList to return addAll(size, c).
*
@@ -981,7 +981,7 @@ while (i.hasNext())
{
return addAll(size, c);
}
-
+
/**
* Specified by AbstractList.subList to return listIterator().
*
@@ -991,7 +991,7 @@ while (i.hasNext())
{
return listIterator();
}
-
+
/**
* Specified by AbstractList.subList to return a wrapper around the
* backing list's iterator.
@@ -1006,176 +1006,176 @@ while (i.hasNext())
{
checkMod();
checkBoundsInclusive(index);
-
+
return new ListIterator()
- {
- private final ListIterator i
- = backingList.listIterator(index + offset);
- private int position = index;
-
- /**
- * Tests to see if there are any more objects to
- * return.
- *
- * @return True if the end of the list has not yet been
- * reached.
- */
- public boolean hasNext()
- {
- return position < size;
- }
-
- /**
- * Tests to see if there are objects prior to the
- * current position in the list.
- *
- * @return True if objects exist prior to the current
- * position of the iterator.
- */
- public boolean hasPrevious()
- {
- return position > 0;
- }
-
- /**
- * Retrieves the next object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * more objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public E next()
- {
- if (position == size)
- throw new NoSuchElementException();
- position++;
- return i.next();
- }
-
- /**
- * Retrieves the previous object from the list.
- *
- * @return The next object.
- * @throws NoSuchElementException if there are no
- * previous objects to retrieve.
- * @throws ConcurrentModificationException if the
- * list has been modified elsewhere.
- */
- public E previous()
- {
- if (position == 0)
- throw new NoSuchElementException();
- position--;
- return i.previous();
- }
-
- /**
- * Returns the index of the next element in the
- * list, which will be retrieved by next()
- *
- * @return The index of the next element.
- */
- public int nextIndex()
- {
- return i.nextIndex() - offset;
- }
-
- /**
- * Returns the index of the previous element in the
- * list, which will be retrieved by previous()
- *
- * @return The index of the previous element.
- */
- public int previousIndex()
- {
- return i.previousIndex() - offset;
- }
-
- /**
- * Removes the last object retrieved by next()
- * from the list, if the list supports object removal.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list does
- * not support removing elements.
- */
- public void remove()
- {
- i.remove();
- size--;
- position = nextIndex();
- modCount = backingList.modCount;
- }
-
-
- /**
- * Replaces the last object retrieved by next()
- * or previous with o, if the list supports object
- * replacement and an add or remove operation has not already
- * been performed.
- *
- * @throws IllegalStateException if the iterator is positioned
- * before the start of the list or the last object has already
- * been removed.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition or removal of elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void set(E o)
- {
- i.set(o);
- }
-
- /**
- * Adds the supplied object before the element that would be returned
- * by a call to next(), if the list supports addition.
- *
- * @param o The object to add to the list.
- * @throws UnsupportedOperationException if the list doesn't support
- * the addition of new elements.
- * @throws ClassCastException if the type of o is not a valid type
- * for this list.
- * @throws IllegalArgumentException if something else related to o
- * prevents its addition.
- * @throws ConcurrentModificationException if the list
- * has been modified elsewhere.
- */
- public void add(E o)
- {
- i.add(o);
- size++;
- position++;
- modCount = backingList.modCount;
- }
-
- // Here is the reason why the various modCount fields are mostly
- // ignored in this wrapper listIterator.
- // If the backing listIterator is failfast, then the following holds:
- // Using any other method on this list will call a corresponding
- // method on the backing list *after* the backing listIterator
- // is created, which will in turn cause a ConcurrentModException
- // when this listIterator comes to use the backing one. So it is
- // implicitly failfast.
- // If the backing listIterator is NOT failfast, then the whole of
- // this list isn't failfast, because the modCount field of the
- // backing list is not valid. It would still be *possible* to
- // make the iterator failfast wrt modifications of the sublist
- // only, but somewhat pointless when the list can be changed under
- // us.
- // Either way, no explicit handling of modCount is needed.
- // However modCount = backingList.modCount must be executed in add
- // and remove, and size must also be updated in these two methods,
- // since they do not go through the corresponding methods of the subList.
- };
+ {
+ private final ListIterator i
+ = backingList.listIterator(index + offset);
+ private int position = index;
+
+ /**
+ * Tests to see if there are any more objects to
+ * return.
+ *
+ * @return True if the end of the list has not yet been
+ * reached.
+ */
+ public boolean hasNext()
+ {
+ return position < size;
+ }
+
+ /**
+ * Tests to see if there are objects prior to the
+ * current position in the list.
+ *
+ * @return True if objects exist prior to the current
+ * position of the iterator.
+ */
+ public boolean hasPrevious()
+ {
+ return position > 0;
+ }
+
+ /**
+ * Retrieves the next object from the list.
+ *
+ * @return The next object.
+ * @throws NoSuchElementException if there are no
+ * more objects to retrieve.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public E next()
+ {
+ if (position == size)
+ throw new NoSuchElementException();
+ position++;
+ return i.next();
+ }
+
+ /**
+ * Retrieves the previous object from the list.
+ *
+ * @return The next object.
+ * @throws NoSuchElementException if there are no
+ * previous objects to retrieve.
+ * @throws ConcurrentModificationException if the
+ * list has been modified elsewhere.
+ */
+ public E previous()
+ {
+ if (position == 0)
+ throw new NoSuchElementException();
+ position--;
+ return i.previous();
+ }
+
+ /**
+ * Returns the index of the next element in the
+ * list, which will be retrieved by next()
+ *
+ * @return The index of the next element.
+ */
+ public int nextIndex()
+ {
+ return i.nextIndex() - offset;
+ }
+
+ /**
+ * Returns the index of the previous element in the
+ * list, which will be retrieved by previous()
+ *
+ * @return The index of the previous element.
+ */
+ public int previousIndex()
+ {
+ return i.previousIndex() - offset;
+ }
+
+ /**
+ * Removes the last object retrieved by next()
+ * from the list, if the list supports object removal.
+ *
+ * @throws IllegalStateException if the iterator is positioned
+ * before the start of the list or the last object has already
+ * been removed.
+ * @throws UnsupportedOperationException if the list does
+ * not support removing elements.
+ */
+ public void remove()
+ {
+ i.remove();
+ size--;
+ position = nextIndex();
+ modCount = backingList.modCount;
+ }
+
+
+ /**
+ * Replaces the last object retrieved by next()
+ * or previous with o, if the list supports object
+ * replacement and an add or remove operation has not already
+ * been performed.
+ *
+ * @throws IllegalStateException if the iterator is positioned
+ * before the start of the list or the last object has already
+ * been removed.
+ * @throws UnsupportedOperationException if the list doesn't support
+ * the addition or removal of elements.
+ * @throws ClassCastException if the type of o is not a valid type
+ * for this list.
+ * @throws IllegalArgumentException if something else related to o
+ * prevents its addition.
+ * @throws ConcurrentModificationException if the list
+ * has been modified elsewhere.
+ */
+ public void set(E o)
+ {
+ i.set(o);
+ }
+
+ /**
+ * Adds the supplied object before the element that would be returned
+ * by a call to next(), if the list supports addition.
+ *
+ * @param o The object to add to the list.
+ * @throws UnsupportedOperationException if the list doesn't support
+ * the addition of new elements.
+ * @throws ClassCastException if the type of o is not a valid type
+ * for this list.
+ * @throws IllegalArgumentException if something else related to o
+ * prevents its addition.
+ * @throws ConcurrentModificationException if the list
+ * has been modified elsewhere.
+ */
+ public void add(E o)
+ {
+ i.add(o);
+ size++;
+ position++;
+ modCount = backingList.modCount;
+ }
+
+ // Here is the reason why the various modCount fields are mostly
+ // ignored in this wrapper listIterator.
+ // If the backing listIterator is failfast, then the following holds:
+ // Using any other method on this list will call a corresponding
+ // method on the backing list *after* the backing listIterator
+ // is created, which will in turn cause a ConcurrentModException
+ // when this listIterator comes to use the backing one. So it is
+ // implicitly failfast.
+ // If the backing listIterator is NOT failfast, then the whole of
+ // this list isn't failfast, because the modCount field of the
+ // backing list is not valid. It would still be *possible* to
+ // make the iterator failfast wrt modifications of the sublist
+ // only, but somewhat pointless when the list can be changed under
+ // us.
+ // Either way, no explicit handling of modCount is needed.
+ // However modCount = backingList.modCount must be executed in add
+ // and remove, and size must also be updated in these two methods,
+ // since they do not go through the corresponding methods of the subList.
+ };
}
} // class SubList
@@ -1200,5 +1200,5 @@ while (i.hasNext())
super(backing, fromIndex, toIndex);
}
} // class RandomAccessSubList
-
+
} // class AbstractList
diff --git a/libjava/classpath/java/util/AbstractMap.java b/libjava/classpath/java/util/AbstractMap.java
index 5d59db9..e0e3571 100644
--- a/libjava/classpath/java/util/AbstractMap.java
+++ b/libjava/classpath/java/util/AbstractMap.java
@@ -71,14 +71,14 @@ import java.io.Serializable;
*/
public abstract class AbstractMap implements Map
{
- /**
+ /**
* A class containing an immutable key and value. The
* implementation of {@link Entry#setValue(V)} for this class
* simply throws an {@link UnsupportedOperationException},
* thus preventing changes being made. This is useful when
* a static thread-safe view of a map is required.
*
- * @since 1.6
+ * @since 1.6
*/
public static class SimpleImmutableEntry
implements Entry, Serializable
@@ -251,8 +251,8 @@ public abstract class AbstractMap implements Map
public boolean equals(Object o)
{
return (o == this
- || (o instanceof Map
- && entrySet().equals(((Map) o).entrySet())));
+ || (o instanceof Map
+ && entrySet().equals(((Map) o).entrySet())));
}
/**
@@ -330,76 +330,76 @@ public abstract class AbstractMap implements Map
if (keys == null)
keys = new AbstractSet()
{
- /**
- * Retrieves the number of keys in the backing map.
- *
- * @return The number of keys.
- */
+ /**
+ * Retrieves the number of keys in the backing map.
+ *
+ * @return The number of keys.
+ */
public int size()
{
return AbstractMap.this.size();
}
- /**
- * Returns true if the backing map contains the
- * supplied key.
- *
- * @param key The key to search for.
- * @return True if the key was found, false otherwise.
- */
+ /**
+ * Returns true if the backing map contains the
+ * supplied key.
+ *
+ * @param key The key to search for.
+ * @return True if the key was found, false otherwise.
+ */
public boolean contains(Object key)
{
return containsKey(key);
}
- /**
- * Returns an iterator which iterates over the keys
- * in the backing map, using a wrapper around the
- * iterator returned by entrySet().
- *
- * @return An iterator over the keys.
- */
+ /**
+ * Returns an iterator which iterates over the keys
+ * in the backing map, using a wrapper around the
+ * iterator returned by entrySet().
+ *
+ * @return An iterator over the keys.
+ */
public Iterator iterator()
{
return new Iterator()
{
- /**
- * The iterator returned by entrySet().
- */
+ /**
+ * The iterator returned by entrySet().
+ */
private final Iterator> map_iterator
- = entrySet().iterator();
-
- /**
- * Returns true if a call to next() will
- * return another key.
- *
- * @return True if the iterator has not yet reached
- * the last key.
- */
+ = entrySet().iterator();
+
+ /**
+ * Returns true if a call to next() will
+ * return another key.
+ *
+ * @return True if the iterator has not yet reached
+ * the last key.
+ */
public boolean hasNext()
{
return map_iterator.hasNext();
}
- /**
- * Returns the key from the next entry retrieved
- * by the underlying entrySet() iterator.
- *
- * @return The next key.
- */
+ /**
+ * Returns the key from the next entry retrieved
+ * by the underlying entrySet() iterator.
+ *
+ * @return The next key.
+ */
public K next()
{
return map_iterator.next().getKey();
}
- /**
- * Removes the map entry which has a key equal
- * to that returned by the last call to
- * next().
- *
- * @throws UnsupportedOperationException if the
- * map doesn't support removal.
- */
+ /**
+ * Removes the map entry which has a key equal
+ * to that returned by the last call to
+ * next().
+ *
+ * @throws UnsupportedOperationException if the
+ * map doesn't support removal.
+ */
public void remove()
{
map_iterator.remove();
@@ -565,77 +565,77 @@ public abstract class AbstractMap implements Map
if (values == null)
values = new AbstractCollection()
{
- /**
- * Returns the number of values stored in
- * the backing map.
- *
- * @return The number of values.
- */
+ /**
+ * Returns the number of values stored in
+ * the backing map.
+ *
+ * @return The number of values.
+ */
public int size()
{
return AbstractMap.this.size();
}
- /**
- * Returns true if the backing map contains
- * the supplied value.
- *
- * @param value The value to search for.
- * @return True if the value was found, false otherwise.
- */
+ /**
+ * Returns true if the backing map contains
+ * the supplied value.
+ *
+ * @param value The value to search for.
+ * @return True if the value was found, false otherwise.
+ */
public boolean contains(Object value)
{
return containsValue(value);
}
- /**
- * Returns an iterator which iterates over the
- * values in the backing map, by using a wrapper
- * around the iterator returned by entrySet().
- *
- * @return An iterator over the values.
- */
+ /**
+ * Returns an iterator which iterates over the
+ * values in the backing map, by using a wrapper
+ * around the iterator returned by entrySet().
+ *
+ * @return An iterator over the values.
+ */
public Iterator iterator()
{
return new Iterator()
{
- /**
- * The iterator returned by entrySet().
- */
+ /**
+ * The iterator returned by entrySet().
+ */
private final Iterator> map_iterator
- = entrySet().iterator();
-
- /**
- * Returns true if a call to next() will
- * return another value.
- *
- * @return True if the iterator has not yet reached
- * the last value.
- */
+ = entrySet().iterator();
+
+ /**
+ * Returns true if a call to next() will
+ * return another value.
+ *
+ * @return True if the iterator has not yet reached
+ * the last value.
+ */
public boolean hasNext()
{
return map_iterator.hasNext();
}
- /**
- * Returns the value from the next entry retrieved
- * by the underlying entrySet() iterator.
- *
- * @return The next value.
- */
+ /**
+ * Returns the value from the next entry retrieved
+ * by the underlying entrySet() iterator.
+ *
+ * @return The next value.
+ */
public V next()
{
return map_iterator.next().getValue();
}
- /**
- * Removes the map entry which has a key equal
- * to that returned by the last call to
- * next().
- *
- * @throws UnsupportedOperationException if the
- * map doesn't support removal.
- */
+ /**
+ * Removes the map entry which has a key equal
+ * to that returned by the last call to
+ * next().
+ *
+ * @throws UnsupportedOperationException if the
+ * map doesn't support removal.
+ */
public void remove()
{
map_iterator.remove();
@@ -680,7 +680,7 @@ public abstract class AbstractMap implements Map
*
* @author Jon Zeppieri
* @author Eric Blake (ebb9@email.byu.edu)
- *
+ *
* @since 1.6
*/
public static class SimpleEntry implements Entry, Serializable
@@ -711,7 +711,7 @@ public abstract class AbstractMap implements Map
key = newKey;
value = newValue;
}
-
+
public SimpleEntry(Entry extends K, ? extends V> entry)
{
this(entry.getKey(), entry.getValue());
@@ -814,6 +814,6 @@ public abstract class AbstractMap implements Map
return key + "=" + value;
}
} // class SimpleEntry
-
-
+
+
}
diff --git a/libjava/classpath/java/util/AbstractSet.java b/libjava/classpath/java/util/AbstractSet.java
index 423ac80..af1e4d1 100644
--- a/libjava/classpath/java/util/AbstractSet.java
+++ b/libjava/classpath/java/util/AbstractSet.java
@@ -83,8 +83,8 @@ public abstract class AbstractSet
public boolean equals(Object o)
{
return (o == this
- || (o instanceof Set && ((Set) o).size() == size()
- && containsAll((Collection) o)));
+ || (o instanceof Set && ((Set) o).size() == size()
+ && containsAll((Collection) o)));
}
/**
@@ -128,18 +128,18 @@ public abstract class AbstractSet
int count = c.size();
if (oldsize < count)
{
- Iterator i;
- for (i = iterator(), count = oldsize; count > 0; count--)
- {
- if (c.contains(i.next()))
- i.remove();
- }
+ Iterator i;
+ for (i = iterator(), count = oldsize; count > 0; count--)
+ {
+ if (c.contains(i.next()))
+ i.remove();
+ }
}
else
{
- Iterator> i;
- for (i = c.iterator(); count > 0; count--)
- remove(i.next());
+ Iterator> i;
+ for (i = c.iterator(); count > 0; count--)
+ remove(i.next());
}
return oldsize != size();
}
diff --git a/libjava/classpath/java/util/ArrayList.java b/libjava/classpath/java/util/ArrayList.java
index 1fb25d8..0da2193 100644
--- a/libjava/classpath/java/util/ArrayList.java
+++ b/libjava/classpath/java/util/ArrayList.java
@@ -503,8 +503,8 @@ public class ArrayList extends AbstractList
// do so).
throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
}
-
-
+
+
/**
* Remove from this list all elements contained in the given collection.
* This is not public, due to Sun's API, but this performs in linear
diff --git a/libjava/classpath/java/util/Arrays.java b/libjava/classpath/java/util/Arrays.java
index d154eb1..dad55c4 100644
--- a/libjava/classpath/java/util/Arrays.java
+++ b/libjava/classpath/java/util/Arrays.java
@@ -76,7 +76,7 @@ public class Arrays
{
}
-
+
// binarySearch
/**
* Perform a binary search of a byte array for a key. The array must be
@@ -122,10 +122,10 @@ public class Arrays
{
if (low > hi)
throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
+ "the finish index.");
if (low < 0 || hi > a.length)
throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
+ "of bounds.");
int mid = 0;
while (low <= hi)
{
@@ -186,10 +186,10 @@ public class Arrays
{
if (low > hi)
throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
+ "the finish index.");
if (low < 0 || hi > a.length)
throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
+ "of bounds.");
int mid = 0;
while (low <= hi)
{
@@ -250,10 +250,10 @@ public class Arrays
{
if (low > hi)
throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
+ "the finish index.");
if (low < 0 || hi > a.length)
throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
+ "of bounds.");
int mid = 0;
while (low <= hi)
{
@@ -314,10 +314,10 @@ public class Arrays
{
if (low > hi)
throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
+ "the finish index.");
if (low < 0 || hi > a.length)
throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
+ "of bounds.");
int mid = 0;
while (low <= hi)
{
@@ -378,10 +378,10 @@ public class Arrays
{
if (low > hi)
throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
+ "the finish index.");
if (low < 0 || hi > a.length)
throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
+ "of bounds.");
int mid = 0;
while (low <= hi)
{
@@ -442,10 +442,10 @@ public class Arrays
{
if (low > hi)
throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
+ "the finish index.");
if (low < 0 || hi > a.length)
throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
+ "of bounds.");
// Must use Float.compare to take into account NaN, +-0.
int mid = 0;
while (low <= hi)
@@ -507,10 +507,10 @@ public class Arrays
{
if (low > hi)
throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
+ "the finish index.");
if (low < 0 || hi > a.length)
throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
+ "of bounds.");
// Must use Double.compare to take into account NaN, +-0.
int mid = 0;
while (low <= hi)
@@ -629,21 +629,21 @@ public class Arrays
* hi > a.length.
*/
public static int binarySearch(T[] a, int low, int hi, T key,
- Comparator super T> c)
+ Comparator super T> c)
{
if (low > hi)
throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
+ "the finish index.");
if (low < 0 || hi > a.length)
throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
+ "of bounds.");
int mid = 0;
while (low <= hi)
{
mid = (low + hi) >>> 1;
- // NOTE: Please keep the order of a[mid] and key. Although
- // not required by the specs, the RI has it in this order as
- // well, and real programs (erroneously) depend on it.
+ // NOTE: Please keep the order of a[mid] and key. Although
+ // not required by the specs, the RI has it in this order as
+ // well, and real programs (erroneously) depend on it.
final int d = Collections.compare(a[mid], key, c);
if (d == 0)
return mid;
@@ -656,7 +656,7 @@ public class Arrays
return -mid - 1;
}
-
+
// equals
/**
* Compare two boolean arrays for equality.
@@ -675,15 +675,15 @@ public class Arrays
if (null == a1 || null == a2)
return false;
-
+
// If they're the same length, test each element
if (a1.length == a2.length)
{
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -709,11 +709,11 @@ public class Arrays
// If they're the same length, test each element
if (a1.length == a2.length)
{
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -735,15 +735,15 @@ public class Arrays
if (null == a1 || null == a2)
return false;
-
+
// If they're the same length, test each element
if (a1.length == a2.length)
{
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -769,11 +769,11 @@ public class Arrays
// If they're the same length, test each element
if (a1.length == a2.length)
{
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -799,11 +799,11 @@ public class Arrays
// If they're the same length, test each element
if (a1.length == a2.length)
{
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -829,11 +829,11 @@ public class Arrays
// If they're the same length, test each element
if (a1.length == a2.length)
{
- int i = a1.length;
- while (--i >= 0)
- if (a1[i] != a2[i])
- return false;
- return true;
+ int i = a1.length;
+ while (--i >= 0)
+ if (a1[i] != a2[i])
+ return false;
+ return true;
}
return false;
}
@@ -860,11 +860,11 @@ public class Arrays
// If they're the same length, test each element
if (a1.length == a2.length)
{
- int i = a1.length;
- while (--i >= 0)
- if (Float.compare(a1[i], a2[i]) != 0)
- return false;
- return true;
+ int i = a1.length;
+ while (--i >= 0)
+ if (Float.compare(a1[i], a2[i]) != 0)
+ return false;
+ return true;
}
return false;
}
@@ -886,16 +886,16 @@ public class Arrays
if (null == a1 || null == a2)
return false;
-
+
// Must use Double.compare to take into account NaN, +-0.
// If they're the same length, test each element
if (a1.length == a2.length)
{
- int i = a1.length;
- while (--i >= 0)
- if (Double.compare(a1[i], a2[i]) != 0)
- return false;
- return true;
+ int i = a1.length;
+ while (--i >= 0)
+ if (Double.compare(a1[i], a2[i]) != 0)
+ return false;
+ return true;
}
return false;
}
@@ -918,20 +918,20 @@ public class Arrays
if (null == a1 || null == a2)
return false;
-
+
// If they're the same length, test each element
if (a1.length == a2.length)
{
- int i = a1.length;
- while (--i >= 0)
- if (! AbstractCollection.equals(a1[i], a2[i]))
- return false;
- return true;
+ int i = a1.length;
+ while (--i >= 0)
+ if (! AbstractCollection.equals(a1[i], a2[i]))
+ return false;
+ return true;
}
return false;
}
-
+
// fill
/**
* Fill an array with a boolean value.
@@ -1207,7 +1207,7 @@ public class Arrays
a[i] = val;
}
-
+
// sort
// Thanks to Paul Fisher (rao@gnu.org) for finding this quicksort algorithm
// as specified by Sun and porting it to Java. The algorithm is an optimised
@@ -1633,8 +1633,8 @@ public class Arrays
if (count <= 7)
{
for (int i = from + 1; i < from + count; i++)
- for (int j = i; j > from && array[j - 1] > array[j]; j--)
- swap(j, j - 1, array);
+ for (int j = i; j > from && array[j - 1] > array[j]; j--)
+ swap(j, j - 1, array);
return;
}
@@ -2488,7 +2488,7 @@ public class Arrays
* ordering (only possible when c is null)
*/
public static void sort(T[] a, int fromIndex, int toIndex,
- Comparator super T> c)
+ Comparator super T> c)
{
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex " + fromIndex
@@ -2618,7 +2618,7 @@ public class Arrays
*
* @param a the array to return a view of (null not permitted)
* @return a fixed-size list, changes to which "write through" to the array
- *
+ *
* @throws NullPointerException if a is null.
* @see Serializable
* @see RandomAccess
@@ -2629,7 +2629,7 @@ public class Arrays
return new Arrays.ArrayList(a);
}
- /**
+ /**
* Returns the hashcode of an array of long numbers. If two arrays
* are equal, according to equals(), they should have the
* same hashcode. The hashcode returned by the method is equal to that
@@ -2640,7 +2640,7 @@ public class Arrays
* @param v an array of long numbers for which the hash code should be
* computed.
* @return the hash code of the array, or 0 if null was given.
- * @since 1.5
+ * @since 1.5
*/
public static int hashCode(long[] v)
{
@@ -2649,13 +2649,13 @@ public class Arrays
int result = 1;
for (int i = 0; i < v.length; ++i)
{
- int elt = (int) (v[i] ^ (v[i] >>> 32));
- result = 31 * result + elt;
+ int elt = (int) (v[i] ^ (v[i] >>> 32));
+ result = 31 * result + elt;
}
return result;
}
- /**
+ /**
* Returns the hashcode of an array of integer numbers. If two arrays
* are equal, according to equals(), they should have the
* same hashcode. The hashcode returned by the method is equal to that
@@ -2666,7 +2666,7 @@ public class Arrays
* @param v an array of integer numbers for which the hash code should be
* computed.
* @return the hash code of the array, or 0 if null was given.
- * @since 1.5
+ * @since 1.5
*/
public static int hashCode(int[] v)
{
@@ -2678,7 +2678,7 @@ public class Arrays
return result;
}
- /**
+ /**
* Returns the hashcode of an array of short numbers. If two arrays
* are equal, according to equals(), they should have the
* same hashcode. The hashcode returned by the method is equal to that
@@ -2689,7 +2689,7 @@ public class Arrays
* @param v an array of short numbers for which the hash code should be
* computed.
* @return the hash code of the array, or 0 if null was given.
- * @since 1.5
+ * @since 1.5
*/
public static int hashCode(short[] v)
{
@@ -2701,7 +2701,7 @@ public class Arrays
return result;
}
- /**
+ /**
* Returns the hashcode of an array of characters. If two arrays
* are equal, according to equals(), they should have the
* same hashcode. The hashcode returned by the method is equal to that
@@ -2712,7 +2712,7 @@ public class Arrays
* @param v an array of characters for which the hash code should be
* computed.
* @return the hash code of the array, or 0 if null was given.
- * @since 1.5
+ * @since 1.5
*/
public static int hashCode(char[] v)
{
@@ -2724,7 +2724,7 @@ public class Arrays
return result;
}
- /**
+ /**
* Returns the hashcode of an array of bytes. If two arrays
* are equal, according to equals(), they should have the
* same hashcode. The hashcode returned by the method is equal to that
@@ -2735,7 +2735,7 @@ public class Arrays
* @param v an array of bytes for which the hash code should be
* computed.
* @return the hash code of the array, or 0 if null was given.
- * @since 1.5
+ * @since 1.5
*/
public static int hashCode(byte[] v)
{
@@ -2747,7 +2747,7 @@ public class Arrays
return result;
}
- /**
+ /**
* Returns the hashcode of an array of booleans. If two arrays
* are equal, according to equals(), they should have the
* same hashcode. The hashcode returned by the method is equal to that
@@ -2758,7 +2758,7 @@ public class Arrays
* @param v an array of booleans for which the hash code should be
* computed.
* @return the hash code of the array, or 0 if null was given.
- * @since 1.5
+ * @since 1.5
*/
public static int hashCode(boolean[] v)
{
@@ -2770,7 +2770,7 @@ public class Arrays
return result;
}
- /**
+ /**
* Returns the hashcode of an array of floats. If two arrays
* are equal, according to equals(), they should have the
* same hashcode. The hashcode returned by the method is equal to that
@@ -2781,7 +2781,7 @@ public class Arrays
* @param v an array of floats for which the hash code should be
* computed.
* @return the hash code of the array, or 0 if null was given.
- * @since 1.5
+ * @since 1.5
*/
public static int hashCode(float[] v)
{
@@ -2793,7 +2793,7 @@ public class Arrays
return result;
}
- /**
+ /**
* Returns the hashcode of an array of doubles. If two arrays
* are equal, according to equals(), they should have the
* same hashcode. The hashcode returned by the method is equal to that
@@ -2804,7 +2804,7 @@ public class Arrays
* @param v an array of doubles for which the hash code should be
* computed.
* @return the hash code of the array, or 0 if null was given.
- * @since 1.5
+ * @since 1.5
*/
public static int hashCode(double[] v)
{
@@ -2813,24 +2813,24 @@ public class Arrays
int result = 1;
for (int i = 0; i < v.length; ++i)
{
- long l = Double.doubleToLongBits(v[i]);
- int elt = (int) (l ^ (l >>> 32));
- result = 31 * result + elt;
+ long l = Double.doubleToLongBits(v[i]);
+ int elt = (int) (l ^ (l >>> 32));
+ result = 31 * result + elt;
}
return result;
}
- /**
+ /**
* Returns the hashcode of an array of objects. If two arrays
* are equal, according to equals(), they should have the
* same hashcode. The hashcode returned by the method is equal to that
- * obtained by the corresponding List object.
+ * obtained by the corresponding List object.
* For null, 0 is returned.
*
* @param v an array of integer numbers for which the hash code should be
* computed.
* @return the hash code of the array, or 0 if null was given.
- * @since 1.5
+ * @since 1.5
*/
public static int hashCode(Object[] v)
{
@@ -2839,8 +2839,8 @@ public class Arrays
int result = 1;
for (int i = 0; i < v.length; ++i)
{
- int elt = v[i] == null ? 0 : v[i].hashCode();
- result = 31 * result + elt;
+ int elt = v[i] == null ? 0 : v[i].hashCode();
+ result = 31 * result + elt;
}
return result;
}
@@ -2852,30 +2852,30 @@ public class Arrays
int result = 1;
for (int i = 0; i < v.length; ++i)
{
- int elt;
- if (v[i] == null)
- elt = 0;
- else if (v[i] instanceof boolean[])
- elt = hashCode((boolean[]) v[i]);
- else if (v[i] instanceof byte[])
- elt = hashCode((byte[]) v[i]);
- else if (v[i] instanceof char[])
- elt = hashCode((char[]) v[i]);
- else if (v[i] instanceof short[])
- elt = hashCode((short[]) v[i]);
- else if (v[i] instanceof int[])
- elt = hashCode((int[]) v[i]);
- else if (v[i] instanceof long[])
- elt = hashCode((long[]) v[i]);
- else if (v[i] instanceof float[])
- elt = hashCode((float[]) v[i]);
- else if (v[i] instanceof double[])
- elt = hashCode((double[]) v[i]);
- else if (v[i] instanceof Object[])
- elt = hashCode((Object[]) v[i]);
- else
- elt = v[i].hashCode();
- result = 31 * result + elt;
+ int elt;
+ if (v[i] == null)
+ elt = 0;
+ else if (v[i] instanceof boolean[])
+ elt = hashCode((boolean[]) v[i]);
+ else if (v[i] instanceof byte[])
+ elt = hashCode((byte[]) v[i]);
+ else if (v[i] instanceof char[])
+ elt = hashCode((char[]) v[i]);
+ else if (v[i] instanceof short[])
+ elt = hashCode((short[]) v[i]);
+ else if (v[i] instanceof int[])
+ elt = hashCode((int[]) v[i]);
+ else if (v[i] instanceof long[])
+ elt = hashCode((long[]) v[i]);
+ else if (v[i] instanceof float[])
+ elt = hashCode((float[]) v[i]);
+ else if (v[i] instanceof double[])
+ elt = hashCode((double[]) v[i]);
+ else if (v[i] instanceof Object[])
+ elt = hashCode((Object[]) v[i]);
+ else
+ elt = v[i].hashCode();
+ result = 31 * result + elt;
}
return result;
}
@@ -2890,37 +2890,37 @@ public class Arrays
for (int i = 0; i < v1.length; ++i)
{
- Object e1 = v1[i];
- Object e2 = v2[i];
-
- if (e1 == e2)
- continue;
- if (e1 == null || e2 == null)
- return false;
-
- boolean check;
- if (e1 instanceof boolean[] && e2 instanceof boolean[])
- check = equals((boolean[]) e1, (boolean[]) e2);
- else if (e1 instanceof byte[] && e2 instanceof byte[])
- check = equals((byte[]) e1, (byte[]) e2);
- else if (e1 instanceof char[] && e2 instanceof char[])
- check = equals((char[]) e1, (char[]) e2);
- else if (e1 instanceof short[] && e2 instanceof short[])
- check = equals((short[]) e1, (short[]) e2);
- else if (e1 instanceof int[] && e2 instanceof int[])
- check = equals((int[]) e1, (int[]) e2);
- else if (e1 instanceof long[] && e2 instanceof long[])
- check = equals((long[]) e1, (long[]) e2);
- else if (e1 instanceof float[] && e2 instanceof float[])
- check = equals((float[]) e1, (float[]) e2);
- else if (e1 instanceof double[] && e2 instanceof double[])
- check = equals((double[]) e1, (double[]) e2);
- else if (e1 instanceof Object[] && e2 instanceof Object[])
- check = equals((Object[]) e1, (Object[]) e2);
- else
- check = e1.equals(e2);
- if (! check)
- return false;
+ Object e1 = v1[i];
+ Object e2 = v2[i];
+
+ if (e1 == e2)
+ continue;
+ if (e1 == null || e2 == null)
+ return false;
+
+ boolean check;
+ if (e1 instanceof boolean[] && e2 instanceof boolean[])
+ check = equals((boolean[]) e1, (boolean[]) e2);
+ else if (e1 instanceof byte[] && e2 instanceof byte[])
+ check = equals((byte[]) e1, (byte[]) e2);
+ else if (e1 instanceof char[] && e2 instanceof char[])
+ check = equals((char[]) e1, (char[]) e2);
+ else if (e1 instanceof short[] && e2 instanceof short[])
+ check = equals((short[]) e1, (short[]) e2);
+ else if (e1 instanceof int[] && e2 instanceof int[])
+ check = equals((int[]) e1, (int[]) e2);
+ else if (e1 instanceof long[] && e2 instanceof long[])
+ check = equals((long[]) e1, (long[]) e2);
+ else if (e1 instanceof float[] && e2 instanceof float[])
+ check = equals((float[]) e1, (float[]) e2);
+ else if (e1 instanceof double[] && e2 instanceof double[])
+ check = equals((double[]) e1, (double[]) e2);
+ else if (e1 instanceof Object[] && e2 instanceof Object[])
+ check = equals((Object[]) e1, (Object[]) e2);
+ else
+ check = e1.equals(e2);
+ if (! check)
+ return false;
}
return true;
@@ -2940,9 +2940,9 @@ public class Arrays
CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- b.append(v[i]);
+ if (i > 0)
+ b.append(", ");
+ b.append(v[i]);
}
b.append("]");
return b.toString();
@@ -2962,9 +2962,9 @@ public class Arrays
CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- b.append(v[i]);
+ if (i > 0)
+ b.append(", ");
+ b.append(v[i]);
}
b.append("]");
return b.toString();
@@ -2984,9 +2984,9 @@ public class Arrays
CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- b.append(v[i]);
+ if (i > 0)
+ b.append(", ");
+ b.append(v[i]);
}
b.append("]");
return b.toString();
@@ -3006,9 +3006,9 @@ public class Arrays
CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- b.append(v[i]);
+ if (i > 0)
+ b.append(", ");
+ b.append(v[i]);
}
b.append("]");
return b.toString();
@@ -3028,9 +3028,9 @@ public class Arrays
CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- b.append(v[i]);
+ if (i > 0)
+ b.append(", ");
+ b.append(v[i]);
}
b.append("]");
return b.toString();
@@ -3050,9 +3050,9 @@ public class Arrays
CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- b.append(v[i]);
+ if (i > 0)
+ b.append(", ");
+ b.append(v[i]);
}
b.append("]");
return b.toString();
@@ -3072,9 +3072,9 @@ public class Arrays
CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- b.append(v[i]);
+ if (i > 0)
+ b.append(", ");
+ b.append(v[i]);
}
b.append("]");
return b.toString();
@@ -3094,9 +3094,9 @@ public class Arrays
CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- b.append(v[i]);
+ if (i > 0)
+ b.append(", ");
+ b.append(v[i]);
}
b.append("]");
return b.toString();
@@ -3116,9 +3116,9 @@ public class Arrays
CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- b.append(v[i]);
+ if (i > 0)
+ b.append(", ");
+ b.append(v[i]);
}
b.append("]");
return b.toString();
@@ -3129,40 +3129,40 @@ public class Arrays
b.append("[");
for (int i = 0; i < v.length; ++i)
{
- if (i > 0)
- b.append(", ");
- Object elt = v[i];
- if (elt == null)
- b.append("null");
- else if (elt instanceof boolean[])
- b.append(toString((boolean[]) elt));
- else if (elt instanceof byte[])
- b.append(toString((byte[]) elt));
- else if (elt instanceof char[])
- b.append(toString((char[]) elt));
- else if (elt instanceof short[])
- b.append(toString((short[]) elt));
- else if (elt instanceof int[])
- b.append(toString((int[]) elt));
- else if (elt instanceof long[])
- b.append(toString((long[]) elt));
- else if (elt instanceof float[])
- b.append(toString((float[]) elt));
- else if (elt instanceof double[])
- b.append(toString((double[]) elt));
- else if (elt instanceof Object[])
- {
- Object[] os = (Object[]) elt;
- if (seen.contains(os))
- b.append("[...]");
- else
- {
- seen.add(os);
- deepToString(os, b, seen);
- }
- }
- else
- b.append(elt);
+ if (i > 0)
+ b.append(", ");
+ Object elt = v[i];
+ if (elt == null)
+ b.append("null");
+ else if (elt instanceof boolean[])
+ b.append(toString((boolean[]) elt));
+ else if (elt instanceof byte[])
+ b.append(toString((byte[]) elt));
+ else if (elt instanceof char[])
+ b.append(toString((char[]) elt));
+ else if (elt instanceof short[])
+ b.append(toString((short[]) elt));
+ else if (elt instanceof int[])
+ b.append(toString((int[]) elt));
+ else if (elt instanceof long[])
+ b.append(toString((long[]) elt));
+ else if (elt instanceof float[])
+ b.append(toString((float[]) elt));
+ else if (elt instanceof double[])
+ b.append(toString((double[]) elt));
+ else if (elt instanceof Object[])
+ {
+ Object[] os = (Object[]) elt;
+ if (seen.contains(os))
+ b.append("[...]");
+ else
+ {
+ seen.add(os);
+ deepToString(os, b, seen);
+ }
+ }
+ else
+ b.append(elt);
}
b.append("]");
}
@@ -3223,7 +3223,7 @@ public class Arrays
*
* @param index The index to retrieve an object from.
* @return The object at the array index specified.
- */
+ */
public E get(int index)
{
return a[index];
@@ -3325,7 +3325,7 @@ public class Arrays
int size = a.length;
if (array.length < size)
array = (T[]) Array.newInstance(array.getClass().getComponentType(),
- size);
+ size);
else if (array.length > size)
array[size] = null;
@@ -3390,13 +3390,13 @@ public class Arrays
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
boolean[] newArray = new boolean[to - from];
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, false);
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, false);
}
else
System.arraycopy(original, from, newArray, 0, to - from);
@@ -3459,13 +3459,13 @@ public class Arrays
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
byte[] newArray = new byte[to - from];
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, (byte)0);
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, (byte)0);
}
else
System.arraycopy(original, from, newArray, 0, to - from);
@@ -3528,13 +3528,13 @@ public class Arrays
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
char[] newArray = new char[to - from];
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, '\0');
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, '\0');
}
else
System.arraycopy(original, from, newArray, 0, to - from);
@@ -3597,13 +3597,13 @@ public class Arrays
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
double[] newArray = new double[to - from];
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, 0d);
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, 0d);
}
else
System.arraycopy(original, from, newArray, 0, to - from);
@@ -3666,13 +3666,13 @@ public class Arrays
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
float[] newArray = new float[to - from];
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, 0f);
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, 0f);
}
else
System.arraycopy(original, from, newArray, 0, to - from);
@@ -3735,13 +3735,13 @@ public class Arrays
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
int[] newArray = new int[to - from];
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, 0);
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, 0);
}
else
System.arraycopy(original, from, newArray, 0, to - from);
@@ -3804,13 +3804,13 @@ public class Arrays
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
long[] newArray = new long[to - from];
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, 0L);
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, 0L);
}
else
System.arraycopy(original, from, newArray, 0, to - from);
@@ -3873,13 +3873,13 @@ public class Arrays
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
short[] newArray = new short[to - from];
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, (short)0);
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, (short)0);
}
else
System.arraycopy(original, from, newArray, 0, to - from);
@@ -3942,14 +3942,14 @@ public class Arrays
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
Class elemType = original.getClass().getComponentType();
T[] newArray = (T[]) Array.newInstance(elemType, to - from);
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, null);
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, null);
}
else
System.arraycopy(original, from, newArray, 0, to - from);
@@ -3977,7 +3977,7 @@ public class Arrays
* @see #copyOfRange(U[],int,int,Class)
*/
public static T[] copyOf(U[] original, int newLength,
- Class extends T[]> newType)
+ Class extends T[]> newType)
{
if (newLength < 0)
throw new NegativeArraySizeException("The array size is negative.");
@@ -4014,18 +4014,18 @@ public class Arrays
* @see #copyOf(T[],int)
*/
public static T[] copyOfRange(U[] original, int from, int to,
- Class extends T[]> newType)
+ Class extends T[]> newType)
{
if (from > to)
throw new IllegalArgumentException("The initial index is after " +
- "the final index.");
+ "the final index.");
T[] newArray = (T[]) Array.newInstance(newType.getComponentType(),
- to - from);
+ to - from);
if (to > original.length)
{
- System.arraycopy(original, from, newArray, 0,
- original.length - from);
- fill(newArray, original.length, newArray.length, null);
+ System.arraycopy(original, from, newArray, 0,
+ original.length - from);
+ fill(newArray, original.length, newArray.length, null);
}
else
System.arraycopy(original, from, newArray, 0, to - from);
diff --git a/libjava/classpath/java/util/BitSet.java b/libjava/classpath/java/util/BitSet.java
index 13bf8a1..1072978 100644
--- a/libjava/classpath/java/util/BitSet.java
+++ b/libjava/classpath/java/util/BitSet.java
@@ -107,7 +107,7 @@ public class BitSet implements Cloneable, Serializable
{
if (nbits < 0)
throw new NegativeArraySizeException();
-
+
int length = nbits >>> 6;
if ((nbits & LONG_MASK) != 0)
++length;
@@ -412,7 +412,7 @@ public class BitSet implements Cloneable, Serializable
* Then the following definition of the hashCode method
* would be a correct implementation of the actual algorithm:
*
- *
+ *
public int hashCode()
{
long h = 1234;
@@ -535,7 +535,7 @@ public class BitSet implements Cloneable, Serializable
* Returns the index of the next true bit, from the specified bit
* (inclusive). If there is none, -1 is returned. You can iterate over
* all true bits with this loop:
- *
+ *
for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1))
{
// operate on i here
@@ -750,8 +750,8 @@ public class BitSet implements Cloneable, Serializable
{
for (int i = other.bits.length - 1; i >= 0; i--)
{
- if ((bits[i] & other.bits[i]) != other.bits[i])
- return false;
+ if ((bits[i] & other.bits[i]) != other.bits[i])
+ return false;
}
return true;
}
diff --git a/libjava/classpath/java/util/Calendar.java b/libjava/classpath/java/util/Calendar.java
index 0449e12..8123b17 100644
--- a/libjava/classpath/java/util/Calendar.java
+++ b/libjava/classpath/java/util/Calendar.java
@@ -1,5 +1,5 @@
/* Calendar.java --
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006,
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006,
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -487,7 +487,7 @@ public abstract class Calendar
}
/**
- * The set of properties for obtaining the minimum number of days in
+ * The set of properties for obtaining the minimum number of days in
* the first week.
*/
private static transient final Properties properties;
@@ -498,7 +498,7 @@ public abstract class Calendar
static
{
properties = new Properties();
- try
+ try
{
properties.load(Calendar.class.getResourceAsStream("weeks.properties"));
}
@@ -538,19 +538,19 @@ public abstract class Calendar
first = properties.getProperty("firstDay.DEFAULT");
try
{
- if (min != null)
- minimalDaysInFirstWeek = Integer.parseInt(min);
+ if (min != null)
+ minimalDaysInFirstWeek = Integer.parseInt(min);
}
catch (NumberFormatException ex)
{
- minimalDaysInFirstWeek = 1;
+ minimalDaysInFirstWeek = 1;
}
firstDayOfWeek = 1;
if (first != null)
for (int i = 0; i < 8; i++)
- if (days[i].equals(first))
- firstDayOfWeek = i;
+ if (days[i].equals(first))
+ firstDayOfWeek = i;
clear();
}
@@ -558,7 +558,7 @@ public abstract class Calendar
/**
* Creates a calendar representing the actual time, using the default
* time zone and locale.
- *
+ *
* @return The new calendar.
*/
public static synchronized Calendar getInstance()
@@ -569,11 +569,11 @@ public abstract class Calendar
/**
* Creates a calendar representing the actual time, using the given
* time zone and the default locale.
- *
+ *
* @param zone a time zone (null not permitted).
- *
+ *
* @return The new calendar.
- *
+ *
* @throws NullPointerException if zone is null.
*/
public static synchronized Calendar getInstance(TimeZone zone)
@@ -584,11 +584,11 @@ public abstract class Calendar
/**
* Creates a calendar representing the actual time, using the default
* time zone and the given locale.
- *
+ *
* @param locale a locale (null not permitted).
- *
+ *
* @return The new calendar.
- *
+ *
* @throws NullPointerException if locale is null.
*/
public static synchronized Calendar getInstance(Locale locale)
@@ -611,12 +611,12 @@ public abstract class Calendar
/**
* Creates a calendar representing the actual time, using the given
* time zone and locale.
- *
+ *
* @param zone a time zone (null not permitted).
* @param locale a locale (null not permitted).
- *
+ *
* @return The new calendar.
- *
+ *
* @throws NullPointerException if zone or locale
* is null.
*/
@@ -627,43 +627,43 @@ public abstract class Calendar
try
{
- if (calendarClass == null)
- {
- calendarClass = Class.forName(calendarClassName);
- if (Calendar.class.isAssignableFrom(calendarClass))
- cache.put(locale, calendarClass);
- }
-
- // GregorianCalendar is by far the most common case. Optimize by
- // avoiding reflection.
- if (calendarClass == GregorianCalendar.class)
- return new GregorianCalendar(zone, locale);
-
- if (Calendar.class.isAssignableFrom(calendarClass))
- {
- Constructor ctor = calendarClass.getConstructor(ctorArgTypes);
- return (Calendar) ctor.newInstance(new Object[] { zone, locale });
- }
+ if (calendarClass == null)
+ {
+ calendarClass = Class.forName(calendarClassName);
+ if (Calendar.class.isAssignableFrom(calendarClass))
+ cache.put(locale, calendarClass);
+ }
+
+ // GregorianCalendar is by far the most common case. Optimize by
+ // avoiding reflection.
+ if (calendarClass == GregorianCalendar.class)
+ return new GregorianCalendar(zone, locale);
+
+ if (Calendar.class.isAssignableFrom(calendarClass))
+ {
+ Constructor ctor = calendarClass.getConstructor(ctorArgTypes);
+ return (Calendar) ctor.newInstance(new Object[] { zone, locale });
+ }
}
catch (ClassNotFoundException ex)
{
- exception = ex;
+ exception = ex;
}
catch (IllegalAccessException ex)
{
- exception = ex;
+ exception = ex;
}
catch (NoSuchMethodException ex)
{
- exception = ex;
+ exception = ex;
}
catch (InstantiationException ex)
{
- exception = ex;
+ exception = ex;
}
catch (InvocationTargetException ex)
{
- exception = ex;
+ exception = ex;
}
throw new RuntimeException("Error instantiating calendar for locale "
@@ -710,9 +710,9 @@ public abstract class Calendar
/**
* Sets this Calendar's time to the given Date. All time fields
* are invalidated by this method.
- *
+ *
* @param date the date (null not permitted).
- *
+ *
* @throws NullPointerException if date is null.
*/
public final void setTime(Date date)
@@ -794,7 +794,7 @@ public abstract class Calendar
{
if (isTimeSet)
for (int i = 0; i < FIELD_COUNT; i++)
- isSet[i] = false;
+ isSet[i] = false;
isTimeSet = false;
fields[field] = value;
isSet[field] = true;
@@ -808,74 +808,74 @@ public abstract class Calendar
switch (field)
{
case MONTH: // pattern 1,2 or 3
- isSet[DAY_OF_YEAR] = false;
- isSet[WEEK_OF_YEAR] = false;
- break;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ break;
case DAY_OF_MONTH: // pattern 1
- isSet[YEAR] = true;
- isSet[MONTH] = true;
- isSet[WEEK_OF_MONTH] = true;
- isSet[DAY_OF_WEEK] = false;
- isSet[DAY_OF_WEEK_IN_MONTH] = false;
- isSet[DAY_OF_YEAR] = false;
- isSet[WEEK_OF_YEAR] = false;
- break;
+ isSet[YEAR] = true;
+ isSet[MONTH] = true;
+ isSet[WEEK_OF_MONTH] = true;
+ isSet[DAY_OF_WEEK] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ break;
case WEEK_OF_MONTH: // pattern 2
- if (! isSet[DAY_OF_WEEK])
- fields[DAY_OF_WEEK] = getFirstDayOfWeek();
- isSet[YEAR] = true;
- isSet[MONTH] = true;
- isSet[DAY_OF_WEEK] = true;
- isSet[DAY_OF_MONTH] = false;
- isSet[DAY_OF_WEEK_IN_MONTH] = false;
- isSet[DAY_OF_YEAR] = false;
- isSet[WEEK_OF_YEAR] = false;
- break;
+ if (! isSet[DAY_OF_WEEK])
+ fields[DAY_OF_WEEK] = getFirstDayOfWeek();
+ isSet[YEAR] = true;
+ isSet[MONTH] = true;
+ isSet[DAY_OF_WEEK] = true;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ break;
case DAY_OF_WEEK_IN_MONTH: // pattern 3
- if (! isSet[DAY_OF_WEEK])
- fields[DAY_OF_WEEK] = getFirstDayOfWeek();
- isSet[YEAR] = true;
- isSet[MONTH] = true;
- isSet[DAY_OF_WEEK] = true;
- isSet[DAY_OF_YEAR] = false;
- isSet[DAY_OF_MONTH] = false;
- isSet[WEEK_OF_MONTH] = false;
- isSet[WEEK_OF_YEAR] = false;
- break;
+ if (! isSet[DAY_OF_WEEK])
+ fields[DAY_OF_WEEK] = getFirstDayOfWeek();
+ isSet[YEAR] = true;
+ isSet[MONTH] = true;
+ isSet[DAY_OF_WEEK] = true;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ break;
case DAY_OF_YEAR: // pattern 4
- isSet[YEAR] = true;
- isSet[MONTH] = false;
- isSet[WEEK_OF_MONTH] = false;
- isSet[DAY_OF_MONTH] = false;
- isSet[DAY_OF_WEEK] = false;
- isSet[WEEK_OF_YEAR] = false;
- isSet[DAY_OF_WEEK_IN_MONTH] = false;
- break;
+ isSet[YEAR] = true;
+ isSet[MONTH] = false;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[DAY_OF_WEEK] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ break;
case WEEK_OF_YEAR: // pattern 5
- if (! isSet[DAY_OF_WEEK])
- fields[DAY_OF_WEEK] = getFirstDayOfWeek();
- isSet[YEAR] = true;
- isSet[DAY_OF_WEEK] = true;
- isSet[MONTH] = false;
- isSet[DAY_OF_MONTH] = false;
- isSet[WEEK_OF_MONTH] = false;
- isSet[DAY_OF_YEAR] = false;
- isSet[DAY_OF_WEEK_IN_MONTH] = false;
- break;
+ if (! isSet[DAY_OF_WEEK])
+ fields[DAY_OF_WEEK] = getFirstDayOfWeek();
+ isSet[YEAR] = true;
+ isSet[DAY_OF_WEEK] = true;
+ isSet[MONTH] = false;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ break;
case AM_PM:
- isSet[HOUR] = true;
- isSet[HOUR_OF_DAY] = false;
- break;
+ isSet[HOUR] = true;
+ isSet[HOUR_OF_DAY] = false;
+ break;
case HOUR_OF_DAY:
- isSet[AM_PM] = false;
- isSet[HOUR] = false;
- break;
+ isSet[AM_PM] = false;
+ isSet[HOUR] = false;
+ break;
case HOUR:
- isSet[AM_PM] = true;
- isSet[HOUR_OF_DAY] = false;
- break;
+ isSet[AM_PM] = true;
+ isSet[HOUR_OF_DAY] = false;
+ break;
case DST_OFFSET:
- explicitDSTOffset = true;
+ explicitDSTOffset = true;
}
// May have crossed over a DST boundary.
@@ -950,7 +950,7 @@ public abstract class Calendar
isTimeSet = false;
areFieldsSet = false;
int zoneOffs = zone.getRawOffset();
- int[] tempFields =
+ int[] tempFields =
{
1, 1970, JANUARY, 1, 1, 1, 1, THURSDAY, 1, AM, 0, 0, 0,
0, 0, zoneOffs, 0
@@ -969,7 +969,7 @@ public abstract class Calendar
*/
public final void clear(int field)
{
- int[] tempFields =
+ int[] tempFields =
{
1, 1970, JANUARY, 1, 1, 1, 1, THURSDAY, 1, AM, 0, 0, 0,
0, 0, zone.getRawOffset(), 0
@@ -1118,13 +1118,13 @@ public abstract class Calendar
{
while (amount > 0)
{
- roll(field, true);
- amount--;
+ roll(field, true);
+ amount--;
}
while (amount < 0)
{
- roll(field, false);
- amount++;
+ roll(field, false);
+ amount++;
}
}
@@ -1260,9 +1260,9 @@ public abstract class Calendar
tmp.set(field, min);
for (; min > end; min--)
{
- tmp.add(field, -1); // Try to get smaller
- if (tmp.get(field) != min - 1)
- break; // Done if not successful
+ tmp.add(field, -1); // Try to get smaller
+ if (tmp.get(field) != min - 1)
+ break; // Done if not successful
}
return min;
}
@@ -1285,9 +1285,9 @@ public abstract class Calendar
tmp.set(field, max);
for (; max < end; max++)
{
- tmp.add(field, 1);
- if (tmp.get(field) != max + 1)
- break;
+ tmp.add(field, 1);
+ if (tmp.get(field) != max + 1)
+ break;
}
return max;
}
@@ -1295,14 +1295,14 @@ public abstract class Calendar
/**
* Compares the time of two calendar instances.
* @param cal the calendar to which the time should be compared.
- * @return 0 if the two calendars are set to the same time,
- * less than 0 if the time of this calendar is before that of
+ * @return 0 if the two calendars are set to the same time,
+ * less than 0 if the time of this calendar is before that of
* cal, or more than 0 if the time of this calendar is after
* that of cal.
*
* @param cal the calendar to compare this instance with.
* @throws NullPointerException if cal is null.
- * @throws IllegalArgumentException if either calendar has fields set to
+ * @throws IllegalArgumentException if either calendar has fields set to
* invalid values.
* @since 1.5
*/
@@ -1324,18 +1324,18 @@ public abstract class Calendar
{
try
{
- Calendar cal = (Calendar) super.clone();
- cal.fields = (int[]) fields.clone();
- cal.isSet = (boolean[]) isSet.clone();
- return cal;
+ Calendar cal = (Calendar) super.clone();
+ cal.fields = (int[]) fields.clone();
+ cal.isSet = (boolean[]) isSet.clone();
+ return cal;
}
catch (CloneNotSupportedException ex)
{
- return null;
+ return null;
}
}
- private static final String[] fieldNames =
+ private static final String[] fieldNames =
{
",ERA=", ",YEAR=", ",MONTH=",
",WEEK_OF_YEAR=",
@@ -1367,11 +1367,11 @@ public abstract class Calendar
sb.append(",areFieldsSet=" + areFieldsSet);
for (int i = 0; i < FIELD_COUNT; i++)
{
- sb.append(fieldNames[i]);
- if (isSet[i])
- sb.append(fields[i]);
- else
- sb.append("?");
+ sb.append(fieldNames[i]);
+ if (isSet[i])
+ sb.append(fields[i]);
+ else
+ sb.append("?");
}
sb.append(",lenient=").append(lenient);
sb.append(",firstDayOfWeek=").append(firstDayOfWeek);
@@ -1407,13 +1407,13 @@ public abstract class Calendar
if (serialVersionOnStream > 1)
{
- // This is my interpretation of the serial number:
- // Sun wants to remove all fields from the stream someday
- // and will then increase the serialVersion number again.
- // We prepare to be compatible.
- fields = new int[FIELD_COUNT];
- isSet = new boolean[FIELD_COUNT];
- areFieldsSet = false;
+ // This is my interpretation of the serial number:
+ // Sun wants to remove all fields from the stream someday
+ // and will then increase the serialVersion number again.
+ // We prepare to be compatible.
+ fields = new int[FIELD_COUNT];
+ isSet = new boolean[FIELD_COUNT];
+ areFieldsSet = false;
}
}
@@ -1449,15 +1449,15 @@ public abstract class Calendar
{
if (field < 0 || field >= FIELD_COUNT)
throw new IllegalArgumentException("The field value, " + field +
- ", is invalid.");
+ ", is invalid.");
if (style != SHORT && style != LONG)
throw new IllegalArgumentException("The style must be either " +
- "short or long.");
+ "short or long.");
if (field == YEAR || field == WEEK_OF_YEAR ||
- field == WEEK_OF_MONTH || field == DAY_OF_MONTH ||
- field == DAY_OF_YEAR || field == DAY_OF_WEEK_IN_MONTH ||
- field == HOUR || field == HOUR_OF_DAY || field == MINUTE ||
- field == SECOND || field == MILLISECOND)
+ field == WEEK_OF_MONTH || field == DAY_OF_MONTH ||
+ field == DAY_OF_YEAR || field == DAY_OF_WEEK_IN_MONTH ||
+ field == HOUR || field == HOUR_OF_DAY || field == MINUTE ||
+ field == SECOND || field == MILLISECOND)
return null;
int value = get(field);
@@ -1466,30 +1466,30 @@ public abstract class Calendar
return syms.getEras()[value];
if (field == MONTH)
if (style == LONG)
- return syms.getMonths()[value];
- else
- return syms.getShortMonths()[value];
+ return syms.getMonths()[value];
+ else
+ return syms.getShortMonths()[value];
if (field == DAY_OF_WEEK)
if (style == LONG)
- return syms.getWeekdays()[value];
+ return syms.getWeekdays()[value];
else
- return syms.getShortWeekdays()[value];
+ return syms.getShortWeekdays()[value];
if (field == AM_PM)
return syms.getAmPmStrings()[value];
if (field == ZONE_OFFSET)
if (style == LONG)
- return syms.getZoneStrings()[value][1];
+ return syms.getZoneStrings()[value][1];
else
- return syms.getZoneStrings()[value][2];
+ return syms.getZoneStrings()[value][2];
if (field == DST_OFFSET)
if (style == LONG)
- return syms.getZoneStrings()[value][3];
+ return syms.getZoneStrings()[value][3];
else
- return syms.getZoneStrings()[value][4];
+ return syms.getZoneStrings()[value][4];
throw new InternalError("Failed to resolve field " + field +
- " with style " + style + " for locale " +
- locale);
+ " with style " + style + " for locale " +
+ locale);
}
/**
@@ -1528,93 +1528,93 @@ public abstract class Calendar
{
if (field < 0 || field >= FIELD_COUNT)
throw new IllegalArgumentException("The field value, " + field +
- ", is invalid.");
+ ", is invalid.");
if (style != SHORT && style != LONG && style != ALL_STYLES)
throw new IllegalArgumentException("The style must be either " +
- "short, long or all styles.");
+ "short, long or all styles.");
if (field == YEAR || field == WEEK_OF_YEAR ||
- field == WEEK_OF_MONTH || field == DAY_OF_MONTH ||
- field == DAY_OF_YEAR || field == DAY_OF_WEEK_IN_MONTH ||
- field == HOUR || field == HOUR_OF_DAY || field == MINUTE ||
- field == SECOND || field == MILLISECOND)
+ field == WEEK_OF_MONTH || field == DAY_OF_MONTH ||
+ field == DAY_OF_YEAR || field == DAY_OF_WEEK_IN_MONTH ||
+ field == HOUR || field == HOUR_OF_DAY || field == MINUTE ||
+ field == SECOND || field == MILLISECOND)
return null;
DateFormatSymbols syms = DateFormatSymbols.getInstance(locale);
Map map = new HashMap();
if (field == ERA)
{
- String[] eras = syms.getEras();
- for (int a = 0; a < eras.length; ++a)
- map.put(eras[a], a);
- return map;
+ String[] eras = syms.getEras();
+ for (int a = 0; a < eras.length; ++a)
+ map.put(eras[a], a);
+ return map;
}
if (field == MONTH)
{
- if (style == LONG || style == ALL_STYLES)
- {
- String[] months = syms.getMonths();
- for (int a = 0; a < months.length; ++a)
- map.put(months[a], a);
- }
- if (style == SHORT || style == ALL_STYLES)
- {
- String[] months = syms.getShortMonths();
- for (int a = 0; a < months.length; ++a)
- map.put(months[a], a);
- }
- return map;
+ if (style == LONG || style == ALL_STYLES)
+ {
+ String[] months = syms.getMonths();
+ for (int a = 0; a < months.length; ++a)
+ map.put(months[a], a);
+ }
+ if (style == SHORT || style == ALL_STYLES)
+ {
+ String[] months = syms.getShortMonths();
+ for (int a = 0; a < months.length; ++a)
+ map.put(months[a], a);
+ }
+ return map;
}
if (field == DAY_OF_WEEK)
{
- if (style == LONG || style == ALL_STYLES)
- {
- String[] weekdays = syms.getWeekdays();
- for (int a = SUNDAY; a < weekdays.length; ++a)
- map.put(weekdays[a], a);
- }
- if (style == SHORT || style == ALL_STYLES)
- {
- String[] weekdays = syms.getShortWeekdays();
- for (int a = SUNDAY; a < weekdays.length; ++a)
- map.put(weekdays[a], a);
- }
- return map;
+ if (style == LONG || style == ALL_STYLES)
+ {
+ String[] weekdays = syms.getWeekdays();
+ for (int a = SUNDAY; a < weekdays.length; ++a)
+ map.put(weekdays[a], a);
+ }
+ if (style == SHORT || style == ALL_STYLES)
+ {
+ String[] weekdays = syms.getShortWeekdays();
+ for (int a = SUNDAY; a < weekdays.length; ++a)
+ map.put(weekdays[a], a);
+ }
+ return map;
}
if (field == AM_PM)
{
- String[] ampms = syms.getAmPmStrings();
- for (int a = 0; a < ampms.length; ++a)
- map.put(ampms[a], a);
- return map;
+ String[] ampms = syms.getAmPmStrings();
+ for (int a = 0; a < ampms.length; ++a)
+ map.put(ampms[a], a);
+ return map;
}
if (field == ZONE_OFFSET)
{
- String[][] zones = syms.getZoneStrings();
- for (int a = 0; a < zones.length; ++a)
- {
- if (style == LONG || style == ALL_STYLES)
- map.put(zones[a][1], a);
- if (style == SHORT || style == ALL_STYLES)
- map.put(zones[a][2], a);
- }
- return map;
+ String[][] zones = syms.getZoneStrings();
+ for (int a = 0; a < zones.length; ++a)
+ {
+ if (style == LONG || style == ALL_STYLES)
+ map.put(zones[a][1], a);
+ if (style == SHORT || style == ALL_STYLES)
+ map.put(zones[a][2], a);
+ }
+ return map;
}
if (field == DST_OFFSET)
{
- String[][] zones = syms.getZoneStrings();
- for (int a = 0; a < zones.length; ++a)
- {
- if (style == LONG || style == ALL_STYLES)
- map.put(zones[a][3], a);
- if (style == SHORT || style == ALL_STYLES)
- map.put(zones[a][4], a);
- }
- return map;
+ String[][] zones = syms.getZoneStrings();
+ for (int a = 0; a < zones.length; ++a)
+ {
+ if (style == LONG || style == ALL_STYLES)
+ map.put(zones[a][3], a);
+ if (style == SHORT || style == ALL_STYLES)
+ map.put(zones[a][4], a);
+ }
+ return map;
}
-
+
throw new InternalError("Failed to resolve field " + field +
- " with style " + style + " for locale " +
- locale);
+ " with style " + style + " for locale " +
+ locale);
}
}
diff --git a/libjava/classpath/java/util/Collections.java b/libjava/classpath/java/util/Collections.java
index 066c9d5..828c6ec 100644
--- a/libjava/classpath/java/util/Collections.java
+++ b/libjava/classpath/java/util/Collections.java
@@ -354,7 +354,7 @@ public class Collections
* This is true only if the given collection is also empty.
* @param c The collection of objects, which should be compared
* against the members of this list.
- * @return true if c is also empty.
+ * @return true if c is also empty.
*/
public boolean containsAll(Collection> c)
{
@@ -552,7 +552,7 @@ public class Collections
/**
* No mappings, so this returns null.
* @param o The key of the object to retrieve.
- * @return null.
+ * @return null.
*/
public V get(Object o)
{
@@ -617,7 +617,7 @@ public class Collections
}
} // class EmptyMap
-
+
/**
* Compare two objects with or without a Comparator. If c is null, uses the
* natural ordering. Slightly slower than doing it inline if the JVM isn't
@@ -653,8 +653,8 @@ public class Collections
* @throws NullPointerException if a null element has compareTo called
* @see #sort(List)
*/
- public static int binarySearch(List extends Comparable super T>> l,
- T key)
+ public static int binarySearch(List extends Comparable super T>> l,
+ T key)
{
return binarySearch(l, key, null);
}
@@ -687,7 +687,7 @@ public class Collections
* @see #sort(List, Comparator)
*/
public static int binarySearch(List extends T> l, T key,
- Comparator super T> c)
+ Comparator super T> c)
{
int pos = 0;
int low = 0;
@@ -697,53 +697,53 @@ public class Collections
// if the list is sequential-access.
if (isSequential(l))
{
- ListIterator itr = ((List) l).listIterator();
+ ListIterator itr = ((List) l).listIterator();
int i = 0;
- T o = itr.next(); // Assumes list is not empty (see isSequential)
- boolean forward = true;
+ T o = itr.next(); // Assumes list is not empty (see isSequential)
+ boolean forward = true;
while (low <= hi)
{
pos = (low + hi) >>> 1;
if (i < pos)
- {
- if (!forward)
- itr.next(); // Changing direction first.
- for ( ; i != pos; i++, o = itr.next())
+ {
+ if (!forward)
+ itr.next(); // Changing direction first.
+ for ( ; i != pos; i++, o = itr.next())
;
- forward = true;
- }
+ forward = true;
+ }
else
- {
- if (forward)
- itr.previous(); // Changing direction first.
- for ( ; i != pos; i--, o = itr.previous())
+ {
+ if (forward)
+ itr.previous(); // Changing direction first.
+ for ( ; i != pos; i--, o = itr.previous())
;
- forward = false;
- }
- final int d = compare(o, key, c);
- if (d == 0)
+ forward = false;
+ }
+ final int d = compare(o, key, c);
+ if (d == 0)
return pos;
- else if (d > 0)
+ else if (d > 0)
hi = pos - 1;
- else
+ else
// This gets the insertion point right on the last loop
low = ++pos;
}
}
else
{
- while (low <= hi)
- {
- pos = (low + hi) >>> 1;
- final int d = compare(((List) l).get(pos), key, c);
- if (d == 0)
+ while (low <= hi)
+ {
+ pos = (low + hi) >>> 1;
+ final int d = compare(((List) l).get(pos), key, c);
+ if (d == 0)
return pos;
- else if (d > 0)
+ else if (d > 0)
hi = pos - 1;
- else
+ else
// This gets the insertion point right on the last loop
low = ++pos;
- }
+ }
}
// If we failed to find it, we do the same whichever search we did.
@@ -799,7 +799,7 @@ public class Collections
*/
public final boolean hasMoreElements()
{
- return i.hasNext();
+ return i.hasNext();
}
/**
@@ -810,7 +810,7 @@ public class Collections
*/
public final T nextElement()
{
- return i.next();
+ return i.next();
}
};
}
@@ -829,8 +829,8 @@ public class Collections
ListIterator super T> itr = l.listIterator();
for (int i = l.size() - 1; i >= 0; --i)
{
- itr.next();
- itr.set(val);
+ itr.next();
+ itr.set(val);
}
}
@@ -928,16 +928,16 @@ public class Collections
* (only possible when order is null)
*/
public static T max(Collection extends T> c,
- Comparator super T> order)
+ Comparator super T> order)
{
Iterator extends T> itr = c.iterator();
T max = itr.next(); // throws NoSuchElementException
int csize = c.size();
for (int i = 1; i < csize; i++)
{
- T o = itr.next();
- if (compare(max, o, order) < 0)
- max = o;
+ T o = itr.next();
+ if (compare(max, o, order) < 0)
+ max = o;
}
return max;
}
@@ -974,16 +974,16 @@ public class Collections
* (only possible when order is null)
*/
public static T min(Collection extends T> c,
- Comparator super T> order)
+ Comparator super T> order)
{
Iterator extends T> itr = c.iterator();
- T min = itr.next(); // throws NoSuchElementExcception
+ T min = itr.next(); // throws NoSuchElementExcception
int csize = c.size();
for (int i = 1; i < csize; i++)
{
- T o = itr.next();
- if (compare(min, o, order) > 0)
- min = o;
+ T o = itr.next();
+ if (compare(min, o, order) > 0)
+ min = o;
}
return min;
}
@@ -1044,7 +1044,7 @@ public class Collections
CopiesList(int n, T o)
{
if (n < 0)
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException();
this.n = n;
element = o;
}
@@ -1190,12 +1190,12 @@ public class Collections
ListIterator i2 = l.listIterator(pos2);
while (pos1 < pos2)
{
- Object o1 = i1.next();
+ Object o1 = i1.next();
Object o2 = i2.previous();
- i1.set(o2);
- i2.set(o1);
- ++pos1;
- --pos2;
+ i1.set(o2);
+ i2.set(o1);
+ ++pos1;
+ --pos2;
}
}
@@ -1221,7 +1221,7 @@ public class Collections
{
public int compare(T a, T b)
{
- return - c.compare(a, b);
+ return - c.compare(a, b);
}
};
}
@@ -1344,7 +1344,7 @@ public class Collections
// Now, make the swaps. We must take the remainder every time through
// the inner loop so that we don't overflow i to negative values.
- List
to reverse
* the inclusiveness of both endpoints.
*
- *
+ *
* @param fromElement the inclusive lower range of the subset.
* @param toElement the exclusive upper range of the subset.
* @return the subset.
@@ -7471,7 +7471,7 @@ public class Collections
}
/**
- * The implementation of {@link #asLIFOQueue(Deque)}.
+ * The implementation of {@link #asLIFOQueue(Deque)}.
*
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.6
@@ -7479,7 +7479,7 @@ public class Collections
private static class LIFOQueue
extends AbstractQueue
{
-
+
/**
* The backing deque.
*/
@@ -7500,36 +7500,36 @@ public class Collections
{
return deque.offerFirst(e);
}
-
+
public boolean addAll(Collection extends T> c)
{
boolean result = false;
final Iterator extends T> it = c.iterator();
while (it.hasNext())
- result |= deque.offerFirst(it.next());
+ result |= deque.offerFirst(it.next());
return result;
}
-
+
public void clear()
{
deque.clear();
}
-
+
public boolean isEmpty()
{
return deque.isEmpty();
}
-
+
public Iterator iterator()
{
return deque.iterator();
}
-
+
public boolean offer(T e)
{
return deque.offerFirst(e);
}
-
+
public T peek()
{
return deque.peek();
@@ -7539,7 +7539,7 @@ public class Collections
{
return deque.poll();
}
-
+
public int size()
{
return deque.size();
@@ -7547,7 +7547,7 @@ public class Collections
} // class LIFOQueue
/**
- * The implementation of {@link #newSetFromMap(Map)}.
+ * The implementation of {@link #newSetFromMap(Map)}.
*
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.6
@@ -7555,7 +7555,7 @@ public class Collections
private static class MapSet
extends AbstractSet
{
-
+
/**
* The backing map.
*/
@@ -7571,7 +7571,7 @@ public class Collections
public MapSet(Map map)
{
if (!map.isEmpty())
- throw new IllegalArgumentException("The map must be empty.");
+ throw new IllegalArgumentException("The map must be empty.");
this.map = map;
}
@@ -7579,45 +7579,45 @@ public class Collections
{
return map.put(e, true) == null;
}
-
+
public boolean addAll(Collection extends E> c)
{
boolean result = false;
final Iterator extends E> it = c.iterator();
while (it.hasNext())
- result |= (map.put(it.next(), true) == null);
+ result |= (map.put(it.next(), true) == null);
return result;
}
-
+
public void clear()
{
map.clear();
}
-
+
public boolean contains(Object o)
{
return map.containsKey(o);
}
-
+
public boolean isEmpty()
{
return map.isEmpty();
}
-
+
public Iterator iterator()
{
return map.keySet().iterator();
}
-
+
public boolean remove(Object o)
{
return map.remove(o) != null;
}
-
+
public int size()
{
return map.size();
}
} // class MapSet
-
+
} // class Collections
diff --git a/libjava/classpath/java/util/Currency.java b/libjava/classpath/java/util/Currency.java
index 11235f1..d58082c 100644
--- a/libjava/classpath/java/util/Currency.java
+++ b/libjava/classpath/java/util/Currency.java
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -60,7 +60,7 @@ import java.util.spi.CurrencyNameProvider;
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.4
*/
-public final class Currency
+public final class Currency
implements Serializable
{
/**
@@ -95,7 +95,7 @@ public final class Currency
* @serial the number of fraction digits
*/
private transient int fractionDigits;
-
+
/**
* A cached map of country codes
* instances to international currency code
@@ -115,7 +115,7 @@ public final class Currency
* is the international currency code.
*
* @see #getInstance(java.util.Locale)
- * @see #getInstance(java.lang.String)
+ * @see #getInstance(java.lang.String)
* @see #readResolve()
* @serial ignored.
*/
@@ -133,7 +133,7 @@ public final class Currency
/* Create the properties object */
properties = new Properties();
/* Try and load the properties from our iso4217.properties resource */
- try
+ try
{
properties.load(Currency.class.getResourceAsStream("iso4217.properties"));
}
@@ -157,7 +157,7 @@ public final class Currency
* country code, are ignored. The results of calling this
* method may vary over time, as the currency associated with
* a particular country changes. For countries without
- * a given currency (e.g. Antarctica), the result is null.
+ * a given currency (e.g. Antarctica), the result is null.
*
* @param loc the locale for the new currency, or null if
* there is no country code specified or a currency
@@ -176,8 +176,8 @@ public final class Currency
if (countryCode.equals(""))
{
throw new
- IllegalArgumentException("Invalid (empty) country code for locale:"
- + loc);
+ IllegalArgumentException("Invalid (empty) country code for locale:"
+ + loc);
}
/* Construct the key for the currency */
currencyKey = countryCode + ".currency";
@@ -206,7 +206,7 @@ public final class Currency
* currency code.
*
* @param code the code to use.
- */
+ */
private Currency(String code)
{
currencyCode = code;
@@ -234,19 +234,19 @@ public final class Currency
* currencies, such as IMF Special Drawing Rights, -1 is returned.
*
* @return the number of digits after the decimal separator for this currency.
- */
+ */
public int getDefaultFractionDigits()
{
return fractionDigits;
}
-
+
/**
* Builds a new currency instance for this locale.
* All components of the given locale, other than the
* country code, are ignored. The results of calling this
* method may vary over time, as the currency associated with
* a particular country changes. For countries without
- * a given currency (e.g. Antarctica), the result is null.
+ * a given currency (e.g. Antarctica), the result is null.
*
* @param locale a Locale instance.
* @return a new Currency instance.
@@ -254,7 +254,7 @@ public final class Currency
* country code is null.
* @throws IllegalArgumentException if the country of
* the given locale is not a supported ISO3166 code.
- */
+ */
public static Currency getInstance(Locale locale)
{
/**
@@ -270,39 +270,39 @@ public final class Currency
String country = locale.getCountry();
if (locale == null || country == null)
{
- throw new
- NullPointerException("The locale or its country is null.");
+ throw new
+ NullPointerException("The locale or its country is null.");
}
-
+
/* Check that country of locale given is valid. */
if (country.length() != 2)
throw new IllegalArgumentException();
-
+
/* Attempt to get the currency from the cache */
String code = (String) countryMap.get(country);
if (code == null)
{
/* Create the currency for this locale */
newCurrency = new Currency(locale);
- /*
+ /*
* If the currency code is null, then creation failed
* and we return null.
*/
- code = newCurrency.getCurrencyCode();
+ code = newCurrency.getCurrencyCode();
if (code == null)
{
return null;
}
- else
+ else
{
/* Cache it */
countryMap.put(country, code);
- cache.put(code, newCurrency);
+ cache.put(code, newCurrency);
}
}
else
{
- newCurrency = (Currency) cache.get(code);
+ newCurrency = (Currency) cache.get(code);
}
/* Return the instance */
return newCurrency;
@@ -321,10 +321,10 @@ public final class Currency
{
Locale[] allLocales;
- /*
+ /*
* Throw a null pointer exception explicitly if currencyCode is null.
* One is not thrown otherwise. It results in an
- * IllegalArgumentException.
+ * IllegalArgumentException.
*/
if (currencyCode == null)
{
@@ -336,35 +336,35 @@ public final class Currency
Currency newCurrency = (Currency) cache.get(currencyCode);
if (newCurrency == null)
{
- /* Get all locales */
- allLocales = Locale.getAvailableLocales();
- /* Loop through each locale, looking for the code */
- for (int i = 0;i < allLocales.length; i++)
- {
- try
- {
- Currency testCurrency = getInstance (allLocales[i]);
- if (testCurrency != null &&
- testCurrency.getCurrencyCode().equals(currencyCode))
- {
- return testCurrency;
- }
- }
- catch (IllegalArgumentException exception)
- {
- /* Ignore locales without valid countries */
- }
- }
- /*
- * If we get this far, the code is not supported by any of
- * our locales.
- */
- throw new IllegalArgumentException("The currency code, " + currencyCode +
- ", is not supported.");
+ /* Get all locales */
+ allLocales = Locale.getAvailableLocales();
+ /* Loop through each locale, looking for the code */
+ for (int i = 0;i < allLocales.length; i++)
+ {
+ try
+ {
+ Currency testCurrency = getInstance (allLocales[i]);
+ if (testCurrency != null &&
+ testCurrency.getCurrencyCode().equals(currencyCode))
+ {
+ return testCurrency;
+ }
+ }
+ catch (IllegalArgumentException exception)
+ {
+ /* Ignore locales without valid countries */
+ }
+ }
+ /*
+ * If we get this far, the code is not supported by any of
+ * our locales.
+ */
+ throw new IllegalArgumentException("The currency code, " + currencyCode +
+ ", is not supported.");
}
else
{
- return newCurrency;
+ return newCurrency;
}
}
@@ -413,27 +413,27 @@ public final class Currency
try
{
return ResourceBundle.getBundle("gnu.java.locale.LocaleInformation",
- locale).getString(property);
+ locale).getString(property);
}
catch (MissingResourceException exception)
{
- /* This means runtime support for the locale
- * is not available, so we check providers. */
+ /* This means runtime support for the locale
+ * is not available, so we check providers. */
}
for (CurrencyNameProvider p :
- ServiceLoader.load(CurrencyNameProvider.class))
+ ServiceLoader.load(CurrencyNameProvider.class))
{
- for (Locale loc : p.getAvailableLocales())
- {
- if (loc.equals(locale))
- {
- String localizedString = p.getSymbol(currencyCode,
- locale);
- if (localizedString != null)
- return localizedString;
- break;
- }
- }
+ for (Locale loc : p.getAvailableLocales())
+ {
+ if (loc.equals(locale))
+ {
+ String localizedString = p.getSymbol(currencyCode,
+ locale);
+ if (localizedString != null)
+ return localizedString;
+ break;
+ }
+ }
}
if (locale.equals(Locale.ROOT)) // Base case
return currencyCode;
diff --git a/libjava/classpath/java/util/Date.java b/libjava/classpath/java/util/Date.java
index 5f83cd0..3f7ba6f 100644
--- a/libjava/classpath/java/util/Date.java
+++ b/libjava/classpath/java/util/Date.java
@@ -49,11 +49,11 @@ import java.text.SimpleDateFormat;
/**
*
* This class represents a specific time in milliseconds since the epoch.
- * The epoch is 1970, January 1 00:00:00.0000 UTC.
+ * The epoch is 1970, January 1 00:00:00.0000 UTC.
*
*
* Date is intended to reflect universal time coordinate (UTC),
- * but this depends on the underlying host environment. Most operating systems
+ * but this depends on the underlying host environment. Most operating systems
* don't handle the leap second, which occurs about once every year or
* so. The leap second is added to the last minute of the day on either
* the 30th of June or the 31st of December, creating a minute 61 seconds
@@ -127,13 +127,13 @@ public class Date
* An array of week names used to map names to integer values.
*/
private static final String[] weekNames = { "Sun", "Mon", "Tue", "Wed",
- "Thu", "Fri", "Sat" };
+ "Thu", "Fri", "Sat" };
/**
* An array of month names used to map names to integer values.
*/
private static final String[] monthNames = { "Jan", "Feb", "Mar", "Apr",
- "May", "Jun", "Jul", "Aug",
- "Sep", "Oct", "Nov", "Dec" };
+ "May", "Jun", "Jul", "Aug",
+ "Sep", "Oct", "Nov", "Dec" };
/**
* Creates a new Date Object representing the current time.
*/
@@ -187,7 +187,7 @@ public class Date
* Creates a new Date Object representing the given time.
*
* @deprecated use new GregorianCalendar(year+1900, month,
- * day, hour, min, sec) instead.
+ * day, hour, min, sec) instead.
* @param year the difference between the required year and 1900.
* @param month the month as a value between 0 and 11.
* @param day the day as a value between 0 and 31.
@@ -200,7 +200,7 @@ public class Date
public Date(int year, int month, int day, int hour, int min, int sec)
{
GregorianCalendar cal =
- new GregorianCalendar(year + 1900, month, day, hour, min, sec);
+ new GregorianCalendar(year + 1900, month, day, hour, min, sec);
time = cal.getTimeInMillis();
}
@@ -208,7 +208,7 @@ public class Date
* Creates a new Date from the given string representation. This
* does the same as new Date(Date.parse(s))
* @see #parse
- * @deprecated use java.text.DateFormat.parse(s) instead.
+ * @deprecated use java.text.DateFormat.parse(s) instead.
*/
public Date(String s)
{
@@ -226,11 +226,11 @@ public class Date
{
try
{
- return super.clone();
+ return super.clone();
}
catch (CloneNotSupportedException ex)
{
- return null;
+ return null;
}
}
@@ -253,7 +253,7 @@ public class Date
* @return the time in milliseconds since the epoch.
*/
public static long UTC(int year, int month, int date,
- int hrs, int min, int sec)
+ int hrs, int min, int sec)
{
GregorianCalendar cal =
new GregorianCalendar(year + 1900, month, date, hrs, min, sec);
@@ -278,7 +278,7 @@ public class Date
* from this object is also used to determine whether or not daylight savings
* time is in effect. For example, the offset for the UK would be 0 if the
* month of the date object was January, and 1 if the month was August.
- *
+ *
* @deprecated use
* Calendar.get(Calendar.ZONE_OFFSET)+Calendar.get(Calendar.DST_OFFSET)
* instead.
@@ -291,13 +291,13 @@ public class Date
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
return - (cal.get(Calendar.ZONE_OFFSET)
- + cal.get(Calendar.DST_OFFSET)) / (60 * 1000);
+ + cal.get(Calendar.DST_OFFSET)) / (60 * 1000);
}
/**
* Sets the time which this object should represent.
*
- * @param time the time in milliseconds since the epoch.
+ * @param time the time in milliseconds since the epoch.
*/
public void setTime(long time)
{
@@ -309,7 +309,7 @@ public class Date
*
* @param when the other date
* @return true, if the date represented by this object is
- * strictly later than the time represented by when.
+ * strictly later than the time represented by when.
*/
public boolean after(Date when)
{
@@ -334,7 +334,7 @@ public class Date
* @param obj the object to compare.
* @return true, if obj is a Date object and the time represented
* by obj is exactly the same as the time represented by this
- * object.
+ * object.
*/
public boolean equals(Object obj)
{
@@ -348,7 +348,7 @@ public class Date
* @return 0, if the date represented
* by obj is exactly the same as the time represented by this
* object, a negative if this Date is before the other Date, and
- * a positive value otherwise.
+ * a positive value otherwise.
*/
public int compareTo(Date when)
{
@@ -414,7 +414,7 @@ public class Date
*
*
*
- * The DateFormat class should now be
+ * The DateFormat class should now be
* preferred over using this method.
*
*
@@ -439,11 +439,11 @@ public class Date
+ sec.substring(sec.length() - 2) + " "
+
cal.getTimeZone().getDisplayName(cal.getTimeZone().inDaylightTime(this),
- TimeZone.SHORT) + " " +
+ TimeZone.SHORT) + " " +
year.substring(year.length() - 4);
}
- /**
+ /**
* Returns a locale-dependent string representation of this
* Date object.
*
@@ -457,7 +457,7 @@ public class Date
return java.text.DateFormat.getInstance().format(this);
}
- /**
+ /**
*
* Returns a string representation of this Date
* object using GMT rather than the local timezone.
@@ -497,7 +497,7 @@ public class Date
* the local timezone.
*
*
- *
+ *
* @deprecated Use DateFormat.format(Date) with a GMT TimeZone.
* @return A string of the form 'd mon yyyy hh:mm:ss GMT' using
* GMT as opposed to the local timezone.
@@ -526,12 +526,12 @@ public class Date
try
{
- // parseInt doesn't handle '+' so strip off sign.
- num = Integer.parseInt(tok.substring(1));
+ // parseInt doesn't handle '+' so strip off sign.
+ num = Integer.parseInt(tok.substring(1));
}
catch (NumberFormatException ex)
{
- throw new IllegalArgumentException(tok);
+ throw new IllegalArgumentException(tok);
}
// Convert hours to minutes.
@@ -557,8 +557,8 @@ public class Date
// We could possibly use the fields of DateFormatSymbols but that is
// localized and thus might not match the English words specified.
String months[] = { "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY",
- "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER",
- "NOVEMBER", "DECEMBER" };
+ "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER",
+ "NOVEMBER", "DECEMBER" };
int i;
for (i = 0; i < 12; i++)
@@ -581,7 +581,7 @@ public class Date
// We could possibly use the fields of DateFormatSymbols but that is
// localized and thus might not match the English words specified.
String daysOfWeek[] = { "SUNDAY", "MONDAY", "TUESDAY", "WEDNESDAY",
- "THURSDAY", "FRIDAY", "SATURDAY" };
+ "THURSDAY", "FRIDAY", "SATURDAY" };
int i;
for (i = 0; i < 7; i++)
@@ -591,7 +591,7 @@ public class Date
return false;
}
- /**
+ /**
*
* Parses a String and returns the time, in milliseconds since the
* epoch, it represents. Most syntaxes are handled, including
@@ -612,7 +612,7 @@ public class Date
* failure. The ASCII characters A-Z, a-z, 0-9, and ',', '+', '-',
* ':' and '/' are the only characters permitted within the string,
* besides whitespace and characters enclosed within parantheses
- * '(' and ')'.
+ * '(' and ')'.
*
*
* A sequence of consecutive digits are recognised as a number,
@@ -729,15 +729,15 @@ public class Date
int len = string.length();
for (int i = 0; i < len; i++)
{
- char ch = string.charAt(i);
- if (ch >= 'a' && ch <= 'z')
- ch -= 'a' - 'A';
- if (ch == '(')
- parenNesting++;
- else if (parenNesting == 0)
- buf.append(ch);
- else if (ch == ')')
- parenNesting--;
+ char ch = string.charAt(i);
+ if (ch >= 'a' && ch <= 'z')
+ ch -= 'a' - 'A';
+ if (ch == '(')
+ parenNesting++;
+ else if (parenNesting == 0)
+ buf.append(ch);
+ else if (ch == ')')
+ parenNesting--;
}
int tmpMonth;
@@ -747,163 +747,163 @@ public class Date
while (strtok.hasMoreTokens())
{
- String tok = strtok.nextToken();
- char firstch = tok.charAt(0);
- if ((firstch == '+' || firstch == '-') && year >= 0)
- {
- timezone = parseTz(tok, firstch);
- localTimezone = false;
- }
- else if (firstch >= '0' && firstch <= '9')
- {
- int lastPunct = -1;
- while (tok != null && tok.length() > 0)
- {
- int punctOffset = tok.length();
- int num = 0;
- int punct;
- for (int i = 0; ; i++)
- {
- if (i >= punctOffset)
- {
- punct = -1;
- break;
- }
- else
- {
- punct = tok.charAt(i);
- if (punct >= '0' && punct <= '9')
- {
- if (num > 999999999) // in case of overflow
- throw new IllegalArgumentException(tok);
- num = 10 * num + (punct - '0');
- }
- else
- {
- punctOffset = i;
- break;
- }
- }
-
- }
-
- if (punct == ':')
- {
- if (hour < 0)
- hour = num;
- else
- minute = num;
- }
- else if (lastPunct == ':' && hour >= 0 && (minute < 0 || second < 0))
- {
- if (minute < 0)
- minute = num;
- else
- second = num;
- }
- else if ((num >= 70
- && (punct == ' ' || punct == ','
- || punct == '/' || punct < 0))
- || (num < 70 && day >= 0 && month >= 0 && year < 0))
- {
- if (num >= 100)
- year = num;
- else
- {
- int curYear = 1900 + new Date().getYear();
- int firstYear = curYear - 80;
- year = firstYear / 100 * 100 + num;
- if (year < firstYear)
- year += 100;
- }
- }
- else if (punct == '/')
- {
- if (month < 0)
- month = num - 1;
- else
- day = num;
- }
- else if (hour >= 0 && minute < 0)
- minute = num;
- else if (minute >= 0 && second < 0)
- second = num;
- else if (day < 0)
- day = num;
- else
- throw new IllegalArgumentException(tok);
-
- // Advance string if there's more to process in this token.
- if (punct < 0 || punctOffset + 1 >= tok.length())
- tok = null;
- else
- tok = tok.substring(punctOffset + 1);
- lastPunct = punct;
- }
- }
- else if (firstch >= 'A' && firstch <= 'Z')
- {
- if (tok.equals("AM"))
- {
- if (hour < 1 || hour > 12)
- throw new IllegalArgumentException(tok);
- if (hour == 12)
- hour = 0;
- }
- else if (tok.equals("PM"))
- {
- if (hour < 1 || hour > 12)
- throw new IllegalArgumentException(tok);
- if (hour < 12)
- hour += 12;
- }
- else if (parseDayOfWeek(tok))
- { /* Ignore it; throw the token away. */ }
- else if (tok.equals("UT") || tok.equals("UTC") || tok.equals("GMT"))
- localTimezone = false;
- else if (tok.startsWith("UT") || tok.startsWith("GMT"))
- {
- int signOffset = 3;
- if (tok.charAt(1) == 'T' && tok.charAt(2) != 'C')
- signOffset = 2;
-
- char sign = tok.charAt(signOffset);
- if (sign != '+' && sign != '-')
- throw new IllegalArgumentException(tok);
-
- timezone = parseTz(tok.substring(signOffset), sign);
- localTimezone = false;
- }
- else if ((tmpMonth = parseMonth(tok)) >= 0)
- month = tmpMonth;
- else if (tok.length() == 3 && tok.charAt(2) == 'T')
- {
- // Convert timezone offset from hours to minutes.
- char ch = tok.charAt(0);
- if (ch == 'E')
- timezone = -5 * 60;
- else if (ch == 'C')
- timezone = -6 * 60;
- else if (ch == 'M')
- timezone = -7 * 60;
- else if (ch == 'P')
- timezone = -8 * 60;
- else
- throw new IllegalArgumentException(tok);
-
- // Shift 60 minutes for Daylight Savings Time.
- if (tok.charAt(1) == 'D')
- timezone += 60;
- else if (tok.charAt(1) != 'S')
- throw new IllegalArgumentException(tok);
-
- localTimezone = false;
- }
- else
- throw new IllegalArgumentException(tok);
- }
- else
- throw new IllegalArgumentException(tok);
+ String tok = strtok.nextToken();
+ char firstch = tok.charAt(0);
+ if ((firstch == '+' || firstch == '-') && year >= 0)
+ {
+ timezone = parseTz(tok, firstch);
+ localTimezone = false;
+ }
+ else if (firstch >= '0' && firstch <= '9')
+ {
+ int lastPunct = -1;
+ while (tok != null && tok.length() > 0)
+ {
+ int punctOffset = tok.length();
+ int num = 0;
+ int punct;
+ for (int i = 0; ; i++)
+ {
+ if (i >= punctOffset)
+ {
+ punct = -1;
+ break;
+ }
+ else
+ {
+ punct = tok.charAt(i);
+ if (punct >= '0' && punct <= '9')
+ {
+ if (num > 999999999) // in case of overflow
+ throw new IllegalArgumentException(tok);
+ num = 10 * num + (punct - '0');
+ }
+ else
+ {
+ punctOffset = i;
+ break;
+ }
+ }
+
+ }
+
+ if (punct == ':')
+ {
+ if (hour < 0)
+ hour = num;
+ else
+ minute = num;
+ }
+ else if (lastPunct == ':' && hour >= 0 && (minute < 0 || second < 0))
+ {
+ if (minute < 0)
+ minute = num;
+ else
+ second = num;
+ }
+ else if ((num >= 70
+ && (punct == ' ' || punct == ','
+ || punct == '/' || punct < 0))
+ || (num < 70 && day >= 0 && month >= 0 && year < 0))
+ {
+ if (num >= 100)
+ year = num;
+ else
+ {
+ int curYear = 1900 + new Date().getYear();
+ int firstYear = curYear - 80;
+ year = firstYear / 100 * 100 + num;
+ if (year < firstYear)
+ year += 100;
+ }
+ }
+ else if (punct == '/')
+ {
+ if (month < 0)
+ month = num - 1;
+ else
+ day = num;
+ }
+ else if (hour >= 0 && minute < 0)
+ minute = num;
+ else if (minute >= 0 && second < 0)
+ second = num;
+ else if (day < 0)
+ day = num;
+ else
+ throw new IllegalArgumentException(tok);
+
+ // Advance string if there's more to process in this token.
+ if (punct < 0 || punctOffset + 1 >= tok.length())
+ tok = null;
+ else
+ tok = tok.substring(punctOffset + 1);
+ lastPunct = punct;
+ }
+ }
+ else if (firstch >= 'A' && firstch <= 'Z')
+ {
+ if (tok.equals("AM"))
+ {
+ if (hour < 1 || hour > 12)
+ throw new IllegalArgumentException(tok);
+ if (hour == 12)
+ hour = 0;
+ }
+ else if (tok.equals("PM"))
+ {
+ if (hour < 1 || hour > 12)
+ throw new IllegalArgumentException(tok);
+ if (hour < 12)
+ hour += 12;
+ }
+ else if (parseDayOfWeek(tok))
+ { /* Ignore it; throw the token away. */ }
+ else if (tok.equals("UT") || tok.equals("UTC") || tok.equals("GMT"))
+ localTimezone = false;
+ else if (tok.startsWith("UT") || tok.startsWith("GMT"))
+ {
+ int signOffset = 3;
+ if (tok.charAt(1) == 'T' && tok.charAt(2) != 'C')
+ signOffset = 2;
+
+ char sign = tok.charAt(signOffset);
+ if (sign != '+' && sign != '-')
+ throw new IllegalArgumentException(tok);
+
+ timezone = parseTz(tok.substring(signOffset), sign);
+ localTimezone = false;
+ }
+ else if ((tmpMonth = parseMonth(tok)) >= 0)
+ month = tmpMonth;
+ else if (tok.length() == 3 && tok.charAt(2) == 'T')
+ {
+ // Convert timezone offset from hours to minutes.
+ char ch = tok.charAt(0);
+ if (ch == 'E')
+ timezone = -5 * 60;
+ else if (ch == 'C')
+ timezone = -6 * 60;
+ else if (ch == 'M')
+ timezone = -7 * 60;
+ else if (ch == 'P')
+ timezone = -8 * 60;
+ else
+ throw new IllegalArgumentException(tok);
+
+ // Shift 60 minutes for Daylight Savings Time.
+ if (tok.charAt(1) == 'D')
+ timezone += 60;
+ else if (tok.charAt(1) != 'S')
+ throw new IllegalArgumentException(tok);
+
+ localTimezone = false;
+ }
+ else
+ throw new IllegalArgumentException(tok);
+ }
+ else
+ throw new IllegalArgumentException(tok);
}
// Unspecified hours, minutes, or seconds should default to 0.
@@ -925,8 +925,8 @@ public class Date
= new GregorianCalendar(year, month, day, hour, minute, second);
if (!localTimezone)
{
- cal.set(Calendar.ZONE_OFFSET, timezone * 60 * 1000);
- cal.set(Calendar.DST_OFFSET, 0);
+ cal.set(Calendar.ZONE_OFFSET, timezone * 60 * 1000);
+ cal.set(Calendar.DST_OFFSET, 0);
}
return cal.getTimeInMillis();
}
@@ -965,7 +965,7 @@ public class Date
* @param year the year minus 1900.
* @deprecated Use Calendar instead of Date, and use
* set(Calendar.YEAR, year) instead. Note about the 1900
- * difference in year.
+ * difference in year.
* @see #getYear()
* @see Calendar
*/
@@ -1008,13 +1008,13 @@ public class Date
* in the seconds value being reset to 0 and the minutes
* value being incremented by 1, if the new time does
* not include a leap second.
- *
+ *
* @param month the month, with a zero-based index
* from January.
* @deprecated Use Calendar instead of Date, and use
* set(Calendar.MONTH, month) instead.
* @see #getMonth()
- * @see Calendar
+ * @see Calendar
*/
public void setMonth(int month)
{
@@ -1059,7 +1059,7 @@ public class Date
*
* @param date the date.
* @deprecated Use Calendar instead of Date, and use
- * set(Calendar.DATE, date) instead.
+ * set(Calendar.DATE, date) instead.
* @see Calendar
* @see #getDate()
*/
@@ -1121,7 +1121,7 @@ public class Date
* @deprecated Use Calendar instead of Date, and use
* set(Calendar.HOUR_OF_DAY, hours) instead.
* @see Calendar
- * @see #getHours()
+ * @see #getHours()
*/
public void setHours(int hours)
{
@@ -1162,7 +1162,7 @@ public class Date
*
* @param minutes the minutes.
* @deprecated Use Calendar instead of Date, and use
- * set(Calendar.MINUTE, minutes) instead.
+ * set(Calendar.MINUTE, minutes) instead.
* @see Calendar
* @see #getMinutes()
*/
@@ -1207,7 +1207,7 @@ public class Date
* @deprecated Use Calendar instead of Date, and use
* set(Calendar.SECOND, seconds) instead.
* @see Calendar
- * @see #getSeconds()
+ * @see #getSeconds()
*/
public void setSeconds(int seconds)
{
diff --git a/libjava/classpath/java/util/Dictionary.java b/libjava/classpath/java/util/Dictionary.java
index 7b82a9f..acd90eb 100644
--- a/libjava/classpath/java/util/Dictionary.java
+++ b/libjava/classpath/java/util/Dictionary.java
@@ -1,4 +1,4 @@
-/* Dictionary.java -- an abstract (and essentially worthless)
+/* Dictionary.java -- an abstract (and essentially worthless)
class which is Hashtable's superclass
Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
@@ -42,12 +42,12 @@ package java.util;
/**
* A Dictionary maps keys to values; how it does that is
* implementation-specific.
- *
+ *
* This is an abstract class which has really gone by the wayside.
* People at Javasoft are probably embarrassed by it. At this point,
* it might as well be an interface rather than a class, but it remains
* this poor, laughable skeleton for the sake of backwards compatibility.
- * At any rate, this was what came before the {@link Map} interface
+ * At any rate, this was what came before the {@link Map} interface
* in the Collections framework.
*
* @author Jon Zeppieri
@@ -77,7 +77,7 @@ public abstract class Dictionary
*/
public abstract Enumeration elements();
- /**
+ /**
* Returns the value associated with the supplied key, or null
* if no such value exists. Since Dictionaries are not allowed null keys
* or elements, a null result always means the key is not present.
diff --git a/libjava/classpath/java/util/DuplicateFormatFlagsException.java b/libjava/classpath/java/util/DuplicateFormatFlagsException.java
index c180605..38c3766 100644
--- a/libjava/classpath/java/util/DuplicateFormatFlagsException.java
+++ b/libjava/classpath/java/util/DuplicateFormatFlagsException.java
@@ -38,15 +38,15 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when the flags supplied to the {@link Formatter#format()}
* method of a {@link Formatter} contain duplicates.
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class DuplicateFormatFlagsException
+public class DuplicateFormatFlagsException
extends IllegalFormatException
{
private static final long serialVersionUID = 18890531L;
@@ -72,7 +72,7 @@ public class DuplicateFormatFlagsException
super("Duplicate flag passed in " + flags);
if (flags == null)
throw new
- NullPointerException("Null flags value passed to constructor.");
+ NullPointerException("Null flags value passed to constructor.");
this.flags = flags;
}
diff --git a/libjava/classpath/java/util/EnumMap.java b/libjava/classpath/java/util/EnumMap.java
index b7187b9..78f0500 100644
--- a/libjava/classpath/java/util/EnumMap.java
+++ b/libjava/classpath/java/util/EnumMap.java
@@ -40,10 +40,10 @@ package java.util;
import java.io.Serializable;
-/**
+/**
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
public class EnumMap, V>
@@ -82,29 +82,29 @@ public class EnumMap, V>
{
if (map instanceof EnumMap)
{
- EnumMap other = (EnumMap) map;
- store = (V[]) other.store.clone();
- cardinality = other.cardinality;
- enumClass = other.enumClass;
+ EnumMap other = (EnumMap) map;
+ store = (V[]) other.store.clone();
+ cardinality = other.cardinality;
+ enumClass = other.enumClass;
}
else
{
- for (K key : map.keySet())
- {
- V value = map.get(key);
- if (store == null)
- {
- enumClass = key.getDeclaringClass();
- store = (V[]) new Object[enumClass.getEnumConstants().length];
- }
- int o = key.ordinal();
- if (store[o] == emptySlot)
- ++cardinality;
- store[o] = value;
- }
- // There must be a single element.
- if (store == null)
- throw new IllegalArgumentException("no elements in map");
+ for (K key : map.keySet())
+ {
+ V value = map.get(key);
+ if (store == null)
+ {
+ enumClass = key.getDeclaringClass();
+ store = (V[]) new Object[enumClass.getEnumConstants().length];
+ }
+ int o = key.ordinal();
+ if (store[o] == emptySlot)
+ ++cardinality;
+ store[o] = value;
+ }
+ // There must be a single element.
+ if (store == null)
+ throw new IllegalArgumentException("no elements in map");
}
}
@@ -117,8 +117,8 @@ public class EnumMap, V>
{
for (V i : store)
{
- if (i != emptySlot && AbstractCollection.equals(i , value))
- return true;
+ if (i != emptySlot && AbstractCollection.equals(i , value))
+ return true;
}
return false;
}
@@ -150,8 +150,8 @@ public class EnumMap, V>
V result;
if (store[o] == emptySlot)
{
- result = null;
- ++cardinality;
+ result = null;
+ ++cardinality;
}
else
result = store[o];
@@ -179,12 +179,12 @@ public class EnumMap, V>
{
for (K key : map.keySet())
{
- V value = map.get(key);
+ V value = map.get(key);
- int o = key.ordinal();
- if (store[o] == emptySlot)
- ++cardinality;
- store[o] = value;
+ int o = key.ordinal();
+ if (store[o] == emptySlot)
+ ++cardinality;
+ store[o] = value;
}
}
@@ -198,56 +198,56 @@ public class EnumMap, V>
{
if (keys == null)
{
- keys = new AbstractSet()
- {
- public int size()
- {
- return cardinality;
- }
-
- public Iterator iterator()
- {
- return new Iterator()
- {
- int count = 0;
- int index = -1;
-
- public boolean hasNext()
- {
- return count < cardinality;
- }
-
- public K next()
- {
- ++count;
- for (++index; store[index] == emptySlot; ++index)
- ;
- return enumClass.getEnumConstants()[index];
- }
-
- public void remove()
- {
- --cardinality;
- store[index] = (V) emptySlot;
- }
- };
- }
-
- public void clear()
- {
- EnumMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- return contains(o);
- }
-
- public boolean remove(Object o)
- {
- return EnumMap.this.remove(o) != null;
- }
- };
+ keys = new AbstractSet()
+ {
+ public int size()
+ {
+ return cardinality;
+ }
+
+ public Iterator iterator()
+ {
+ return new Iterator()
+ {
+ int count = 0;
+ int index = -1;
+
+ public boolean hasNext()
+ {
+ return count < cardinality;
+ }
+
+ public K next()
+ {
+ ++count;
+ for (++index; store[index] == emptySlot; ++index)
+ ;
+ return enumClass.getEnumConstants()[index];
+ }
+
+ public void remove()
+ {
+ --cardinality;
+ store[index] = (V) emptySlot;
+ }
+ };
+ }
+
+ public void clear()
+ {
+ EnumMap.this.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ return contains(o);
+ }
+
+ public boolean remove(Object o)
+ {
+ return EnumMap.this.remove(o) != null;
+ }
+ };
}
return keys;
}
@@ -256,46 +256,46 @@ public class EnumMap, V>
{
if (values == null)
{
- values = new AbstractCollection()
- {
- public int size()
- {
- return cardinality;
- }
-
- public Iterator iterator()
- {
- return new Iterator()
- {
- int count = 0;
- int index = -1;
-
- public boolean hasNext()
- {
- return count < cardinality;
- }
-
- public V next()
- {
- ++count;
- for (++index; store[index] == emptySlot; ++index)
- ;
- return store[index];
- }
-
- public void remove()
- {
- --cardinality;
- store[index] = (V) emptySlot;
- }
- };
- }
-
- public void clear()
- {
- EnumMap.this.clear();
- }
- };
+ values = new AbstractCollection()
+ {
+ public int size()
+ {
+ return cardinality;
+ }
+
+ public Iterator iterator()
+ {
+ return new Iterator()
+ {
+ int count = 0;
+ int index = -1;
+
+ public boolean hasNext()
+ {
+ return count < cardinality;
+ }
+
+ public V next()
+ {
+ ++count;
+ for (++index; store[index] == emptySlot; ++index)
+ ;
+ return store[index];
+ }
+
+ public void remove()
+ {
+ --cardinality;
+ store[index] = (V) emptySlot;
+ }
+ };
+ }
+
+ public void clear()
+ {
+ EnumMap.this.clear();
+ }
+ };
}
return values;
}
@@ -304,74 +304,74 @@ public class EnumMap, V>
{
if (entries == null)
{
- entries = new AbstractSet>()
- {
- public int size()
- {
- return cardinality;
- }
-
- public Iterator> iterator()
- {
- return new Iterator>()
- {
- int count = 0;
- int index = -1;
-
- public boolean hasNext()
- {
- return count < cardinality;
- }
-
- public Map.Entry next()
- {
- ++count;
- for (++index; store[index] == emptySlot; ++index)
- ;
- // FIXME: we could just return something that
- // only knows the index. That would be cleaner.
- return new AbstractMap.SimpleEntry(enumClass.getEnumConstants()[index],
- store[index])
- {
- public V setValue(V newVal)
- {
- value = newVal;
- return put(key, newVal);
- }
- };
- }
-
- public void remove()
- {
- --cardinality;
- store[index] = (V) emptySlot;
- }
- };
- }
-
- public void clear()
- {
- EnumMap.this.clear();
- }
-
- public boolean contains(Object o)
- {
- if (! (o instanceof Map.Entry))
- return false;
- Map.Entry other = (Map.Entry) o;
- return (containsKey(other.getKey())
- && AbstractCollection.equals(get(other.getKey()),
- other.getValue()));
- }
-
- public boolean remove(Object o)
- {
- if (! (o instanceof Map.Entry))
- return false;
- Map.Entry other = (Map.Entry) o;
- return EnumMap.this.remove(other.getKey()) != null;
- }
- };
+ entries = new AbstractSet>()
+ {
+ public int size()
+ {
+ return cardinality;
+ }
+
+ public Iterator> iterator()
+ {
+ return new Iterator>()
+ {
+ int count = 0;
+ int index = -1;
+
+ public boolean hasNext()
+ {
+ return count < cardinality;
+ }
+
+ public Map.Entry next()
+ {
+ ++count;
+ for (++index; store[index] == emptySlot; ++index)
+ ;
+ // FIXME: we could just return something that
+ // only knows the index. That would be cleaner.
+ return new AbstractMap.SimpleEntry(enumClass.getEnumConstants()[index],
+ store[index])
+ {
+ public V setValue(V newVal)
+ {
+ value = newVal;
+ return put(key, newVal);
+ }
+ };
+ }
+
+ public void remove()
+ {
+ --cardinality;
+ store[index] = (V) emptySlot;
+ }
+ };
+ }
+
+ public void clear()
+ {
+ EnumMap.this.clear();
+ }
+
+ public boolean contains(Object o)
+ {
+ if (! (o instanceof Map.Entry))
+ return false;
+ Map.Entry other = (Map.Entry) o;
+ return (containsKey(other.getKey())
+ && AbstractCollection.equals(get(other.getKey()),
+ other.getValue()));
+ }
+
+ public boolean remove(Object o)
+ {
+ if (! (o instanceof Map.Entry))
+ return false;
+ Map.Entry other = (Map.Entry) o;
+ return EnumMap.this.remove(other.getKey()) != null;
+ }
+ };
}
return entries;
}
@@ -391,12 +391,12 @@ public class EnumMap, V>
EnumMap result;
try
{
- result = (EnumMap) super.clone();
+ result = (EnumMap) super.clone();
}
catch (CloneNotSupportedException ignore)
{
- // Can't happen.
- result = null;
+ // Can't happen.
+ result = null;
}
result.store = (V[]) store.clone();
return result;
diff --git a/libjava/classpath/java/util/EnumSet.java b/libjava/classpath/java/util/EnumSet.java
index 31b0368..60d0106 100644
--- a/libjava/classpath/java/util/EnumSet.java
+++ b/libjava/classpath/java/util/EnumSet.java
@@ -52,7 +52,7 @@ import java.io.Serializable;
*
*
* This class is designed to provide an alternative to using integer bit flags
- * by providing a typesafe {@link Collection} interface with an underlying
+ * by providing a typesafe {@link Collection} interface with an underlying
* implementation that utilises the assumptions above to give an equivalent level
* of efficiency. The values in a {@link EnumSet} must all be from the same
* {@link Enum} type, which allows the contents to be packed into a bit vector.
@@ -76,7 +76,7 @@ import java.io.Serializable;
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @author Dalibor Topic (robilad@kaffe.org)
- * @since 1.5
+ * @since 1.5
*/
// FIXME: serialization is special, uses SerializationProxy.
@@ -115,7 +115,7 @@ public abstract class EnumSet>
/**
* Returns a clone of the set.
- *
+ *
* @return a clone of the set.
*/
public EnumSet clone()
@@ -124,12 +124,12 @@ public abstract class EnumSet>
try
{
- r = (EnumSet) super.clone();
+ r = (EnumSet) super.clone();
}
catch (CloneNotSupportedException _)
{
- /* Can't happen */
- return null;
+ /* Can't happen */
+ return null;
}
r.store = (BitSet) store.clone();
return r;
@@ -190,16 +190,16 @@ public abstract class EnumSet>
if (other instanceof EnumSet)
return copyOf((EnumSet) other);
if (other.isEmpty())
- throw new IllegalArgumentException("Collection is empty");
+ throw new IllegalArgumentException("Collection is empty");
EnumSet r = null;
for (T val : other)
{
- if (r == null)
- r = of(val);
- else
- r.add(val);
+ if (r == null)
+ r = of(val);
+ else
+ r.add(val);
}
return r;
@@ -225,7 +225,7 @@ public abstract class EnumSet>
/**
* Creates a new {@link EnumSet} populated with the given element.
- *
+ *
* @param first the element to use to populate the new set.
* @return an {@link EnumSet} containing the element.
* @throws NullPointerException if first is null.
@@ -236,149 +236,149 @@ public abstract class EnumSet>
{
public boolean add(T val)
{
- if (store.get(val.ordinal()))
- return false;
+ if (store.get(val.ordinal()))
+ return false;
- store.set(val.ordinal());
- ++cardinality;
- return true;
+ store.set(val.ordinal());
+ ++cardinality;
+ return true;
}
public boolean addAll(Collection extends T> c)
{
- boolean result = false;
- if (c instanceof EnumSet)
- {
- EnumSet other = (EnumSet) c;
- if (enumClass == other.enumClass)
- {
- store.or(other.store);
- int save = cardinality;
- cardinality = store.cardinality();
- result = save != cardinality;
- }
- }
- else
- {
- for (T val : c)
- {
- if (add (val))
- result = true;
- }
- }
- return result;
+ boolean result = false;
+ if (c instanceof EnumSet)
+ {
+ EnumSet other = (EnumSet) c;
+ if (enumClass == other.enumClass)
+ {
+ store.or(other.store);
+ int save = cardinality;
+ cardinality = store.cardinality();
+ result = save != cardinality;
+ }
+ }
+ else
+ {
+ for (T val : c)
+ {
+ if (add (val))
+ result = true;
+ }
+ }
+ return result;
}
public void clear()
{
- store.clear();
- cardinality = 0;
+ store.clear();
+ cardinality = 0;
}
public boolean contains(Object o)
{
- if (! (o instanceof Enum))
- return false;
+ if (! (o instanceof Enum))
+ return false;
- Enum e = (Enum) o;
- if (e.getDeclaringClass() != enumClass)
- return false;
+ Enum e = (Enum) o;
+ if (e.getDeclaringClass() != enumClass)
+ return false;
- return store.get(e.ordinal());
+ return store.get(e.ordinal());
}
public boolean containsAll(Collection> c)
{
- if (c instanceof EnumSet)
- {
- EnumSet other = (EnumSet) c;
- if (enumClass == other.enumClass)
- return store.containsAll(other.store);
-
- return false;
- }
- return super.containsAll(c);
+ if (c instanceof EnumSet)
+ {
+ EnumSet other = (EnumSet) c;
+ if (enumClass == other.enumClass)
+ return store.containsAll(other.store);
+
+ return false;
+ }
+ return super.containsAll(c);
}
public Iterator iterator()
{
- return new Iterator()
- {
- int next = -1;
- int count = 0;
-
- public boolean hasNext()
- {
- return count < cardinality;
- }
-
- public T next()
- {
- next = store.nextSetBit(next + 1);
- ++count;
- return enumClass.getEnumConstants()[next];
- }
-
- public void remove()
- {
- if (! store.get(next))
- {
- store.clear(next);
- --cardinality;
- }
- }
- };
+ return new Iterator()
+ {
+ int next = -1;
+ int count = 0;
+
+ public boolean hasNext()
+ {
+ return count < cardinality;
+ }
+
+ public T next()
+ {
+ next = store.nextSetBit(next + 1);
+ ++count;
+ return enumClass.getEnumConstants()[next];
+ }
+
+ public void remove()
+ {
+ if (! store.get(next))
+ {
+ store.clear(next);
+ --cardinality;
+ }
+ }
+ };
}
public boolean remove(Object o)
{
- if (! (o instanceof Enum))
- return false;
+ if (! (o instanceof Enum))
+ return false;
- Enum e = (Enum) o;
- if (e.getDeclaringClass() != enumClass)
- return false;
+ Enum e = (Enum) o;
+ if (e.getDeclaringClass() != enumClass)
+ return false;
- store.clear(e.ordinal());
- --cardinality;
- return true;
+ store.clear(e.ordinal());
+ --cardinality;
+ return true;
}
public boolean removeAll(Collection> c)
{
- if (c instanceof EnumSet)
- {
- EnumSet other = (EnumSet) c;
- if (enumClass != other.enumClass)
- return false;
-
- store.andNot(other.store);
- int save = cardinality;
- cardinality = store.cardinality();
- return save != cardinality;
- }
- return super.removeAll(c);
+ if (c instanceof EnumSet)
+ {
+ EnumSet other = (EnumSet) c;
+ if (enumClass != other.enumClass)
+ return false;
+
+ store.andNot(other.store);
+ int save = cardinality;
+ cardinality = store.cardinality();
+ return save != cardinality;
+ }
+ return super.removeAll(c);
}
public boolean retainAll(Collection> c)
{
- if (c instanceof EnumSet)
- {
- EnumSet other = (EnumSet) c;
- if (enumClass != other.enumClass)
- return false;
-
- store.and(other.store);
- int save = cardinality;
- cardinality = store.cardinality();
- return save != cardinality;
- }
- return super.retainAll(c);
+ if (c instanceof EnumSet)
+ {
+ EnumSet other = (EnumSet) c;
+ if (enumClass != other.enumClass)
+ return false;
+
+ store.and(other.store);
+ int save = cardinality;
+ cardinality = store.cardinality();
+ return save != cardinality;
+ }
+ return super.retainAll(c);
}
public int size()
{
- return cardinality;
+ return cardinality;
}
};
@@ -392,7 +392,7 @@ public abstract class EnumSet>
/**
* Creates a new {@link EnumSet} populated with the given two elements.
- *
+ *
* @param first the first element to use to populate the new set.
* @param second the second element to use.
* @return an {@link EnumSet} containing the elements.
@@ -407,7 +407,7 @@ public abstract class EnumSet>
/**
* Creates a new {@link EnumSet} populated with the given three elements.
- *
+ *
* @param first the first element to use to populate the new set.
* @param second the second element to use.
* @param third the third element to use.
@@ -423,7 +423,7 @@ public abstract class EnumSet>
/**
* Creates a new {@link EnumSet} populated with the given four elements.
- *
+ *
* @param first the first element to use to populate the new set.
* @param second the second element to use.
* @param third the third element to use.
@@ -432,7 +432,7 @@ public abstract class EnumSet>
* @throws NullPointerException if any of the parameters are null.
*/
public static > EnumSet of(T first, T second, T third,
- T fourth)
+ T fourth)
{
EnumSet r = of(first, second, third);
r.add(fourth);
@@ -441,7 +441,7 @@ public abstract class EnumSet>
/**
* Creates a new {@link EnumSet} populated with the given five elements.
- *
+ *
* @param first the first element to use to populate the new set.
* @param second the second element to use.
* @param third the third element to use.
@@ -451,7 +451,7 @@ public abstract class EnumSet>
* @throws NullPointerException if any of the parameters are null.
*/
public static > EnumSet of(T first, T second, T third,
- T fourth, T fifth)
+ T fourth, T fifth)
{
EnumSet r = of(first, second, third, fourth);
r.add(fifth);
@@ -460,7 +460,7 @@ public abstract class EnumSet>
/**
* Creates a new {@link EnumSet} populated with the given elements.
- *
+ *
* @param first the first element to use to populate the new set.
* @param rest the other elements to use.
* @return an {@link EnumSet} containing the elements.
diff --git a/libjava/classpath/java/util/FormatFlagsConversionMismatchException.java b/libjava/classpath/java/util/FormatFlagsConversionMismatchException.java
index ec31773..b28ded1 100644
--- a/libjava/classpath/java/util/FormatFlagsConversionMismatchException.java
+++ b/libjava/classpath/java/util/FormatFlagsConversionMismatchException.java
@@ -38,14 +38,14 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when the flags supplied to the {@link Formatter#format()}
* method of a {@link Formatter} contains a flag that does not match
* the conversion character specified for it.
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
public class FormatFlagsConversionMismatchException
extends IllegalFormatException
@@ -83,7 +83,7 @@ public class FormatFlagsConversionMismatchException
super("Invalid flag " + f + " for conversion " + c);
if (f == null)
throw new
- NullPointerException("Null flag value passed to constructor.");
+ NullPointerException("Null flag value passed to constructor.");
this.f = f;
this.c = c;
}
diff --git a/libjava/classpath/java/util/Formattable.java b/libjava/classpath/java/util/Formattable.java
index 27e26a7..6a83ed5 100644
--- a/libjava/classpath/java/util/Formattable.java
+++ b/libjava/classpath/java/util/Formattable.java
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.util;
-/**
+/**
*
* The Formattable interface is used to provide customised
* formatting to arbitrary objects via the {@link Formatter}. The
@@ -54,7 +54,7 @@ package java.util;
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
public interface Formattable
{
@@ -88,5 +88,5 @@ public interface Formattable
* between it and the arguments.
*/
public void formatTo(Formatter formatter, int flags, int width,
- int precision);
+ int precision);
}
diff --git a/libjava/classpath/java/util/FormattableFlags.java b/libjava/classpath/java/util/FormattableFlags.java
index 648b3c0..2c5e199 100644
--- a/libjava/classpath/java/util/FormattableFlags.java
+++ b/libjava/classpath/java/util/FormattableFlags.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.util;
-/**
+/**
* This class contains a set of flags used
* by the {@link Formattable#formatTo()} method.
* They are used to modify the output of the
@@ -48,7 +48,7 @@ package java.util;
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
public class FormattableFlags
{
diff --git a/libjava/classpath/java/util/Formatter.java b/libjava/classpath/java/util/Formatter.java
index 9217d93..04ae805 100644
--- a/libjava/classpath/java/util/Formatter.java
+++ b/libjava/classpath/java/util/Formatter.java
@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-
+
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -56,7 +56,7 @@ import java.text.DecimalFormatSymbols;
import gnu.classpath.SystemProperties;
-/**
+/**
*
* A Java formatter for printf-style format strings,
* as seen in the C programming language. This differs from the
@@ -79,12 +79,12 @@ import gnu.classpath.SystemProperties;
* Note: the formatter is not thread-safe. For
* multi-threaded access, external synchronization should be provided.
*
- *
+ *
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public final class Formatter
+public final class Formatter
implements Closeable, Flushable
{
@@ -211,7 +211,7 @@ public final class Formatter
* @throws SecurityException if a security manager is present
* and doesn't allow writing to the file.
*/
- public Formatter(File file)
+ public Formatter(File file)
throws FileNotFoundException
{
this(new OutputStreamWriter(new FileOutputStream(file)));
@@ -257,7 +257,7 @@ public final class Formatter
throws FileNotFoundException, UnsupportedEncodingException
{
this(new OutputStreamWriter(new FileOutputStream(file), charset),
- loc);
+ loc);
}
/**
@@ -373,7 +373,7 @@ public final class Formatter
throws FileNotFoundException, UnsupportedEncodingException
{
this(new OutputStreamWriter(new FileOutputStream(file), charset),
- loc);
+ loc);
}
/**
@@ -390,13 +390,13 @@ public final class Formatter
return;
try
{
- if (out instanceof Closeable)
- ((Closeable) out).close();
+ if (out instanceof Closeable)
+ ((Closeable) out).close();
}
catch (IOException _)
{
- // FIXME: do we ignore these or do we set ioException?
- // The docs seem to indicate that we should ignore.
+ // FIXME: do we ignore these or do we set ioException?
+ // The docs seem to indicate that we should ignore.
}
closed = true;
}
@@ -414,13 +414,13 @@ public final class Formatter
throw new FormatterClosedException();
try
{
- if (out instanceof Flushable)
- ((Flushable) out).flush();
+ if (out instanceof Flushable)
+ ((Flushable) out).flush();
}
catch (IOException _)
{
- // FIXME: do we ignore these or do we set ioException?
- // The docs seem to indicate that we should ignore.
+ // FIXME: do we ignore these or do we set ioException?
+ // The docs seem to indicate that we should ignore.
}
}
@@ -450,7 +450,7 @@ public final class Formatter
flags &= ~allowed;
if (flags != 0)
throw new FormatFlagsConversionMismatchException(getName(flags),
- conversion);
+ conversion);
}
/**
@@ -473,7 +473,7 @@ public final class Formatter
* @param isNegative true if the value is negative.
*/
private void applyLocalization(CPStringBuilder builder, int flags, int width,
- boolean isNegative)
+ boolean isNegative)
{
DecimalFormatSymbols dfsyms;
if (fmtLocale == null)
@@ -486,52 +486,52 @@ public final class Formatter
int decimalOffset = -1;
for (int i = builder.length() - 1; i >= 0; --i)
{
- char c = builder.charAt(i);
- if (c >= '0' && c <= '9')
- builder.setCharAt(i, (char) (c - '0' + zeroDigit));
- else if (c == '.')
- {
- assert decimalOffset == -1;
- decimalOffset = i;
- }
+ char c = builder.charAt(i);
+ if (c >= '0' && c <= '9')
+ builder.setCharAt(i, (char) (c - '0' + zeroDigit));
+ else if (c == '.')
+ {
+ assert decimalOffset == -1;
+ decimalOffset = i;
+ }
}
// Localize the decimal separator.
if (decimalOffset != -1)
{
- builder.deleteCharAt(decimalOffset);
- builder.insert(decimalOffset, dfsyms.getDecimalSeparator());
+ builder.deleteCharAt(decimalOffset);
+ builder.insert(decimalOffset, dfsyms.getDecimalSeparator());
}
-
+
// Insert the grouping separators.
if ((flags & FormattableFlags.COMMA) != 0)
{
- char groupSeparator = dfsyms.getGroupingSeparator();
- int groupSize = 3; // FIXME
- int offset = (decimalOffset == -1) ? builder.length() : decimalOffset;
- // We use '>' because we don't want to insert a separator
- // before the first digit.
- for (int i = offset - groupSize; i > 0; i -= groupSize)
- builder.insert(i, groupSeparator);
+ char groupSeparator = dfsyms.getGroupingSeparator();
+ int groupSize = 3; // FIXME
+ int offset = (decimalOffset == -1) ? builder.length() : decimalOffset;
+ // We use '>' because we don't want to insert a separator
+ // before the first digit.
+ for (int i = offset - groupSize; i > 0; i -= groupSize)
+ builder.insert(i, groupSeparator);
}
if ((flags & FormattableFlags.ZERO) != 0)
{
- // Zero fill. Note that according to the algorithm we do not
- // insert grouping separators here.
- for (int i = width - builder.length(); i > 0; --i)
- builder.insert(0, zeroDigit);
+ // Zero fill. Note that according to the algorithm we do not
+ // insert grouping separators here.
+ for (int i = width - builder.length(); i > 0; --i)
+ builder.insert(0, zeroDigit);
}
if (isNegative)
{
- if ((flags & FormattableFlags.PAREN) != 0)
- {
- builder.insert(0, '(');
- builder.append(')');
- }
- else
- builder.insert(0, '-');
+ if ((flags & FormattableFlags.PAREN) != 0)
+ {
+ builder.insert(0, '(');
+ builder.append(')');
+ }
+ else
+ builder.insert(0, '-');
}
else if ((flags & FormattableFlags.PLUS) != 0)
builder.insert(0, '+');
@@ -554,10 +554,10 @@ public final class Formatter
{
if ((flags & FormattableFlags.UPPERCASE) != 0)
{
- if (fmtLocale == null)
- arg = arg.toUpperCase();
- else
- arg = arg.toUpperCase(fmtLocale);
+ if (fmtLocale == null)
+ arg = arg.toUpperCase();
+ else
+ arg = arg.toUpperCase(fmtLocale);
}
if (precision >= 0 && arg.length() > precision)
@@ -568,19 +568,19 @@ public final class Formatter
throw new MissingFormatWidthException("fixme");
if (! leftJustify && arg.length() < width)
{
- for (int i = width - arg.length(); i > 0; --i)
- out.append(' ');
+ for (int i = width - arg.length(); i > 0; --i)
+ out.append(' ');
}
out.append(arg);
if (leftJustify && arg.length() < width)
{
- for (int i = width - arg.length(); i > 0; --i)
- out.append(' ');
+ for (int i = width - arg.length(); i > 0; --i)
+ out.append(' ');
}
}
- /**
- * Emit a boolean.
+ /**
+ * Emit a boolean.
*
* @param arg the boolean to emit.
* @param flags the formatting flags to use.
@@ -590,12 +590,12 @@ public final class Formatter
* @throws IOException if the output stream throws an I/O error.
*/
private void booleanFormat(Object arg, int flags, int width, int precision,
- char conversion)
+ char conversion)
throws IOException
{
checkFlags(flags,
- FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
- conversion);
+ FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
+ conversion);
String result;
if (arg instanceof Boolean)
result = String.valueOf((Boolean) arg);
@@ -604,8 +604,8 @@ public final class Formatter
genericFormat(result, flags, width, precision);
}
- /**
- * Emit a hash code.
+ /**
+ * Emit a hash code.
*
* @param arg the hash code to emit.
* @param flags the formatting flags to use.
@@ -615,18 +615,18 @@ public final class Formatter
* @throws IOException if the output stream throws an I/O error.
*/
private void hashCodeFormat(Object arg, int flags, int width, int precision,
- char conversion)
+ char conversion)
throws IOException
{
checkFlags(flags,
- FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
- conversion);
+ FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
+ conversion);
genericFormat(arg == null ? "null" : Integer.toHexString(arg.hashCode()),
- flags, width, precision);
+ flags, width, precision);
}
- /**
- * Emit a String or Formattable conversion.
+ /**
+ * Emit a String or Formattable conversion.
*
* @param arg the String or Formattable to emit.
* @param flags the formatting flags to use.
@@ -636,31 +636,31 @@ public final class Formatter
* @throws IOException if the output stream throws an I/O error.
*/
private void stringFormat(Object arg, int flags, int width, int precision,
- char conversion)
+ char conversion)
throws IOException
{
if (arg instanceof Formattable)
{
- checkFlags(flags,
- (FormattableFlags.LEFT_JUSTIFY
- | FormattableFlags.UPPERCASE
- | FormattableFlags.ALTERNATE),
- conversion);
- Formattable fmt = (Formattable) arg;
- fmt.formatTo(this, flags, width, precision);
+ checkFlags(flags,
+ (FormattableFlags.LEFT_JUSTIFY
+ | FormattableFlags.UPPERCASE
+ | FormattableFlags.ALTERNATE),
+ conversion);
+ Formattable fmt = (Formattable) arg;
+ fmt.formatTo(this, flags, width, precision);
}
else
{
- checkFlags(flags,
- FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
- conversion);
- genericFormat(arg == null ? "null" : arg.toString(), flags, width,
- precision);
+ checkFlags(flags,
+ FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
+ conversion);
+ genericFormat(arg == null ? "null" : arg.toString(), flags, width,
+ precision);
}
}
- /**
- * Emit a character.
+ /**
+ * Emit a character.
*
* @param arg the character to emit.
* @param flags the formatting flags to use.
@@ -670,12 +670,12 @@ public final class Formatter
* @throws IOException if the output stream throws an I/O error.
*/
private void characterFormat(Object arg, int flags, int width, int precision,
- char conversion)
+ char conversion)
throws IOException
{
checkFlags(flags,
- FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
- conversion);
+ FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
+ conversion);
noPrecision(precision);
int theChar;
@@ -687,9 +687,9 @@ public final class Formatter
theChar = (char) (((Short) arg).shortValue ());
else if (arg instanceof Integer)
{
- theChar = ((Integer) arg).intValue();
- if (! Character.isValidCodePoint(theChar))
- throw new IllegalFormatCodePointException(theChar);
+ theChar = ((Integer) arg).intValue();
+ if (! Character.isValidCodePoint(theChar))
+ throw new IllegalFormatCodePointException(theChar);
}
else
throw new IllegalFormatConversionException(conversion, arg.getClass());
@@ -697,7 +697,7 @@ public final class Formatter
genericFormat(result, flags, width, precision);
}
- /**
+ /**
* Emit a '%'.
*
* @param flags the formatting flags to use.
@@ -713,7 +713,7 @@ public final class Formatter
genericFormat("%", flags, width, precision);
}
- /**
+ /**
* Emit a newline.
*
* @param flags the formatting flags to use.
@@ -744,15 +744,15 @@ public final class Formatter
* @return the result.
*/
private CPStringBuilder basicIntegralConversion(Object arg, int flags,
- int width, int precision,
- int radix, char conversion)
+ int width, int precision,
+ int radix, char conversion)
{
assert radix == 8 || radix == 10 || radix == 16;
noPrecision(precision);
// Some error checking.
if ((flags & FormattableFlags.PLUS) != 0
- && (flags & FormattableFlags.SPACE) != 0)
+ && (flags & FormattableFlags.SPACE) != 0)
throw new IllegalFormatFlagsException(getName(flags));
if ((flags & FormattableFlags.LEFT_JUSTIFY) != 0 && width == -1)
@@ -761,41 +761,41 @@ public final class Formatter
// Do the base translation of the value to a string.
String result;
int basicFlags = (FormattableFlags.LEFT_JUSTIFY
- // We already handled any possible error when
- // parsing.
- | FormattableFlags.UPPERCASE
- | FormattableFlags.ZERO);
+ // We already handled any possible error when
+ // parsing.
+ | FormattableFlags.UPPERCASE
+ | FormattableFlags.ZERO);
if (radix == 10)
basicFlags |= (FormattableFlags.PLUS
- | FormattableFlags.SPACE
- | FormattableFlags.COMMA
- | FormattableFlags.PAREN);
+ | FormattableFlags.SPACE
+ | FormattableFlags.COMMA
+ | FormattableFlags.PAREN);
else
basicFlags |= FormattableFlags.ALTERNATE;
if (arg instanceof BigInteger)
{
- checkFlags(flags,
- (basicFlags
- | FormattableFlags.PLUS
- | FormattableFlags.SPACE
- | FormattableFlags.PAREN),
- conversion);
- BigInteger bi = (BigInteger) arg;
- result = bi.toString(radix);
+ checkFlags(flags,
+ (basicFlags
+ | FormattableFlags.PLUS
+ | FormattableFlags.SPACE
+ | FormattableFlags.PAREN),
+ conversion);
+ BigInteger bi = (BigInteger) arg;
+ result = bi.toString(radix);
}
else if (arg instanceof Number
- && ! (arg instanceof Float)
- && ! (arg instanceof Double))
+ && ! (arg instanceof Float)
+ && ! (arg instanceof Double))
{
- checkFlags(flags, basicFlags, conversion);
- long value = ((Number) arg).longValue ();
- if (radix == 8)
- result = Long.toOctalString(value);
- else if (radix == 16)
- result = Long.toHexString(value);
- else
- result = Long.toString(value);
+ checkFlags(flags, basicFlags, conversion);
+ long value = ((Number) arg).longValue ();
+ if (radix == 8)
+ result = Long.toOctalString(value);
+ else if (radix == 16)
+ result = Long.toHexString(value);
+ else
+ result = Long.toString(value);
}
else
throw new IllegalFormatConversionException(conversion, arg.getClass());
@@ -803,9 +803,9 @@ public final class Formatter
return new CPStringBuilder(result);
}
- /**
- * Emit a hex or octal value.
- *
+ /**
+ * Emit a hex or octal value.
+ *
* @param arg the hexadecimal or octal value.
* @param flags the formatting flags to use.
* @param width the width to use.
@@ -815,79 +815,79 @@ public final class Formatter
* @throws IOException if the output stream throws an I/O error.
*/
private void hexOrOctalConversion(Object arg, int flags, int width,
- int precision, int radix,
- char conversion)
+ int precision, int radix,
+ char conversion)
throws IOException
{
assert radix == 8 || radix == 16;
CPStringBuilder builder = basicIntegralConversion(arg, flags, width,
- precision, radix,
- conversion);
+ precision, radix,
+ conversion);
int insertPoint = 0;
// Insert the sign.
if (builder.charAt(0) == '-')
{
- // Already inserted. Note that we don't insert a sign, since
- // the only case where it is needed it BigInteger, and it has
- // already been inserted by toString.
- ++insertPoint;
+ // Already inserted. Note that we don't insert a sign, since
+ // the only case where it is needed it BigInteger, and it has
+ // already been inserted by toString.
+ ++insertPoint;
}
else if ((flags & FormattableFlags.PLUS) != 0)
{
- builder.insert(insertPoint, '+');
- ++insertPoint;
+ builder.insert(insertPoint, '+');
+ ++insertPoint;
}
else if ((flags & FormattableFlags.SPACE) != 0)
{
- builder.insert(insertPoint, ' ');
- ++insertPoint;
+ builder.insert(insertPoint, ' ');
+ ++insertPoint;
}
// Insert the radix prefix.
if ((flags & FormattableFlags.ALTERNATE) != 0)
{
- builder.insert(insertPoint, radix == 8 ? "0" : "0x");
- insertPoint += radix == 8 ? 1 : 2;
+ builder.insert(insertPoint, radix == 8 ? "0" : "0x");
+ insertPoint += radix == 8 ? 1 : 2;
}
// Now justify the result.
int resultWidth = builder.length();
if (resultWidth < width)
{
- char fill = ((flags & FormattableFlags.ZERO) != 0) ? '0' : ' ';
- if ((flags & FormattableFlags.LEFT_JUSTIFY) != 0)
- {
- // Left justify.
- if (fill == ' ')
- insertPoint = builder.length();
- }
- else
- {
- // Right justify. Insert spaces before the radix prefix
- // and sign.
- insertPoint = 0;
- }
- while (resultWidth++ < width)
- builder.insert(insertPoint, fill);
+ char fill = ((flags & FormattableFlags.ZERO) != 0) ? '0' : ' ';
+ if ((flags & FormattableFlags.LEFT_JUSTIFY) != 0)
+ {
+ // Left justify.
+ if (fill == ' ')
+ insertPoint = builder.length();
+ }
+ else
+ {
+ // Right justify. Insert spaces before the radix prefix
+ // and sign.
+ insertPoint = 0;
+ }
+ while (resultWidth++ < width)
+ builder.insert(insertPoint, fill);
}
String result = builder.toString();
if ((flags & FormattableFlags.UPPERCASE) != 0)
{
- if (fmtLocale == null)
- result = result.toUpperCase();
- else
- result = result.toUpperCase(fmtLocale);
+ if (fmtLocale == null)
+ result = result.toUpperCase();
+ else
+ result = result.toUpperCase(fmtLocale);
}
out.append(result);
}
- /**
- * Emit a decimal value.
- *
+ /**
+ * Emit a decimal value.
+ *
* @param arg the hexadecimal or octal value.
* @param flags the formatting flags to use.
* @param width the width to use.
@@ -896,26 +896,26 @@ public final class Formatter
* @throws IOException if the output stream throws an I/O error.
*/
private void decimalConversion(Object arg, int flags, int width,
- int precision, char conversion)
+ int precision, char conversion)
throws IOException
{
CPStringBuilder builder = basicIntegralConversion(arg, flags, width,
- precision, 10,
- conversion);
+ precision, 10,
+ conversion);
boolean isNegative = false;
if (builder.charAt(0) == '-')
{
- // Sign handling is done during localization.
- builder.deleteCharAt(0);
- isNegative = true;
+ // Sign handling is done during localization.
+ builder.deleteCharAt(0);
+ isNegative = true;
}
applyLocalization(builder, flags, width, isNegative);
genericFormat(builder.toString(), flags, width, precision);
}
- /**
- * Emit a single date or time conversion to a StringBuilder.
+ /**
+ * Emit a single date or time conversion to a StringBuilder.
*
* @param builder the builder to write to.
* @param cal the calendar to use in the conversion.
@@ -923,185 +923,185 @@ public final class Formatter
* @param syms the date formatting symbols.
*/
private void singleDateTimeConversion(CPStringBuilder builder, Calendar cal,
- char conversion,
- DateFormatSymbols syms)
+ char conversion,
+ DateFormatSymbols syms)
{
int oldLen = builder.length();
int digits = -1;
switch (conversion)
{
case 'H':
- builder.append(cal.get(Calendar.HOUR_OF_DAY));
- digits = 2;
- break;
+ builder.append(cal.get(Calendar.HOUR_OF_DAY));
+ digits = 2;
+ break;
case 'I':
- builder.append(cal.get(Calendar.HOUR));
- digits = 2;
- break;
+ builder.append(cal.get(Calendar.HOUR));
+ digits = 2;
+ break;
case 'k':
- builder.append(cal.get(Calendar.HOUR_OF_DAY));
- break;
+ builder.append(cal.get(Calendar.HOUR_OF_DAY));
+ break;
case 'l':
- builder.append(cal.get(Calendar.HOUR));
- break;
+ builder.append(cal.get(Calendar.HOUR));
+ break;
case 'M':
- builder.append(cal.get(Calendar.MINUTE));
- digits = 2;
- break;
+ builder.append(cal.get(Calendar.MINUTE));
+ digits = 2;
+ break;
case 'S':
- builder.append(cal.get(Calendar.SECOND));
- digits = 2;
- break;
+ builder.append(cal.get(Calendar.SECOND));
+ digits = 2;
+ break;
case 'N':
- // FIXME: nanosecond ...
- digits = 9;
- break;
+ // FIXME: nanosecond ...
+ digits = 9;
+ break;
case 'p':
- {
- int ampm = cal.get(Calendar.AM_PM);
- builder.append(syms.getAmPmStrings()[ampm]);
- }
- break;
+ {
+ int ampm = cal.get(Calendar.AM_PM);
+ builder.append(syms.getAmPmStrings()[ampm]);
+ }
+ break;
case 'z':
- {
- int zone = cal.get(Calendar.ZONE_OFFSET) / (1000 * 60);
- builder.append(zone);
- digits = 4;
- // Skip the '-' sign.
- if (zone < 0)
- ++oldLen;
- }
- break;
+ {
+ int zone = cal.get(Calendar.ZONE_OFFSET) / (1000 * 60);
+ builder.append(zone);
+ digits = 4;
+ // Skip the '-' sign.
+ if (zone < 0)
+ ++oldLen;
+ }
+ break;
case 'Z':
- {
- // FIXME: DST?
- int zone = cal.get(Calendar.ZONE_OFFSET) / (1000 * 60 * 60);
- String[][] zs = syms.getZoneStrings();
- builder.append(zs[zone + 12][1]);
- }
- break;
+ {
+ // FIXME: DST?
+ int zone = cal.get(Calendar.ZONE_OFFSET) / (1000 * 60 * 60);
+ String[][] zs = syms.getZoneStrings();
+ builder.append(zs[zone + 12][1]);
+ }
+ break;
case 's':
- {
- long val = cal.getTime().getTime();
- builder.append(val / 1000);
- }
- break;
+ {
+ long val = cal.getTime().getTime();
+ builder.append(val / 1000);
+ }
+ break;
case 'Q':
- {
- long val = cal.getTime().getTime();
- builder.append(val);
- }
- break;
+ {
+ long val = cal.getTime().getTime();
+ builder.append(val);
+ }
+ break;
case 'B':
- {
- int month = cal.get(Calendar.MONTH);
- builder.append(syms.getMonths()[month]);
- }
- break;
+ {
+ int month = cal.get(Calendar.MONTH);
+ builder.append(syms.getMonths()[month]);
+ }
+ break;
case 'b':
case 'h':
- {
- int month = cal.get(Calendar.MONTH);
- builder.append(syms.getShortMonths()[month]);
- }
- break;
+ {
+ int month = cal.get(Calendar.MONTH);
+ builder.append(syms.getShortMonths()[month]);
+ }
+ break;
case 'A':
- {
- int day = cal.get(Calendar.DAY_OF_WEEK);
- builder.append(syms.getWeekdays()[day]);
- }
- break;
+ {
+ int day = cal.get(Calendar.DAY_OF_WEEK);
+ builder.append(syms.getWeekdays()[day]);
+ }
+ break;
case 'a':
- {
- int day = cal.get(Calendar.DAY_OF_WEEK);
- builder.append(syms.getShortWeekdays()[day]);
- }
- break;
+ {
+ int day = cal.get(Calendar.DAY_OF_WEEK);
+ builder.append(syms.getShortWeekdays()[day]);
+ }
+ break;
case 'C':
- builder.append(cal.get(Calendar.YEAR) / 100);
- digits = 2;
- break;
+ builder.append(cal.get(Calendar.YEAR) / 100);
+ digits = 2;
+ break;
case 'Y':
- builder.append(cal.get(Calendar.YEAR));
- digits = 4;
- break;
+ builder.append(cal.get(Calendar.YEAR));
+ digits = 4;
+ break;
case 'y':
- builder.append(cal.get(Calendar.YEAR) % 100);
- digits = 2;
- break;
+ builder.append(cal.get(Calendar.YEAR) % 100);
+ digits = 2;
+ break;
case 'j':
- builder.append(cal.get(Calendar.DAY_OF_YEAR));
- digits = 3;
- break;
+ builder.append(cal.get(Calendar.DAY_OF_YEAR));
+ digits = 3;
+ break;
case 'm':
- builder.append(cal.get(Calendar.MONTH) + 1);
- digits = 2;
- break;
+ builder.append(cal.get(Calendar.MONTH) + 1);
+ digits = 2;
+ break;
case 'd':
- builder.append(cal.get(Calendar.DAY_OF_MONTH));
- digits = 2;
- break;
+ builder.append(cal.get(Calendar.DAY_OF_MONTH));
+ digits = 2;
+ break;
case 'e':
- builder.append(cal.get(Calendar.DAY_OF_MONTH));
- break;
+ builder.append(cal.get(Calendar.DAY_OF_MONTH));
+ break;
case 'R':
- singleDateTimeConversion(builder, cal, 'H', syms);
- builder.append(':');
- singleDateTimeConversion(builder, cal, 'M', syms);
- break;
+ singleDateTimeConversion(builder, cal, 'H', syms);
+ builder.append(':');
+ singleDateTimeConversion(builder, cal, 'M', syms);
+ break;
case 'T':
- singleDateTimeConversion(builder, cal, 'H', syms);
- builder.append(':');
- singleDateTimeConversion(builder, cal, 'M', syms);
- builder.append(':');
- singleDateTimeConversion(builder, cal, 'S', syms);
- break;
+ singleDateTimeConversion(builder, cal, 'H', syms);
+ builder.append(':');
+ singleDateTimeConversion(builder, cal, 'M', syms);
+ builder.append(':');
+ singleDateTimeConversion(builder, cal, 'S', syms);
+ break;
case 'r':
- singleDateTimeConversion(builder, cal, 'I', syms);
- builder.append(':');
- singleDateTimeConversion(builder, cal, 'M', syms);
- builder.append(':');
- singleDateTimeConversion(builder, cal, 'S', syms);
- builder.append(' ');
- singleDateTimeConversion(builder, cal, 'p', syms);
- break;
+ singleDateTimeConversion(builder, cal, 'I', syms);
+ builder.append(':');
+ singleDateTimeConversion(builder, cal, 'M', syms);
+ builder.append(':');
+ singleDateTimeConversion(builder, cal, 'S', syms);
+ builder.append(' ');
+ singleDateTimeConversion(builder, cal, 'p', syms);
+ break;
case 'D':
- singleDateTimeConversion(builder, cal, 'm', syms);
- builder.append('/');
- singleDateTimeConversion(builder, cal, 'd', syms);
- builder.append('/');
- singleDateTimeConversion(builder, cal, 'y', syms);
- break;
+ singleDateTimeConversion(builder, cal, 'm', syms);
+ builder.append('/');
+ singleDateTimeConversion(builder, cal, 'd', syms);
+ builder.append('/');
+ singleDateTimeConversion(builder, cal, 'y', syms);
+ break;
case 'F':
- singleDateTimeConversion(builder, cal, 'Y', syms);
- builder.append('-');
- singleDateTimeConversion(builder, cal, 'm', syms);
- builder.append('-');
- singleDateTimeConversion(builder, cal, 'd', syms);
- break;
+ singleDateTimeConversion(builder, cal, 'Y', syms);
+ builder.append('-');
+ singleDateTimeConversion(builder, cal, 'm', syms);
+ builder.append('-');
+ singleDateTimeConversion(builder, cal, 'd', syms);
+ break;
case 'c':
- singleDateTimeConversion(builder, cal, 'a', syms);
- builder.append(' ');
- singleDateTimeConversion(builder, cal, 'b', syms);
- builder.append(' ');
- singleDateTimeConversion(builder, cal, 'd', syms);
- builder.append(' ');
- singleDateTimeConversion(builder, cal, 'T', syms);
- builder.append(' ');
- singleDateTimeConversion(builder, cal, 'Z', syms);
- builder.append(' ');
- singleDateTimeConversion(builder, cal, 'Y', syms);
- break;
+ singleDateTimeConversion(builder, cal, 'a', syms);
+ builder.append(' ');
+ singleDateTimeConversion(builder, cal, 'b', syms);
+ builder.append(' ');
+ singleDateTimeConversion(builder, cal, 'd', syms);
+ builder.append(' ');
+ singleDateTimeConversion(builder, cal, 'T', syms);
+ builder.append(' ');
+ singleDateTimeConversion(builder, cal, 'Z', syms);
+ builder.append(' ');
+ singleDateTimeConversion(builder, cal, 'Y', syms);
+ break;
default:
- throw new UnknownFormatConversionException(String.valueOf(conversion));
+ throw new UnknownFormatConversionException(String.valueOf(conversion));
}
if (digits > 0)
{
- int newLen = builder.length();
- int delta = newLen - oldLen;
- while (delta++ < digits)
- builder.insert(oldLen, '0');
+ int newLen = builder.length();
+ int delta = newLen - oldLen;
+ while (delta++ < digits)
+ builder.insert(oldLen, '0');
}
}
@@ -1117,33 +1117,33 @@ public final class Formatter
* @throws IOException if the output stream throws an I/O error.
*/
private void dateTimeConversion(Object arg, int flags, int width,
- int precision, char conversion,
- char subConversion)
+ int precision, char conversion,
+ char subConversion)
throws IOException
{
noPrecision(precision);
checkFlags(flags,
- FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
- conversion);
+ FormattableFlags.LEFT_JUSTIFY | FormattableFlags.UPPERCASE,
+ conversion);
Calendar cal;
if (arg instanceof Calendar)
cal = (Calendar) arg;
else
{
- Date date;
- if (arg instanceof Date)
- date = (Date) arg;
- else if (arg instanceof Long)
- date = new Date(((Long) arg).longValue());
- else
- throw new IllegalFormatConversionException(conversion,
- arg.getClass());
- if (fmtLocale == null)
- cal = Calendar.getInstance();
- else
- cal = Calendar.getInstance(fmtLocale);
- cal.setTime(date);
+ Date date;
+ if (arg instanceof Date)
+ date = (Date) arg;
+ else if (arg instanceof Long)
+ date = new Date(((Long) arg).longValue());
+ else
+ throw new IllegalFormatConversionException(conversion,
+ arg.getClass());
+ if (fmtLocale == null)
+ cal = Calendar.getInstance();
+ else
+ cal = Calendar.getInstance(fmtLocale);
+ cal.setTime(date);
}
// We could try to be more efficient by computing this lazily.
@@ -1170,8 +1170,8 @@ public final class Formatter
++index;
if (index >= length)
{
- // FIXME: what exception here?
- throw new IllegalArgumentException();
+ // FIXME: what exception here?
+ throw new IllegalArgumentException();
}
}
@@ -1204,20 +1204,20 @@ public final class Formatter
int start = index;
if (format.charAt(index) == '<')
{
- result = 0;
- advance();
+ result = 0;
+ advance();
}
else if (Character.isDigit(format.charAt(index)))
{
- result = parseInt();
- if (format.charAt(index) == '$')
- advance();
- else
- {
- // Reset.
- index = start;
- result = -1;
- }
+ result = parseInt();
+ if (format.charAt(index) == '$')
+ advance();
+ else
+ {
+ // Reset.
+ index = start;
+ result = -1;
+ }
}
return result;
}
@@ -1235,15 +1235,15 @@ public final class Formatter
int start = index;
while (true)
{
- int x = FLAGS.indexOf(format.charAt(index));
- if (x == -1)
- break;
- int newValue = 1 << x;
- if ((value & newValue) != 0)
- throw new DuplicateFormatFlagsException(format.substring(start,
- index + 1));
- value |= newValue;
- advance();
+ int x = FLAGS.indexOf(format.charAt(index));
+ if (x == -1)
+ break;
+ int newValue = 1 << x;
+ if ((value & newValue) != 0)
+ throw new DuplicateFormatFlagsException(format.substring(start,
+ index + 1));
+ value |= newValue;
+ advance();
}
return value;
}
@@ -1293,7 +1293,7 @@ public final class Formatter
* specification or a mismatch
* between it and the arguments.
* @throws FormatterClosedException if the formatter is closed.
- */
+ */
public Formatter format(Locale loc, String fmt, Object... args)
{
if (closed)
@@ -1305,122 +1305,122 @@ public final class Formatter
try
{
- fmtLocale = loc;
- format = fmt;
- length = format.length();
- for (index = 0; index < length; ++index)
- {
- char c = format.charAt(index);
- if (c != '%')
- {
- out.append(c);
- continue;
- }
-
- int start = index;
- advance();
-
- // We do the needed post-processing of this later, when we
- // determine whether an argument is actually needed by
- // this conversion.
- int argumentIndex = parseArgumentIndex();
-
- int flags = parseFlags();
- int width = parseWidth();
- int precision = parsePrecision();
- char origConversion = format.charAt(index);
- char conversion = origConversion;
- if (Character.isUpperCase(conversion))
- {
- flags |= FormattableFlags.UPPERCASE;
- conversion = Character.toLowerCase(conversion);
- }
-
- Object argument = null;
- if (conversion == '%' || conversion == 'n')
- {
- if (argumentIndex != -1)
- {
- // FIXME: not sure about this.
- throw new UnknownFormatConversionException("FIXME");
- }
- }
- else
- {
- if (argumentIndex == -1)
- argumentIndex = implicitArgumentIndex++;
- else if (argumentIndex == 0)
- argumentIndex = previousArgumentIndex;
- // Argument indices start at 1 but array indices at 0.
- --argumentIndex;
- if (argumentIndex < 0 || argumentIndex >= args.length)
- throw new MissingFormatArgumentException(format.substring(start, index));
- argument = args[argumentIndex];
- }
-
- switch (conversion)
- {
- case 'b':
- booleanFormat(argument, flags, width, precision,
- origConversion);
- break;
- case 'h':
- hashCodeFormat(argument, flags, width, precision,
- origConversion);
- break;
- case 's':
- stringFormat(argument, flags, width, precision,
- origConversion);
- break;
- case 'c':
- characterFormat(argument, flags, width, precision,
- origConversion);
- break;
- case 'd':
- checkFlags(flags & FormattableFlags.UPPERCASE, 0, 'd');
- decimalConversion(argument, flags, width, precision,
- origConversion);
- break;
- case 'o':
- checkFlags(flags & FormattableFlags.UPPERCASE, 0, 'o');
- hexOrOctalConversion(argument, flags, width, precision, 8,
- origConversion);
- break;
- case 'x':
- hexOrOctalConversion(argument, flags, width, precision, 16,
- origConversion);
- case 'e':
- // scientificNotationConversion();
- break;
- case 'f':
- // floatingDecimalConversion();
- break;
- case 'g':
- // smartFloatingConversion();
- break;
- case 'a':
- // hexFloatingConversion();
- break;
- case 't':
- advance();
- char subConversion = format.charAt(index);
- dateTimeConversion(argument, flags, width, precision,
- origConversion, subConversion);
- break;
- case '%':
- percentFormat(flags, width, precision);
- break;
- case 'n':
- newLineFormat(flags, width, precision);
- break;
- default:
- throw new UnknownFormatConversionException(String.valueOf(origConversion));
- }
- }
+ fmtLocale = loc;
+ format = fmt;
+ length = format.length();
+ for (index = 0; index < length; ++index)
+ {
+ char c = format.charAt(index);
+ if (c != '%')
+ {
+ out.append(c);
+ continue;
+ }
+
+ int start = index;
+ advance();
+
+ // We do the needed post-processing of this later, when we
+ // determine whether an argument is actually needed by
+ // this conversion.
+ int argumentIndex = parseArgumentIndex();
+
+ int flags = parseFlags();
+ int width = parseWidth();
+ int precision = parsePrecision();
+ char origConversion = format.charAt(index);
+ char conversion = origConversion;
+ if (Character.isUpperCase(conversion))
+ {
+ flags |= FormattableFlags.UPPERCASE;
+ conversion = Character.toLowerCase(conversion);
+ }
+
+ Object argument = null;
+ if (conversion == '%' || conversion == 'n')
+ {
+ if (argumentIndex != -1)
+ {
+ // FIXME: not sure about this.
+ throw new UnknownFormatConversionException("FIXME");
+ }
+ }
+ else
+ {
+ if (argumentIndex == -1)
+ argumentIndex = implicitArgumentIndex++;
+ else if (argumentIndex == 0)
+ argumentIndex = previousArgumentIndex;
+ // Argument indices start at 1 but array indices at 0.
+ --argumentIndex;
+ if (argumentIndex < 0 || argumentIndex >= args.length)
+ throw new MissingFormatArgumentException(format.substring(start, index));
+ argument = args[argumentIndex];
+ }
+
+ switch (conversion)
+ {
+ case 'b':
+ booleanFormat(argument, flags, width, precision,
+ origConversion);
+ break;
+ case 'h':
+ hashCodeFormat(argument, flags, width, precision,
+ origConversion);
+ break;
+ case 's':
+ stringFormat(argument, flags, width, precision,
+ origConversion);
+ break;
+ case 'c':
+ characterFormat(argument, flags, width, precision,
+ origConversion);
+ break;
+ case 'd':
+ checkFlags(flags & FormattableFlags.UPPERCASE, 0, 'd');
+ decimalConversion(argument, flags, width, precision,
+ origConversion);
+ break;
+ case 'o':
+ checkFlags(flags & FormattableFlags.UPPERCASE, 0, 'o');
+ hexOrOctalConversion(argument, flags, width, precision, 8,
+ origConversion);
+ break;
+ case 'x':
+ hexOrOctalConversion(argument, flags, width, precision, 16,
+ origConversion);
+ case 'e':
+ // scientificNotationConversion();
+ break;
+ case 'f':
+ // floatingDecimalConversion();
+ break;
+ case 'g':
+ // smartFloatingConversion();
+ break;
+ case 'a':
+ // hexFloatingConversion();
+ break;
+ case 't':
+ advance();
+ char subConversion = format.charAt(index);
+ dateTimeConversion(argument, flags, width, precision,
+ origConversion, subConversion);
+ break;
+ case '%':
+ percentFormat(flags, width, precision);
+ break;
+ case 'n':
+ newLineFormat(flags, width, precision);
+ break;
+ default:
+ throw new UnknownFormatConversionException(String.valueOf(origConversion));
+ }
+ }
}
catch (IOException exc)
{
- ioException = exc;
+ ioException = exc;
}
return this;
}
diff --git a/libjava/classpath/java/util/FormatterClosedException.java b/libjava/classpath/java/util/FormatterClosedException.java
index c358864..6206849 100644
--- a/libjava/classpath/java/util/FormatterClosedException.java
+++ b/libjava/classpath/java/util/FormatterClosedException.java
@@ -38,15 +38,15 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when a method is called on a {@link Formatter} but
* it has already been closed.
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class FormatterClosedException
+public class FormatterClosedException
extends IllegalStateException
{
private static final long serialVersionUID = 18111216L;
diff --git a/libjava/classpath/java/util/GregorianCalendar.java b/libjava/classpath/java/util/GregorianCalendar.java
index 6eb7ce8..b5d9e8c 100644
--- a/libjava/classpath/java/util/GregorianCalendar.java
+++ b/libjava/classpath/java/util/GregorianCalendar.java
@@ -367,25 +367,25 @@ public class GregorianCalendar extends Calendar
if (month > 11)
{
- year += (month / 12);
- month = month % 12;
+ year += (month / 12);
+ month = month % 12;
}
if (month < 0)
{
- year += (int) month / 12;
- month = month % 12;
- if (month < 0)
- {
- month += 12;
- year--;
- }
+ year += (int) month / 12;
+ month = month % 12;
+ if (month < 0)
+ {
+ month += 12;
+ year--;
+ }
}
int dayOfYear = dayCount[month] + 1;
if (month > 1)
if (isLeapYear(year))
- dayOfYear++;
+ dayOfYear++;
boolean greg = isGregorian(year, dayOfYear);
int day = (int) getLinearDay(year, dayOfYear, greg);
@@ -431,29 +431,29 @@ public class GregorianCalendar extends Calendar
throw new IllegalArgumentException("Illegal MONTH.");
if (isSet[WEEK_OF_YEAR])
{
- int daysInYear = 365 + leap;
- daysInYear += (getFirstDayOfMonth(year, 0) - 1); // pad first week
- int last = getFirstDayOfMonth(year, 11) + 4;
- if (last > 7)
- last -= 7;
- daysInYear += 7 - last;
- int weeks = daysInYear / 7;
- if (fields[WEEK_OF_YEAR] < 1 || fields[WEEK_OF_YEAR] > weeks)
- throw new IllegalArgumentException("Illegal WEEK_OF_YEAR.");
+ int daysInYear = 365 + leap;
+ daysInYear += (getFirstDayOfMonth(year, 0) - 1); // pad first week
+ int last = getFirstDayOfMonth(year, 11) + 4;
+ if (last > 7)
+ last -= 7;
+ daysInYear += 7 - last;
+ int weeks = daysInYear / 7;
+ if (fields[WEEK_OF_YEAR] < 1 || fields[WEEK_OF_YEAR] > weeks)
+ throw new IllegalArgumentException("Illegal WEEK_OF_YEAR.");
}
if (isSet[WEEK_OF_MONTH])
{
- int weeks = (month == 1 && leap == 0) ? 5 : 6;
- if (fields[WEEK_OF_MONTH] < 1 || fields[WEEK_OF_MONTH] > weeks)
- throw new IllegalArgumentException("Illegal WEEK_OF_MONTH.");
+ int weeks = (month == 1 && leap == 0) ? 5 : 6;
+ if (fields[WEEK_OF_MONTH] < 1 || fields[WEEK_OF_MONTH] > weeks)
+ throw new IllegalArgumentException("Illegal WEEK_OF_MONTH.");
}
if (isSet[DAY_OF_MONTH])
if (fields[DAY_OF_MONTH] < 1
|| fields[DAY_OF_MONTH] > month_days[month]
+ ((month == 1) ? leap : 0))
- throw new IllegalArgumentException("Illegal DAY_OF_MONTH.");
+ throw new IllegalArgumentException("Illegal DAY_OF_MONTH.");
if (isSet[DAY_OF_YEAR]
&& (fields[DAY_OF_YEAR] < 1 || fields[DAY_OF_YEAR] > 365 + leap))
@@ -465,10 +465,10 @@ public class GregorianCalendar extends Calendar
if (isSet[DAY_OF_WEEK_IN_MONTH])
{
- int weeks = (month == 1 && leap == 0) ? 4 : 5;
- if (fields[DAY_OF_WEEK_IN_MONTH] < -weeks
- || fields[DAY_OF_WEEK_IN_MONTH] > weeks)
- throw new IllegalArgumentException("Illegal DAY_OF_WEEK_IN_MONTH.");
+ int weeks = (month == 1 && leap == 0) ? 4 : 5;
+ if (fields[DAY_OF_WEEK_IN_MONTH] < -weeks
+ || fields[DAY_OF_WEEK_IN_MONTH] > weeks)
+ throw new IllegalArgumentException("Illegal DAY_OF_WEEK_IN_MONTH.");
}
if (isSet[AM_PM] && fields[AM_PM] != AM && fields[AM_PM] != PM)
@@ -522,78 +522,78 @@ public class GregorianCalendar extends Calendar
if (! isSet[MONTH] && (! isSet[DAY_OF_WEEK] || isSet[WEEK_OF_YEAR]))
{
- // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR
- if (isSet[WEEK_OF_YEAR])
- {
- int first = getFirstDayOfMonth(year, 0);
- int offs = 1;
- int daysInFirstWeek = getFirstDayOfWeek() - first;
- if (daysInFirstWeek <= 0)
- daysInFirstWeek += 7;
-
- if (daysInFirstWeek < getMinimalDaysInFirstWeek())
- offs += daysInFirstWeek;
- else
- offs -= 7 - daysInFirstWeek;
- month = 0;
- day = offs + 7 * (fields[WEEK_OF_YEAR] - 1);
- offs = fields[DAY_OF_WEEK] - getFirstDayOfWeek();
-
- if (offs < 0)
- offs += 7;
- day += offs;
- }
- else
- {
- // 4: YEAR + DAY_OF_YEAR
- month = 0;
- day = fields[DAY_OF_YEAR];
- }
+ // 5: YEAR + DAY_OF_WEEK + WEEK_OF_YEAR
+ if (isSet[WEEK_OF_YEAR])
+ {
+ int first = getFirstDayOfMonth(year, 0);
+ int offs = 1;
+ int daysInFirstWeek = getFirstDayOfWeek() - first;
+ if (daysInFirstWeek <= 0)
+ daysInFirstWeek += 7;
+
+ if (daysInFirstWeek < getMinimalDaysInFirstWeek())
+ offs += daysInFirstWeek;
+ else
+ offs -= 7 - daysInFirstWeek;
+ month = 0;
+ day = offs + 7 * (fields[WEEK_OF_YEAR] - 1);
+ offs = fields[DAY_OF_WEEK] - getFirstDayOfWeek();
+
+ if (offs < 0)
+ offs += 7;
+ day += offs;
+ }
+ else
+ {
+ // 4: YEAR + DAY_OF_YEAR
+ month = 0;
+ day = fields[DAY_OF_YEAR];
+ }
}
else
{
- if (isSet[DAY_OF_WEEK])
- {
- int first = getFirstDayOfMonth(year, month);
-
- // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK
- if (isSet[DAY_OF_WEEK_IN_MONTH])
- {
- if (fields[DAY_OF_WEEK_IN_MONTH] < 0)
- {
- month++;
- first = getFirstDayOfMonth(year, month);
- day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH]);
- }
- else
- day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1);
-
- int offs = fields[DAY_OF_WEEK] - first;
- if (offs < 0)
- offs += 7;
- day += offs;
- }
- else
- { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
- int offs = 1;
- int daysInFirstWeek = getFirstDayOfWeek() - first;
- if (daysInFirstWeek <= 0)
- daysInFirstWeek += 7;
-
- if (daysInFirstWeek < getMinimalDaysInFirstWeek())
- offs += daysInFirstWeek;
- else
- offs -= 7 - daysInFirstWeek;
-
- day = offs + 7 * (fields[WEEK_OF_MONTH] - 1);
- offs = fields[DAY_OF_WEEK] - getFirstDayOfWeek();
- if (offs < 0)
- offs += 7;
- day += offs;
- }
- }
-
- // 1: YEAR + MONTH + DAY_OF_MONTH
+ if (isSet[DAY_OF_WEEK])
+ {
+ int first = getFirstDayOfMonth(year, month);
+
+ // 3: YEAR + MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK
+ if (isSet[DAY_OF_WEEK_IN_MONTH])
+ {
+ if (fields[DAY_OF_WEEK_IN_MONTH] < 0)
+ {
+ month++;
+ first = getFirstDayOfMonth(year, month);
+ day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH]);
+ }
+ else
+ day = 1 + 7 * (fields[DAY_OF_WEEK_IN_MONTH] - 1);
+
+ int offs = fields[DAY_OF_WEEK] - first;
+ if (offs < 0)
+ offs += 7;
+ day += offs;
+ }
+ else
+ { // 2: YEAR + MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
+ int offs = 1;
+ int daysInFirstWeek = getFirstDayOfWeek() - first;
+ if (daysInFirstWeek <= 0)
+ daysInFirstWeek += 7;
+
+ if (daysInFirstWeek < getMinimalDaysInFirstWeek())
+ offs += daysInFirstWeek;
+ else
+ offs -= 7 - daysInFirstWeek;
+
+ day = offs + 7 * (fields[WEEK_OF_MONTH] - 1);
+ offs = fields[DAY_OF_WEEK] - getFirstDayOfWeek();
+ if (offs < 0)
+ offs += 7;
+ day += offs;
+ }
+ }
+
+ // 1: YEAR + MONTH + DAY_OF_MONTH
}
if (era == BC && year > 0)
year = 1 - year;
@@ -603,9 +603,9 @@ public class GregorianCalendar extends Calendar
// get the hour (but no check for validity)
if (isSet[HOUR])
{
- hour = fields[HOUR];
- if (fields[AM_PM] == PM)
- hour += 12;
+ hour = fields[HOUR];
+ if (fields[AM_PM] == PM)
+ hour += 12;
}
else
hour = fields[HOUR_OF_DAY];
@@ -619,41 +619,41 @@ public class GregorianCalendar extends Calendar
if (month < 0)
{
- year += (int) month / 12;
- month = month % 12;
- if (month < 0)
- {
- month += 12;
- year--;
- }
+ year += (int) month / 12;
+ month = month % 12;
+ if (month < 0)
+ {
+ month += 12;
+ year--;
+ }
}
if (month > 11)
{
- year += (month / 12);
- month = month % 12;
+ year += (month / 12);
+ month = month % 12;
}
month_days[1] = isLeapYear(year) ? 29 : 28;
while (day <= 0)
{
- if (month == 0)
- {
- year--;
- month_days[1] = isLeapYear(year) ? 29 : 28;
- }
- month = (month + 11) % 12;
- day += month_days[month];
+ if (month == 0)
+ {
+ year--;
+ month_days[1] = isLeapYear(year) ? 29 : 28;
+ }
+ month = (month + 11) % 12;
+ day += month_days[month];
}
while (day > month_days[month])
{
- day -= (month_days[month]);
- month = (month + 1) % 12;
- if (month == 0)
- {
- year++;
- month_days[1] = isLeapYear(year) ? 29 : 28;
- }
+ day -= (month_days[month]);
+ month = (month + 1) % 12;
+ if (month == 0)
+ {
+ year++;
+ month_days[1] = isLeapYear(year) ? 29 : 28;
+ }
}
// ok, by here we have valid day,month,year,era and millisinday
@@ -719,19 +719,19 @@ public class GregorianCalendar extends Calendar
if (gregorian)
{
- // subtract the days that are missing in gregorian calendar
- // with respect to julian calendar.
- //
- // Okay, here we rely on the fact that the gregorian
- // calendar was introduced in the AD era. This doesn't work
- // with negative years.
- //
- // The additional leap year factor accounts for the fact that
- // a leap day is not seen on Jan 1 of the leap year.
- int gregOffset = (int) Math.floor((double) (year - 1) / 400.)
- - (int) Math.floor((double) (year - 1) / 100.);
-
- return julianDay + gregOffset;
+ // subtract the days that are missing in gregorian calendar
+ // with respect to julian calendar.
+ //
+ // Okay, here we rely on the fact that the gregorian
+ // calendar was introduced in the AD era. This doesn't work
+ // with negative years.
+ //
+ // The additional leap year factor accounts for the fact that
+ // a leap day is not seen on Jan 1 of the leap year.
+ int gregOffset = (int) Math.floor((double) (year - 1) / 400.)
+ - (int) Math.floor((double) (year - 1) / 100.);
+
+ return julianDay + gregOffset;
}
else
julianDay -= 2;
@@ -754,7 +754,7 @@ public class GregorianCalendar extends Calendar
weekday += 7;
fields[DAY_OF_WEEK] = weekday;
- // get a first approximation of the year. This may be one
+ // get a first approximation of the year. This may be one
// year too big.
int year = 1970
+ (int) (gregorian
@@ -768,8 +768,8 @@ public class GregorianCalendar extends Calendar
// Now look in which year day really lies.
if (day < firstDayOfYear)
{
- year--;
- firstDayOfYear = getLinearDay(year, 1, gregorian);
+ year--;
+ firstDayOfYear = getLinearDay(year, 1, gregorian);
}
day -= firstDayOfYear - 1; // day of year, one based.
@@ -777,27 +777,27 @@ public class GregorianCalendar extends Calendar
fields[DAY_OF_YEAR] = (int) day;
if (year <= 0)
{
- fields[ERA] = BC;
- fields[YEAR] = 1 - year;
+ fields[ERA] = BC;
+ fields[YEAR] = 1 - year;
}
else
{
- fields[ERA] = AD;
- fields[YEAR] = year;
+ fields[ERA] = AD;
+ fields[YEAR] = year;
}
int leapday = isLeapYear(year) ? 1 : 0;
if (day <= 31 + 28 + leapday)
{
- fields[MONTH] = (int) day / 32; // 31->JANUARY, 32->FEBRUARY
- fields[DAY_OF_MONTH] = (int) day - 31 * fields[MONTH];
+ fields[MONTH] = (int) day / 32; // 31->JANUARY, 32->FEBRUARY
+ fields[DAY_OF_MONTH] = (int) day - 31 * fields[MONTH];
}
else
{
- // A few more magic formulas
- int scaledDay = ((int) day - leapday) * 5 + 8;
- fields[MONTH] = scaledDay / (31 + 30 + 31 + 30 + 31);
- fields[DAY_OF_MONTH] = (scaledDay % (31 + 30 + 31 + 30 + 31)) / 5 + 1;
+ // A few more magic formulas
+ int scaledDay = ((int) day - leapday) * 5 + 8;
+ fields[MONTH] = scaledDay / (31 + 30 + 31 + 30 + 31);
+ fields[DAY_OF_MONTH] = (scaledDay % (31 + 30 + 31 + 30 + 31)) / 5 + 1;
}
}
@@ -819,8 +819,8 @@ public class GregorianCalendar extends Calendar
if (millisInDay < 0)
{
- millisInDay += (24 * 60 * 60 * 1000);
- day--;
+ millisInDay += (24 * 60 * 60 * 1000);
+ day--;
}
calculateDay(fields, day, gregorian);
@@ -832,8 +832,8 @@ public class GregorianCalendar extends Calendar
millisInDay += fields[DST_OFFSET];
if (millisInDay >= 24 * 60 * 60 * 1000)
{
- millisInDay -= 24 * 60 * 60 * 1000;
- calculateDay(fields, ++day, gregorian);
+ millisInDay -= 24 * 60 * 60 * 1000;
+ calculateDay(fields, ++day, gregorian);
}
fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7;
@@ -845,7 +845,7 @@ public class GregorianCalendar extends Calendar
// nb 35 is the smallest multiple of 7 that ensures that
// the left hand side of the modulo operator is positive.
int relativeWeekdayOfFirst = (relativeWeekday - fields[DAY_OF_MONTH]
- + 1 + 35) % 7;
+ + 1 + 35) % 7;
// which week of the month is the first of this month in?
int minDays = getMinimalDaysInFirstWeek();
@@ -853,11 +853,11 @@ public class GregorianCalendar extends Calendar
// which week of the month is this day in?
fields[WEEK_OF_MONTH] = (fields[DAY_OF_MONTH]
- + relativeWeekdayOfFirst - 1) / 7 + weekOfFirst;
+ + relativeWeekdayOfFirst - 1) / 7 + weekOfFirst;
int weekOfYear = (fields[DAY_OF_YEAR] - relativeWeekday + 6) / 7;
- // Do the Correction: getMinimalDaysInFirstWeek() is always in the
+ // Do the Correction: getMinimalDaysInFirstWeek() is always in the
// first week.
int firstWeekday = (7 + getWeekDay(fields[YEAR], minDays)
- getFirstDayOfWeek()) % 7;
@@ -878,7 +878,7 @@ public class GregorianCalendar extends Calendar
areFieldsSet = isSet[ERA] = isSet[YEAR] = isSet[MONTH] = isSet[WEEK_OF_YEAR] = isSet[WEEK_OF_MONTH] = isSet[DAY_OF_MONTH] = isSet[DAY_OF_YEAR] = isSet[DAY_OF_WEEK] = isSet[DAY_OF_WEEK_IN_MONTH] = isSet[AM_PM] = isSet[HOUR] = isSet[HOUR_OF_DAY] = isSet[MINUTE] = isSet[SECOND] = isSet[MILLISECOND] = isSet[ZONE_OFFSET] = isSet[DST_OFFSET] = true;
}
-
+
/**
* Return a hash code for this object, following the general contract
* specified by {@link Object#hashCode()}.
@@ -931,76 +931,76 @@ public class GregorianCalendar extends Calendar
switch (field)
{
case YEAR:
- complete();
- fields[YEAR] += amount;
- isTimeSet = false;
- break;
+ complete();
+ fields[YEAR] += amount;
+ isTimeSet = false;
+ break;
case MONTH:
- complete();
- int months = fields[MONTH] + amount;
- fields[YEAR] += months / 12;
- fields[MONTH] = months % 12;
- if (fields[MONTH] < 0)
- {
- fields[MONTH] += 12;
- fields[YEAR]--;
- }
- int maxDay = getActualMaximum(DAY_OF_MONTH);
- if (fields[DAY_OF_MONTH] > maxDay)
- fields[DAY_OF_MONTH] = maxDay;
- set(YEAR, fields[YEAR]);
- set(MONTH, fields[MONTH]);
- break;
+ complete();
+ int months = fields[MONTH] + amount;
+ fields[YEAR] += months / 12;
+ fields[MONTH] = months % 12;
+ if (fields[MONTH] < 0)
+ {
+ fields[MONTH] += 12;
+ fields[YEAR]--;
+ }
+ int maxDay = getActualMaximum(DAY_OF_MONTH);
+ if (fields[DAY_OF_MONTH] > maxDay)
+ fields[DAY_OF_MONTH] = maxDay;
+ set(YEAR, fields[YEAR]);
+ set(MONTH, fields[MONTH]);
+ break;
case DAY_OF_MONTH:
case DAY_OF_YEAR:
case DAY_OF_WEEK:
- if (! isTimeSet)
- computeTime();
- time += amount * (24 * 60 * 60 * 1000L);
- areFieldsSet = false;
- break;
+ if (! isTimeSet)
+ computeTime();
+ time += amount * (24 * 60 * 60 * 1000L);
+ areFieldsSet = false;
+ break;
case WEEK_OF_YEAR:
case WEEK_OF_MONTH:
case DAY_OF_WEEK_IN_MONTH:
- if (! isTimeSet)
- computeTime();
- time += amount * (7 * 24 * 60 * 60 * 1000L);
- areFieldsSet = false;
- break;
+ if (! isTimeSet)
+ computeTime();
+ time += amount * (7 * 24 * 60 * 60 * 1000L);
+ areFieldsSet = false;
+ break;
case AM_PM:
- if (! isTimeSet)
- computeTime();
- time += amount * (12 * 60 * 60 * 1000L);
- areFieldsSet = false;
- break;
+ if (! isTimeSet)
+ computeTime();
+ time += amount * (12 * 60 * 60 * 1000L);
+ areFieldsSet = false;
+ break;
case HOUR:
case HOUR_OF_DAY:
- if (! isTimeSet)
- computeTime();
- time += amount * (60 * 60 * 1000L);
- areFieldsSet = false;
- break;
+ if (! isTimeSet)
+ computeTime();
+ time += amount * (60 * 60 * 1000L);
+ areFieldsSet = false;
+ break;
case MINUTE:
- if (! isTimeSet)
- computeTime();
- time += amount * (60 * 1000L);
- areFieldsSet = false;
- break;
+ if (! isTimeSet)
+ computeTime();
+ time += amount * (60 * 1000L);
+ areFieldsSet = false;
+ break;
case SECOND:
- if (! isTimeSet)
- computeTime();
- time += amount * (1000L);
- areFieldsSet = false;
- break;
+ if (! isTimeSet)
+ computeTime();
+ time += amount * (1000L);
+ areFieldsSet = false;
+ break;
case MILLISECOND:
- if (! isTimeSet)
- computeTime();
- time += amount;
- areFieldsSet = false;
- break;
+ if (! isTimeSet)
+ computeTime();
+ time += amount;
+ areFieldsSet = false;
+ break;
case ZONE_OFFSET:
case DST_OFFSET:default:
- throw new IllegalArgumentException("Invalid or unknown field");
+ throw new IllegalArgumentException("Invalid or unknown field");
}
}
@@ -1044,77 +1044,77 @@ public class GregorianCalendar extends Calendar
case ERA:
case YEAR:
case MONTH:
- // check that day of month is still in correct range
- if (fields[DAY_OF_MONTH] > getActualMaximum(DAY_OF_MONTH))
- fields[DAY_OF_MONTH] = getActualMaximum(DAY_OF_MONTH);
- isTimeSet = false;
- isSet[WEEK_OF_MONTH] = false;
- isSet[DAY_OF_WEEK] = false;
- isSet[DAY_OF_WEEK_IN_MONTH] = false;
- isSet[DAY_OF_YEAR] = false;
- isSet[WEEK_OF_YEAR] = false;
- break;
+ // check that day of month is still in correct range
+ if (fields[DAY_OF_MONTH] > getActualMaximum(DAY_OF_MONTH))
+ fields[DAY_OF_MONTH] = getActualMaximum(DAY_OF_MONTH);
+ isTimeSet = false;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[DAY_OF_WEEK] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ break;
case DAY_OF_MONTH:
- isSet[WEEK_OF_MONTH] = false;
- isSet[DAY_OF_WEEK] = false;
- isSet[DAY_OF_WEEK_IN_MONTH] = false;
- isSet[DAY_OF_YEAR] = false;
- isSet[WEEK_OF_YEAR] = false;
- time += delta * (24 * 60 * 60 * 1000L);
- break;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[DAY_OF_WEEK] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ time += delta * (24 * 60 * 60 * 1000L);
+ break;
case WEEK_OF_MONTH:
- isSet[DAY_OF_MONTH] = false;
- isSet[DAY_OF_WEEK_IN_MONTH] = false;
- isSet[DAY_OF_YEAR] = false;
- isSet[WEEK_OF_YEAR] = false;
- time += delta * (7 * 24 * 60 * 60 * 1000L);
- break;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ time += delta * (7 * 24 * 60 * 60 * 1000L);
+ break;
case DAY_OF_WEEK_IN_MONTH:
- isSet[DAY_OF_MONTH] = false;
- isSet[WEEK_OF_MONTH] = false;
- isSet[DAY_OF_YEAR] = false;
- isSet[WEEK_OF_YEAR] = false;
- time += delta * (7 * 24 * 60 * 60 * 1000L);
- break;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ time += delta * (7 * 24 * 60 * 60 * 1000L);
+ break;
case DAY_OF_YEAR:
- isSet[MONTH] = false;
- isSet[DAY_OF_MONTH] = false;
- isSet[WEEK_OF_MONTH] = false;
- isSet[DAY_OF_WEEK_IN_MONTH] = false;
- isSet[DAY_OF_WEEK] = false;
- isSet[WEEK_OF_YEAR] = false;
- time += delta * (24 * 60 * 60 * 1000L);
- break;
+ isSet[MONTH] = false;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[DAY_OF_WEEK] = false;
+ isSet[WEEK_OF_YEAR] = false;
+ time += delta * (24 * 60 * 60 * 1000L);
+ break;
case WEEK_OF_YEAR:
- isSet[MONTH] = false;
- isSet[DAY_OF_MONTH] = false;
- isSet[WEEK_OF_MONTH] = false;
- isSet[DAY_OF_WEEK_IN_MONTH] = false;
- isSet[DAY_OF_YEAR] = false;
- time += delta * (7 * 24 * 60 * 60 * 1000L);
- break;
+ isSet[MONTH] = false;
+ isSet[DAY_OF_MONTH] = false;
+ isSet[WEEK_OF_MONTH] = false;
+ isSet[DAY_OF_WEEK_IN_MONTH] = false;
+ isSet[DAY_OF_YEAR] = false;
+ time += delta * (7 * 24 * 60 * 60 * 1000L);
+ break;
case AM_PM:
- isSet[HOUR_OF_DAY] = false;
- time += delta * (12 * 60 * 60 * 1000L);
- break;
+ isSet[HOUR_OF_DAY] = false;
+ time += delta * (12 * 60 * 60 * 1000L);
+ break;
case HOUR:
- isSet[HOUR_OF_DAY] = false;
- time += delta * (60 * 60 * 1000L);
- break;
+ isSet[HOUR_OF_DAY] = false;
+ time += delta * (60 * 60 * 1000L);
+ break;
case HOUR_OF_DAY:
- isSet[HOUR] = false;
- isSet[AM_PM] = false;
- time += delta * (60 * 60 * 1000L);
- break;
+ isSet[HOUR] = false;
+ isSet[AM_PM] = false;
+ time += delta * (60 * 60 * 1000L);
+ break;
case MINUTE:
- time += delta * (60 * 1000L);
- break;
+ time += delta * (60 * 1000L);
+ break;
case SECOND:
- time += delta * (1000L);
- break;
+ time += delta * (1000L);
+ break;
case MILLISECOND:
- time += delta;
- break;
+ time += delta;
+ break;
}
}
@@ -1141,12 +1141,12 @@ public class GregorianCalendar extends Calendar
switch (field)
{
case DAY_OF_WEEK:
- // day of week is special: it rolls automatically
- add(field, amount);
- return;
+ // day of week is special: it rolls automatically
+ add(field, amount);
+ return;
case ZONE_OFFSET:
case DST_OFFSET:
- throw new IllegalArgumentException("Can't roll time zone");
+ throw new IllegalArgumentException("Can't roll time zone");
}
complete();
int min = getActualMinimum(field);
@@ -1162,7 +1162,7 @@ public class GregorianCalendar extends Calendar
/**
* The minimum values for the calendar fields.
*/
- private static final int[] minimums =
+ private static final int[] minimums =
{
BC, 1, 0, 0, 1, 1, 1, SUNDAY, 1, AM,
1, 0, 0, 0, 0, -(12 * 60 * 60 * 1000),
@@ -1172,7 +1172,7 @@ public class GregorianCalendar extends Calendar
/**
* The maximum values for the calendar fields.
*/
- private static final int[] maximums =
+ private static final int[] maximums =
{
AD, 5000000, 11, 53, 6, 31, 366,
SATURDAY, 5, PM, 12, 23, 59, 59, 999,
@@ -1235,16 +1235,16 @@ public class GregorianCalendar extends Calendar
switch (field)
{
case WEEK_OF_YEAR:
- return 52;
+ return 52;
case DAY_OF_MONTH:
- return 28;
+ return 28;
case DAY_OF_YEAR:
- return 365;
+ return 365;
case DAY_OF_WEEK_IN_MONTH:
case WEEK_OF_MONTH:
- return 4;
+ return 4;
default:
- return maximums[field];
+ return maximums[field];
}
}
@@ -1263,17 +1263,17 @@ public class GregorianCalendar extends Calendar
{
if (field == WEEK_OF_YEAR)
{
- int min = getMinimalDaysInFirstWeek();
- if (min == 0)
- return 1;
- if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
- complete();
-
- int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
- int weekday = getWeekDay(year, min);
- if ((7 + weekday - getFirstDayOfWeek()) % 7 >= min - 1)
- return 1;
- return 0;
+ int min = getMinimalDaysInFirstWeek();
+ if (min == 0)
+ return 1;
+ if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
+ complete();
+
+ int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
+ int weekday = getWeekDay(year, min);
+ if ((7 + weekday - getFirstDayOfWeek()) % 7 >= min - 1)
+ return 1;
+ return 0;
}
return minimums[field];
}
@@ -1295,71 +1295,71 @@ public class GregorianCalendar extends Calendar
{
case WEEK_OF_YEAR:
{
- if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
- complete();
-
- // This is wrong for the year that contains the gregorian change.
- // I.e it gives the weeks in the julian year or in the gregorian
- // year in that case.
- int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
- int lastDay = isLeapYear(year) ? 366 : 365;
- int weekday = getWeekDay(year, lastDay);
- int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
-
- int minimalDays = getMinimalDaysInFirstWeek();
- int firstWeekday = getWeekDay(year, minimalDays);
- /*
- * Is there a set of days at the beginning of the year, before the
- * first day of the week, equal to or greater than the minimum number
- * of days required in the first week?
- */
- if (minimalDays - (7 + firstWeekday - getFirstDayOfWeek()) % 7 < 1)
- return week + 1; /* Add week 1: firstWeekday through to firstDayOfWeek */
+ if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
+ complete();
+
+ // This is wrong for the year that contains the gregorian change.
+ // I.e it gives the weeks in the julian year or in the gregorian
+ // year in that case.
+ int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
+ int lastDay = isLeapYear(year) ? 366 : 365;
+ int weekday = getWeekDay(year, lastDay);
+ int week = (lastDay + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
+
+ int minimalDays = getMinimalDaysInFirstWeek();
+ int firstWeekday = getWeekDay(year, minimalDays);
+ /*
+ * Is there a set of days at the beginning of the year, before the
+ * first day of the week, equal to or greater than the minimum number
+ * of days required in the first week?
+ */
+ if (minimalDays - (7 + firstWeekday - getFirstDayOfWeek()) % 7 < 1)
+ return week + 1; /* Add week 1: firstWeekday through to firstDayOfWeek */
}
case DAY_OF_MONTH:
{
- if (! areFieldsSet || ! isSet[MONTH])
- complete();
- int month = fields[MONTH];
-
- // If you change this, you should also change
- // SimpleTimeZone.getDaysInMonth();
- if (month == FEBRUARY)
- {
- if (! isSet[YEAR] || ! isSet[ERA])
- complete();
- int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
- return isLeapYear(year) ? 29 : 28;
- }
- else if (month < AUGUST)
- return 31 - (month & 1);
- else
- return 30 + (month & 1);
+ if (! areFieldsSet || ! isSet[MONTH])
+ complete();
+ int month = fields[MONTH];
+
+ // If you change this, you should also change
+ // SimpleTimeZone.getDaysInMonth();
+ if (month == FEBRUARY)
+ {
+ if (! isSet[YEAR] || ! isSet[ERA])
+ complete();
+ int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
+ return isLeapYear(year) ? 29 : 28;
+ }
+ else if (month < AUGUST)
+ return 31 - (month & 1);
+ else
+ return 30 + (month & 1);
}
case DAY_OF_YEAR:
{
- if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
- complete();
- int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
- return isLeapYear(year) ? 366 : 365;
+ if (! areFieldsSet || ! isSet[ERA] || ! isSet[YEAR])
+ complete();
+ int year = fields[ERA] == AD ? fields[YEAR] : 1 - fields[YEAR];
+ return isLeapYear(year) ? 366 : 365;
}
case DAY_OF_WEEK_IN_MONTH:
{
- // This is wrong for the month that contains the gregorian change.
- int daysInMonth = getActualMaximum(DAY_OF_MONTH);
+ // This is wrong for the month that contains the gregorian change.
+ int daysInMonth = getActualMaximum(DAY_OF_MONTH);
- // That's black magic, I know
- return (daysInMonth - (fields[DAY_OF_MONTH] - 1) % 7 + 6) / 7;
+ // That's black magic, I know
+ return (daysInMonth - (fields[DAY_OF_MONTH] - 1) % 7 + 6) / 7;
}
case WEEK_OF_MONTH:
{
- int daysInMonth = getActualMaximum(DAY_OF_MONTH);
- int weekday = (daysInMonth - fields[DAY_OF_MONTH]
- + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY;
- return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
+ int daysInMonth = getActualMaximum(DAY_OF_MONTH);
+ int weekday = (daysInMonth - fields[DAY_OF_MONTH]
+ + fields[DAY_OF_WEEK] - SUNDAY) % 7 + SUNDAY;
+ return (daysInMonth + 6 - (7 + weekday - getFirstDayOfWeek()) % 7) / 7;
}
default:
- return maximums[field];
+ return maximums[field];
}
}
}
diff --git a/libjava/classpath/java/util/HashMap.java b/libjava/classpath/java/util/HashMap.java
index eca3ad6..55d81c6 100644
--- a/libjava/classpath/java/util/HashMap.java
+++ b/libjava/classpath/java/util/HashMap.java
@@ -349,7 +349,7 @@ public class HashMap extends AbstractMap
if (equals(key, e.key))
{
e.access(); // Must call this for bookkeeping in LinkedHashMap.
- V r = e.value;
+ V r = e.value;
e.value = value;
return r;
}
@@ -384,12 +384,12 @@ public class HashMap extends AbstractMap
final Iterator> it = addMap.entrySet().iterator();
while (it.hasNext())
{
- final Map.Entry e = it.next();
+ final Map.Entry e = it.next();
// Optimize in case the Entry is one of our own.
if (e instanceof AbstractMap.SimpleEntry)
{
AbstractMap.SimpleEntry extends K, ? extends V> entry
- = (AbstractMap.SimpleEntry extends K, ? extends V>) e;
+ = (AbstractMap.SimpleEntry extends K, ? extends V>) e;
put(entry.key, entry.value);
}
else
@@ -702,8 +702,8 @@ public class HashMap extends AbstractMap
}
/**
- * A simplified, more efficient internal implementation of putAll(). clone()
- * should not call putAll or put, in order to be compatible with the JDK
+ * A simplified, more efficient internal implementation of putAll(). clone()
+ * should not call putAll or put, in order to be compatible with the JDK
* implementation with respect to subclasses.
*
* @param m the map to initialize this from
@@ -715,11 +715,11 @@ public class HashMap extends AbstractMap
size = 0;
while (it.hasNext())
{
- final Map.Entry e = it.next();
+ final Map.Entry e = it.next();
size++;
- K key = e.getKey();
- int idx = hash(key);
- addEntry(key, e.getValue(), idx, false);
+ K key = e.getKey();
+ int idx = hash(key);
+ addEntry(key, e.getValue(), idx, false);
}
}
diff --git a/libjava/classpath/java/util/Hashtable.java b/libjava/classpath/java/util/Hashtable.java
index 0851de8..8f08e96 100644
--- a/libjava/classpath/java/util/Hashtable.java
+++ b/libjava/classpath/java/util/Hashtable.java
@@ -345,7 +345,7 @@ public class Hashtable extends Dictionary
}
}
- return false;
+ return false;
}
/**
@@ -362,7 +362,7 @@ public class Hashtable extends Dictionary
*/
public boolean containsValue(Object value)
{
- // Delegate to older method to make sure code overriding it continues
+ // Delegate to older method to make sure code overriding it continues
// to work.
return contains(value);
}
@@ -511,12 +511,12 @@ public class Hashtable extends Dictionary
final Iterator> it = addMap.entrySet().iterator();
while (it.hasNext())
{
- final Map.Entry e = it.next();
+ final Map.Entry e = it.next();
// Optimize in case the Entry is one of our own.
if (e instanceof AbstractMap.SimpleEntry)
{
AbstractMap.SimpleEntry extends K, ? extends V> entry
- = (AbstractMap.SimpleEntry extends K, ? extends V>) e;
+ = (AbstractMap.SimpleEntry extends K, ? extends V>) e;
put(entry.key, entry.value);
}
else
@@ -850,8 +850,8 @@ public class Hashtable extends Dictionary
}
/**
- * A simplified, more efficient internal implementation of putAll(). clone()
- * should not call putAll or put, in order to be compatible with the JDK
+ * A simplified, more efficient internal implementation of putAll(). clone()
+ * should not call putAll or put, in order to be compatible with the JDK
* implementation with respect to subclasses.
*
* @param m the map to initialize this from
@@ -863,13 +863,13 @@ public class Hashtable extends Dictionary
size = 0;
while (it.hasNext())
{
- final Map.Entry e = it.next();
+ final Map.Entry e = it.next();
size++;
- K key = e.getKey();
- int idx = hash(key);
- HashEntry he = new HashEntry(key, e.getValue());
- he.next = buckets[idx];
- buckets[idx] = he;
+ K key = e.getKey();
+ int idx = hash(key);
+ HashEntry he = new HashEntry(key, e.getValue());
+ he.next = buckets[idx];
+ buckets[idx] = he;
}
}
@@ -991,7 +991,7 @@ public class Hashtable extends Dictionary
* @author Jon Zeppieri
* @author Fridjof Siebert
*/
- private class EntryIterator
+ private class EntryIterator
implements Iterator>
{
/**
@@ -1044,10 +1044,10 @@ public class Hashtable extends Dictionary
HashEntry e = next;
while (e == null)
- if (idx <= 0)
- return null;
- else
- e = buckets[--idx];
+ if (idx <= 0)
+ return null;
+ else
+ e = buckets[--idx];
next = e.next;
last = e;
@@ -1081,7 +1081,7 @@ public class Hashtable extends Dictionary
* @author Fridtjof Siebert
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
*/
- private class KeyIterator
+ private class KeyIterator
implements Iterator
{
@@ -1097,7 +1097,7 @@ public class Hashtable extends Dictionary
*/
KeyIterator()
{
- iterator = new EntryIterator();
+ iterator = new EntryIterator();
}
@@ -1109,7 +1109,7 @@ public class Hashtable extends Dictionary
*/
public boolean hasNext()
{
- return iterator.hasNext();
+ return iterator.hasNext();
}
/**
@@ -1137,7 +1137,7 @@ public class Hashtable extends Dictionary
iterator.remove();
}
} // class KeyIterator
-
+
/**
* A class which implements the Iterator interface and is used for
* iterating over values in Hashtables. This class uses an
@@ -1162,7 +1162,7 @@ public class Hashtable extends Dictionary
*/
ValueIterator()
{
- iterator = new EntryIterator();
+ iterator = new EntryIterator();
}
@@ -1174,7 +1174,7 @@ public class Hashtable extends Dictionary
*/
public boolean hasNext()
{
- return iterator.hasNext();
+ return iterator.hasNext();
}
/**
@@ -1218,7 +1218,7 @@ public class Hashtable extends Dictionary
* @author Jon Zeppieri
* @author Fridjof Siebert
*/
- private class EntryEnumerator
+ private class EntryEnumerator
implements Enumeration>
{
/** The number of elements remaining to be returned by next(). */
@@ -1315,7 +1315,7 @@ public class Hashtable extends Dictionary
*/
public boolean hasMoreElements()
{
- return enumerator.hasMoreElements();
+ return enumerator.hasMoreElements();
}
/**
@@ -1376,7 +1376,7 @@ public class Hashtable extends Dictionary
*/
public boolean hasMoreElements()
{
- return enumerator.hasMoreElements();
+ return enumerator.hasMoreElements();
}
/**
diff --git a/libjava/classpath/java/util/IdentityHashMap.java b/libjava/classpath/java/util/IdentityHashMap.java
index 8dead96..89a7525 100644
--- a/libjava/classpath/java/util/IdentityHashMap.java
+++ b/libjava/classpath/java/util/IdentityHashMap.java
@@ -789,10 +789,10 @@ public class IdentityHashMap extends AbstractMap
key = table[loc];
}
while (key == null);
-
- return (I) (type == KEYS ? unxform(key)
- : (type == VALUES ? unxform(table[loc + 1])
- : new IdentityEntry(loc)));
+
+ return (I) (type == KEYS ? unxform(key)
+ : (type == VALUES ? unxform(table[loc + 1])
+ : new IdentityEntry(loc)));
}
/**
diff --git a/libjava/classpath/java/util/IllegalFormatCodePointException.java b/libjava/classpath/java/util/IllegalFormatCodePointException.java
index 001839f..f6d5c2f 100644
--- a/libjava/classpath/java/util/IllegalFormatCodePointException.java
+++ b/libjava/classpath/java/util/IllegalFormatCodePointException.java
@@ -38,16 +38,16 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when a {@link Formatter} receives a character with an
* invalid Unicode codepoint, as defined by
* {@link Character#isValidCodePoint(int)}.
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class IllegalFormatCodePointException
+public class IllegalFormatCodePointException
extends IllegalFormatException
{
private static final long serialVersionUID = 19080630L;
diff --git a/libjava/classpath/java/util/IllegalFormatConversionException.java b/libjava/classpath/java/util/IllegalFormatConversionException.java
index d59c0a4..58aa918 100644
--- a/libjava/classpath/java/util/IllegalFormatConversionException.java
+++ b/libjava/classpath/java/util/IllegalFormatConversionException.java
@@ -38,16 +38,16 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when the type of an argument supplied to the
* {@link Formatter#format()} method of a {@link Formatter}
* does not match the conversion character specified for it.
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class IllegalFormatConversionException
+public class IllegalFormatConversionException
extends IllegalFormatException
{
private static final long serialVersionUID = 17000126L;
@@ -81,7 +81,7 @@ public class IllegalFormatConversionException
public IllegalFormatConversionException(char c, Class> arg)
{
super("The type, " + arg + ", is invalid for the conversion character, " +
- c + ".");
+ c + ".");
if (arg == null)
throw new NullPointerException("The supplied type was null.");
this.c = c;
diff --git a/libjava/classpath/java/util/IllegalFormatException.java b/libjava/classpath/java/util/IllegalFormatException.java
index 4daafca..b5c740a 100644
--- a/libjava/classpath/java/util/IllegalFormatException.java
+++ b/libjava/classpath/java/util/IllegalFormatException.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.util;
-/**
+/**
* A general exception thrown when a format string is supplied
* to a {@link Formatter} that contains either invalid syntax
* or a mismatch between the format specification and the
@@ -48,9 +48,9 @@ package java.util;
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class IllegalFormatException
+public class IllegalFormatException
extends IllegalArgumentException
{
private static final long serialVersionUID = 18830826L;
diff --git a/libjava/classpath/java/util/IllegalFormatFlagsException.java b/libjava/classpath/java/util/IllegalFormatFlagsException.java
index 2a085c1..b53bfa5 100644
--- a/libjava/classpath/java/util/IllegalFormatFlagsException.java
+++ b/libjava/classpath/java/util/IllegalFormatFlagsException.java
@@ -38,15 +38,15 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when the flags supplied to the {@link Formatter#format()}
* method of a {@link Formatter} form an illegal combination.
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class IllegalFormatFlagsException
+public class IllegalFormatFlagsException
extends IllegalFormatException
{
private static final long serialVersionUID = 790824L;
diff --git a/libjava/classpath/java/util/IllegalFormatPrecisionException.java b/libjava/classpath/java/util/IllegalFormatPrecisionException.java
index a555f5d..a216dc1 100644
--- a/libjava/classpath/java/util/IllegalFormatPrecisionException.java
+++ b/libjava/classpath/java/util/IllegalFormatPrecisionException.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when the specified precision for a {@link Formatter}
* argument is illegal. This may be because the number is
* a negative number (other than -1), the argument does not
@@ -46,9 +46,9 @@ package java.util;
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class IllegalFormatPrecisionException
+public class IllegalFormatPrecisionException
extends IllegalFormatException
{
private static final long serialVersionUID = 18711008L;
diff --git a/libjava/classpath/java/util/IllegalFormatWidthException.java b/libjava/classpath/java/util/IllegalFormatWidthException.java
index 95d3e15..7f2a625 100644
--- a/libjava/classpath/java/util/IllegalFormatWidthException.java
+++ b/libjava/classpath/java/util/IllegalFormatWidthException.java
@@ -38,16 +38,16 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when the specified width for a {@link Formatter}
* argument is illegal. This may be because the number is
* a negative number (other than -1) or for some other reason.
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class IllegalFormatWidthException
+public class IllegalFormatWidthException
extends IllegalFormatException
{
private static final long serialVersionUID = 16660902L;
diff --git a/libjava/classpath/java/util/InputMismatchException.java b/libjava/classpath/java/util/InputMismatchException.java
index 39326c3..ee29e46 100644
--- a/libjava/classpath/java/util/InputMismatchException.java
+++ b/libjava/classpath/java/util/InputMismatchException.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when a {@link Scanner} instance encounters a mismatch
* between the input data and the pattern it is trying to match it
* against. This could be because the input data represents an
@@ -47,9 +47,9 @@ package java.util;
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class InputMismatchException
+public class InputMismatchException
extends NoSuchElementException
{
/**
diff --git a/libjava/classpath/java/util/LinkedHashMap.java b/libjava/classpath/java/util/LinkedHashMap.java
index 6ec06a9..7701d77 100644
--- a/libjava/classpath/java/util/LinkedHashMap.java
+++ b/libjava/classpath/java/util/LinkedHashMap.java
@@ -76,9 +76,9 @@ package java.util;
* things like keep the map at a fixed size.
*
*
- * Under ideal circumstances (no collisions), LinkedHashMap offers O(1)
+ * Under ideal circumstances (no collisions), LinkedHashMap offers O(1)
* performance on most operations (containsValue() is,
- * of course, O(n)). In the worst case (all keys map to the same
+ * of course, O(n)). In the worst case (all keys map to the same
* hash code -- very unlikely), most operations are O(n). Traversal is
* faster than in HashMap (proportional to the map size, and not the space
* allocated for the map), but other operations may be slower because of the
@@ -188,7 +188,7 @@ public class LinkedHashMap extends HashMap
succ = null;
pred = root.pred;
pred.succ = this;
- root.pred = this;
+ root.pred = this;
}
}
}
@@ -477,7 +477,7 @@ public class LinkedHashMap extends HashMap
current = current.succ;
return type == VALUES ? last.value : type == KEYS ? last.key : last;
}
-
+
/**
* Removes from the backing HashMap the last element which was fetched
* with the next() method.
diff --git a/libjava/classpath/java/util/LinkedHashSet.java b/libjava/classpath/java/util/LinkedHashSet.java
index 03b9556..2caebaf 100644
--- a/libjava/classpath/java/util/LinkedHashSet.java
+++ b/libjava/classpath/java/util/LinkedHashSet.java
@@ -62,7 +62,7 @@ import java.io.Serializable;
* without needing the overhead of TreeSet.
*
*
- * Under ideal circumstances (no collisions), LinkedHashSet offers O(1)
+ * Under ideal circumstances (no collisions), LinkedHashSet offers O(1)
* performance on most operations. In the worst case (all elements map
* to the same hash code -- very unlikely), most operations are O(n).
*
diff --git a/libjava/classpath/java/util/LinkedList.java b/libjava/classpath/java/util/LinkedList.java
index 3f8b2ad..813d099 100644
--- a/libjava/classpath/java/util/LinkedList.java
+++ b/libjava/classpath/java/util/LinkedList.java
@@ -684,7 +684,7 @@ public class LinkedList extends AbstractSequentialList
* Returns an Array whose component type is the runtime component type of
* the passed-in Array. The returned Array is populated with all of the
* elements in this LinkedList. If the passed-in Array is not large enough
- * to store all of the elements in this List, a new Array will be created
+ * to store all of the elements in this List, a new Array will be created
* and returned; if the passed-in Array is larger than the size
* of this List, then size() index will be set to null.
*
@@ -1081,8 +1081,8 @@ public class LinkedList extends AbstractSequentialList
if (next == null)
throw new NoSuchElementException();
--position;
- lastReturned = next;
- next = lastReturned.previous;
+ lastReturned = next;
+ next = lastReturned.previous;
return lastReturned.data;
}
@@ -1101,9 +1101,9 @@ public class LinkedList extends AbstractSequentialList
checkMod();
if (lastReturned == null)
throw new IllegalStateException();
- removeEntry(lastReturned);
- lastReturned = null;
- ++knownMod;
+ removeEntry(lastReturned);
+ lastReturned = null;
+ ++knownMod;
}
};
}
@@ -1217,7 +1217,7 @@ public class LinkedList extends AbstractSequentialList
{
addFirst(value);
}
-
+
/**
* Removes the first occurrence of the specified element
* from the list, when traversing the list from head to
@@ -1247,12 +1247,12 @@ public class LinkedList extends AbstractSequentialList
Entry e = last;
while (e != null)
{
- if (equals(o, e.data))
- {
- removeEntry(e);
- return true;
- }
- e = e.previous;
+ if (equals(o, e.data))
+ {
+ removeEntry(e);
+ return true;
+ }
+ e = e.previous;
}
return false;
}
diff --git a/libjava/classpath/java/util/List.java b/libjava/classpath/java/util/List.java
index 0a1c409..3a437a5 100644
--- a/libjava/classpath/java/util/List.java
+++ b/libjava/classpath/java/util/List.java
@@ -232,7 +232,7 @@ public interface List extends Collection
* Obtains a hash code for this list. In order to obey the general
* contract of the hashCode method of class Object, this value is
* calculated as follows:
- *
+ *
hashCode = 1;
Iterator i = list.iterator();
while (i.hasNext())
diff --git a/libjava/classpath/java/util/Locale.java b/libjava/classpath/java/util/Locale.java
index c28709f..ef11173 100644
--- a/libjava/classpath/java/util/Locale.java
+++ b/libjava/classpath/java/util/Locale.java
@@ -215,7 +215,7 @@ public final class Locale implements Serializable, Cloneable
* got called.
*/
private static transient HashMap localeMap;
-
+
/**
* The default locale. Except for during bootstrapping, this should never be
* null. Note the logic in the main constructor, to detect when
@@ -249,12 +249,12 @@ public final class Locale implements Serializable, Cloneable
*
* @param language the language of the locale to retrieve.
* @return the locale.
- */
+ */
private static Locale getLocale(String language)
{
return getLocale(language, "", "");
}
-
+
/**
* Retrieves the locale with the specified language and country
* from the cache.
@@ -262,12 +262,12 @@ public final class Locale implements Serializable, Cloneable
* @param language the language of the locale to retrieve.
* @param country the country of the locale to retrieve.
* @return the locale.
- */
+ */
private static Locale getLocale(String language, String country)
{
return getLocale(language, country, "");
}
-
+
/**
* Retrieves the locale with the specified language, country
* and variant from the cache.
@@ -276,7 +276,7 @@ public final class Locale implements Serializable, Cloneable
* @param country the country of the locale to retrieve.
* @param variant the variant of the locale to retrieve.
* @return the locale.
- */
+ */
private static Locale getLocale(String language, String country, String variant)
{
if (localeMap == null)
@@ -287,13 +287,13 @@ public final class Locale implements Serializable, Cloneable
if (locale == null)
{
- locale = new Locale(language, country, variant);
- localeMap.put(name, locale);
+ locale = new Locale(language, country, variant);
+ localeMap.put(name, locale);
}
return locale;
}
-
+
/**
* Convert new iso639 codes to the old ones.
*
@@ -418,17 +418,17 @@ public final class Locale implements Serializable, Cloneable
if (name.length() > 2)
country = name.substring(3);
- int index = country.indexOf("_");
- if (index > 0)
- {
- variant = country.substring(index + 1);
- country = country.substring(0, index - 1);
- }
+ int index = country.indexOf("_");
+ if (index > 0)
+ {
+ variant = country.substring(index + 1);
+ country = country.substring(0, index - 1);
+ }
availableLocales[i] = getLocale(language, country, variant);
}
}
-
+
return (Locale[]) availableLocales.clone();
}
@@ -442,7 +442,7 @@ public final class Locale implements Serializable, Cloneable
{
if (countryCache == null)
{
- countryCache = getISOStrings("territories");
+ countryCache = getISOStrings("territories");
}
return (String[]) countryCache.clone();
@@ -458,7 +458,7 @@ public final class Locale implements Serializable, Cloneable
{
if (languageCache == null)
{
- languageCache = getISOStrings("languages");
+ languageCache = getISOStrings("languages");
}
return (String[]) languageCache.clone();
}
@@ -480,27 +480,27 @@ public final class Locale implements Serializable, Cloneable
while (e.hasMoreElements())
{
- String key = (String) e.nextElement();
-
- if (key.startsWith(tableName + "."))
- {
- String str = key.substring(tableName.length() + 1);
-
- if (str.length() == 2
- && Character.isLetter(str.charAt(0))
- && Character.isLetter(str.charAt(1)))
- {
- tempList.add(str);
- ++count;
- }
- }
+ String key = (String) e.nextElement();
+
+ if (key.startsWith(tableName + "."))
+ {
+ String str = key.substring(tableName.length() + 1);
+
+ if (str.length() == 2
+ && Character.isLetter(str.charAt(0))
+ && Character.isLetter(str.charAt(1)))
+ {
+ tempList.add(str);
+ ++count;
+ }
+ }
}
String[] strings = new String[count];
-
+
for (int a = 0; a < count; ++a)
strings[a] = (String) tempList.get(a);
-
+
return strings;
}
@@ -687,7 +687,7 @@ public final class Locale implements Serializable, Cloneable
return "";
try
{
- ResourceBundle res =
+ ResourceBundle res =
ResourceBundle.getBundle("gnu.java.locale.LocaleInformation",
inLocale,
ClassLoader.getSystemClassLoader());
@@ -696,23 +696,23 @@ public final class Locale implements Serializable, Cloneable
}
catch (MissingResourceException e)
{
- /* This means runtime support for the locale
- * is not available, so we check providers. */
+ /* This means runtime support for the locale
+ * is not available, so we check providers. */
}
for (LocaleNameProvider p :
- ServiceLoader.load(LocaleNameProvider.class))
+ ServiceLoader.load(LocaleNameProvider.class))
{
- for (Locale loc : p.getAvailableLocales())
- {
- if (loc.equals(inLocale))
- {
- String locLang = p.getDisplayLanguage(language,
- inLocale);
- if (locLang != null)
- return locLang;
- break;
- }
- }
+ for (Locale loc : p.getAvailableLocales())
+ {
+ if (loc.equals(inLocale))
+ {
+ String locLang = p.getDisplayLanguage(language,
+ inLocale);
+ if (locLang != null)
+ return locLang;
+ break;
+ }
+ }
}
if (inLocale.equals(Locale.ROOT)) // Base case
return language;
@@ -770,28 +770,28 @@ public final class Locale implements Serializable, Cloneable
ResourceBundle.getBundle("gnu.java.locale.LocaleInformation",
inLocale,
ClassLoader.getSystemClassLoader());
-
+
return res.getString("territories." + country);
}
catch (MissingResourceException e)
{
- /* This means runtime support for the locale
- * is not available, so we check providers. */
+ /* This means runtime support for the locale
+ * is not available, so we check providers. */
}
for (LocaleNameProvider p :
- ServiceLoader.load(LocaleNameProvider.class))
+ ServiceLoader.load(LocaleNameProvider.class))
{
- for (Locale loc : p.getAvailableLocales())
- {
- if (loc.equals(inLocale))
- {
- String locCountry = p.getDisplayCountry(country,
- inLocale);
- if (locCountry != null)
- return locCountry;
- break;
- }
- }
+ for (Locale loc : p.getAvailableLocales())
+ {
+ if (loc.equals(inLocale))
+ {
+ String locCountry = p.getDisplayCountry(country,
+ inLocale);
+ if (locCountry != null)
+ return locCountry;
+ break;
+ }
+ }
}
if (inLocale.equals(Locale.ROOT)) // Base case
return country;
@@ -850,28 +850,28 @@ public final class Locale implements Serializable, Cloneable
ResourceBundle.getBundle("gnu.java.locale.LocaleInformation",
inLocale,
ClassLoader.getSystemClassLoader());
-
+
return res.getString("variants." + variant);
}
catch (MissingResourceException e)
{
- /* This means runtime support for the locale
- * is not available, so we check providers. */
+ /* This means runtime support for the locale
+ * is not available, so we check providers. */
}
for (LocaleNameProvider p :
- ServiceLoader.load(LocaleNameProvider.class))
+ ServiceLoader.load(LocaleNameProvider.class))
{
- for (Locale loc : p.getAvailableLocales())
- {
- if (loc.equals(inLocale))
- {
- String locVar = p.getDisplayVariant(variant,
- inLocale);
- if (locVar != null)
- return locVar;
- break;
- }
- }
+ for (Locale loc : p.getAvailableLocales())
+ {
+ if (loc.equals(inLocale))
+ {
+ String locVar = p.getDisplayVariant(variant,
+ inLocale);
+ if (locVar != null)
+ return locVar;
+ break;
+ }
+ }
}
if (inLocale.equals(Locale.ROOT)) // Base case
return country;
@@ -989,8 +989,8 @@ public final class Locale implements Serializable, Cloneable
return false;
Locale l = (Locale) obj;
- return (language == l.language
- && country == l.country
+ return (language == l.language
+ && country == l.country
&& variant == l.variant);
}
@@ -1000,8 +1000,8 @@ public final class Locale implements Serializable, Cloneable
* @param s the stream to write to
* @throws IOException if the write fails
* @serialData The first three fields are Strings representing language,
- * country, and variant. The fourth field is a placeholder for
- * the cached hashcode, but this is always written as -1, and
+ * country, and variant. The fourth field is a placeholder for
+ * the cached hashcode, but this is always written as -1, and
* recomputed when reading it back.
*/
private void writeObject(ObjectOutputStream s)
diff --git a/libjava/classpath/java/util/Map.java b/libjava/classpath/java/util/Map.java
index 67b3d8a..1bcb1b2 100644
--- a/libjava/classpath/java/util/Map.java
+++ b/libjava/classpath/java/util/Map.java
@@ -310,7 +310,7 @@ public interface Map
* Returns the hash code of the entry. This is defined as the
* exclusive-or of the hashcodes of the key and value (using 0 for
* null). In other words, this must be:
- *
+ *
*
@@ -322,7 +322,7 @@ public interface Map
* Compares the specified object with this entry. Returns true only if
* the object is a mapping of identical key and value. In other words,
* this must be:
- *
+ *
(o instanceof Map.Entry)
&& (getKey() == null ? ((Map.Entry) o).getKey() == null
: getKey().equals(((Map.Entry) o).getKey()))
diff --git a/libjava/classpath/java/util/MissingFormatArgumentException.java b/libjava/classpath/java/util/MissingFormatArgumentException.java
index 4a9385e..e53de0a 100644
--- a/libjava/classpath/java/util/MissingFormatArgumentException.java
+++ b/libjava/classpath/java/util/MissingFormatArgumentException.java
@@ -38,16 +38,16 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when the a format specification for a {@link Formatter}
* refers to an argument that is non-existent, or an argument index
* references a non-existent argument.
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class MissingFormatArgumentException
+public class MissingFormatArgumentException
extends IllegalFormatException
{
private static final long serialVersionUID = 19190115L;
@@ -71,8 +71,8 @@ public class MissingFormatArgumentException
*/
public MissingFormatArgumentException(String s)
{
- super("The specification, " + s +
- ", refers to a non-existent argument.");
+ super("The specification, " + s +
+ ", refers to a non-existent argument.");
if (s == null)
throw new NullPointerException("The specification is null.");
this.s = s;
diff --git a/libjava/classpath/java/util/MissingFormatWidthException.java b/libjava/classpath/java/util/MissingFormatWidthException.java
index 55de620..e083172 100644
--- a/libjava/classpath/java/util/MissingFormatWidthException.java
+++ b/libjava/classpath/java/util/MissingFormatWidthException.java
@@ -38,15 +38,15 @@ exception statement from your version. */
package java.util;
-/**
+/**
* Thrown when the a format specification for a {@link Formatter}
* does not include a width for a value where one is required.
*
* @author Tom Tromey (tromey@redhat.com)
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
- * @since 1.5
+ * @since 1.5
*/
-public class MissingFormatWidthException
+public class MissingFormatWidthException
extends IllegalFormatException
{
private static final long serialVersionUID = 15560123L;
diff --git a/libjava/classpath/java/util/PriorityQueue.java b/libjava/classpath/java/util/PriorityQueue.java
index 9e738d6..5b6a368 100644
--- a/libjava/classpath/java/util/PriorityQueue.java
+++ b/libjava/classpath/java/util/PriorityQueue.java
@@ -79,23 +79,23 @@ public class PriorityQueue extends AbstractQueue implements Serializable
// Special case where we can find the comparator to use.
if (c instanceof SortedSet)
{
- SortedSet extends E> ss = (SortedSet extends E>) c;
- this.comparator = (Comparator super E>) ss.comparator();
- // We can insert the elements directly, since they are sorted.
- int i = 0;
- for (E val : ss)
- {
- if (val == null)
- throw new NullPointerException();
- storage[i++] = val;
- }
+ SortedSet extends E> ss = (SortedSet extends E>) c;
+ this.comparator = (Comparator super E>) ss.comparator();
+ // We can insert the elements directly, since they are sorted.
+ int i = 0;
+ for (E val : ss)
+ {
+ if (val == null)
+ throw new NullPointerException();
+ storage[i++] = val;
+ }
}
else if (c instanceof PriorityQueue)
{
- PriorityQueue extends E> pq = (PriorityQueue extends E>) c;
- this.comparator = (Comparator super E>)pq.comparator();
- // We can just copy the contents.
- System.arraycopy(pq.storage, 0, storage, 0, pq.storage.length);
+ PriorityQueue extends E> pq = (PriorityQueue extends E>) c;
+ this.comparator = (Comparator super E>)pq.comparator();
+ // We can just copy the contents.
+ System.arraycopy(pq.storage, 0, storage, 0, pq.storage.length);
}
addAll(c);
@@ -109,7 +109,7 @@ public class PriorityQueue extends AbstractQueue implements Serializable
public PriorityQueue(int cap, Comparator super E> comp)
{
if (cap < 1)
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException();
this.used = 0;
this.storage = (E[]) new Object[cap];
this.comparator = comp;
@@ -118,7 +118,7 @@ public class PriorityQueue extends AbstractQueue implements Serializable
public PriorityQueue(PriorityQueue extends E> c)
{
this(Math.max(1, (int) (1.1 * c.size())),
- (Comparator super E>)c.comparator());
+ (Comparator super E>)c.comparator());
// We can just copy the contents.
System.arraycopy(c.storage, 0, storage, 0, c.storage.length);
}
@@ -126,14 +126,14 @@ public class PriorityQueue extends AbstractQueue implements Serializable
public PriorityQueue(SortedSet extends E> c)
{
this(Math.max(1, (int) (1.1 * c.size())),
- (Comparator super E>)c.comparator());
+ (Comparator super E>)c.comparator());
// We can insert the elements directly, since they are sorted.
int i = 0;
for (E val : c)
{
- if (val == null)
- throw new NullPointerException();
- storage[i++] = val;
+ if (val == null)
+ throw new NullPointerException();
+ storage[i++] = val;
}
}
@@ -157,22 +157,22 @@ public class PriorityQueue extends AbstractQueue implements Serializable
public boolean hasNext()
{
- return count < used;
+ return count < used;
}
public E next()
{
- while (storage[++index] == null)
- ;
-
- ++count;
- return storage[index];
+ while (storage[++index] == null)
+ ;
+
+ ++count;
+ return storage[index];
}
public void remove()
{
- PriorityQueue.this.remove(index);
- index--;
+ PriorityQueue.this.remove(index);
+ index--;
}
};
}
@@ -209,14 +209,14 @@ public class PriorityQueue extends AbstractQueue implements Serializable
{
if (o != null)
{
- for (int i = 0; i < storage.length; ++i)
- {
- if (o.equals(storage[i]))
- {
- remove(i);
- return true;
- }
- }
+ for (int i = 0; i < storage.length; ++i)
+ {
+ if (o.equals(storage[i]))
+ {
+ remove(i);
+ return true;
+ }
+ }
}
return false;
}
@@ -237,12 +237,12 @@ public class PriorityQueue extends AbstractQueue implements Serializable
int save = used;
for (E val : c)
{
- if (val == null)
- throw new NullPointerException();
- newSlot = findSlot(newSlot);
- storage[newSlot] = val;
- ++used;
- bubbleUp(newSlot);
+ if (val == null)
+ throw new NullPointerException();
+ newSlot = findSlot(newSlot);
+ storage[newSlot] = val;
+ ++used;
+ bubbleUp(newSlot);
}
return save != used;
@@ -253,17 +253,17 @@ public class PriorityQueue extends AbstractQueue implements Serializable
int slot;
if (used == storage.length)
{
- resize();
- slot = used;
+ resize();
+ slot = used;
}
else
{
- for (slot = start + 1; slot < storage.length; ++slot)
- {
- if (storage[slot] == null)
- break;
- }
- // We'll always find a slot.
+ for (slot = start + 1; slot < storage.length; ++slot)
+ {
+ if (storage[slot] == null)
+ break;
+ }
+ // We'll always find a slot.
}
return slot;
}
@@ -275,28 +275,28 @@ public class PriorityQueue extends AbstractQueue implements Serializable
// the bottom of the tree.
while (storage[index] != null)
{
- int child = 2 * index + 1;
-
- // See if we went off the end.
- if (child >= storage.length)
- {
- storage[index] = null;
- break;
- }
-
- // Find which child we want to promote. If one is not null,
- // we pick it. If both are null, it doesn't matter, we're
- // about to leave. If neither is null, pick the lesser.
- if (child + 1 >= storage.length || storage[child + 1] == null)
- {
- // Nothing.
- }
- else if (storage[child] == null
- || (Collections.compare(storage[child], storage[child + 1],
- comparator) > 0))
- ++child;
- storage[index] = storage[child];
- index = child;
+ int child = 2 * index + 1;
+
+ // See if we went off the end.
+ if (child >= storage.length)
+ {
+ storage[index] = null;
+ break;
+ }
+
+ // Find which child we want to promote. If one is not null,
+ // we pick it. If both are null, it doesn't matter, we're
+ // about to leave. If neither is null, pick the lesser.
+ if (child + 1 >= storage.length || storage[child + 1] == null)
+ {
+ // Nothing.
+ }
+ else if (storage[child] == null
+ || (Collections.compare(storage[child], storage[child + 1],
+ comparator) > 0))
+ ++child;
+ storage[index] = storage[child];
+ index = child;
}
--used;
}
@@ -307,23 +307,23 @@ public class PriorityQueue extends AbstractQueue implements Serializable
// it up the tree to its natural resting place.
while (index > 0)
{
- // This works regardless of whether we're at 2N+1 or 2N+2.
- int parent = (index - 1) / 2;
- if (Collections.compare(storage[parent], storage[index], comparator)
- <= 0)
- {
- // Parent is the same or smaller than this element, so the
- // invariant is preserved. Note that if the new element
- // is smaller than the parent, then it is necessarily
- // smaller than the parent's other child.
- break;
- }
-
- E temp = storage[index];
- storage[index] = storage[parent];
- storage[parent] = temp;
-
- index = parent;
+ // This works regardless of whether we're at 2N+1 or 2N+2.
+ int parent = (index - 1) / 2;
+ if (Collections.compare(storage[parent], storage[index], comparator)
+ <= 0)
+ {
+ // Parent is the same or smaller than this element, so the
+ // invariant is preserved. Note that if the new element
+ // is smaller than the parent, then it is necessarily
+ // smaller than the parent's other child.
+ break;
+ }
+
+ E temp = storage[index];
+ storage[index] = storage[parent];
+ storage[parent] = temp;
+
+ index = parent;
}
}
diff --git a/libjava/classpath/java/util/Properties.java b/libjava/classpath/java/util/Properties.java
index a57004b..b0f436f 100644
--- a/libjava/classpath/java/util/Properties.java
+++ b/libjava/classpath/java/util/Properties.java
@@ -75,7 +75,7 @@ import org.w3c.dom.ls.LSSerializer;
* and put it in the CLASSPATH. (The character
* \u00e4 is the german umlaut)
*
- *
+ *
s1=3
s2=MeineDisk
s3=3. M\u00e4rz 96
@@ -179,7 +179,7 @@ public class Properties extends Hashtable
* \\uxxxx notation are detected, and
* converted to the corresponding single character.
*
- *
+ *
# This is a comment
key = value
k\:5 \ a string starting with space and ending with newline\n
@@ -204,21 +204,21 @@ label = Name:\\u0020
{
char c = 0;
int pos = 0;
- // Leading whitespaces must be deleted first.
+ // Leading whitespaces must be deleted first.
while (pos < line.length()
&& Character.isWhitespace(c = line.charAt(pos)))
pos++;
// If empty line or begins with a comment character, skip this line.
if ((line.length() - pos) == 0
- || line.charAt(pos) == '#' || line.charAt(pos) == '!')
+ || line.charAt(pos) == '#' || line.charAt(pos) == '!')
continue;
// The characters up to the next Whitespace, ':', or '='
// describe the key. But look for escape sequences.
- // Try to short-circuit when there is no escape char.
- int start = pos;
- boolean needsEscape = line.indexOf('\\', pos) != -1;
+ // Try to short-circuit when there is no escape char.
+ int start = pos;
+ boolean needsEscape = line.indexOf('\\', pos) != -1;
CPStringBuilder key = needsEscape ? new CPStringBuilder() : null;
while (pos < line.length()
&& ! Character.isWhitespace(c = line.charAt(pos++))
@@ -232,8 +232,8 @@ label = Name:\\u0020
// is no next line, just treat it as a key with an
// empty value.
line = reader.readLine();
- if (line == null)
- line = "";
+ if (line == null)
+ line = "";
pos = 0;
while (pos < line.length()
&& Character.isWhitespace(c = line.charAt(pos)))
@@ -274,13 +274,13 @@ label = Name:\\u0020
pos++;
}
- // Short-circuit if no escape chars found.
- if (!needsEscape)
- {
- put(keyString, line.substring(pos));
- continue;
- }
+ // Short-circuit if no escape chars found.
+ if (!needsEscape)
+ {
+ put(keyString, line.substring(pos));
+ continue;
+ }
- // Escape char found so iterate through the rest of the line.
+ // Escape char found so iterate through the rest of the line.
StringBuilder element = new StringBuilder(line.length() - pos);
while (pos < line.length())
{
@@ -313,11 +313,11 @@ label = Name:\\u0020
// The line continues on the next line.
line = reader.readLine();
- // We might have seen a backslash at the end of
- // the file. The JDK ignores the backslash in
- // this case, so we follow for compatibility.
- if (line == null)
- break;
+ // We might have seen a backslash at the end of
+ // the file. The JDK ignores the backslash in
+ // this case, so we follow for compatibility.
+ if (line == null)
+ break;
pos = 0;
while (pos < line.length()
@@ -438,7 +438,7 @@ label = Name:\\u0020
if (header != null)
writer.println("#" + header);
writer.println ("#" + Calendar.getInstance ().getTime ());
-
+
Iterator iter = entrySet ().iterator ();
int i = size ();
CPStringBuilder s = new CPStringBuilder (); // Reuse the same buffer.
@@ -528,7 +528,7 @@ label = Name:\\u0020
}
/**
- * Prints the key/value pairs to the given print stream. This is
+ * Prints the key/value pairs to the given print stream. This is
* mainly useful for debugging purposes.
*
* @param out the print stream, where the key/value pairs are written to
@@ -645,7 +645,7 @@ label = Name:\\u0020
* Invoking this method provides the same behaviour as invoking
* storeToXML(os, comment, "UTF-8").
*
- *
+ *
* @param os the stream to output to.
* @param comment a comment to include at the top of the XML file, or
* null if one is not required.
@@ -666,7 +666,7 @@ label = Name:\\u0020
*
* http://java.sun.com/dtd/properties.dtd.
*
- *
+ *
* @param os the stream to output to.
* @param comment a comment to include at the top of the XML file, or
* null if one is not required.
@@ -685,53 +685,53 @@ label = Name:\\u0020
throw new NullPointerException("Null encoding supplied.");
try
{
- DOMImplementationRegistry registry =
- DOMImplementationRegistry.newInstance();
- DOMImplementation domImpl = registry.getDOMImplementation("LS 3.0");
- DocumentType doctype =
- domImpl.createDocumentType("properties", null,
- "http://java.sun.com/dtd/properties.dtd");
- Document doc = domImpl.createDocument(null, "properties", doctype);
- Element root = doc.getDocumentElement();
- if (comment != null)
- {
- Element commentElement = doc.createElement("comment");
- commentElement.appendChild(doc.createTextNode(comment));
- root.appendChild(commentElement);
- }
- Iterator iterator = entrySet().iterator();
- while (iterator.hasNext())
- {
- Map.Entry entry = (Map.Entry) iterator.next();
- Element entryElement = doc.createElement("entry");
- entryElement.setAttribute("key", (String) entry.getKey());
- entryElement.appendChild(doc.createTextNode((String)
- entry.getValue()));
- root.appendChild(entryElement);
- }
- DOMImplementationLS loadAndSave = (DOMImplementationLS) domImpl;
- LSSerializer serializer = loadAndSave.createLSSerializer();
- LSOutput output = loadAndSave.createLSOutput();
- output.setByteStream(os);
- output.setEncoding(encoding);
- serializer.write(doc, output);
+ DOMImplementationRegistry registry =
+ DOMImplementationRegistry.newInstance();
+ DOMImplementation domImpl = registry.getDOMImplementation("LS 3.0");
+ DocumentType doctype =
+ domImpl.createDocumentType("properties", null,
+ "http://java.sun.com/dtd/properties.dtd");
+ Document doc = domImpl.createDocument(null, "properties", doctype);
+ Element root = doc.getDocumentElement();
+ if (comment != null)
+ {
+ Element commentElement = doc.createElement("comment");
+ commentElement.appendChild(doc.createTextNode(comment));
+ root.appendChild(commentElement);
+ }
+ Iterator iterator = entrySet().iterator();
+ while (iterator.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) iterator.next();
+ Element entryElement = doc.createElement("entry");
+ entryElement.setAttribute("key", (String) entry.getKey());
+ entryElement.appendChild(doc.createTextNode((String)
+ entry.getValue()));
+ root.appendChild(entryElement);
+ }
+ DOMImplementationLS loadAndSave = (DOMImplementationLS) domImpl;
+ LSSerializer serializer = loadAndSave.createLSSerializer();
+ LSOutput output = loadAndSave.createLSOutput();
+ output.setByteStream(os);
+ output.setEncoding(encoding);
+ serializer.write(doc, output);
}
catch (ClassNotFoundException e)
{
- throw (IOException)
- new IOException("The XML classes could not be found.").initCause(e);
+ throw (IOException)
+ new IOException("The XML classes could not be found.").initCause(e);
}
catch (InstantiationException e)
{
- throw (IOException)
- new IOException("The XML classes could not be instantiated.")
- .initCause(e);
+ throw (IOException)
+ new IOException("The XML classes could not be instantiated.")
+ .initCause(e);
}
catch (IllegalAccessException e)
{
- throw (IOException)
- new IOException("The XML classes could not be accessed.")
- .initCause(e);
+ throw (IOException)
+ new IOException("The XML classes could not be accessed.")
+ .initCause(e);
}
}
@@ -813,9 +813,9 @@ label = Name:\\u0020
}
catch (XMLStreamException e)
{
- throw (InvalidPropertiesFormatException)
- new InvalidPropertiesFormatException("Error in parsing XML.").
- initCause(e);
+ throw (InvalidPropertiesFormatException)
+ new InvalidPropertiesFormatException("Error in parsing XML.").
+ initCause(e);
}
}
diff --git a/libjava/classpath/java/util/PropertyPermission.java b/libjava/classpath/java/util/PropertyPermission.java
index d1bdbd1..6ed4690 100644
--- a/libjava/classpath/java/util/PropertyPermission.java
+++ b/libjava/classpath/java/util/PropertyPermission.java
@@ -136,7 +136,7 @@ public final class PropertyPermission extends BasicPermission
{
// Initialising the class java.util.Locale ...
// tries to initialise the Locale.defaultLocale static
- // which calls System.getProperty,
+ // which calls System.getProperty,
// which calls SecurityManager.checkPropertiesAccess,
// which creates a PropertyPermission with action "read,write",
// which calls setActions("read,write").
@@ -144,9 +144,9 @@ public final class PropertyPermission extends BasicPermission
// this would call Locale.getDefault() which returns null
// because Locale.defaultLocale hasn't been set yet
// then toLowerCase will fail with a null pointer exception.
- //
+ //
// The solution is to take a punt on 'str' being lower case, and
- // test accordingly. If that fails, we convert 'str' to lower case
+ // test accordingly. If that fails, we convert 'str' to lower case
// and try the tests again.
if ("read".equals(str))
actions = READ;
@@ -156,15 +156,15 @@ public final class PropertyPermission extends BasicPermission
actions = READ | WRITE;
else
{
- String lstr = str.toLowerCase();
- if ("read".equals(lstr))
- actions = READ;
- else if ("write".equals(lstr))
- actions = WRITE;
- else if ("read,write".equals(lstr) || "write,read".equals(lstr))
- actions = READ | WRITE;
- else
- throw new IllegalArgumentException("illegal action " + str);
+ String lstr = str.toLowerCase();
+ if ("read".equals(lstr))
+ actions = READ;
+ else if ("write".equals(lstr))
+ actions = WRITE;
+ else if ("read,write".equals(lstr) || "write,read".equals(lstr))
+ actions = READ | WRITE;
+ else
+ throw new IllegalArgumentException("illegal action " + str);
}
}
diff --git a/libjava/classpath/java/util/PropertyPermissionCollection.java b/libjava/classpath/java/util/PropertyPermissionCollection.java
index c95fa4e..768b112 100644
--- a/libjava/classpath/java/util/PropertyPermissionCollection.java
+++ b/libjava/classpath/java/util/PropertyPermissionCollection.java
@@ -67,7 +67,7 @@ class PropertyPermissionCollection extends PermissionCollection
/**
* A flag to detect if "*" is in the collection.
*
- * @serial true if "*" is in the collection
+ * @serial true if "*" is in the collection
*/
private boolean all_allowed;
diff --git a/libjava/classpath/java/util/Random.java b/libjava/classpath/java/util/Random.java
index b016f78..999e895 100644
--- a/libjava/classpath/java/util/Random.java
+++ b/libjava/classpath/java/util/Random.java
@@ -227,7 +227,7 @@ public class Random implements Serializable
* an int value whose 32 bits are independent chosen random bits
* (0 and 1 are equally likely). The implementation for
* java.util.Random is:
- *
+ *
public int nextInt()
{
return next(32);
@@ -246,7 +246,7 @@ public class Random implements Serializable
* each value has the same likelihodd (1/n).
* (0 and 1 are equally likely). The implementation for
* java.util.Random is:
- *
+ *
public int nextInt(int n)
{
@@ -266,7 +266,7 @@ public int nextInt(int n)
return val;
}
- *
+ *
*
This algorithm would return every value with exactly the same
* probability, if the next()-method would be a perfect random number
* generator.
@@ -323,7 +323,7 @@ public int nextInt(int n)
/**
* Generates the next pseudorandom boolean. True and false have
* the same probability. The implementation is:
- *
+ *
public boolean nextBoolean()
{
return next(1) != 0;
@@ -341,7 +341,7 @@ public int nextInt(int n)
* Generates the next pseudorandom float uniformly distributed
* between 0.0f (inclusive) and 1.0f (exclusive). The
* implementation is as follows.
- *
+ *
public float nextFloat()
{
return next(24) / ((float)(1 << 24));
@@ -375,7 +375,7 @@ public int nextInt(int n)
* Generates the next pseudorandom, Gaussian (normally) distributed
* double value, with mean 0.0 and standard deviation 1.0.
* The algorithm is as follows.
- *
+ *
public synchronized double nextGaussian()
{
if (haveNextNextGaussian)
diff --git a/libjava/classpath/java/util/ResourceBundle.java b/libjava/classpath/java/util/ResourceBundle.java
index 2124340..966eb02 100644
--- a/libjava/classpath/java/util/ResourceBundle.java
+++ b/libjava/classpath/java/util/ResourceBundle.java
@@ -95,7 +95,7 @@ public abstract class ResourceBundle
/**
* Maximum size of our cache of ResourceBundles keyed by
* {@link BundleKey} instances.
- *
+ *
* @see BundleKey
*/
private static final int CACHE_SIZE = 100;
@@ -120,7 +120,7 @@ public abstract class ResourceBundle
* {@link #CACHE_SIZE} accessed ResourceBundles keyed by the
* tuple: default locale, resource-bundle name, resource-bundle locale, and
* classloader.
- *
+ *
* @see BundleKey
*/
private static Map bundleCache =
@@ -188,8 +188,8 @@ public abstract class ResourceBundle
String className = getClass().getName();
throw new MissingResourceException("Key '" + key
- + "'not found in Bundle: "
- + className, className, key);
+ + "'not found in Bundle: "
+ + className, className, key);
}
/**
@@ -270,7 +270,7 @@ public abstract class ResourceBundle
{
set(dl, s, l, cl);
}
-
+
void set(Locale dl, String s, Locale l, ClassLoader cl)
{
defaultLocale = dl;
@@ -280,12 +280,12 @@ public abstract class ResourceBundle
hashcode = defaultLocale.hashCode() ^ baseName.hashCode()
^ locale.hashCode() ^ classLoader.hashCode();
}
-
+
public int hashCode()
{
return hashcode;
}
-
+
public boolean equals(Object o)
{
if (! (o instanceof BundleKey))
@@ -296,7 +296,7 @@ public abstract class ResourceBundle
&& baseName.equals(key.baseName)
&& locale.equals(key.locale)
&& classLoader.equals(key.classLoader);
- }
+ }
public String toString()
{
@@ -313,11 +313,11 @@ public abstract class ResourceBundle
return builder.toString();
}
}
-
+
/** A cache lookup key. This avoids having to a new one for every
* getBundle() call. */
private static final BundleKey lookupKey = new BundleKey();
-
+
/** Singleton cache entry to represent previous failed lookups. */
private static final Object nullEntry = new Object();
@@ -383,7 +383,7 @@ public abstract class ResourceBundle
*
Locale("es", "ES"): result MyResources_es_ES.class, parent
* MyResources.class
*
- *
+ *
*
The file MyResources_fr_CH.properties is never used because it is hidden
* by MyResources_fr_CH.class.
*
@@ -475,38 +475,38 @@ public abstract class ResourceBundle
rbClass = Class.forName(localizedName);
else
rbClass = classloader.loadClass(localizedName);
- // Note that we do the check up front instead of catching
- // ClassCastException. The reason for this is that some crazy
- // programs (Eclipse) have classes that do not extend
- // ResourceBundle but that have the same name as a property
- // bundle; in fact Eclipse relies on ResourceBundle not
- // instantiating these classes.
- if (ResourceBundle.class.isAssignableFrom(rbClass))
- bundle = (ResourceBundle) rbClass.newInstance();
+ // Note that we do the check up front instead of catching
+ // ClassCastException. The reason for this is that some crazy
+ // programs (Eclipse) have classes that do not extend
+ // ResourceBundle but that have the same name as a property
+ // bundle; in fact Eclipse relies on ResourceBundle not
+ // instantiating these classes.
+ if (ResourceBundle.class.isAssignableFrom(rbClass))
+ bundle = (ResourceBundle) rbClass.newInstance();
}
catch (Exception ex) {}
if (bundle == null)
{
- try
- {
- InputStream is;
- String resourceName
- = localizedName.replace('.', '/') + ".properties";
- if (classloader == null)
- is = ClassLoader.getSystemResourceAsStream(resourceName);
- else
- is = classloader.getResourceAsStream(resourceName);
- if (is != null)
- bundle = new PropertyResourceBundle(is);
- }
- catch (IOException ex)
- {
- MissingResourceException mre = new MissingResourceException
- ("Failed to load bundle: " + localizedName, localizedName, "");
- mre.initCause(ex);
- throw mre;
- }
+ try
+ {
+ InputStream is;
+ String resourceName
+ = localizedName.replace('.', '/') + ".properties";
+ if (classloader == null)
+ is = ClassLoader.getSystemResourceAsStream(resourceName);
+ else
+ is = classloader.getResourceAsStream(resourceName);
+ if (is != null)
+ bundle = new PropertyResourceBundle(is);
+ }
+ catch (IOException ex)
+ {
+ MissingResourceException mre = new MissingResourceException
+ ("Failed to load bundle: " + localizedName, localizedName, "");
+ mre.initCause(ex);
+ throw mre;
+ }
}
return bundle;
@@ -524,13 +524,13 @@ public abstract class ResourceBundle
* @return the resource bundle if it was loaded, otherwise the backup
*/
private static ResourceBundle tryBundle(String baseName, Locale locale,
- ClassLoader classLoader,
- boolean wantBase)
+ ClassLoader classLoader,
+ boolean wantBase)
{
String language = locale.getLanguage();
String country = locale.getCountry();
String variant = locale.getVariant();
-
+
int baseLen = baseName.length();
// Build up a CPStringBuilder containing the complete bundle name, fully
@@ -538,23 +538,23 @@ public abstract class ResourceBundle
CPStringBuilder sb = new CPStringBuilder(baseLen + variant.length() + 7);
sb.append(baseName);
-
+
if (language.length() > 0)
{
- sb.append('_');
- sb.append(language);
-
- if (country.length() > 0)
- {
- sb.append('_');
- sb.append(country);
-
- if (variant.length() > 0)
- {
- sb.append('_');
- sb.append(variant);
- }
- }
+ sb.append('_');
+ sb.append(language);
+
+ if (country.length() > 0)
+ {
+ sb.append('_');
+ sb.append(country);
+
+ if (variant.length() > 0)
+ {
+ sb.append('_');
+ sb.append(variant);
+ }
+ }
}
// Now try to load bundles, starting with the most specialized name.
@@ -562,28 +562,28 @@ public abstract class ResourceBundle
String bundleName = sb.toString();
ResourceBundle first = null; // The most specialized bundle.
ResourceBundle last = null; // The least specialized bundle.
-
+
while (true)
{
ResourceBundle foundBundle = tryBundle(bundleName, classLoader);
- if (foundBundle != null)
- {
- if (first == null)
- first = foundBundle;
- if (last != null)
- last.parent = foundBundle;
- foundBundle.locale = locale;
- last = foundBundle;
- }
- int idx = bundleName.lastIndexOf('_');
- // Try the non-localized base name only if we already have a
- // localized child bundle, or wantBase is true.
- if (idx > baseLen || (idx == baseLen && (first != null || wantBase)))
- bundleName = bundleName.substring(0, idx);
- else
- break;
+ if (foundBundle != null)
+ {
+ if (first == null)
+ first = foundBundle;
+ if (last != null)
+ last.parent = foundBundle;
+ foundBundle.locale = locale;
+ last = foundBundle;
+ }
+ int idx = bundleName.lastIndexOf('_');
+ // Try the non-localized base name only if we already have a
+ // localized child bundle, or wantBase is true.
+ if (idx > baseLen || (idx == baseLen && (first != null || wantBase)))
+ bundleName = bundleName.substring(0, idx);
+ else
+ break;
}
-
+
return first;
}
@@ -611,14 +611,14 @@ public abstract class ResourceBundle
if (loader == null)
throw new NullPointerException("The loader can not be null.");
synchronized (ResourceBundle.class)
- {
- Iterator iter = bundleCache.keySet().iterator();
- while (iter.hasNext())
- {
- BundleKey key = iter.next();
- if (key.classLoader == loader)
- iter.remove();
- }
+ {
+ Iterator iter = bundleCache.keySet().iterator();
+ while (iter.hasNext())
+ {
+ BundleKey key = iter.next();
+ if (key.classLoader == loader)
+ iter.remove();
+ }
}
}
diff --git a/libjava/classpath/java/util/ServiceConfigurationError.java b/libjava/classpath/java/util/ServiceConfigurationError.java
index 1d006c8..40d744c2 100644
--- a/libjava/classpath/java/util/ServiceConfigurationError.java
+++ b/libjava/classpath/java/util/ServiceConfigurationError.java
@@ -50,14 +50,14 @@ package java.util;
*
A listed class does not implement the service
*
A listed class can not be instantiated
*
- *
+ *
* @author Andrew John Hughes (gnu_andrew@member.fsf.org)
* @since 1.6
*/
public class ServiceConfigurationError
extends Error
{
-
+
/**
* Compatible with JDK 1.6
*/
@@ -86,7 +86,7 @@ public class ServiceConfigurationError
* or inappropriate.
*/
public ServiceConfigurationError(String message,
- Throwable cause)
+ Throwable cause)
{
super(message,cause);
}
diff --git a/libjava/classpath/java/util/ServiceLoader.java b/libjava/classpath/java/util/ServiceLoader.java
index 9935416..bcac070 100644
--- a/libjava/classpath/java/util/ServiceLoader.java
+++ b/libjava/classpath/java/util/ServiceLoader.java
@@ -149,37 +149,37 @@ public final class ServiceLoader
{
return new Iterator()
{
- /**
- * The cache iterator.
- */
- private Iterator cacheIt = cache.iterator();
+ /**
+ * The cache iterator.
+ */
+ private Iterator cacheIt = cache.iterator();
- public boolean hasNext()
- {
- if (cacheIt.hasNext())
- return true;
- if (serviceIt == null)
- serviceIt =
- ServiceFactory.lookupProviders(spi, loader, true);
- return serviceIt.hasNext();
- }
+ public boolean hasNext()
+ {
+ if (cacheIt.hasNext())
+ return true;
+ if (serviceIt == null)
+ serviceIt =
+ ServiceFactory.lookupProviders(spi, loader, true);
+ return serviceIt.hasNext();
+ }
- public S next()
- {
- if (cacheIt.hasNext())
- return cacheIt.next();
- if (serviceIt == null)
- serviceIt =
- ServiceFactory.lookupProviders(spi, loader, true);
- S nextService = serviceIt.next();
- cache.add(nextService);
- return nextService;
- }
+ public S next()
+ {
+ if (cacheIt.hasNext())
+ return cacheIt.next();
+ if (serviceIt == null)
+ serviceIt =
+ ServiceFactory.lookupProviders(spi, loader, true);
+ S nextService = serviceIt.next();
+ cache.add(nextService);
+ return nextService;
+ }
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
};
}
@@ -196,7 +196,7 @@ public final class ServiceLoader
public static ServiceLoader load(Class service)
{
return load(service,
- Thread.currentThread().getContextClassLoader());
+ Thread.currentThread().getContextClassLoader());
}
/**
@@ -215,7 +215,7 @@ public final class ServiceLoader
* @return a new {@link ServiceLoader} instance.
*/
public static ServiceLoader load(Class service,
- ClassLoader loader)
+ ClassLoader loader)
{
if (loader == null)
loader = ClassLoader.getSystemClassLoader();
@@ -244,7 +244,7 @@ public final class ServiceLoader
* of the system class loader, as in
* ClassLoader.getDefaultSystemClassLoader() */
return load(service,
- ClassLoader.getSystemClassLoader().getParent());
+ ClassLoader.getSystemClassLoader().getParent());
}
/**
@@ -258,8 +258,8 @@ public final class ServiceLoader
/**
* Returns a textual representation of this
- * {@link ServiceLoader}.
- *
+ * {@link ServiceLoader}.
+ *
* @return a textual representation of the
* service loader.
*/
diff --git a/libjava/classpath/java/util/SimpleTimeZone.java b/libjava/classpath/java/util/SimpleTimeZone.java
index 4f18401..6b3b55f 100644
--- a/libjava/classpath/java/util/SimpleTimeZone.java
+++ b/libjava/classpath/java/util/SimpleTimeZone.java
@@ -211,7 +211,7 @@ public class SimpleTimeZone extends TimeZone
* @serial
*/
private byte[] monthLength = monthArr;
- private static final byte[] monthArr =
+ private static final byte[] monthArr =
{
31, 28, 31, 30, 31, 30, 31, 31, 30,
31, 30, 31
@@ -382,7 +382,7 @@ public class SimpleTimeZone extends TimeZone
int endTime, int endTimeMode, int dstSavings)
{
this(rawOffset, id, startMonth, startDayOfWeekInMonth, startDayOfWeek,
- startTime, endMonth, endDayOfWeekInMonth, endDayOfWeek, endTime);
+ startTime, endMonth, endDayOfWeekInMonth, endDayOfWeek, endTime);
if (startTimeMode < WALL_TIME || startTimeMode > UTC_TIME)
throw new IllegalArgumentException("startTimeMode must be one of WALL_TIME, STANDARD_TIME, or UTC_TIME");
@@ -425,28 +425,28 @@ public class SimpleTimeZone extends TimeZone
int daysInMonth = getDaysInMonth(month, 1);
if (dayOfWeek == 0)
{
- if (day <= 0 || day > daysInMonth)
- throw new IllegalArgumentException("day out of range");
- return DOM_MODE;
+ if (day <= 0 || day > daysInMonth)
+ throw new IllegalArgumentException("day out of range");
+ return DOM_MODE;
}
else if (dayOfWeek > 0)
{
- if (Math.abs(day) > (daysInMonth + 6) / 7)
- throw new IllegalArgumentException("dayOfWeekInMonth out of range");
- if (dayOfWeek > Calendar.SATURDAY)
- throw new IllegalArgumentException("dayOfWeek out of range");
- return DOW_IN_MONTH_MODE;
+ if (Math.abs(day) > (daysInMonth + 6) / 7)
+ throw new IllegalArgumentException("dayOfWeekInMonth out of range");
+ if (dayOfWeek > Calendar.SATURDAY)
+ throw new IllegalArgumentException("dayOfWeek out of range");
+ return DOW_IN_MONTH_MODE;
}
else
{
- if (day == 0 || Math.abs(day) > daysInMonth)
- throw new IllegalArgumentException("day out of range");
- if (dayOfWeek < -Calendar.SATURDAY)
- throw new IllegalArgumentException("dayOfWeek out of range");
- if (day < 0)
- return DOW_LE_DOM_MODE;
- else
- return DOW_GE_DOM_MODE;
+ if (day == 0 || Math.abs(day) > daysInMonth)
+ throw new IllegalArgumentException("day out of range");
+ if (dayOfWeek < -Calendar.SATURDAY)
+ throw new IllegalArgumentException("dayOfWeek out of range");
+ if (day < 0)
+ return DOW_LE_DOM_MODE;
+ else
+ return DOW_GE_DOM_MODE;
}
}
@@ -641,45 +641,45 @@ public class SimpleTimeZone extends TimeZone
int daylightSavings = 0;
if (useDaylight && era == GregorianCalendar.AD && year >= startYear)
{
- int orig_year = year;
- int time = startTime + (startTimeMode == UTC_TIME ? rawOffset : 0);
- // This does only work for Gregorian calendars :-(
- // This is mainly because setStartYear doesn't take an era.
- boolean afterStart = ! isBefore(year, month, day, dayOfWeek, millis,
- startMode, startMonth, startDay,
- startDayOfWeek, time);
- millis += dstSavings;
- if (millis >= 24 * 60 * 60 * 1000)
- {
- millis -= 24 * 60 * 60 * 1000;
- dayOfWeek = (dayOfWeek % 7) + 1;
- if (++day > daysInMonth)
- {
- day = 1;
- if (month++ == Calendar.DECEMBER)
- {
- month = Calendar.JANUARY;
- year++;
- }
- }
- }
- time = endTime + (endTimeMode == UTC_TIME ? rawOffset : 0);
- if (endTimeMode != WALL_TIME)
- time += dstSavings;
- boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis,
- endMode, endMonth, endDay, endDayOfWeek,
- time);
-
- if (year != orig_year)
- afterStart = false;
- if (startMonth < endMonth)
- // use daylight savings, if the date is after the start of
- // savings, and before the end of savings.
- daylightSavings = afterStart && beforeEnd ? dstSavings : 0;
- else
- // use daylight savings, if the date is before the end of
- // savings, or after the start of savings.
- daylightSavings = beforeEnd || afterStart ? dstSavings : 0;
+ int orig_year = year;
+ int time = startTime + (startTimeMode == UTC_TIME ? rawOffset : 0);
+ // This does only work for Gregorian calendars :-(
+ // This is mainly because setStartYear doesn't take an era.
+ boolean afterStart = ! isBefore(year, month, day, dayOfWeek, millis,
+ startMode, startMonth, startDay,
+ startDayOfWeek, time);
+ millis += dstSavings;
+ if (millis >= 24 * 60 * 60 * 1000)
+ {
+ millis -= 24 * 60 * 60 * 1000;
+ dayOfWeek = (dayOfWeek % 7) + 1;
+ if (++day > daysInMonth)
+ {
+ day = 1;
+ if (month++ == Calendar.DECEMBER)
+ {
+ month = Calendar.JANUARY;
+ year++;
+ }
+ }
+ }
+ time = endTime + (endTimeMode == UTC_TIME ? rawOffset : 0);
+ if (endTimeMode != WALL_TIME)
+ time += dstSavings;
+ boolean beforeEnd = isBefore(year, month, day, dayOfWeek, millis,
+ endMode, endMonth, endDay, endDayOfWeek,
+ time);
+
+ if (year != orig_year)
+ afterStart = false;
+ if (startMonth < endMonth)
+ // use daylight savings, if the date is after the start of
+ // savings, and before the end of savings.
+ daylightSavings = afterStart && beforeEnd ? dstSavings : 0;
+ else
+ // use daylight savings, if the date is before the end of
+ // savings, or after the start of savings.
+ daylightSavings = beforeEnd || afterStart ? dstSavings : 0;
}
return rawOffset + daylightSavings;
}
@@ -748,19 +748,19 @@ public class SimpleTimeZone extends TimeZone
* @param year The year.
*/
private int getDaysInMonth(int month, int year)
- {
+ {
if (month == Calendar.FEBRUARY)
{
- if ((year & 3) != 0)
- return 28;
+ if ((year & 3) != 0)
+ return 28;
- // Assume default Gregorian cutover,
- // all years prior to this must be Julian
- if (year < 1582)
- return 29;
+ // Assume default Gregorian cutover,
+ // all years prior to this must be Julian
+ if (year < 1582)
+ return 29;
- // Gregorian rules
- return ((year % 100) != 0 || (year % 400) == 0) ? 29 : 28;
+ // Gregorian rules
+ return ((year % 100) != 0 || (year % 400) == 0) ? 29 : 28;
}
else
return monthArr[month];
@@ -800,66 +800,66 @@ public class SimpleTimeZone extends TimeZone
switch (mode)
{
case DOM_MODE:
- if (calDayOfMonth != day)
- return calDayOfMonth < day;
- break;
+ if (calDayOfMonth != day)
+ return calDayOfMonth < day;
+ break;
case DOW_IN_MONTH_MODE:
{
- // This computes the day of month of the day of type
- // "dayOfWeek" that lies in the same (sunday based) week as cal.
- calDayOfMonth += (dayOfWeek - calDayOfWeek);
-
- // Now we convert it to 7 based number (to get a one based offset
- // after dividing by 7). If we count from the end of the
- // month, we get want a -7 based number counting the days from
- // the end:
- if (day < 0)
- calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7;
- else
- calDayOfMonth += 6;
-
- // day > 0 day < 0
- // S M T W T F S S M T W T F S
- // 7 8 9 10 11 12 -36-35-34-33-32-31
- // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24
- // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17
- // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10
- // 34 35 36 -9 -8 -7
- // Now we calculate the day of week in month:
- int week = calDayOfMonth / 7;
-
- // day > 0 day < 0
- // S M T W T F S S M T W T F S
- // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4
- // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3
- // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2
- // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1
- // 4 5 5 -1 -1 -1
- if (week != day)
- return week < day;
-
- if (calDayOfWeek != dayOfWeek)
- return calDayOfWeek < dayOfWeek;
-
- // daylight savings starts/ends on the given day.
- break;
+ // This computes the day of month of the day of type
+ // "dayOfWeek" that lies in the same (sunday based) week as cal.
+ calDayOfMonth += (dayOfWeek - calDayOfWeek);
+
+ // Now we convert it to 7 based number (to get a one based offset
+ // after dividing by 7). If we count from the end of the
+ // month, we get want a -7 based number counting the days from
+ // the end:
+ if (day < 0)
+ calDayOfMonth -= getDaysInMonth(calMonth, calYear) + 7;
+ else
+ calDayOfMonth += 6;
+
+ // day > 0 day < 0
+ // S M T W T F S S M T W T F S
+ // 7 8 9 10 11 12 -36-35-34-33-32-31
+ // 13 14 15 16 17 18 19 -30-29-28-27-26-25-24
+ // 20 21 22 23 24 25 26 -23-22-21-20-19-18-17
+ // 27 28 29 30 31 32 33 -16-15-14-13-12-11-10
+ // 34 35 36 -9 -8 -7
+ // Now we calculate the day of week in month:
+ int week = calDayOfMonth / 7;
+
+ // day > 0 day < 0
+ // S M T W T F S S M T W T F S
+ // 1 1 1 1 1 1 -5 -5 -4 -4 -4 -4
+ // 1 2 2 2 2 2 2 -4 -4 -4 -3 -3 -3 -3
+ // 2 3 3 3 3 3 3 -3 -3 -3 -2 -2 -2 -2
+ // 3 4 4 4 4 4 4 -2 -2 -2 -1 -1 -1 -1
+ // 4 5 5 -1 -1 -1
+ if (week != day)
+ return week < day;
+
+ if (calDayOfWeek != dayOfWeek)
+ return calDayOfWeek < dayOfWeek;
+
+ // daylight savings starts/ends on the given day.
+ break;
}
case DOW_LE_DOM_MODE:
- // The greatest sunday before or equal December, 12
- // is the same as smallest sunday after or equal December, 6.
- day = Math.abs(day) - 6;
+ // The greatest sunday before or equal December, 12
+ // is the same as smallest sunday after or equal December, 6.
+ day = Math.abs(day) - 6;
case DOW_GE_DOM_MODE:
- // Calculate the day of month of the day of type
- // "dayOfWeek" that lies before (or on) the given date.
- calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek
- - dayOfWeek;
- if (calDayOfMonth < day)
- return true;
- if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7)
- return false;
-
- // now we have the same day
- break;
+ // Calculate the day of month of the day of type
+ // "dayOfWeek" that lies before (or on) the given date.
+ calDayOfMonth -= (calDayOfWeek < dayOfWeek ? 7 : 0) + calDayOfWeek
+ - dayOfWeek;
+ if (calDayOfMonth < day)
+ return true;
+ if (calDayOfWeek != dayOfWeek || calDayOfMonth >= day + 7)
+ return false;
+
+ // now we have the same day
+ break;
}
// the millis decides:
@@ -971,28 +971,28 @@ public class SimpleTimeZone extends TimeZone
input.defaultReadObject();
if (serialVersionOnStream == 0)
{
- // initialize the new fields to default values.
- dstSavings = 60 * 60 * 1000;
- endMode = DOW_IN_MONTH_MODE;
- startMode = DOW_IN_MONTH_MODE;
- startTimeMode = WALL_TIME;
- endTimeMode = WALL_TIME;
- serialVersionOnStream = 2;
+ // initialize the new fields to default values.
+ dstSavings = 60 * 60 * 1000;
+ endMode = DOW_IN_MONTH_MODE;
+ startMode = DOW_IN_MONTH_MODE;
+ startTimeMode = WALL_TIME;
+ endTimeMode = WALL_TIME;
+ serialVersionOnStream = 2;
}
else
{
- int length = input.readInt();
- byte[] byteArray = new byte[length];
- input.read(byteArray, 0, length);
- if (length >= 4)
- {
- // Lets hope that Sun does extensions to the serialized
- // form in a sane manner.
- startDay = byteArray[0];
- startDayOfWeek = byteArray[1];
- endDay = byteArray[2];
- endDayOfWeek = byteArray[3];
- }
+ int length = input.readInt();
+ byte[] byteArray = new byte[length];
+ input.read(byteArray, 0, length);
+ if (length >= 4)
+ {
+ // Lets hope that Sun does extensions to the serialized
+ // form in a sane manner.
+ startDay = byteArray[0];
+ startDayOfWeek = byteArray[1];
+ endDay = byteArray[2];
+ endDayOfWeek = byteArray[3];
+ }
}
}
@@ -1025,22 +1025,22 @@ public class SimpleTimeZone extends TimeZone
switch (startMode)
{
case DOM_MODE:
- startDayOfWeek = Calendar.SUNDAY; // random day of week
+ startDayOfWeek = Calendar.SUNDAY; // random day of week
// fall through
case DOW_GE_DOM_MODE:
case DOW_LE_DOM_MODE:
- startDay = (startDay + 6) / 7;
+ startDay = (startDay + 6) / 7;
}
switch (endMode)
{
case DOM_MODE:
- endDayOfWeek = Calendar.SUNDAY;
+ endDayOfWeek = Calendar.SUNDAY;
// fall through
case DOW_GE_DOM_MODE:
case DOW_LE_DOM_MODE:
- endDay = (endDay + 6) / 7;
+ endDay = (endDay + 6) / 7;
}
// the required part:
diff --git a/libjava/classpath/java/util/StringTokenizer.java b/libjava/classpath/java/util/StringTokenizer.java
index b230c73..d16ec9b 100644
--- a/libjava/classpath/java/util/StringTokenizer.java
+++ b/libjava/classpath/java/util/StringTokenizer.java
@@ -189,7 +189,7 @@ public class StringTokenizer implements Enumeration
int start = pos;
while (++pos < len && delim.indexOf(str.charAt(pos)) < 0)
;
-
+
return str.substring(start, pos);
}
throw new NoSuchElementException();
diff --git a/libjava/classpath/java/util/TimeZone.java b/libjava/classpath/java/util/TimeZone.java
index 681a6a2..86a6291 100644
--- a/libjava/classpath/java/util/TimeZone.java
+++ b/libjava/classpath/java/util/TimeZone.java
@@ -50,7 +50,7 @@ import java.text.DateFormatSymbols;
/**
* This class represents a time zone offset and handles daylight savings.
- *
+ *
* You can get the default time zone with getDefault.
* This represents the time zone where program is running.
*
@@ -100,36 +100,36 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
private static synchronized TimeZone defaultZone()
{
/* Look up default timezone */
- if (defaultZone0 == null)
+ if (defaultZone0 == null)
{
- defaultZone0 = (TimeZone) AccessController.doPrivileged
- (new PrivilegedAction()
- {
- public Object run()
- {
- TimeZone zone = null;
-
- // Prefer System property user.timezone.
- String tzid = System.getProperty("user.timezone");
- if (tzid != null && !tzid.equals(""))
- zone = getDefaultTimeZone(tzid);
-
- // Try platfom specific way.
- if (zone == null)
- zone = VMTimeZone.getDefaultTimeZoneId();
-
- // Fall back on GMT.
- if (zone == null)
- zone = getTimeZone ("GMT");
-
- return zone;
- }
- });
+ defaultZone0 = (TimeZone) AccessController.doPrivileged
+ (new PrivilegedAction()
+ {
+ public Object run()
+ {
+ TimeZone zone = null;
+
+ // Prefer System property user.timezone.
+ String tzid = System.getProperty("user.timezone");
+ if (tzid != null && !tzid.equals(""))
+ zone = getDefaultTimeZone(tzid);
+
+ // Try platfom specific way.
+ if (zone == null)
+ zone = VMTimeZone.getDefaultTimeZoneId();
+
+ // Fall back on GMT.
+ if (zone == null)
+ zone = getTimeZone ("GMT");
+
+ return zone;
+ }
+ });
}
-
- return defaultZone0;
+
+ return defaultZone0;
}
-
+
private static final long serialVersionUID = 3581463369166924961L;
/**
@@ -149,756 +149,756 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
private static HashMap aliases0;
/**
- * HashMap for timezones by ID.
+ * HashMap for timezones by ID.
*/
private static HashMap timezones0;
/* initialize this static field lazily to overhead if
- * it is not needed:
+ * it is not needed:
*/
// Package-private to avoid a trampoline.
static HashMap timezones()
{
- if (timezones0 == null)
+ if (timezones0 == null)
{
- HashMap timezones = new HashMap();
- timezones0 = timezones;
-
- zoneinfo_dir = SystemProperties.getProperty("gnu.java.util.zoneinfo.dir");
- if (zoneinfo_dir != null && !new File(zoneinfo_dir).isDirectory())
- zoneinfo_dir = null;
-
- if (zoneinfo_dir != null)
- {
- aliases0 = new HashMap();
-
- // These deprecated aliases for JDK 1.1.x compatibility
- // should take precedence over data files read from
- // /usr/share/zoneinfo.
- aliases0.put("ACT", "Australia/Darwin");
- aliases0.put("AET", "Australia/Sydney");
- aliases0.put("AGT", "America/Argentina/Buenos_Aires");
- aliases0.put("ART", "Africa/Cairo");
- aliases0.put("AST", "America/Juneau");
- aliases0.put("BST", "Asia/Colombo");
- aliases0.put("CAT", "Africa/Gaborone");
- aliases0.put("CNT", "America/St_Johns");
- aliases0.put("CST", "CST6CDT");
- aliases0.put("CTT", "Asia/Brunei");
- aliases0.put("EAT", "Indian/Comoro");
- aliases0.put("ECT", "CET");
- aliases0.put("EST", "EST5EDT");
- aliases0.put("EST5", "EST5EDT");
- aliases0.put("IET", "EST5EDT");
- aliases0.put("IST", "Asia/Calcutta");
- aliases0.put("JST", "Asia/Seoul");
- aliases0.put("MIT", "Pacific/Niue");
- aliases0.put("MST", "MST7MDT");
- aliases0.put("MST7", "MST7MDT");
- aliases0.put("NET", "Indian/Mauritius");
- aliases0.put("NST", "Pacific/Auckland");
- aliases0.put("PLT", "Indian/Kerguelen");
- aliases0.put("PNT", "MST7MDT");
- aliases0.put("PRT", "America/Anguilla");
- aliases0.put("PST", "PST8PDT");
- aliases0.put("SST", "Pacific/Ponape");
- aliases0.put("VST", "Asia/Bangkok");
- return timezones;
- }
-
- TimeZone tz;
- // Automatically generated by scripts/timezones.pl
- // XXX - Should we read this data from a file?
- tz = new SimpleTimeZone(-11000 * 3600, "MIT");
- timezones0.put("MIT", tz);
- timezones0.put("Pacific/Apia", tz);
- timezones0.put("Pacific/Midway", tz);
- timezones0.put("Pacific/Niue", tz);
- timezones0.put("Pacific/Pago_Pago", tz);
- tz = new SimpleTimeZone
- (-10000 * 3600, "America/Adak",
- Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Adak", tz);
- tz = new SimpleTimeZone(-10000 * 3600, "HST");
- timezones0.put("HST", tz);
- timezones0.put("Pacific/Fakaofo", tz);
- timezones0.put("Pacific/Honolulu", tz);
- timezones0.put("Pacific/Johnston", tz);
- timezones0.put("Pacific/Rarotonga", tz);
- timezones0.put("Pacific/Tahiti", tz);
- tz = new SimpleTimeZone(-9500 * 3600, "Pacific/Marquesas");
- timezones0.put("Pacific/Marquesas", tz);
- tz = new SimpleTimeZone
- (-9000 * 3600, "AST",
- Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("AST", tz);
- timezones0.put("America/Anchorage", tz);
- timezones0.put("America/Juneau", tz);
- timezones0.put("America/Nome", tz);
- timezones0.put("America/Yakutat", tz);
- tz = new SimpleTimeZone(-9000 * 3600, "Pacific/Gambier");
- timezones0.put("Pacific/Gambier", tz);
- tz = new SimpleTimeZone
- (-8000 * 3600, "America/Tijuana",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Tijuana", tz);
- tz = new SimpleTimeZone
- (-8000 * 3600, "PST",
- Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("PST", tz);
- timezones0.put("PST8PDT", tz);
- timezones0.put("America/Dawson", tz);
- timezones0.put("America/Los_Angeles", tz);
- timezones0.put("America/Vancouver", tz);
- timezones0.put("America/Whitehorse", tz);
- timezones0.put("US/Pacific-New", tz);
- tz = new SimpleTimeZone(-8000 * 3600, "Pacific/Pitcairn");
- timezones0.put("Pacific/Pitcairn", tz);
- tz = new SimpleTimeZone
- (-7000 * 3600, "America/Chihuahua",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Chihuahua", tz);
- timezones0.put("America/Mazatlan", tz);
- tz = new SimpleTimeZone(-7000 * 3600, "MST7");
- timezones0.put("MST7", tz);
- timezones0.put("PNT", tz);
- timezones0.put("America/Dawson_Creek", tz);
- timezones0.put("America/Hermosillo", tz);
- timezones0.put("America/Phoenix", tz);
- tz = new SimpleTimeZone
- (-7000 * 3600, "MST",
- Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("MST", tz);
- timezones0.put("MST7MDT", tz);
- timezones0.put("America/Boise", tz);
- timezones0.put("America/Cambridge_Bay", tz);
- timezones0.put("America/Denver", tz);
- timezones0.put("America/Edmonton", tz);
- timezones0.put("America/Inuvik", tz);
- timezones0.put("America/Shiprock", tz);
- timezones0.put("America/Yellowknife", tz);
- tz = new SimpleTimeZone
- (-6000 * 3600, "America/Cancun",
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Cancun", tz);
- timezones0.put("America/Merida", tz);
- timezones0.put("America/Mexico_City", tz);
- timezones0.put("America/Monterrey", tz);
- tz = new SimpleTimeZone(-6000 * 3600, "America/Belize");
- timezones0.put("America/Belize", tz);
- timezones0.put("America/Costa_Rica", tz);
- timezones0.put("America/El_Salvador", tz);
- timezones0.put("America/Guatemala", tz);
- timezones0.put("America/Managua", tz);
- timezones0.put("America/Regina", tz);
- timezones0.put("America/Swift_Current", tz);
- timezones0.put("America/Tegucigalpa", tz);
- timezones0.put("Pacific/Galapagos", tz);
- tz = new SimpleTimeZone
- (-6000 * 3600, "CST",
- Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("CST", tz);
- timezones0.put("CST6CDT", tz);
- timezones0.put("America/Chicago", tz);
- timezones0.put("America/Indiana/Knox", tz);
- timezones0.put("America/Indiana/Petersburg", tz);
- timezones0.put("America/Indiana/Vincennes", tz);
- timezones0.put("America/Menominee", tz);
- timezones0.put("America/North_Dakota/Center", tz);
- timezones0.put("America/North_Dakota/New_Salem", tz);
- timezones0.put("America/Rainy_River", tz);
- timezones0.put("America/Rankin_Inlet", tz);
- timezones0.put("America/Winnipeg", tz);
- tz = new SimpleTimeZone
- (-6000 * 3600, "Pacific/Easter",
- Calendar.OCTOBER, 2, Calendar.SATURDAY, 22000 * 3600,
- Calendar.MARCH, 2, Calendar.SATURDAY, 22000 * 3600);
- timezones0.put("Pacific/Easter", tz);
- tz = new SimpleTimeZone(-5000 * 3600, "EST5");
- timezones0.put("EST5", tz);
- timezones0.put("IET", tz);
- timezones0.put("America/Atikokan", tz);
- timezones0.put("America/Bogota", tz);
- timezones0.put("America/Cayman", tz);
- timezones0.put("America/Eirunepe", tz);
- timezones0.put("America/Guayaquil", tz);
- timezones0.put("America/Jamaica", tz);
- timezones0.put("America/Lima", tz);
- timezones0.put("America/Panama", tz);
- timezones0.put("America/Rio_Branco", tz);
- tz = new SimpleTimeZone
- (-5000 * 3600, "America/Havana",
- Calendar.APRIL, 1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
- timezones0.put("America/Havana", tz);
- tz = new SimpleTimeZone
- (-5000 * 3600, "America/Grand_Turk",
- Calendar.APRIL, 1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Grand_Turk", tz);
- timezones0.put("America/Port-au-Prince", tz);
- tz = new SimpleTimeZone
- (-5000 * 3600, "EST",
- Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("EST", tz);
- timezones0.put("EST5EDT", tz);
- timezones0.put("America/Detroit", tz);
- timezones0.put("America/Indiana/Indianapolis", tz);
- timezones0.put("America/Indiana/Marengo", tz);
- timezones0.put("America/Indiana/Vevay", tz);
- timezones0.put("America/Iqaluit", tz);
- timezones0.put("America/Kentucky/Louisville", tz);
- timezones0.put("America/Kentucky/Monticello", tz);
- timezones0.put("America/Montreal", tz);
- timezones0.put("America/Nassau", tz);
- timezones0.put("America/New_York", tz);
- timezones0.put("America/Nipigon", tz);
- timezones0.put("America/Pangnirtung", tz);
- timezones0.put("America/Thunder_Bay", tz);
- timezones0.put("America/Toronto", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Asuncion",
- Calendar.OCTOBER, 3, Calendar.SUNDAY, 0 * 3600,
- Calendar.MARCH, 2, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Asuncion", tz);
- tz = new SimpleTimeZone(-4000 * 3600, "PRT");
- timezones0.put("PRT", tz);
- timezones0.put("America/Anguilla", tz);
- timezones0.put("America/Antigua", tz);
- timezones0.put("America/Aruba", tz);
- timezones0.put("America/Barbados", tz);
- timezones0.put("America/Blanc-Sablon", tz);
- timezones0.put("America/Boa_Vista", tz);
- timezones0.put("America/Caracas", tz);
- timezones0.put("America/Curacao", tz);
- timezones0.put("America/Dominica", tz);
- timezones0.put("America/Grenada", tz);
- timezones0.put("America/Guadeloupe", tz);
- timezones0.put("America/Guyana", tz);
- timezones0.put("America/La_Paz", tz);
- timezones0.put("America/Manaus", tz);
- timezones0.put("America/Martinique", tz);
- timezones0.put("America/Montserrat", tz);
- timezones0.put("America/Port_of_Spain", tz);
- timezones0.put("America/Porto_Velho", tz);
- timezones0.put("America/Puerto_Rico", tz);
- timezones0.put("America/Santo_Domingo", tz);
- timezones0.put("America/St_Kitts", tz);
- timezones0.put("America/St_Lucia", tz);
- timezones0.put("America/St_Thomas", tz);
- timezones0.put("America/St_Vincent", tz);
- timezones0.put("America/Tortola", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Campo_Grande",
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0 * 3600,
- Calendar.FEBRUARY, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Campo_Grande", tz);
- timezones0.put("America/Cuiaba", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Goose_Bay",
- Calendar.MARCH, 2, Calendar.SUNDAY, 60000,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 60000);
- timezones0.put("America/Goose_Bay", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Glace_Bay",
- Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Glace_Bay", tz);
- timezones0.put("America/Halifax", tz);
- timezones0.put("America/Moncton", tz);
- timezones0.put("America/Thule", tz);
- timezones0.put("Atlantic/Bermuda", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "America/Santiago",
- Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
- Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Santiago", tz);
- timezones0.put("Antarctica/Palmer", tz);
- tz = new SimpleTimeZone
- (-4000 * 3600, "Atlantic/Stanley",
- Calendar.SEPTEMBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.APRIL, 3, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Atlantic/Stanley", tz);
- tz = new SimpleTimeZone
- (-3500 * 3600, "CNT",
- Calendar.MARCH, 2, Calendar.SUNDAY, 60000,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 60000);
- timezones0.put("CNT", tz);
- timezones0.put("America/St_Johns", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Godthab",
- Calendar.MARCH, 30, -Calendar.SATURDAY, 22000 * 3600,
- Calendar.OCTOBER, 30, -Calendar.SATURDAY, 23000 * 3600);
- timezones0.put("America/Godthab", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Miquelon",
- Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Miquelon", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Montevideo",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("America/Montevideo", tz);
- tz = new SimpleTimeZone
- (-3000 * 3600, "America/Sao_Paulo",
- Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0 * 3600,
- Calendar.FEBRUARY, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("America/Sao_Paulo", tz);
- tz = new SimpleTimeZone(-3000 * 3600, "AGT");
- timezones0.put("AGT", tz);
- timezones0.put("America/Araguaina", tz);
- timezones0.put("America/Argentina/Buenos_Aires", tz);
- timezones0.put("America/Argentina/Catamarca", tz);
- timezones0.put("America/Argentina/Cordoba", tz);
- timezones0.put("America/Argentina/Jujuy", tz);
- timezones0.put("America/Argentina/La_Rioja", tz);
- timezones0.put("America/Argentina/Mendoza", tz);
- timezones0.put("America/Argentina/Rio_Gallegos", tz);
- timezones0.put("America/Argentina/San_Juan", tz);
- timezones0.put("America/Argentina/Tucuman", tz);
- timezones0.put("America/Argentina/Ushuaia", tz);
- timezones0.put("America/Bahia", tz);
- timezones0.put("America/Belem", tz);
- timezones0.put("America/Cayenne", tz);
- timezones0.put("America/Fortaleza", tz);
- timezones0.put("America/Maceio", tz);
- timezones0.put("America/Paramaribo", tz);
- timezones0.put("America/Recife", tz);
- timezones0.put("Antarctica/Rothera", tz);
- tz = new SimpleTimeZone(-2000 * 3600, "America/Noronha");
- timezones0.put("America/Noronha", tz);
- timezones0.put("Atlantic/South_Georgia", tz);
- tz = new SimpleTimeZone
- (-1000 * 3600, "America/Scoresbysund",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
- timezones0.put("America/Scoresbysund", tz);
- timezones0.put("Atlantic/Azores", tz);
- tz = new SimpleTimeZone(-1000 * 3600, "Atlantic/Cape_Verde");
- timezones0.put("Atlantic/Cape_Verde", tz);
- tz = new SimpleTimeZone(0 * 3600, "GMT");
- timezones0.put("GMT", tz);
- timezones0.put("UTC", tz);
- timezones0.put("Africa/Abidjan", tz);
- timezones0.put("Africa/Accra", tz);
- timezones0.put("Africa/Bamako", tz);
- timezones0.put("Africa/Banjul", tz);
- timezones0.put("Africa/Bissau", tz);
- timezones0.put("Africa/Casablanca", tz);
- timezones0.put("Africa/Conakry", tz);
- timezones0.put("Africa/Dakar", tz);
- timezones0.put("Africa/El_Aaiun", tz);
- timezones0.put("Africa/Freetown", tz);
- timezones0.put("Africa/Lome", tz);
- timezones0.put("Africa/Monrovia", tz);
- timezones0.put("Africa/Nouakchott", tz);
- timezones0.put("Africa/Ouagadougou", tz);
- timezones0.put("Africa/Sao_Tome", tz);
- timezones0.put("America/Danmarkshavn", tz);
- timezones0.put("Atlantic/Reykjavik", tz);
- timezones0.put("Atlantic/St_Helena", tz);
- tz = new SimpleTimeZone
- (0 * 3600, "WET",
- Calendar.MARCH, -1, Calendar.SUNDAY, 1000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("WET", tz);
- timezones0.put("Atlantic/Canary", tz);
- timezones0.put("Atlantic/Faroe", tz);
- timezones0.put("Atlantic/Madeira", tz);
- timezones0.put("Europe/Dublin", tz);
- timezones0.put("Europe/Guernsey", tz);
- timezones0.put("Europe/Isle_of_Man", tz);
- timezones0.put("Europe/Jersey", tz);
- timezones0.put("Europe/Lisbon", tz);
- timezones0.put("Europe/London", tz);
- tz = new SimpleTimeZone(1000 * 3600, "Africa/Algiers");
- timezones0.put("Africa/Algiers", tz);
- timezones0.put("Africa/Bangui", tz);
- timezones0.put("Africa/Brazzaville", tz);
- timezones0.put("Africa/Douala", tz);
- timezones0.put("Africa/Kinshasa", tz);
- timezones0.put("Africa/Lagos", tz);
- timezones0.put("Africa/Libreville", tz);
- timezones0.put("Africa/Luanda", tz);
- timezones0.put("Africa/Malabo", tz);
- timezones0.put("Africa/Ndjamena", tz);
- timezones0.put("Africa/Niamey", tz);
- timezones0.put("Africa/Porto-Novo", tz);
- tz = new SimpleTimeZone
- (1000 * 3600, "Africa/Windhoek",
- Calendar.SEPTEMBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600);
- timezones0.put("Africa/Windhoek", tz);
- tz = new SimpleTimeZone
- (1000 * 3600, "CET",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("CET", tz);
- timezones0.put("ECT", tz);
- timezones0.put("MET", tz);
- timezones0.put("Africa/Ceuta", tz);
- timezones0.put("Africa/Tunis", tz);
- timezones0.put("Arctic/Longyearbyen", tz);
- timezones0.put("Atlantic/Jan_Mayen", tz);
- timezones0.put("Europe/Amsterdam", tz);
- timezones0.put("Europe/Andorra", tz);
- timezones0.put("Europe/Belgrade", tz);
- timezones0.put("Europe/Berlin", tz);
- timezones0.put("Europe/Bratislava", tz);
- timezones0.put("Europe/Brussels", tz);
- timezones0.put("Europe/Budapest", tz);
- timezones0.put("Europe/Copenhagen", tz);
- timezones0.put("Europe/Gibraltar", tz);
- timezones0.put("Europe/Ljubljana", tz);
- timezones0.put("Europe/Luxembourg", tz);
- timezones0.put("Europe/Madrid", tz);
- timezones0.put("Europe/Malta", tz);
- timezones0.put("Europe/Monaco", tz);
- timezones0.put("Europe/Oslo", tz);
- timezones0.put("Europe/Paris", tz);
- timezones0.put("Europe/Podgorica", tz);
- timezones0.put("Europe/Prague", tz);
- timezones0.put("Europe/Rome", tz);
- timezones0.put("Europe/San_Marino", tz);
- timezones0.put("Europe/Sarajevo", tz);
- timezones0.put("Europe/Skopje", tz);
- timezones0.put("Europe/Stockholm", tz);
- timezones0.put("Europe/Tirane", tz);
- timezones0.put("Europe/Vaduz", tz);
- timezones0.put("Europe/Vatican", tz);
- timezones0.put("Europe/Vienna", tz);
- timezones0.put("Europe/Warsaw", tz);
- timezones0.put("Europe/Zagreb", tz);
- timezones0.put("Europe/Zurich", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "ART",
- Calendar.APRIL, -1, Calendar.FRIDAY, 0 * 3600,
- Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 24000 * 3600);
- timezones0.put("ART", tz);
- timezones0.put("Africa/Cairo", tz);
- tz = new SimpleTimeZone(2000 * 3600, "CAT");
- timezones0.put("CAT", tz);
- timezones0.put("Africa/Blantyre", tz);
- timezones0.put("Africa/Bujumbura", tz);
- timezones0.put("Africa/Gaborone", tz);
- timezones0.put("Africa/Harare", tz);
- timezones0.put("Africa/Johannesburg", tz);
- timezones0.put("Africa/Kigali", tz);
- timezones0.put("Africa/Lubumbashi", tz);
- timezones0.put("Africa/Lusaka", tz);
- timezones0.put("Africa/Maputo", tz);
- timezones0.put("Africa/Maseru", tz);
- timezones0.put("Africa/Mbabane", tz);
- timezones0.put("Africa/Tripoli", tz);
- timezones0.put("Asia/Jerusalem", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Amman",
- Calendar.MARCH, -1, Calendar.THURSDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.FRIDAY, 1000 * 3600);
- timezones0.put("Asia/Amman", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Beirut",
- Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
- timezones0.put("Asia/Beirut", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Damascus",
- Calendar.APRIL, 1, 0, 0 * 3600,
- Calendar.OCTOBER, 1, 0, 0 * 3600);
- timezones0.put("Asia/Damascus", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Asia/Gaza",
- Calendar.APRIL, 1, 0, 0 * 3600,
- Calendar.OCTOBER, 3, Calendar.FRIDAY, 0 * 3600);
- timezones0.put("Asia/Gaza", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "EET",
- Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 4000 * 3600);
- timezones0.put("EET", tz);
- timezones0.put("Asia/Istanbul", tz);
- timezones0.put("Asia/Nicosia", tz);
- timezones0.put("Europe/Athens", tz);
- timezones0.put("Europe/Bucharest", tz);
- timezones0.put("Europe/Chisinau", tz);
- timezones0.put("Europe/Helsinki", tz);
- timezones0.put("Europe/Istanbul", tz);
- timezones0.put("Europe/Kiev", tz);
- timezones0.put("Europe/Mariehamn", tz);
- timezones0.put("Europe/Nicosia", tz);
- timezones0.put("Europe/Riga", tz);
- timezones0.put("Europe/Simferopol", tz);
- timezones0.put("Europe/Sofia", tz);
- timezones0.put("Europe/Tallinn", tz);
- timezones0.put("Europe/Uzhgorod", tz);
- timezones0.put("Europe/Vilnius", tz);
- timezones0.put("Europe/Zaporozhye", tz);
- tz = new SimpleTimeZone
- (2000 * 3600, "Europe/Kaliningrad",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Europe/Kaliningrad", tz);
- timezones0.put("Europe/Minsk", tz);
- tz = new SimpleTimeZone
- (3000 * 3600, "Asia/Baghdad",
- Calendar.APRIL, 1, 0, 3000 * 3600,
- Calendar.OCTOBER, 1, 0, 4000 * 3600);
- timezones0.put("Asia/Baghdad", tz);
- tz = new SimpleTimeZone
- (3000 * 3600, "Europe/Moscow",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Europe/Moscow", tz);
- timezones0.put("Europe/Volgograd", tz);
- tz = new SimpleTimeZone(3000 * 3600, "EAT");
- timezones0.put("EAT", tz);
- timezones0.put("Africa/Addis_Ababa", tz);
- timezones0.put("Africa/Asmara", tz);
- timezones0.put("Africa/Dar_es_Salaam", tz);
- timezones0.put("Africa/Djibouti", tz);
- timezones0.put("Africa/Kampala", tz);
- timezones0.put("Africa/Khartoum", tz);
- timezones0.put("Africa/Mogadishu", tz);
- timezones0.put("Africa/Nairobi", tz);
- timezones0.put("Antarctica/Syowa", tz);
- timezones0.put("Asia/Aden", tz);
- timezones0.put("Asia/Bahrain", tz);
- timezones0.put("Asia/Kuwait", tz);
- timezones0.put("Asia/Qatar", tz);
- timezones0.put("Asia/Riyadh", tz);
- timezones0.put("Indian/Antananarivo", tz);
- timezones0.put("Indian/Comoro", tz);
- timezones0.put("Indian/Mayotte", tz);
- tz = new SimpleTimeZone(3500 * 3600, "Asia/Tehran");
- timezones0.put("Asia/Tehran", tz);
- tz = new SimpleTimeZone
- (4000 * 3600, "Asia/Baku",
- Calendar.MARCH, -1, Calendar.SUNDAY, 4000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 5000 * 3600);
- timezones0.put("Asia/Baku", tz);
- tz = new SimpleTimeZone
- (4000 * 3600, "Asia/Yerevan",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Asia/Yerevan", tz);
- timezones0.put("Europe/Samara", tz);
- tz = new SimpleTimeZone(4000 * 3600, "NET");
- timezones0.put("NET", tz);
- timezones0.put("Asia/Dubai", tz);
- timezones0.put("Asia/Muscat", tz);
- timezones0.put("Asia/Tbilisi", tz);
- timezones0.put("Indian/Mahe", tz);
- timezones0.put("Indian/Mauritius", tz);
- timezones0.put("Indian/Reunion", tz);
- tz = new SimpleTimeZone(4500 * 3600, "Asia/Kabul");
- timezones0.put("Asia/Kabul", tz);
- tz = new SimpleTimeZone
- (5000 * 3600, "Asia/Yekaterinburg",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Asia/Yekaterinburg", tz);
- tz = new SimpleTimeZone(5000 * 3600, "PLT");
- timezones0.put("PLT", tz);
- timezones0.put("Asia/Aqtau", tz);
- timezones0.put("Asia/Aqtobe", tz);
- timezones0.put("Asia/Ashgabat", tz);
- timezones0.put("Asia/Dushanbe", tz);
- timezones0.put("Asia/Karachi", tz);
- timezones0.put("Asia/Oral", tz);
- timezones0.put("Asia/Samarkand", tz);
- timezones0.put("Asia/Tashkent", tz);
- timezones0.put("Indian/Kerguelen", tz);
- timezones0.put("Indian/Maldives", tz);
- tz = new SimpleTimeZone(5500 * 3600, "BST");
- timezones0.put("BST", tz);
- timezones0.put("IST", tz);
- timezones0.put("Asia/Calcutta", tz);
- timezones0.put("Asia/Colombo", tz);
- tz = new SimpleTimeZone(5750 * 3600, "Asia/Katmandu");
- timezones0.put("Asia/Katmandu", tz);
- tz = new SimpleTimeZone(6000 * 3600, "Antarctica/Mawson");
- timezones0.put("Antarctica/Mawson", tz);
- timezones0.put("Antarctica/Vostok", tz);
- timezones0.put("Asia/Almaty", tz);
- timezones0.put("Asia/Bishkek", tz);
- timezones0.put("Asia/Dhaka", tz);
- timezones0.put("Asia/Qyzylorda", tz);
- timezones0.put("Asia/Thimphu", tz);
- timezones0.put("Indian/Chagos", tz);
- tz = new SimpleTimeZone
- (6000 * 3600, "Asia/Novosibirsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Asia/Novosibirsk", tz);
- timezones0.put("Asia/Omsk", tz);
- tz = new SimpleTimeZone(6500 * 3600, "Asia/Rangoon");
- timezones0.put("Asia/Rangoon", tz);
- timezones0.put("Indian/Cocos", tz);
- tz = new SimpleTimeZone(7000 * 3600, "VST");
- timezones0.put("VST", tz);
- timezones0.put("Antarctica/Davis", tz);
- timezones0.put("Asia/Bangkok", tz);
- timezones0.put("Asia/Jakarta", tz);
- timezones0.put("Asia/Phnom_Penh", tz);
- timezones0.put("Asia/Pontianak", tz);
- timezones0.put("Asia/Saigon", tz);
- timezones0.put("Asia/Vientiane", tz);
- timezones0.put("Indian/Christmas", tz);
- tz = new SimpleTimeZone
- (7000 * 3600, "Asia/Hovd",
- Calendar.MARCH, -1, Calendar.SATURDAY, 2000 * 3600,
- Calendar.SEPTEMBER, -1, Calendar.SATURDAY, 2000 * 3600);
- timezones0.put("Asia/Hovd", tz);
- tz = new SimpleTimeZone
- (7000 * 3600, "Asia/Krasnoyarsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Asia/Krasnoyarsk", tz);
- tz = new SimpleTimeZone(8000 * 3600, "CTT");
- timezones0.put("CTT", tz);
- timezones0.put("Antarctica/Casey", tz);
- timezones0.put("Asia/Brunei", tz);
- timezones0.put("Asia/Chongqing", tz);
- timezones0.put("Asia/Harbin", tz);
- timezones0.put("Asia/Hong_Kong", tz);
- timezones0.put("Asia/Kashgar", tz);
- timezones0.put("Asia/Kuala_Lumpur", tz);
- timezones0.put("Asia/Kuching", tz);
- timezones0.put("Asia/Macau", tz);
- timezones0.put("Asia/Makassar", tz);
- timezones0.put("Asia/Manila", tz);
- timezones0.put("Asia/Shanghai", tz);
- timezones0.put("Asia/Singapore", tz);
- timezones0.put("Asia/Taipei", tz);
- timezones0.put("Asia/Urumqi", tz);
- timezones0.put("Australia/Perth", tz);
- tz = new SimpleTimeZone
- (8000 * 3600, "Asia/Irkutsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Asia/Irkutsk", tz);
- tz = new SimpleTimeZone
- (8000 * 3600, "Asia/Ulaanbaatar",
- Calendar.MARCH, -1, Calendar.SATURDAY, 2000 * 3600,
- Calendar.SEPTEMBER, -1, Calendar.SATURDAY, 2000 * 3600);
- timezones0.put("Asia/Ulaanbaatar", tz);
- tz = new SimpleTimeZone(8750 * 3600, "Australia/Eucla");
- timezones0.put("Australia/Eucla", tz);
- tz = new SimpleTimeZone
- (9000 * 3600, "Asia/Choibalsan",
- Calendar.MARCH, -1, Calendar.SATURDAY, 2000 * 3600,
- Calendar.SEPTEMBER, -1, Calendar.SATURDAY, 2000 * 3600);
- timezones0.put("Asia/Choibalsan", tz);
- tz = new SimpleTimeZone(9000 * 3600, "JST");
- timezones0.put("JST", tz);
- timezones0.put("Asia/Dili", tz);
- timezones0.put("Asia/Jayapura", tz);
- timezones0.put("Asia/Pyongyang", tz);
- timezones0.put("Asia/Seoul", tz);
- timezones0.put("Asia/Tokyo", tz);
- timezones0.put("Pacific/Palau", tz);
- tz = new SimpleTimeZone
- (9000 * 3600, "Asia/Yakutsk",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Asia/Yakutsk", tz);
- tz = new SimpleTimeZone
- (9500 * 3600, "Australia/Adelaide",
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Australia/Adelaide", tz);
- timezones0.put("Australia/Broken_Hill", tz);
- tz = new SimpleTimeZone(9500 * 3600, "ACT");
- timezones0.put("ACT", tz);
- timezones0.put("Australia/Darwin", tz);
- tz = new SimpleTimeZone(10000 * 3600, "Antarctica/DumontDUrville");
- timezones0.put("Antarctica/DumontDUrville", tz);
- timezones0.put("Australia/Brisbane", tz);
- timezones0.put("Australia/Lindeman", tz);
- timezones0.put("Pacific/Guam", tz);
- timezones0.put("Pacific/Port_Moresby", tz);
- timezones0.put("Pacific/Saipan", tz);
- timezones0.put("Pacific/Truk", tz);
- tz = new SimpleTimeZone
- (10000 * 3600, "Asia/Sakhalin",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Asia/Sakhalin", tz);
- timezones0.put("Asia/Vladivostok", tz);
- tz = new SimpleTimeZone
- (10000 * 3600, "Australia/Currie",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Australia/Currie", tz);
- timezones0.put("Australia/Hobart", tz);
- tz = new SimpleTimeZone
- (10000 * 3600, "AET",
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("AET", tz);
- timezones0.put("Australia/Melbourne", tz);
- timezones0.put("Australia/Sydney", tz);
- tz = new SimpleTimeZone
- (10500 * 3600, "Australia/Lord_Howe",
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600, 500 * 3600);
- timezones0.put("Australia/Lord_Howe", tz);
- tz = new SimpleTimeZone
- (11000 * 3600, "Asia/Magadan",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Asia/Magadan", tz);
- tz = new SimpleTimeZone(11000 * 3600, "SST");
- timezones0.put("SST", tz);
- timezones0.put("Pacific/Efate", tz);
- timezones0.put("Pacific/Guadalcanal", tz);
- timezones0.put("Pacific/Kosrae", tz);
- timezones0.put("Pacific/Noumea", tz);
- timezones0.put("Pacific/Ponape", tz);
- tz = new SimpleTimeZone(11500 * 3600, "Pacific/Norfolk");
- timezones0.put("Pacific/Norfolk", tz);
- tz = new SimpleTimeZone
- (12000 * 3600, "NST",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.MARCH, 3, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("NST", tz);
- timezones0.put("Antarctica/McMurdo", tz);
- timezones0.put("Antarctica/South_Pole", tz);
- timezones0.put("Pacific/Auckland", tz);
- tz = new SimpleTimeZone
- (12000 * 3600, "Asia/Anadyr",
- Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
- Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
- timezones0.put("Asia/Anadyr", tz);
- timezones0.put("Asia/Kamchatka", tz);
- tz = new SimpleTimeZone(12000 * 3600, "Pacific/Fiji");
- timezones0.put("Pacific/Fiji", tz);
- timezones0.put("Pacific/Funafuti", tz);
- timezones0.put("Pacific/Kwajalein", tz);
- timezones0.put("Pacific/Majuro", tz);
- timezones0.put("Pacific/Nauru", tz);
- timezones0.put("Pacific/Tarawa", tz);
- timezones0.put("Pacific/Wake", tz);
- timezones0.put("Pacific/Wallis", tz);
- tz = new SimpleTimeZone
- (12750 * 3600, "Pacific/Chatham",
- Calendar.OCTOBER, 1, Calendar.SUNDAY, 2750 * 3600,
- Calendar.MARCH, 3, Calendar.SUNDAY, 3750 * 3600);
- timezones0.put("Pacific/Chatham", tz);
- tz = new SimpleTimeZone(13000 * 3600, "Pacific/Enderbury");
- timezones0.put("Pacific/Enderbury", tz);
- timezones0.put("Pacific/Tongatapu", tz);
- tz = new SimpleTimeZone(14000 * 3600, "Pacific/Kiritimati");
- timezones0.put("Pacific/Kiritimati", tz);
+ HashMap timezones = new HashMap();
+ timezones0 = timezones;
+
+ zoneinfo_dir = SystemProperties.getProperty("gnu.java.util.zoneinfo.dir");
+ if (zoneinfo_dir != null && !new File(zoneinfo_dir).isDirectory())
+ zoneinfo_dir = null;
+
+ if (zoneinfo_dir != null)
+ {
+ aliases0 = new HashMap();
+
+ // These deprecated aliases for JDK 1.1.x compatibility
+ // should take precedence over data files read from
+ // /usr/share/zoneinfo.
+ aliases0.put("ACT", "Australia/Darwin");
+ aliases0.put("AET", "Australia/Sydney");
+ aliases0.put("AGT", "America/Argentina/Buenos_Aires");
+ aliases0.put("ART", "Africa/Cairo");
+ aliases0.put("AST", "America/Juneau");
+ aliases0.put("BST", "Asia/Colombo");
+ aliases0.put("CAT", "Africa/Gaborone");
+ aliases0.put("CNT", "America/St_Johns");
+ aliases0.put("CST", "CST6CDT");
+ aliases0.put("CTT", "Asia/Brunei");
+ aliases0.put("EAT", "Indian/Comoro");
+ aliases0.put("ECT", "CET");
+ aliases0.put("EST", "EST5EDT");
+ aliases0.put("EST5", "EST5EDT");
+ aliases0.put("IET", "EST5EDT");
+ aliases0.put("IST", "Asia/Calcutta");
+ aliases0.put("JST", "Asia/Seoul");
+ aliases0.put("MIT", "Pacific/Niue");
+ aliases0.put("MST", "MST7MDT");
+ aliases0.put("MST7", "MST7MDT");
+ aliases0.put("NET", "Indian/Mauritius");
+ aliases0.put("NST", "Pacific/Auckland");
+ aliases0.put("PLT", "Indian/Kerguelen");
+ aliases0.put("PNT", "MST7MDT");
+ aliases0.put("PRT", "America/Anguilla");
+ aliases0.put("PST", "PST8PDT");
+ aliases0.put("SST", "Pacific/Ponape");
+ aliases0.put("VST", "Asia/Bangkok");
+ return timezones;
+ }
+
+ TimeZone tz;
+ // Automatically generated by scripts/timezones.pl
+ // XXX - Should we read this data from a file?
+ tz = new SimpleTimeZone(-11000 * 3600, "MIT");
+ timezones0.put("MIT", tz);
+ timezones0.put("Pacific/Apia", tz);
+ timezones0.put("Pacific/Midway", tz);
+ timezones0.put("Pacific/Niue", tz);
+ timezones0.put("Pacific/Pago_Pago", tz);
+ tz = new SimpleTimeZone
+ (-10000 * 3600, "America/Adak",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Adak", tz);
+ tz = new SimpleTimeZone(-10000 * 3600, "HST");
+ timezones0.put("HST", tz);
+ timezones0.put("Pacific/Fakaofo", tz);
+ timezones0.put("Pacific/Honolulu", tz);
+ timezones0.put("Pacific/Johnston", tz);
+ timezones0.put("Pacific/Rarotonga", tz);
+ timezones0.put("Pacific/Tahiti", tz);
+ tz = new SimpleTimeZone(-9500 * 3600, "Pacific/Marquesas");
+ timezones0.put("Pacific/Marquesas", tz);
+ tz = new SimpleTimeZone
+ (-9000 * 3600, "AST",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("AST", tz);
+ timezones0.put("America/Anchorage", tz);
+ timezones0.put("America/Juneau", tz);
+ timezones0.put("America/Nome", tz);
+ timezones0.put("America/Yakutat", tz);
+ tz = new SimpleTimeZone(-9000 * 3600, "Pacific/Gambier");
+ timezones0.put("Pacific/Gambier", tz);
+ tz = new SimpleTimeZone
+ (-8000 * 3600, "America/Tijuana",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Tijuana", tz);
+ tz = new SimpleTimeZone
+ (-8000 * 3600, "PST",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("PST", tz);
+ timezones0.put("PST8PDT", tz);
+ timezones0.put("America/Dawson", tz);
+ timezones0.put("America/Los_Angeles", tz);
+ timezones0.put("America/Vancouver", tz);
+ timezones0.put("America/Whitehorse", tz);
+ timezones0.put("US/Pacific-New", tz);
+ tz = new SimpleTimeZone(-8000 * 3600, "Pacific/Pitcairn");
+ timezones0.put("Pacific/Pitcairn", tz);
+ tz = new SimpleTimeZone
+ (-7000 * 3600, "America/Chihuahua",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Chihuahua", tz);
+ timezones0.put("America/Mazatlan", tz);
+ tz = new SimpleTimeZone(-7000 * 3600, "MST7");
+ timezones0.put("MST7", tz);
+ timezones0.put("PNT", tz);
+ timezones0.put("America/Dawson_Creek", tz);
+ timezones0.put("America/Hermosillo", tz);
+ timezones0.put("America/Phoenix", tz);
+ tz = new SimpleTimeZone
+ (-7000 * 3600, "MST",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("MST", tz);
+ timezones0.put("MST7MDT", tz);
+ timezones0.put("America/Boise", tz);
+ timezones0.put("America/Cambridge_Bay", tz);
+ timezones0.put("America/Denver", tz);
+ timezones0.put("America/Edmonton", tz);
+ timezones0.put("America/Inuvik", tz);
+ timezones0.put("America/Shiprock", tz);
+ timezones0.put("America/Yellowknife", tz);
+ tz = new SimpleTimeZone
+ (-6000 * 3600, "America/Cancun",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Cancun", tz);
+ timezones0.put("America/Merida", tz);
+ timezones0.put("America/Mexico_City", tz);
+ timezones0.put("America/Monterrey", tz);
+ tz = new SimpleTimeZone(-6000 * 3600, "America/Belize");
+ timezones0.put("America/Belize", tz);
+ timezones0.put("America/Costa_Rica", tz);
+ timezones0.put("America/El_Salvador", tz);
+ timezones0.put("America/Guatemala", tz);
+ timezones0.put("America/Managua", tz);
+ timezones0.put("America/Regina", tz);
+ timezones0.put("America/Swift_Current", tz);
+ timezones0.put("America/Tegucigalpa", tz);
+ timezones0.put("Pacific/Galapagos", tz);
+ tz = new SimpleTimeZone
+ (-6000 * 3600, "CST",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("CST", tz);
+ timezones0.put("CST6CDT", tz);
+ timezones0.put("America/Chicago", tz);
+ timezones0.put("America/Indiana/Knox", tz);
+ timezones0.put("America/Indiana/Petersburg", tz);
+ timezones0.put("America/Indiana/Vincennes", tz);
+ timezones0.put("America/Menominee", tz);
+ timezones0.put("America/North_Dakota/Center", tz);
+ timezones0.put("America/North_Dakota/New_Salem", tz);
+ timezones0.put("America/Rainy_River", tz);
+ timezones0.put("America/Rankin_Inlet", tz);
+ timezones0.put("America/Winnipeg", tz);
+ tz = new SimpleTimeZone
+ (-6000 * 3600, "Pacific/Easter",
+ Calendar.OCTOBER, 2, Calendar.SATURDAY, 22000 * 3600,
+ Calendar.MARCH, 2, Calendar.SATURDAY, 22000 * 3600);
+ timezones0.put("Pacific/Easter", tz);
+ tz = new SimpleTimeZone(-5000 * 3600, "EST5");
+ timezones0.put("EST5", tz);
+ timezones0.put("IET", tz);
+ timezones0.put("America/Atikokan", tz);
+ timezones0.put("America/Bogota", tz);
+ timezones0.put("America/Cayman", tz);
+ timezones0.put("America/Eirunepe", tz);
+ timezones0.put("America/Guayaquil", tz);
+ timezones0.put("America/Jamaica", tz);
+ timezones0.put("America/Lima", tz);
+ timezones0.put("America/Panama", tz);
+ timezones0.put("America/Rio_Branco", tz);
+ tz = new SimpleTimeZone
+ (-5000 * 3600, "America/Havana",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
+ timezones0.put("America/Havana", tz);
+ tz = new SimpleTimeZone
+ (-5000 * 3600, "America/Grand_Turk",
+ Calendar.APRIL, 1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Grand_Turk", tz);
+ timezones0.put("America/Port-au-Prince", tz);
+ tz = new SimpleTimeZone
+ (-5000 * 3600, "EST",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("EST", tz);
+ timezones0.put("EST5EDT", tz);
+ timezones0.put("America/Detroit", tz);
+ timezones0.put("America/Indiana/Indianapolis", tz);
+ timezones0.put("America/Indiana/Marengo", tz);
+ timezones0.put("America/Indiana/Vevay", tz);
+ timezones0.put("America/Iqaluit", tz);
+ timezones0.put("America/Kentucky/Louisville", tz);
+ timezones0.put("America/Kentucky/Monticello", tz);
+ timezones0.put("America/Montreal", tz);
+ timezones0.put("America/Nassau", tz);
+ timezones0.put("America/New_York", tz);
+ timezones0.put("America/Nipigon", tz);
+ timezones0.put("America/Pangnirtung", tz);
+ timezones0.put("America/Thunder_Bay", tz);
+ timezones0.put("America/Toronto", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Asuncion",
+ Calendar.OCTOBER, 3, Calendar.SUNDAY, 0 * 3600,
+ Calendar.MARCH, 2, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Asuncion", tz);
+ tz = new SimpleTimeZone(-4000 * 3600, "PRT");
+ timezones0.put("PRT", tz);
+ timezones0.put("America/Anguilla", tz);
+ timezones0.put("America/Antigua", tz);
+ timezones0.put("America/Aruba", tz);
+ timezones0.put("America/Barbados", tz);
+ timezones0.put("America/Blanc-Sablon", tz);
+ timezones0.put("America/Boa_Vista", tz);
+ timezones0.put("America/Caracas", tz);
+ timezones0.put("America/Curacao", tz);
+ timezones0.put("America/Dominica", tz);
+ timezones0.put("America/Grenada", tz);
+ timezones0.put("America/Guadeloupe", tz);
+ timezones0.put("America/Guyana", tz);
+ timezones0.put("America/La_Paz", tz);
+ timezones0.put("America/Manaus", tz);
+ timezones0.put("America/Martinique", tz);
+ timezones0.put("America/Montserrat", tz);
+ timezones0.put("America/Port_of_Spain", tz);
+ timezones0.put("America/Porto_Velho", tz);
+ timezones0.put("America/Puerto_Rico", tz);
+ timezones0.put("America/Santo_Domingo", tz);
+ timezones0.put("America/St_Kitts", tz);
+ timezones0.put("America/St_Lucia", tz);
+ timezones0.put("America/St_Thomas", tz);
+ timezones0.put("America/St_Vincent", tz);
+ timezones0.put("America/Tortola", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Campo_Grande",
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.FEBRUARY, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Campo_Grande", tz);
+ timezones0.put("America/Cuiaba", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Goose_Bay",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 60000,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 60000);
+ timezones0.put("America/Goose_Bay", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Glace_Bay",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Glace_Bay", tz);
+ timezones0.put("America/Halifax", tz);
+ timezones0.put("America/Moncton", tz);
+ timezones0.put("America/Thule", tz);
+ timezones0.put("Atlantic/Bermuda", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "America/Santiago",
+ Calendar.OCTOBER, 9, -Calendar.SUNDAY, 0 * 3600,
+ Calendar.MARCH, 9, -Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Santiago", tz);
+ timezones0.put("Antarctica/Palmer", tz);
+ tz = new SimpleTimeZone
+ (-4000 * 3600, "Atlantic/Stanley",
+ Calendar.SEPTEMBER, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.APRIL, 3, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Atlantic/Stanley", tz);
+ tz = new SimpleTimeZone
+ (-3500 * 3600, "CNT",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 60000,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 60000);
+ timezones0.put("CNT", tz);
+ timezones0.put("America/St_Johns", tz);
+ tz = new SimpleTimeZone
+ (-3000 * 3600, "America/Godthab",
+ Calendar.MARCH, 30, -Calendar.SATURDAY, 22000 * 3600,
+ Calendar.OCTOBER, 30, -Calendar.SATURDAY, 23000 * 3600);
+ timezones0.put("America/Godthab", tz);
+ tz = new SimpleTimeZone
+ (-3000 * 3600, "America/Miquelon",
+ Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Miquelon", tz);
+ tz = new SimpleTimeZone
+ (-3000 * 3600, "America/Montevideo",
+ Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, 2, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("America/Montevideo", tz);
+ tz = new SimpleTimeZone
+ (-3000 * 3600, "America/Sao_Paulo",
+ Calendar.NOVEMBER, 1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.FEBRUARY, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("America/Sao_Paulo", tz);
+ tz = new SimpleTimeZone(-3000 * 3600, "AGT");
+ timezones0.put("AGT", tz);
+ timezones0.put("America/Araguaina", tz);
+ timezones0.put("America/Argentina/Buenos_Aires", tz);
+ timezones0.put("America/Argentina/Catamarca", tz);
+ timezones0.put("America/Argentina/Cordoba", tz);
+ timezones0.put("America/Argentina/Jujuy", tz);
+ timezones0.put("America/Argentina/La_Rioja", tz);
+ timezones0.put("America/Argentina/Mendoza", tz);
+ timezones0.put("America/Argentina/Rio_Gallegos", tz);
+ timezones0.put("America/Argentina/San_Juan", tz);
+ timezones0.put("America/Argentina/Tucuman", tz);
+ timezones0.put("America/Argentina/Ushuaia", tz);
+ timezones0.put("America/Bahia", tz);
+ timezones0.put("America/Belem", tz);
+ timezones0.put("America/Cayenne", tz);
+ timezones0.put("America/Fortaleza", tz);
+ timezones0.put("America/Maceio", tz);
+ timezones0.put("America/Paramaribo", tz);
+ timezones0.put("America/Recife", tz);
+ timezones0.put("Antarctica/Rothera", tz);
+ tz = new SimpleTimeZone(-2000 * 3600, "America/Noronha");
+ timezones0.put("America/Noronha", tz);
+ timezones0.put("Atlantic/South_Georgia", tz);
+ tz = new SimpleTimeZone
+ (-1000 * 3600, "America/Scoresbysund",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 1000 * 3600);
+ timezones0.put("America/Scoresbysund", tz);
+ timezones0.put("Atlantic/Azores", tz);
+ tz = new SimpleTimeZone(-1000 * 3600, "Atlantic/Cape_Verde");
+ timezones0.put("Atlantic/Cape_Verde", tz);
+ tz = new SimpleTimeZone(0 * 3600, "GMT");
+ timezones0.put("GMT", tz);
+ timezones0.put("UTC", tz);
+ timezones0.put("Africa/Abidjan", tz);
+ timezones0.put("Africa/Accra", tz);
+ timezones0.put("Africa/Bamako", tz);
+ timezones0.put("Africa/Banjul", tz);
+ timezones0.put("Africa/Bissau", tz);
+ timezones0.put("Africa/Casablanca", tz);
+ timezones0.put("Africa/Conakry", tz);
+ timezones0.put("Africa/Dakar", tz);
+ timezones0.put("Africa/El_Aaiun", tz);
+ timezones0.put("Africa/Freetown", tz);
+ timezones0.put("Africa/Lome", tz);
+ timezones0.put("Africa/Monrovia", tz);
+ timezones0.put("Africa/Nouakchott", tz);
+ timezones0.put("Africa/Ouagadougou", tz);
+ timezones0.put("Africa/Sao_Tome", tz);
+ timezones0.put("America/Danmarkshavn", tz);
+ timezones0.put("Atlantic/Reykjavik", tz);
+ timezones0.put("Atlantic/St_Helena", tz);
+ tz = new SimpleTimeZone
+ (0 * 3600, "WET",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 1000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("WET", tz);
+ timezones0.put("Atlantic/Canary", tz);
+ timezones0.put("Atlantic/Faroe", tz);
+ timezones0.put("Atlantic/Madeira", tz);
+ timezones0.put("Europe/Dublin", tz);
+ timezones0.put("Europe/Guernsey", tz);
+ timezones0.put("Europe/Isle_of_Man", tz);
+ timezones0.put("Europe/Jersey", tz);
+ timezones0.put("Europe/Lisbon", tz);
+ timezones0.put("Europe/London", tz);
+ tz = new SimpleTimeZone(1000 * 3600, "Africa/Algiers");
+ timezones0.put("Africa/Algiers", tz);
+ timezones0.put("Africa/Bangui", tz);
+ timezones0.put("Africa/Brazzaville", tz);
+ timezones0.put("Africa/Douala", tz);
+ timezones0.put("Africa/Kinshasa", tz);
+ timezones0.put("Africa/Lagos", tz);
+ timezones0.put("Africa/Libreville", tz);
+ timezones0.put("Africa/Luanda", tz);
+ timezones0.put("Africa/Malabo", tz);
+ timezones0.put("Africa/Ndjamena", tz);
+ timezones0.put("Africa/Niamey", tz);
+ timezones0.put("Africa/Porto-Novo", tz);
+ tz = new SimpleTimeZone
+ (1000 * 3600, "Africa/Windhoek",
+ Calendar.SEPTEMBER, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.APRIL, 1, Calendar.SUNDAY, 2000 * 3600);
+ timezones0.put("Africa/Windhoek", tz);
+ tz = new SimpleTimeZone
+ (1000 * 3600, "CET",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("CET", tz);
+ timezones0.put("ECT", tz);
+ timezones0.put("MET", tz);
+ timezones0.put("Africa/Ceuta", tz);
+ timezones0.put("Africa/Tunis", tz);
+ timezones0.put("Arctic/Longyearbyen", tz);
+ timezones0.put("Atlantic/Jan_Mayen", tz);
+ timezones0.put("Europe/Amsterdam", tz);
+ timezones0.put("Europe/Andorra", tz);
+ timezones0.put("Europe/Belgrade", tz);
+ timezones0.put("Europe/Berlin", tz);
+ timezones0.put("Europe/Bratislava", tz);
+ timezones0.put("Europe/Brussels", tz);
+ timezones0.put("Europe/Budapest", tz);
+ timezones0.put("Europe/Copenhagen", tz);
+ timezones0.put("Europe/Gibraltar", tz);
+ timezones0.put("Europe/Ljubljana", tz);
+ timezones0.put("Europe/Luxembourg", tz);
+ timezones0.put("Europe/Madrid", tz);
+ timezones0.put("Europe/Malta", tz);
+ timezones0.put("Europe/Monaco", tz);
+ timezones0.put("Europe/Oslo", tz);
+ timezones0.put("Europe/Paris", tz);
+ timezones0.put("Europe/Podgorica", tz);
+ timezones0.put("Europe/Prague", tz);
+ timezones0.put("Europe/Rome", tz);
+ timezones0.put("Europe/San_Marino", tz);
+ timezones0.put("Europe/Sarajevo", tz);
+ timezones0.put("Europe/Skopje", tz);
+ timezones0.put("Europe/Stockholm", tz);
+ timezones0.put("Europe/Tirane", tz);
+ timezones0.put("Europe/Vaduz", tz);
+ timezones0.put("Europe/Vatican", tz);
+ timezones0.put("Europe/Vienna", tz);
+ timezones0.put("Europe/Warsaw", tz);
+ timezones0.put("Europe/Zagreb", tz);
+ timezones0.put("Europe/Zurich", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "ART",
+ Calendar.APRIL, -1, Calendar.FRIDAY, 0 * 3600,
+ Calendar.SEPTEMBER, -1, Calendar.THURSDAY, 24000 * 3600);
+ timezones0.put("ART", tz);
+ timezones0.put("Africa/Cairo", tz);
+ tz = new SimpleTimeZone(2000 * 3600, "CAT");
+ timezones0.put("CAT", tz);
+ timezones0.put("Africa/Blantyre", tz);
+ timezones0.put("Africa/Bujumbura", tz);
+ timezones0.put("Africa/Gaborone", tz);
+ timezones0.put("Africa/Harare", tz);
+ timezones0.put("Africa/Johannesburg", tz);
+ timezones0.put("Africa/Kigali", tz);
+ timezones0.put("Africa/Lubumbashi", tz);
+ timezones0.put("Africa/Lusaka", tz);
+ timezones0.put("Africa/Maputo", tz);
+ timezones0.put("Africa/Maseru", tz);
+ timezones0.put("Africa/Mbabane", tz);
+ timezones0.put("Africa/Tripoli", tz);
+ timezones0.put("Asia/Jerusalem", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Amman",
+ Calendar.MARCH, -1, Calendar.THURSDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.FRIDAY, 1000 * 3600);
+ timezones0.put("Asia/Amman", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Beirut",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 0 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 0 * 3600);
+ timezones0.put("Asia/Beirut", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Damascus",
+ Calendar.APRIL, 1, 0, 0 * 3600,
+ Calendar.OCTOBER, 1, 0, 0 * 3600);
+ timezones0.put("Asia/Damascus", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Asia/Gaza",
+ Calendar.APRIL, 1, 0, 0 * 3600,
+ Calendar.OCTOBER, 3, Calendar.FRIDAY, 0 * 3600);
+ timezones0.put("Asia/Gaza", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "EET",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 4000 * 3600);
+ timezones0.put("EET", tz);
+ timezones0.put("Asia/Istanbul", tz);
+ timezones0.put("Asia/Nicosia", tz);
+ timezones0.put("Europe/Athens", tz);
+ timezones0.put("Europe/Bucharest", tz);
+ timezones0.put("Europe/Chisinau", tz);
+ timezones0.put("Europe/Helsinki", tz);
+ timezones0.put("Europe/Istanbul", tz);
+ timezones0.put("Europe/Kiev", tz);
+ timezones0.put("Europe/Mariehamn", tz);
+ timezones0.put("Europe/Nicosia", tz);
+ timezones0.put("Europe/Riga", tz);
+ timezones0.put("Europe/Simferopol", tz);
+ timezones0.put("Europe/Sofia", tz);
+ timezones0.put("Europe/Tallinn", tz);
+ timezones0.put("Europe/Uzhgorod", tz);
+ timezones0.put("Europe/Vilnius", tz);
+ timezones0.put("Europe/Zaporozhye", tz);
+ tz = new SimpleTimeZone
+ (2000 * 3600, "Europe/Kaliningrad",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Europe/Kaliningrad", tz);
+ timezones0.put("Europe/Minsk", tz);
+ tz = new SimpleTimeZone
+ (3000 * 3600, "Asia/Baghdad",
+ Calendar.APRIL, 1, 0, 3000 * 3600,
+ Calendar.OCTOBER, 1, 0, 4000 * 3600);
+ timezones0.put("Asia/Baghdad", tz);
+ tz = new SimpleTimeZone
+ (3000 * 3600, "Europe/Moscow",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Europe/Moscow", tz);
+ timezones0.put("Europe/Volgograd", tz);
+ tz = new SimpleTimeZone(3000 * 3600, "EAT");
+ timezones0.put("EAT", tz);
+ timezones0.put("Africa/Addis_Ababa", tz);
+ timezones0.put("Africa/Asmara", tz);
+ timezones0.put("Africa/Dar_es_Salaam", tz);
+ timezones0.put("Africa/Djibouti", tz);
+ timezones0.put("Africa/Kampala", tz);
+ timezones0.put("Africa/Khartoum", tz);
+ timezones0.put("Africa/Mogadishu", tz);
+ timezones0.put("Africa/Nairobi", tz);
+ timezones0.put("Antarctica/Syowa", tz);
+ timezones0.put("Asia/Aden", tz);
+ timezones0.put("Asia/Bahrain", tz);
+ timezones0.put("Asia/Kuwait", tz);
+ timezones0.put("Asia/Qatar", tz);
+ timezones0.put("Asia/Riyadh", tz);
+ timezones0.put("Indian/Antananarivo", tz);
+ timezones0.put("Indian/Comoro", tz);
+ timezones0.put("Indian/Mayotte", tz);
+ tz = new SimpleTimeZone(3500 * 3600, "Asia/Tehran");
+ timezones0.put("Asia/Tehran", tz);
+ tz = new SimpleTimeZone
+ (4000 * 3600, "Asia/Baku",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 4000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 5000 * 3600);
+ timezones0.put("Asia/Baku", tz);
+ tz = new SimpleTimeZone
+ (4000 * 3600, "Asia/Yerevan",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Asia/Yerevan", tz);
+ timezones0.put("Europe/Samara", tz);
+ tz = new SimpleTimeZone(4000 * 3600, "NET");
+ timezones0.put("NET", tz);
+ timezones0.put("Asia/Dubai", tz);
+ timezones0.put("Asia/Muscat", tz);
+ timezones0.put("Asia/Tbilisi", tz);
+ timezones0.put("Indian/Mahe", tz);
+ timezones0.put("Indian/Mauritius", tz);
+ timezones0.put("Indian/Reunion", tz);
+ tz = new SimpleTimeZone(4500 * 3600, "Asia/Kabul");
+ timezones0.put("Asia/Kabul", tz);
+ tz = new SimpleTimeZone
+ (5000 * 3600, "Asia/Yekaterinburg",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Asia/Yekaterinburg", tz);
+ tz = new SimpleTimeZone(5000 * 3600, "PLT");
+ timezones0.put("PLT", tz);
+ timezones0.put("Asia/Aqtau", tz);
+ timezones0.put("Asia/Aqtobe", tz);
+ timezones0.put("Asia/Ashgabat", tz);
+ timezones0.put("Asia/Dushanbe", tz);
+ timezones0.put("Asia/Karachi", tz);
+ timezones0.put("Asia/Oral", tz);
+ timezones0.put("Asia/Samarkand", tz);
+ timezones0.put("Asia/Tashkent", tz);
+ timezones0.put("Indian/Kerguelen", tz);
+ timezones0.put("Indian/Maldives", tz);
+ tz = new SimpleTimeZone(5500 * 3600, "BST");
+ timezones0.put("BST", tz);
+ timezones0.put("IST", tz);
+ timezones0.put("Asia/Calcutta", tz);
+ timezones0.put("Asia/Colombo", tz);
+ tz = new SimpleTimeZone(5750 * 3600, "Asia/Katmandu");
+ timezones0.put("Asia/Katmandu", tz);
+ tz = new SimpleTimeZone(6000 * 3600, "Antarctica/Mawson");
+ timezones0.put("Antarctica/Mawson", tz);
+ timezones0.put("Antarctica/Vostok", tz);
+ timezones0.put("Asia/Almaty", tz);
+ timezones0.put("Asia/Bishkek", tz);
+ timezones0.put("Asia/Dhaka", tz);
+ timezones0.put("Asia/Qyzylorda", tz);
+ timezones0.put("Asia/Thimphu", tz);
+ timezones0.put("Indian/Chagos", tz);
+ tz = new SimpleTimeZone
+ (6000 * 3600, "Asia/Novosibirsk",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Asia/Novosibirsk", tz);
+ timezones0.put("Asia/Omsk", tz);
+ tz = new SimpleTimeZone(6500 * 3600, "Asia/Rangoon");
+ timezones0.put("Asia/Rangoon", tz);
+ timezones0.put("Indian/Cocos", tz);
+ tz = new SimpleTimeZone(7000 * 3600, "VST");
+ timezones0.put("VST", tz);
+ timezones0.put("Antarctica/Davis", tz);
+ timezones0.put("Asia/Bangkok", tz);
+ timezones0.put("Asia/Jakarta", tz);
+ timezones0.put("Asia/Phnom_Penh", tz);
+ timezones0.put("Asia/Pontianak", tz);
+ timezones0.put("Asia/Saigon", tz);
+ timezones0.put("Asia/Vientiane", tz);
+ timezones0.put("Indian/Christmas", tz);
+ tz = new SimpleTimeZone
+ (7000 * 3600, "Asia/Hovd",
+ Calendar.MARCH, -1, Calendar.SATURDAY, 2000 * 3600,
+ Calendar.SEPTEMBER, -1, Calendar.SATURDAY, 2000 * 3600);
+ timezones0.put("Asia/Hovd", tz);
+ tz = new SimpleTimeZone
+ (7000 * 3600, "Asia/Krasnoyarsk",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Asia/Krasnoyarsk", tz);
+ tz = new SimpleTimeZone(8000 * 3600, "CTT");
+ timezones0.put("CTT", tz);
+ timezones0.put("Antarctica/Casey", tz);
+ timezones0.put("Asia/Brunei", tz);
+ timezones0.put("Asia/Chongqing", tz);
+ timezones0.put("Asia/Harbin", tz);
+ timezones0.put("Asia/Hong_Kong", tz);
+ timezones0.put("Asia/Kashgar", tz);
+ timezones0.put("Asia/Kuala_Lumpur", tz);
+ timezones0.put("Asia/Kuching", tz);
+ timezones0.put("Asia/Macau", tz);
+ timezones0.put("Asia/Makassar", tz);
+ timezones0.put("Asia/Manila", tz);
+ timezones0.put("Asia/Shanghai", tz);
+ timezones0.put("Asia/Singapore", tz);
+ timezones0.put("Asia/Taipei", tz);
+ timezones0.put("Asia/Urumqi", tz);
+ timezones0.put("Australia/Perth", tz);
+ tz = new SimpleTimeZone
+ (8000 * 3600, "Asia/Irkutsk",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Asia/Irkutsk", tz);
+ tz = new SimpleTimeZone
+ (8000 * 3600, "Asia/Ulaanbaatar",
+ Calendar.MARCH, -1, Calendar.SATURDAY, 2000 * 3600,
+ Calendar.SEPTEMBER, -1, Calendar.SATURDAY, 2000 * 3600);
+ timezones0.put("Asia/Ulaanbaatar", tz);
+ tz = new SimpleTimeZone(8750 * 3600, "Australia/Eucla");
+ timezones0.put("Australia/Eucla", tz);
+ tz = new SimpleTimeZone
+ (9000 * 3600, "Asia/Choibalsan",
+ Calendar.MARCH, -1, Calendar.SATURDAY, 2000 * 3600,
+ Calendar.SEPTEMBER, -1, Calendar.SATURDAY, 2000 * 3600);
+ timezones0.put("Asia/Choibalsan", tz);
+ tz = new SimpleTimeZone(9000 * 3600, "JST");
+ timezones0.put("JST", tz);
+ timezones0.put("Asia/Dili", tz);
+ timezones0.put("Asia/Jayapura", tz);
+ timezones0.put("Asia/Pyongyang", tz);
+ timezones0.put("Asia/Seoul", tz);
+ timezones0.put("Asia/Tokyo", tz);
+ timezones0.put("Pacific/Palau", tz);
+ tz = new SimpleTimeZone
+ (9000 * 3600, "Asia/Yakutsk",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Asia/Yakutsk", tz);
+ tz = new SimpleTimeZone
+ (9500 * 3600, "Australia/Adelaide",
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Australia/Adelaide", tz);
+ timezones0.put("Australia/Broken_Hill", tz);
+ tz = new SimpleTimeZone(9500 * 3600, "ACT");
+ timezones0.put("ACT", tz);
+ timezones0.put("Australia/Darwin", tz);
+ tz = new SimpleTimeZone(10000 * 3600, "Antarctica/DumontDUrville");
+ timezones0.put("Antarctica/DumontDUrville", tz);
+ timezones0.put("Australia/Brisbane", tz);
+ timezones0.put("Australia/Lindeman", tz);
+ timezones0.put("Pacific/Guam", tz);
+ timezones0.put("Pacific/Port_Moresby", tz);
+ timezones0.put("Pacific/Saipan", tz);
+ timezones0.put("Pacific/Truk", tz);
+ tz = new SimpleTimeZone
+ (10000 * 3600, "Asia/Sakhalin",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Asia/Sakhalin", tz);
+ timezones0.put("Asia/Vladivostok", tz);
+ tz = new SimpleTimeZone
+ (10000 * 3600, "Australia/Currie",
+ Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Australia/Currie", tz);
+ timezones0.put("Australia/Hobart", tz);
+ tz = new SimpleTimeZone
+ (10000 * 3600, "AET",
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("AET", tz);
+ timezones0.put("Australia/Melbourne", tz);
+ timezones0.put("Australia/Sydney", tz);
+ tz = new SimpleTimeZone
+ (10500 * 3600, "Australia/Lord_Howe",
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600, 500 * 3600);
+ timezones0.put("Australia/Lord_Howe", tz);
+ tz = new SimpleTimeZone
+ (11000 * 3600, "Asia/Magadan",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Asia/Magadan", tz);
+ tz = new SimpleTimeZone(11000 * 3600, "SST");
+ timezones0.put("SST", tz);
+ timezones0.put("Pacific/Efate", tz);
+ timezones0.put("Pacific/Guadalcanal", tz);
+ timezones0.put("Pacific/Kosrae", tz);
+ timezones0.put("Pacific/Noumea", tz);
+ timezones0.put("Pacific/Ponape", tz);
+ tz = new SimpleTimeZone(11500 * 3600, "Pacific/Norfolk");
+ timezones0.put("Pacific/Norfolk", tz);
+ tz = new SimpleTimeZone
+ (12000 * 3600, "NST",
+ Calendar.OCTOBER, 1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.MARCH, 3, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("NST", tz);
+ timezones0.put("Antarctica/McMurdo", tz);
+ timezones0.put("Antarctica/South_Pole", tz);
+ timezones0.put("Pacific/Auckland", tz);
+ tz = new SimpleTimeZone
+ (12000 * 3600, "Asia/Anadyr",
+ Calendar.MARCH, -1, Calendar.SUNDAY, 2000 * 3600,
+ Calendar.OCTOBER, -1, Calendar.SUNDAY, 3000 * 3600);
+ timezones0.put("Asia/Anadyr", tz);
+ timezones0.put("Asia/Kamchatka", tz);
+ tz = new SimpleTimeZone(12000 * 3600, "Pacific/Fiji");
+ timezones0.put("Pacific/Fiji", tz);
+ timezones0.put("Pacific/Funafuti", tz);
+ timezones0.put("Pacific/Kwajalein", tz);
+ timezones0.put("Pacific/Majuro", tz);
+ timezones0.put("Pacific/Nauru", tz);
+ timezones0.put("Pacific/Tarawa", tz);
+ timezones0.put("Pacific/Wake", tz);
+ timezones0.put("Pacific/Wallis", tz);
+ tz = new SimpleTimeZone
+ (12750 * 3600, "Pacific/Chatham",
+ Calendar.OCTOBER, 1, Calendar.SUNDAY, 2750 * 3600,
+ Calendar.MARCH, 3, Calendar.SUNDAY, 3750 * 3600);
+ timezones0.put("Pacific/Chatham", tz);
+ tz = new SimpleTimeZone(13000 * 3600, "Pacific/Enderbury");
+ timezones0.put("Pacific/Enderbury", tz);
+ timezones0.put("Pacific/Tongatapu", tz);
+ tz = new SimpleTimeZone(14000 * 3600, "Pacific/Kiritimati");
+ timezones0.put("Pacific/Kiritimati", tz);
}
return timezones0;
}
@@ -909,7 +909,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
* with the result of System.getProperty("user.timezone")
* or getDefaultTimeZoneId(). Note that giving one of
* the standard tz data names from ftp://elsie.nci.nih.gov/pub/ is
- * preferred.
+ * preferred.
* The time zone name can be given as follows:
* (standard zone name)[(GMT offset)[(DST zone name)[DST offset]]]
*
@@ -954,175 +954,175 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
int dstOffs;
try
{
- int idLength = sysTimeZoneId.length();
-
- int index = 0;
- int prevIndex;
- char c;
-
- // get std
- do
- c = sysTimeZoneId.charAt(index);
- while (c != '+' && c != '-' && c != ',' && c != ':'
- && ! Character.isDigit(c) && c != '\0' && ++index < idLength);
-
- if (index >= idLength)
- return getTimeZoneInternal(sysTimeZoneId);
-
- stdName = sysTimeZoneId.substring(0, index);
- prevIndex = index;
-
- // get the std offset
- do
- c = sysTimeZoneId.charAt(index++);
- while ((c == '-' || c == '+' || c == ':' || Character.isDigit(c))
- && index < idLength);
- if (index < idLength)
- index--;
-
- { // convert the dst string to a millis number
- String offset = sysTimeZoneId.substring(prevIndex, index);
- prevIndex = index;
-
- if (offset.charAt(0) == '+' || offset.charAt(0) == '-')
- stdOffs = parseTime(offset.substring(1));
- else
- stdOffs = parseTime(offset);
-
- if (offset.charAt(0) == '-')
- stdOffs = -stdOffs;
-
- // TZ timezone offsets are positive when WEST of the meridian.
- stdOffs = -stdOffs;
- }
-
- // Done yet? (Format: std offset)
- if (index >= idLength)
- {
- // Do we have an existing timezone with that name and offset?
- TimeZone tz = getTimeZoneInternal(stdName);
- if (tz != null)
- if (tz.getRawOffset() == stdOffs)
- return tz;
-
- // Custom then.
- return new SimpleTimeZone(stdOffs, stdName);
- }
-
- // get dst
- do
- c = sysTimeZoneId.charAt(index);
- while (c != '+' && c != '-' && c != ',' && c != ':'
- && ! Character.isDigit(c) && c != '\0' && ++index < idLength);
-
- // Done yet? (Format: std offset dst)
- if (index >= idLength)
- {
- // Do we have an existing timezone with that name and offset
- // which has DST?
- TimeZone tz = getTimeZoneInternal(stdName);
- if (tz != null)
- if (tz.getRawOffset() == stdOffs && tz.useDaylightTime())
- return tz;
-
- // Custom then.
- return new SimpleTimeZone(stdOffs, stdName);
- }
-
- // get the dst offset
- prevIndex = index;
- do
- c = sysTimeZoneId.charAt(index++);
- while ((c == '-' || c == '+' || c == ':' || Character.isDigit(c))
- && index < idLength);
- if (index < idLength)
- index--;
-
- if (index == prevIndex && (c == ',' || c == ';'))
- {
- // Missing dst offset defaults to one hour ahead of standard
- // time.
- dstOffs = stdOffs + 60 * 60 * 1000;
- }
- else
- { // convert the dst string to a millis number
- String offset = sysTimeZoneId.substring(prevIndex, index);
- prevIndex = index;
-
- if (offset.charAt(0) == '+' || offset.charAt(0) == '-')
- dstOffs = parseTime(offset.substring(1));
- else
- dstOffs = parseTime(offset);
-
- if (offset.charAt(0) == '-')
- dstOffs = -dstOffs;
-
- // TZ timezone offsets are positive when WEST of the meridian.
- dstOffs = -dstOffs;
- }
-
- // Done yet? (Format: std offset dst offset)
- // FIXME: We don't support DST without a rule given. Should we?
- if (index >= idLength)
- {
- // Time Zone existing with same name, dst and offsets?
- TimeZone tz = getTimeZoneInternal(stdName);
- if (tz != null)
- if (tz.getRawOffset() == stdOffs && tz.useDaylightTime()
- && tz.getDSTSavings() == (dstOffs - stdOffs))
- return tz;
-
- return new SimpleTimeZone(stdOffs, stdName);
- }
-
- // get the DST rule
- if (sysTimeZoneId.charAt(index) == ','
- || sysTimeZoneId.charAt(index) == ';')
- {
- index++;
- int offs = index;
- while (sysTimeZoneId.charAt(index) != ','
- && sysTimeZoneId.charAt(index) != ';')
- index++;
- String startTime = sysTimeZoneId.substring(offs, index);
- index++;
- String endTime = sysTimeZoneId.substring(index);
-
- index = startTime.indexOf('/');
- int startMillis;
- int endMillis;
- String startDate;
- String endDate;
- if (index != -1)
- {
- startDate = startTime.substring(0, index);
- startMillis = parseTime(startTime.substring(index + 1));
- }
- else
- {
- startDate = startTime;
- // if time isn't given, default to 2:00:00 AM.
- startMillis = 2 * 60 * 60 * 1000;
- }
- index = endTime.indexOf('/');
- if (index != -1)
- {
- endDate = endTime.substring(0, index);
- endMillis = parseTime(endTime.substring(index + 1));
- }
- else
- {
- endDate = endTime;
- // if time isn't given, default to 2:00:00 AM.
- endMillis = 2 * 60 * 60 * 1000;
- }
-
- int[] start = getDateParams(startDate);
- int[] end = getDateParams(endDate);
- return new SimpleTimeZone(stdOffs, stdName, start[0], start[1],
- start[2], startMillis, end[0], end[1],
- end[2], endMillis, (dstOffs - stdOffs));
- }
+ int idLength = sysTimeZoneId.length();
+
+ int index = 0;
+ int prevIndex;
+ char c;
+
+ // get std
+ do
+ c = sysTimeZoneId.charAt(index);
+ while (c != '+' && c != '-' && c != ',' && c != ':'
+ && ! Character.isDigit(c) && c != '\0' && ++index < idLength);
+
+ if (index >= idLength)
+ return getTimeZoneInternal(sysTimeZoneId);
+
+ stdName = sysTimeZoneId.substring(0, index);
+ prevIndex = index;
+
+ // get the std offset
+ do
+ c = sysTimeZoneId.charAt(index++);
+ while ((c == '-' || c == '+' || c == ':' || Character.isDigit(c))
+ && index < idLength);
+ if (index < idLength)
+ index--;
+
+ { // convert the dst string to a millis number
+ String offset = sysTimeZoneId.substring(prevIndex, index);
+ prevIndex = index;
+
+ if (offset.charAt(0) == '+' || offset.charAt(0) == '-')
+ stdOffs = parseTime(offset.substring(1));
+ else
+ stdOffs = parseTime(offset);
+
+ if (offset.charAt(0) == '-')
+ stdOffs = -stdOffs;
+
+ // TZ timezone offsets are positive when WEST of the meridian.
+ stdOffs = -stdOffs;
+ }
+
+ // Done yet? (Format: std offset)
+ if (index >= idLength)
+ {
+ // Do we have an existing timezone with that name and offset?
+ TimeZone tz = getTimeZoneInternal(stdName);
+ if (tz != null)
+ if (tz.getRawOffset() == stdOffs)
+ return tz;
+
+ // Custom then.
+ return new SimpleTimeZone(stdOffs, stdName);
+ }
+
+ // get dst
+ do
+ c = sysTimeZoneId.charAt(index);
+ while (c != '+' && c != '-' && c != ',' && c != ':'
+ && ! Character.isDigit(c) && c != '\0' && ++index < idLength);
+
+ // Done yet? (Format: std offset dst)
+ if (index >= idLength)
+ {
+ // Do we have an existing timezone with that name and offset
+ // which has DST?
+ TimeZone tz = getTimeZoneInternal(stdName);
+ if (tz != null)
+ if (tz.getRawOffset() == stdOffs && tz.useDaylightTime())
+ return tz;
+
+ // Custom then.
+ return new SimpleTimeZone(stdOffs, stdName);
+ }
+
+ // get the dst offset
+ prevIndex = index;
+ do
+ c = sysTimeZoneId.charAt(index++);
+ while ((c == '-' || c == '+' || c == ':' || Character.isDigit(c))
+ && index < idLength);
+ if (index < idLength)
+ index--;
+
+ if (index == prevIndex && (c == ',' || c == ';'))
+ {
+ // Missing dst offset defaults to one hour ahead of standard
+ // time.
+ dstOffs = stdOffs + 60 * 60 * 1000;
+ }
+ else
+ { // convert the dst string to a millis number
+ String offset = sysTimeZoneId.substring(prevIndex, index);
+ prevIndex = index;
+
+ if (offset.charAt(0) == '+' || offset.charAt(0) == '-')
+ dstOffs = parseTime(offset.substring(1));
+ else
+ dstOffs = parseTime(offset);
+
+ if (offset.charAt(0) == '-')
+ dstOffs = -dstOffs;
+
+ // TZ timezone offsets are positive when WEST of the meridian.
+ dstOffs = -dstOffs;
+ }
+
+ // Done yet? (Format: std offset dst offset)
+ // FIXME: We don't support DST without a rule given. Should we?
+ if (index >= idLength)
+ {
+ // Time Zone existing with same name, dst and offsets?
+ TimeZone tz = getTimeZoneInternal(stdName);
+ if (tz != null)
+ if (tz.getRawOffset() == stdOffs && tz.useDaylightTime()
+ && tz.getDSTSavings() == (dstOffs - stdOffs))
+ return tz;
+
+ return new SimpleTimeZone(stdOffs, stdName);
+ }
+
+ // get the DST rule
+ if (sysTimeZoneId.charAt(index) == ','
+ || sysTimeZoneId.charAt(index) == ';')
+ {
+ index++;
+ int offs = index;
+ while (sysTimeZoneId.charAt(index) != ','
+ && sysTimeZoneId.charAt(index) != ';')
+ index++;
+ String startTime = sysTimeZoneId.substring(offs, index);
+ index++;
+ String endTime = sysTimeZoneId.substring(index);
+
+ index = startTime.indexOf('/');
+ int startMillis;
+ int endMillis;
+ String startDate;
+ String endDate;
+ if (index != -1)
+ {
+ startDate = startTime.substring(0, index);
+ startMillis = parseTime(startTime.substring(index + 1));
+ }
+ else
+ {
+ startDate = startTime;
+ // if time isn't given, default to 2:00:00 AM.
+ startMillis = 2 * 60 * 60 * 1000;
+ }
+ index = endTime.indexOf('/');
+ if (index != -1)
+ {
+ endDate = endTime.substring(0, index);
+ endMillis = parseTime(endTime.substring(index + 1));
+ }
+ else
+ {
+ endDate = endTime;
+ // if time isn't given, default to 2:00:00 AM.
+ endMillis = 2 * 60 * 60 * 1000;
+ }
+
+ int[] start = getDateParams(startDate);
+ int[] end = getDateParams(endDate);
+ return new SimpleTimeZone(stdOffs, stdName, start[0], start[1],
+ start[2], startMillis, end[0], end[1],
+ end[2], endMillis, (dstOffs - stdOffs));
+ }
}
// FIXME: Produce a warning here?
@@ -1148,50 +1148,50 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
if (date.charAt(0) == 'M' || date.charAt(0) == 'm')
{
- int day;
-
- // Month, week of month, day of week
-
- // "Mm.w.d". d is between 0 (Sunday) and 6. Week w is
- // between 1 and 5; Week 1 is the first week in which day d
- // occurs and Week 5 specifies the last d day in the month.
- // Month m is between 1 and 12.
-
- month = Integer.parseInt(date.substring(1, date.indexOf('.')));
- int week = Integer.parseInt(date.substring(date.indexOf('.') + 1,
- date.lastIndexOf('.')));
- int dayOfWeek = Integer.parseInt(date.substring(date.lastIndexOf('.')
- + 1));
- dayOfWeek++; // Java day of week is one-based, Sunday is first day.
-
- if (week == 5)
- day = -1; // last day of month is -1 in java, 5 in TZ
- else
- {
- // First day of week starting on or after. For example,
- // to specify the second Sunday of April, set month to
- // APRIL, day-of-month to 8, and day-of-week to -SUNDAY.
- day = (week - 1) * 7 + 1;
- dayOfWeek = -dayOfWeek;
- }
-
- month--; // Java month is zero-based.
- return new int[] { month, day, dayOfWeek };
+ int day;
+
+ // Month, week of month, day of week
+
+ // "Mm.w.d". d is between 0 (Sunday) and 6. Week w is
+ // between 1 and 5; Week 1 is the first week in which day d
+ // occurs and Week 5 specifies the last d day in the month.
+ // Month m is between 1 and 12.
+
+ month = Integer.parseInt(date.substring(1, date.indexOf('.')));
+ int week = Integer.parseInt(date.substring(date.indexOf('.') + 1,
+ date.lastIndexOf('.')));
+ int dayOfWeek = Integer.parseInt(date.substring(date.lastIndexOf('.')
+ + 1));
+ dayOfWeek++; // Java day of week is one-based, Sunday is first day.
+
+ if (week == 5)
+ day = -1; // last day of month is -1 in java, 5 in TZ
+ else
+ {
+ // First day of week starting on or after. For example,
+ // to specify the second Sunday of April, set month to
+ // APRIL, day-of-month to 8, and day-of-week to -SUNDAY.
+ day = (week - 1) * 7 + 1;
+ dayOfWeek = -dayOfWeek;
+ }
+
+ month--; // Java month is zero-based.
+ return new int[] { month, day, dayOfWeek };
}
// julian day, either zero-based 0<=n<=365 (incl feb 29)
// or one-based 1<=n<=365 (no feb 29)
- int julianDay; // Julian day,
+ int julianDay; // Julian day,
if (date.charAt(0) != 'J' || date.charAt(0) != 'j')
{
- julianDay = Integer.parseInt(date.substring(1));
- julianDay++; // make 1-based
- // Adjust day count to include feb 29.
- dayCount = new int[]
- {
- 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335
- };
+ julianDay = Integer.parseInt(date.substring(1));
+ julianDay++; // make 1-based
+ // Adjust day count to include feb 29.
+ dayCount = new int[]
+ {
+ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335
+ };
}
else
// 1-based julian day
@@ -1200,9 +1200,9 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
int i = 11;
while (i > 0)
if (dayCount[i] < julianDay)
- break;
+ break;
else
- i--;
+ i--;
julianDay -= dayCount[i];
month = i;
return new int[] { month, julianDay, 0 };
@@ -1219,9 +1219,9 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
while (i < time.length())
if (time.charAt(i) == ':')
- break;
+ break;
else
- i++;
+ i++;
millis = 60 * 60 * 1000 * Integer.parseInt(time.substring(0, i));
if (i >= time.length())
return millis;
@@ -1229,9 +1229,9 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
int iprev = ++i;
while (i < time.length())
if (time.charAt(i) == ':')
- break;
+ break;
else
- i++;
+ i++;
millis += 60 * 1000 * Integer.parseInt(time.substring(iprev, i));
if (i >= time.length())
return millis;
@@ -1241,7 +1241,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
}
/**
- * Gets the time zone offset, for current date, modified in case of
+ * Gets the time zone offset, for current date, modified in case of
* daylight savings. This is the offset to add to UTC to get the local
* time.
* @param era the era of the given date
@@ -1253,7 +1253,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
* @return the time zone offset in milliseconds.
*/
public abstract int getOffset(int era, int year, int month,
- int day, int dayOfWeek, int milliseconds);
+ int day, int dayOfWeek, int milliseconds);
/**
* Get the time zone offset for the specified date, modified in case of
@@ -1269,11 +1269,11 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
? getRawOffset() + getDSTSavings()
: getRawOffset());
}
-
+
/**
* Gets the time zone offset, ignoring daylight savings. This is
* the offset to add to UTC to get the local time.
- * @return the time zone offset in milliseconds.
+ * @return the time zone offset in milliseconds.
*/
public abstract int getRawOffset();
@@ -1287,7 +1287,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
/**
* Gets the identifier of this time zone. For instance, PST for
* Pacific Standard Time.
- * @returns the ID of this time zone.
+ * @returns the ID of this time zone.
*/
public String getID()
{
@@ -1304,7 +1304,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
{
if (id == null)
throw new NullPointerException();
-
+
this.ID = id;
}
@@ -1339,7 +1339,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
/**
* This method returns a string name of the time zone suitable
* for displaying to the user. The string returned will be of the
- * specified type in the current locale.
+ * specified type in the current locale.
*
* @param dst Whether or not daylight savings time is in effect.
* @param style LONG for a long name, SHORT for
@@ -1356,7 +1356,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
/**
* This method returns a string name of the time zone suitable
* for displaying to the user. The string returned will be of the
- * specified type in the specified locale.
+ * specified type in the specified locale.
*
* @param dst Whether or not daylight savings time is in effect.
* @param style LONG for a long name, SHORT for
@@ -1370,30 +1370,30 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
DateFormatSymbols dfs;
try
{
- dfs = new DateFormatSymbols(locale);
-
- // The format of the value returned is defined by us.
- String[][]zoneinfo = dfs.getZoneStrings();
- for (int i = 0; i < zoneinfo.length; i++)
- {
- if (zoneinfo[i][0].equals(getID()))
- {
- if (!dst)
- {
- if (style == SHORT)
- return (zoneinfo[i][2]);
- else
- return (zoneinfo[i][1]);
- }
- else
- {
- if (style == SHORT)
- return (zoneinfo[i][4]);
- else
- return (zoneinfo[i][3]);
- }
- }
- }
+ dfs = new DateFormatSymbols(locale);
+
+ // The format of the value returned is defined by us.
+ String[][]zoneinfo = dfs.getZoneStrings();
+ for (int i = 0; i < zoneinfo.length; i++)
+ {
+ if (zoneinfo[i][0].equals(getID()))
+ {
+ if (!dst)
+ {
+ if (style == SHORT)
+ return (zoneinfo[i][2]);
+ else
+ return (zoneinfo[i][1]);
+ }
+ else
+ {
+ if (style == SHORT)
+ return (zoneinfo[i][4]);
+ else
+ return (zoneinfo[i][3]);
+ }
+ }
+ }
}
catch (MissingResourceException e)
{
@@ -1415,18 +1415,18 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
if (minutes != 0 || hours != 0)
{
- sb.append(offset >= 0 ? '+' : '-');
- sb.append((char) ('0' + hours / 10));
- sb.append((char) ('0' + hours % 10));
- sb.append(':');
- sb.append((char) ('0' + minutes / 10));
- sb.append((char) ('0' + minutes % 10));
+ sb.append(offset >= 0 ? '+' : '-');
+ sb.append((char) ('0' + hours / 10));
+ sb.append((char) ('0' + hours % 10));
+ sb.append(':');
+ sb.append((char) ('0' + minutes / 10));
+ sb.append((char) ('0' + minutes % 10));
}
return sb.toString();
}
- /**
+ /**
* Returns true, if this time zone uses Daylight Savings Time.
*/
public abstract boolean useDaylightTime();
@@ -1467,45 +1467,45 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
TimeZone tznew = null;
for (int pass = 0; pass < 2; pass++)
{
- synchronized (TimeZone.class)
- {
- tz = (TimeZone) timezones().get(ID);
- if (tz != null)
- {
- if (!tz.getID().equals(ID))
- {
- // We always return a timezone with the requested ID.
- // This is the same behaviour as with JDK1.2.
- tz = (TimeZone) tz.clone();
- tz.setID(ID);
- // We also save the alias, so that we return the same
- // object again if getTimeZone is called with the same
- // alias.
- timezones().put(ID, tz);
- }
- return tz;
- }
- else if (tznew != null)
- {
- timezones().put(ID, tznew);
- return tznew;
- }
- }
-
- if (pass == 1 || zoneinfo_dir == null)
- return null;
-
- // aliases0 is never changing after first timezones(), so should
- // be safe without synchronization.
- String zonename = (String) aliases0.get(ID);
- if (zonename == null)
- zonename = ID;
-
- // Read the file outside of the critical section, it is expensive.
- tznew = ZoneInfo.readTZFile (ID, zoneinfo_dir
- + File.separatorChar + zonename);
- if (tznew == null)
- return null;
+ synchronized (TimeZone.class)
+ {
+ tz = (TimeZone) timezones().get(ID);
+ if (tz != null)
+ {
+ if (!tz.getID().equals(ID))
+ {
+ // We always return a timezone with the requested ID.
+ // This is the same behaviour as with JDK1.2.
+ tz = (TimeZone) tz.clone();
+ tz.setID(ID);
+ // We also save the alias, so that we return the same
+ // object again if getTimeZone is called with the same
+ // alias.
+ timezones().put(ID, tz);
+ }
+ return tz;
+ }
+ else if (tznew != null)
+ {
+ timezones().put(ID, tznew);
+ return tznew;
+ }
+ }
+
+ if (pass == 1 || zoneinfo_dir == null)
+ return null;
+
+ // aliases0 is never changing after first timezones(), so should
+ // be safe without synchronization.
+ String zonename = (String) aliases0.get(ID);
+ if (zonename == null)
+ zonename = ID;
+
+ // Read the file outside of the critical section, it is expensive.
+ tznew = ZoneInfo.readTZFile (ID, zoneinfo_dir
+ + File.separatorChar + zonename);
+ if (tznew == null)
+ return null;
}
return null;
@@ -1522,68 +1522,68 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
// Check for custom IDs first
if (ID.startsWith("GMT") && ID.length() > 3)
{
- int pos = 3;
- int offset_direction = 1;
-
- if (ID.charAt(pos) == '-')
- {
- offset_direction = -1;
- pos++;
- }
- else if (ID.charAt(pos) == '+')
- {
- pos++;
- }
-
- try
- {
- int hour, minute;
-
- String offset_str = ID.substring(pos);
- int idx = offset_str.indexOf(":");
- if (idx != -1)
- {
- hour = Integer.parseInt(offset_str.substring(0, idx));
- minute = Integer.parseInt(offset_str.substring(idx + 1));
- }
- else
- {
- int offset_length = offset_str.length();
- if (offset_length <= 2)
- {
- // Only hour
- hour = Integer.parseInt(offset_str);
- minute = 0;
- }
- else
- {
- // hour and minute, not separated by colon
- hour = Integer.parseInt
- (offset_str.substring(0, offset_length - 2));
- minute = Integer.parseInt
- (offset_str.substring(offset_length - 2));
- }
- }
-
- // Custom IDs have to be normalized
- CPStringBuilder sb = new CPStringBuilder(9);
- sb.append("GMT");
-
- sb.append(offset_direction >= 0 ? '+' : '-');
- sb.append((char) ('0' + hour / 10));
- sb.append((char) ('0' + hour % 10));
- sb.append(':');
- sb.append((char) ('0' + minute / 10));
- sb.append((char) ('0' + minute % 10));
- ID = sb.toString();
-
- return new SimpleTimeZone((hour * (60 * 60 * 1000)
- + minute * (60 * 1000))
- * offset_direction, ID);
- }
- catch (NumberFormatException e)
- {
- }
+ int pos = 3;
+ int offset_direction = 1;
+
+ if (ID.charAt(pos) == '-')
+ {
+ offset_direction = -1;
+ pos++;
+ }
+ else if (ID.charAt(pos) == '+')
+ {
+ pos++;
+ }
+
+ try
+ {
+ int hour, minute;
+
+ String offset_str = ID.substring(pos);
+ int idx = offset_str.indexOf(":");
+ if (idx != -1)
+ {
+ hour = Integer.parseInt(offset_str.substring(0, idx));
+ minute = Integer.parseInt(offset_str.substring(idx + 1));
+ }
+ else
+ {
+ int offset_length = offset_str.length();
+ if (offset_length <= 2)
+ {
+ // Only hour
+ hour = Integer.parseInt(offset_str);
+ minute = 0;
+ }
+ else
+ {
+ // hour and minute, not separated by colon
+ hour = Integer.parseInt
+ (offset_str.substring(0, offset_length - 2));
+ minute = Integer.parseInt
+ (offset_str.substring(offset_length - 2));
+ }
+ }
+
+ // Custom IDs have to be normalized
+ CPStringBuilder sb = new CPStringBuilder(9);
+ sb.append("GMT");
+
+ sb.append(offset_direction >= 0 ? '+' : '-');
+ sb.append((char) ('0' + hour / 10));
+ sb.append((char) ('0' + hour % 10));
+ sb.append(':');
+ sb.append((char) ('0' + minute / 10));
+ sb.append((char) ('0' + minute % 10));
+ ID = sb.toString();
+
+ return new SimpleTimeZone((hour * (60 * 60 * 1000)
+ + minute * (60 * 1000))
+ * offset_direction, ID);
+ }
+ catch (NumberFormatException e)
+ {
+ }
}
TimeZone tz = getTimeZoneInternal(ID);
@@ -1595,7 +1595,7 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
/**
* Gets the available IDs according to the given time zone
- * offset.
+ * offset.
* @param rawOffset the given time zone GMT offset.
* @return An array of IDs, where the time zone has the specified GMT
* offset. For example {"Phoenix", "Denver"}, since both have
@@ -1605,42 +1605,42 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
{
synchronized (TimeZone.class)
{
- HashMap h = timezones();
- int count = 0;
- if (zoneinfo_dir == null)
- {
- Iterator iter = h.entrySet().iterator();
- while (iter.hasNext())
- {
- // Don't iterate the values, since we want to count
- // doubled values (aliases)
- Map.Entry entry = (Map.Entry) iter.next();
- if (((TimeZone) entry.getValue()).getRawOffset() == rawOffset)
- count++;
- }
-
- String[] ids = new String[count];
- count = 0;
- iter = h.entrySet().iterator();
- while (iter.hasNext())
- {
- Map.Entry entry = (Map.Entry) iter.next();
- if (((TimeZone) entry.getValue()).getRawOffset() == rawOffset)
- ids[count++] = (String) entry.getKey();
- }
- return ids;
- }
+ HashMap h = timezones();
+ int count = 0;
+ if (zoneinfo_dir == null)
+ {
+ Iterator iter = h.entrySet().iterator();
+ while (iter.hasNext())
+ {
+ // Don't iterate the values, since we want to count
+ // doubled values (aliases)
+ Map.Entry entry = (Map.Entry) iter.next();
+ if (((TimeZone) entry.getValue()).getRawOffset() == rawOffset)
+ count++;
+ }
+
+ String[] ids = new String[count];
+ count = 0;
+ iter = h.entrySet().iterator();
+ while (iter.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) iter.next();
+ if (((TimeZone) entry.getValue()).getRawOffset() == rawOffset)
+ ids[count++] = (String) entry.getKey();
+ }
+ return ids;
+ }
}
String[] s = getAvailableIDs();
int count = 0;
for (int i = 0; i < s.length; i++)
{
- TimeZone t = getTimeZoneInternal(s[i]);
- if (t == null || t.getRawOffset() != rawOffset)
- s[i] = null;
- else
- count++;
+ TimeZone t = getTimeZoneInternal(s[i]);
+ if (t == null || t.getRawOffset() != rawOffset)
+ s[i] = null;
+ else
+ count++;
}
String[] ids = new String[count];
count = 0;
@@ -1658,28 +1658,28 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
boolean top = prefix.length() == 0;
list.add (files);
for (int i = 0; i < files.length; i++)
- {
- if (top
- && (files[i].equals("posix")
- || files[i].equals("right")
- || files[i].endsWith(".tab")
- || aliases0.get(files[i]) != null))
- {
- files[i] = null;
- count--;
- continue;
- }
-
- File f = new File(d, files[i]);
- if (f.isDirectory())
- {
- count += getAvailableIDs(f, prefix + files[i]
- + File.separatorChar, list) - 1;
- files[i] = null;
- }
- else
- files[i] = prefix + files[i];
- }
+ {
+ if (top
+ && (files[i].equals("posix")
+ || files[i].equals("right")
+ || files[i].endsWith(".tab")
+ || aliases0.get(files[i]) != null))
+ {
+ files[i] = null;
+ count--;
+ continue;
+ }
+
+ File f = new File(d, files[i]);
+ if (f.isDirectory())
+ {
+ count += getAvailableIDs(f, prefix + files[i]
+ + File.separatorChar, list) - 1;
+ files[i] = null;
+ }
+ else
+ files[i] = prefix + files[i];
+ }
return count;
}
@@ -1691,45 +1691,45 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
{
synchronized (TimeZone.class)
{
- HashMap h = timezones();
- if (zoneinfo_dir == null)
- return (String[]) h.keySet().toArray(new String[h.size()]);
-
- if (availableIDs != null)
- {
- String[] ids = new String[availableIDs.length];
- for (int i = 0; i < availableIDs.length; i++)
- ids[i] = availableIDs[i];
- return ids;
- }
-
- File d = new File(zoneinfo_dir);
- ArrayList list = new ArrayList(30);
- int count = getAvailableIDs(d, "", list) + aliases0.size();
- availableIDs = new String[count];
- String[] ids = new String[count];
-
- count = 0;
- for (int i = 0; i < list.size(); i++)
- {
- String[] s = (String[]) list.get(i);
- for (int j = 0; j < s.length; j++)
- if (s[j] != null)
- {
- availableIDs[count] = s[j];
- ids[count++] = s[j];
- }
- }
-
- Iterator iter = aliases0.entrySet().iterator();
- while (iter.hasNext())
- {
- Map.Entry entry = (Map.Entry) iter.next();
- availableIDs[count] = (String) entry.getKey();
- ids[count++] = (String) entry.getKey();
- }
-
- return ids;
+ HashMap h = timezones();
+ if (zoneinfo_dir == null)
+ return (String[]) h.keySet().toArray(new String[h.size()]);
+
+ if (availableIDs != null)
+ {
+ String[] ids = new String[availableIDs.length];
+ for (int i = 0; i < availableIDs.length; i++)
+ ids[i] = availableIDs[i];
+ return ids;
+ }
+
+ File d = new File(zoneinfo_dir);
+ ArrayList list = new ArrayList(30);
+ int count = getAvailableIDs(d, "", list) + aliases0.size();
+ availableIDs = new String[count];
+ String[] ids = new String[count];
+
+ count = 0;
+ for (int i = 0; i < list.size(); i++)
+ {
+ String[] s = (String[]) list.get(i);
+ for (int j = 0; j < s.length; j++)
+ if (s[j] != null)
+ {
+ availableIDs[count] = s[j];
+ ids[count++] = s[j];
+ }
+ }
+
+ Iterator iter = aliases0.entrySet().iterator();
+ while (iter.hasNext())
+ {
+ Map.Entry entry = (Map.Entry) iter.next();
+ availableIDs[count] = (String) entry.getKey();
+ ids[count++] = (String) entry.getKey();
+ }
+
+ return ids;
}
}
@@ -1771,11 +1771,11 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
{
try
{
- return super.clone();
+ return super.clone();
}
catch (CloneNotSupportedException ex)
{
- return null;
+ return null;
}
}
}
diff --git a/libjava/classpath/java/util/Timer.java b/libjava/classpath/java/util/Timer.java
index 9b23a8f..9902755 100644
--- a/libjava/classpath/java/util/Timer.java
+++ b/libjava/classpath/java/util/Timer.java
@@ -111,11 +111,11 @@ public class Timer
{
elements++;
if (elements == heap.length)
- {
- TimerTask new_heap[] = new TimerTask[heap.length * 2];
- System.arraycopy(heap, 0, new_heap, 0, heap.length);
- heap = new_heap;
- }
+ {
+ TimerTask new_heap[] = new TimerTask[heap.length * 2];
+ System.arraycopy(heap, 0, new_heap, 0, heap.length);
+ heap = new_heap;
+ }
heap[elements] = task;
}
@@ -130,11 +130,11 @@ public class Timer
heap[elements] = null;
elements--;
if (elements + DEFAULT_SIZE / 2 <= (heap.length / 4))
- {
- TimerTask new_heap[] = new TimerTask[heap.length / 2];
- System.arraycopy(heap, 0, new_heap, 0, elements + 1);
- heap = new_heap;
- }
+ {
+ TimerTask new_heap[] = new TimerTask[heap.length / 2];
+ System.arraycopy(heap, 0, new_heap, 0, elements + 1);
+ heap = new_heap;
+ }
}
/**
@@ -145,25 +145,25 @@ public class Timer
{
// Check if it is legal to add another element
if (heap == null)
- {
- throw new IllegalStateException
- ("cannot enqueue when stop() has been called on queue");
- }
+ {
+ throw new IllegalStateException
+ ("cannot enqueue when stop() has been called on queue");
+ }
- heap[0] = task; // sentinel
- add(task); // put the new task at the end
+ heap[0] = task; // sentinel
+ add(task); // put the new task at the end
// Now push the task up in the heap until it has reached its place
int child = elements;
int parent = child / 2;
while (heap[parent].scheduled > task.scheduled)
- {
- heap[child] = heap[parent];
- child = parent;
- parent = child / 2;
- }
+ {
+ heap[child] = heap[parent];
+ child = parent;
+ parent = child / 2;
+ }
// This is the correct place for the new task
heap[child] = task;
- heap[0] = null; // clear sentinel
+ heap[0] = null; // clear sentinel
// Maybe sched() is waiting for a new element
this.notify();
}
@@ -175,13 +175,13 @@ public class Timer
private TimerTask top()
{
if (elements == 0)
- {
- return null;
- }
+ {
+ return null;
+ }
else
- {
- return heap[1];
- }
+ {
+ return heap[1];
+ }
}
/**
@@ -195,50 +195,50 @@ public class Timer
TimerTask task = null;
while (task == null)
- {
- // Get the next task
- task = top();
-
- // return null when asked to stop
- // or if asked to return null when the queue is empty
- if ((heap == null) || (task == null && nullOnEmpty))
- {
- return null;
- }
-
- // Do we have a task?
- if (task != null)
- {
- // The time to wait until the task should be served
- long time = task.scheduled - System.currentTimeMillis();
- if (time > 0)
- {
- // This task should not yet be served
- // So wait until this task is ready
- // or something else happens to the queue
- task = null; // set to null to make sure we call top()
- try
- {
- this.wait(time);
- }
- catch (InterruptedException _)
- {
- }
- }
- }
- else
- {
- // wait until a task is added
- // or something else happens to the queue
- try
- {
- this.wait();
- }
- catch (InterruptedException _)
- {
- }
- }
- }
+ {
+ // Get the next task
+ task = top();
+
+ // return null when asked to stop
+ // or if asked to return null when the queue is empty
+ if ((heap == null) || (task == null && nullOnEmpty))
+ {
+ return null;
+ }
+
+ // Do we have a task?
+ if (task != null)
+ {
+ // The time to wait until the task should be served
+ long time = task.scheduled - System.currentTimeMillis();
+ if (time > 0)
+ {
+ // This task should not yet be served
+ // So wait until this task is ready
+ // or something else happens to the queue
+ task = null; // set to null to make sure we call top()
+ try
+ {
+ this.wait(time);
+ }
+ catch (InterruptedException _)
+ {
+ }
+ }
+ }
+ else
+ {
+ // wait until a task is added
+ // or something else happens to the queue
+ try
+ {
+ this.wait();
+ }
+ catch (InterruptedException _)
+ {
+ }
+ }
+ }
// reconstruct the heap
TimerTask lastTask = heap[elements];
@@ -249,22 +249,22 @@ public class Timer
int child = 2;
heap[1] = lastTask;
while (child <= elements)
- {
- if (child < elements)
- {
- if (heap[child].scheduled > heap[child + 1].scheduled)
- {
- child++;
- }
- }
-
- if (lastTask.scheduled <= heap[child].scheduled)
- break; // found the correct place (the parent) - done
-
- heap[parent] = heap[child];
- parent = child;
- child = parent * 2;
- }
+ {
+ if (child < elements)
+ {
+ if (heap[child].scheduled > heap[child + 1].scheduled)
+ {
+ child++;
+ }
+ }
+
+ if (lastTask.scheduled <= heap[child].scheduled)
+ break; // found the correct place (the parent) - done
+
+ heap[parent] = heap[child];
+ parent = child;
+ child = parent * 2;
+ }
// this is the correct new place for the lastTask
heap[parent] = lastTask;
@@ -306,53 +306,53 @@ public class Timer
// Null out any elements that are canceled. Skip element 0 as
// it is the sentinel.
for (int i = elements; i > 0; --i)
- {
- if (heap[i].scheduled < 0)
- {
- ++removed;
-
- // Remove an element by pushing the appropriate child
- // into place, and then iterating to the bottom of the
- // tree.
- int index = i;
- while (heap[index] != null)
- {
- int child = 2 * index;
- if (child >= heap.length)
- {
- // Off end; we're done.
- heap[index] = null;
- break;
- }
-
- if (child + 1 >= heap.length || heap[child + 1] == null)
- {
- // Nothing -- we're done.
- }
- else if (heap[child] == null
- || (heap[child].scheduled
- > heap[child + 1].scheduled))
- ++child;
- heap[index] = heap[child];
- index = child;
- }
- }
- }
+ {
+ if (heap[i].scheduled < 0)
+ {
+ ++removed;
+
+ // Remove an element by pushing the appropriate child
+ // into place, and then iterating to the bottom of the
+ // tree.
+ int index = i;
+ while (heap[index] != null)
+ {
+ int child = 2 * index;
+ if (child >= heap.length)
+ {
+ // Off end; we're done.
+ heap[index] = null;
+ break;
+ }
+
+ if (child + 1 >= heap.length || heap[child + 1] == null)
+ {
+ // Nothing -- we're done.
+ }
+ else if (heap[child] == null
+ || (heap[child].scheduled
+ > heap[child + 1].scheduled))
+ ++child;
+ heap[index] = heap[child];
+ index = child;
+ }
+ }
+ }
// Make a new heap if we shrank enough.
int newLen = heap.length;
while (elements - removed + DEFAULT_SIZE / 2 <= newLen / 4)
- newLen /= 2;
+ newLen /= 2;
if (newLen != heap.length)
- {
- TimerTask[] newHeap = new TimerTask[newLen];
- System.arraycopy(heap, 0, newHeap, 0, elements + 1);
- heap = newHeap;
- }
+ {
+ TimerTask[] newHeap = new TimerTask[newLen];
+ System.arraycopy(heap, 0, newHeap, 0, elements + 1);
+ heap = newHeap;
+ }
return removed;
}
- } // TaskQueue
+ } // TaskQueue
/**
* The scheduler that executes all the tasks on a particular TaskQueue,
@@ -378,63 +378,63 @@ public class Timer
{
TimerTask task;
while ((task = queue.serve()) != null)
- {
- // If this task has not been canceled
- if (task.scheduled >= 0)
- {
-
- // Mark execution time
- task.lastExecutionTime = task.scheduled;
-
- // Repeatable task?
- if (task.period < 0)
- {
- // Last time this task is executed
- task.scheduled = -1;
- }
-
- // Run the task
- try
- {
- task.run();
- }
+ {
+ // If this task has not been canceled
+ if (task.scheduled >= 0)
+ {
+
+ // Mark execution time
+ task.lastExecutionTime = task.scheduled;
+
+ // Repeatable task?
+ if (task.period < 0)
+ {
+ // Last time this task is executed
+ task.scheduled = -1;
+ }
+
+ // Run the task
+ try
+ {
+ task.run();
+ }
catch (ThreadDeath death)
{
// If an exception escapes, the Timer becomes invalid.
queue.stop();
throw death;
}
- catch (Throwable t)
- {
- // If an exception escapes, the Timer becomes invalid.
+ catch (Throwable t)
+ {
+ // If an exception escapes, the Timer becomes invalid.
queue.stop();
- }
- }
-
- // Calculate next time and possibly re-enqueue.
- if (task.scheduled >= 0)
- {
- if (task.fixed)
- {
- task.scheduled += task.period;
- }
- else
- {
- task.scheduled = task.period + System.currentTimeMillis();
- }
-
- try
- {
- queue.enqueue(task);
- }
- catch (IllegalStateException ise)
- {
- // Ignore. Apparently the Timer queue has been stopped.
- }
- }
- }
+ }
+ }
+
+ // Calculate next time and possibly re-enqueue.
+ if (task.scheduled >= 0)
+ {
+ if (task.fixed)
+ {
+ task.scheduled += task.period;
+ }
+ else
+ {
+ task.scheduled = task.period + System.currentTimeMillis();
+ }
+
+ try
+ {
+ queue.enqueue(task);
+ }
+ catch (IllegalStateException ise)
+ {
+ // Ignore. Apparently the Timer queue has been stopped.
+ }
+ }
+ }
}
- } // Scheduler
+ } // Scheduler
// Number of Timers created.
// Used for creating nice Thread names.
@@ -474,11 +474,11 @@ public class Timer
this(daemon, Thread.NORM_PRIORITY);
}
- /**
- * Create a new Timer whose Thread has the indicated name. It will have
- * normal priority and will not be a daemon thread.
+ /**
+ * Create a new Timer whose Thread has the indicated name. It will have
+ * normal priority and will not be a daemon thread.
* @param name the name of the Thread
- * @since 1.5
+ * @since 1.5
*/
public Timer(String name)
{
@@ -486,7 +486,7 @@ public class Timer
}
/**
- * Create a new Timer whose Thread has the indicated name. It will have
+ * Create a new Timer whose Thread has the indicated name. It will have
* normal priority. The boolean argument controls whether or not it
* will be a daemon thread.
* @param name the name of the Thread
@@ -548,24 +548,24 @@ public class Timer
if (task.scheduled == 0 && task.lastExecutionTime == -1)
{
- task.scheduled = time;
- task.period = period;
- task.fixed = fixed;
+ task.scheduled = time;
+ task.period = period;
+ task.fixed = fixed;
}
else
{
- throw new IllegalStateException
- ("task was already scheduled or canceled");
+ throw new IllegalStateException
+ ("task was already scheduled or canceled");
}
if (!this.canceled && this.thread != null)
{
- queue.enqueue(task);
+ queue.enqueue(task);
}
else
{
- throw new IllegalStateException
- ("timer was canceled or scheduler thread has died");
+ throw new IllegalStateException
+ ("timer was canceled or scheduler thread has died");
}
}
@@ -573,7 +573,7 @@ public class Timer
{
if (delay < 0)
{
- throw new IllegalArgumentException("delay is negative");
+ throw new IllegalArgumentException("delay is negative");
}
}
@@ -581,7 +581,7 @@ public class Timer
{
if (period < 0)
{
- throw new IllegalArgumentException("period is negative");
+ throw new IllegalArgumentException("period is negative");
}
}
diff --git a/libjava/classpath/java/util/TreeMap.java b/libjava/classpath/java/util/TreeMap.java
index 99a42cb..87c532f 100644
--- a/libjava/classpath/java/util/TreeMap.java
+++ b/libjava/classpath/java/util/TreeMap.java
@@ -446,7 +446,7 @@ public class TreeMap extends AbstractMap
* (or equal to, if inclusive is true) toKey.
* The returned map is backed by the original, so changes in one appear
* in the other. The submap will throw an {@link IllegalArgumentException}
- * for any attempt to access or add an element beyond the specified cutoff.
+ * for any attempt to access or add an element beyond the specified cutoff.
*
* @param toKey the cutoff point
* @param inclusive true if the cutoff point should be included.
@@ -459,8 +459,8 @@ public class TreeMap extends AbstractMap
*/
public NavigableMap headMap(K toKey, boolean inclusive)
{
- return new SubMap((K)(Object)nil, inclusive
- ? successor(getNode(toKey)).key : toKey);
+ return new SubMap((K)(Object)nil, inclusive
+ ? successor(getNode(toKey)).key : toKey);
}
/**
@@ -641,7 +641,7 @@ public class TreeMap extends AbstractMap
* toKey. The returned map is backed by the original, so
* changes in one appear in the other. The submap will throw an
* {@link IllegalArgumentException} for any attempt to access or add an
- * element beyond the specified cutoffs.
+ * element beyond the specified cutoffs.
*
* @param fromKey the low cutoff point
* @param fromInclusive true if the low cutoff point should be included.
@@ -655,10 +655,10 @@ public class TreeMap extends AbstractMap
* @throws IllegalArgumentException if fromKey is greater than toKey
*/
public NavigableMap subMap(K fromKey, boolean fromInclusive,
- K toKey, boolean toInclusive)
+ K toKey, boolean toInclusive)
{
return new SubMap(fromInclusive ? fromKey : successor(getNode(fromKey)).key,
- toInclusive ? successor(getNode(toKey)).key : toKey);
+ toInclusive ? successor(getNode(toKey)).key : toKey);
}
/**
@@ -701,7 +701,7 @@ public class TreeMap extends AbstractMap
public NavigableMap tailMap(K fromKey, boolean inclusive)
{
return new SubMap(inclusive ? fromKey : successor(getNode(fromKey)).key,
- (K)(Object)nil);
+ (K)(Object)nil);
}
/**
@@ -873,9 +873,9 @@ public class TreeMap extends AbstractMap
{
if (count == 0)
{
- root = nil;
- size = 0;
- return;
+ root = nil;
+ size = 0;
+ return;
}
// We color every row of nodes black, except for the overflow nodes.
@@ -1601,7 +1601,7 @@ public class TreeMap extends AbstractMap
{
Entry n = TreeMap.this.ceilingEntry(key);
if (n != null && keyInRange(n.getKey()))
- return n;
+ return n;
return null;
}
@@ -1609,9 +1609,9 @@ public class TreeMap extends AbstractMap
{
K found = TreeMap.this.ceilingKey(key);
if (keyInRange(found))
- return found;
+ return found;
else
- return null;
+ return null;
}
public NavigableSet descendingKeySet()
@@ -1622,10 +1622,10 @@ public class TreeMap extends AbstractMap
public NavigableMap descendingMap()
{
if (descendingMap == null)
- descendingMap = new DescendingMap(this);
+ descendingMap = new DescendingMap(this);
return descendingMap;
}
-
+
public void clear()
{
Node next = lowestGreaterThan(minKey, true);
@@ -1674,7 +1674,7 @@ public class TreeMap extends AbstractMap
{
Node node = lowestGreaterThan(minKey, true);
if (node == nil || ! keyInRange(node.key))
- return null;
+ return null;
return node;
}
@@ -1690,7 +1690,7 @@ public class TreeMap extends AbstractMap
{
Entry n = TreeMap.this.floorEntry(key);
if (n != null && keyInRange(n.getKey()))
- return n;
+ return n;
return null;
}
@@ -1698,9 +1698,9 @@ public class TreeMap extends AbstractMap
{
K found = TreeMap.this.floorKey(key);
if (keyInRange(found))
- return found;
+ return found;
else
- return null;
+ return null;
}
public V get(Object key)
@@ -1719,8 +1719,8 @@ public class TreeMap extends AbstractMap
{
if (!keyInRange(toKey))
throw new IllegalArgumentException("Key outside submap range");
- return new SubMap(minKey, (inclusive ?
- successor(getNode(toKey)).key : toKey));
+ return new SubMap(minKey, (inclusive ?
+ successor(getNode(toKey)).key : toKey));
}
public Set keySet()
@@ -1736,7 +1736,7 @@ public class TreeMap extends AbstractMap
{
Entry n = TreeMap.this.higherEntry(key);
if (n != null && keyInRange(n.getKey()))
- return n;
+ return n;
return null;
}
@@ -1744,9 +1744,9 @@ public class TreeMap extends AbstractMap
{
K found = TreeMap.this.higherKey(key);
if (keyInRange(found))
- return found;
+ return found;
else
- return null;
+ return null;
}
public Entry lastEntry()
@@ -1766,7 +1766,7 @@ public class TreeMap extends AbstractMap
{
Entry n = TreeMap.this.lowerEntry(key);
if (n != null && keyInRange(n.getKey()))
- return n;
+ return n;
return null;
}
@@ -1774,9 +1774,9 @@ public class TreeMap extends AbstractMap
{
K found = TreeMap.this.lowerKey(key);
if (keyInRange(found))
- return found;
+ return found;
else
- return null;
+ return null;
}
public NavigableSet navigableKeySet()
@@ -1785,14 +1785,14 @@ public class TreeMap extends AbstractMap
// Create an AbstractSet with custom implementations of those methods
// that can be overriden easily and efficiently.
this.nKeys = new SubMap.NavigableKeySet();
- return this.nKeys;
+ return this.nKeys;
}
public Entry pollFirstEntry()
{
Entry e = firstEntry();
if (e != null)
- removeNode((Node) e);
+ removeNode((Node) e);
return e;
}
@@ -1800,7 +1800,7 @@ public class TreeMap extends AbstractMap
{
Entry e = lastEntry();
if (e != null)
- removeNode((Node) e);
+ removeNode((Node) e);
return e;
}
@@ -1837,25 +1837,25 @@ public class TreeMap extends AbstractMap
}
public NavigableMap subMap(K fromKey, boolean fromInclusive,
- K toKey, boolean toInclusive)
+ K toKey, boolean toInclusive)
{
if (! keyInRange(fromKey) || ! keyInRange(toKey))
throw new IllegalArgumentException("key outside range");
- return new SubMap(fromInclusive ? fromKey : successor(getNode(fromKey)).key,
- toInclusive ? successor(getNode(toKey)).key : toKey);
+ return new SubMap(fromInclusive ? fromKey : successor(getNode(fromKey)).key,
+ toInclusive ? successor(getNode(toKey)).key : toKey);
}
public SortedMap tailMap(K fromKey)
{
return tailMap(fromKey, true);
}
-
+
public NavigableMap tailMap(K fromKey, boolean inclusive)
{
if (! keyInRange(fromKey))
throw new IllegalArgumentException("key outside range");
return new SubMap(inclusive ? fromKey : successor(getNode(fromKey)).key,
- maxKey);
+ maxKey);
}
public Collection values()
@@ -1884,47 +1884,47 @@ public class TreeMap extends AbstractMap
};
return this.values;
}
-
+
private class KeySet
extends AbstractSet
{
public int size()
{
- return SubMap.this.size();
+ return SubMap.this.size();
}
-
+
public Iterator iterator()
{
- Node first = lowestGreaterThan(minKey, true);
- Node max = lowestGreaterThan(maxKey, false);
- return new TreeIterator(KEYS, first, max);
+ Node first = lowestGreaterThan(minKey, true);
+ Node max = lowestGreaterThan(maxKey, false);
+ return new TreeIterator(KEYS, first, max);
}
-
+
public void clear()
{
- SubMap.this.clear();
+ SubMap.this.clear();
}
-
+
public boolean contains(Object o)
{
- if (! keyInRange((K) o))
- return false;
- return getNode((K) o) != nil;
+ if (! keyInRange((K) o))
+ return false;
+ return getNode((K) o) != nil;
}
-
+
public boolean remove(Object o)
{
- if (! keyInRange((K) o))
- return false;
- Node n = getNode((K) o);
- if (n != nil)
- {
- removeNode(n);
- return true;
- }
- return false;
- }
-
+ if (! keyInRange((K) o))
+ return false;
+ Node n = getNode((K) o);
+ if (n != nil)
+ {
+ removeNode(n);
+ return true;
+ }
+ return false;
+ }
+
} // class SubMap.KeySet
private final class NavigableKeySet
@@ -1934,91 +1934,91 @@ public class TreeMap extends AbstractMap
public K ceiling(K k)
{
- return SubMap.this.ceilingKey(k);
+ return SubMap.this.ceilingKey(k);
}
-
+
public Comparator super K> comparator()
{
- return comparator;
+ return comparator;
}
-
+
public Iterator descendingIterator()
{
- return descendingSet().iterator();
+ return descendingSet().iterator();
}
-
+
public NavigableSet descendingSet()
{
- return new DescendingSet(this);
+ return new DescendingSet(this);
}
-
+
public K first()
{
- return SubMap.this.firstKey();
+ return SubMap.this.firstKey();
}
-
+
public K floor(K k)
{
- return SubMap.this.floorKey(k);
+ return SubMap.this.floorKey(k);
}
-
+
public SortedSet headSet(K to)
{
- return headSet(to, false);
+ return headSet(to, false);
}
public NavigableSet headSet(K to, boolean inclusive)
{
- return SubMap.this.headMap(to, inclusive).navigableKeySet();
+ return SubMap.this.headMap(to, inclusive).navigableKeySet();
}
public K higher(K k)
{
- return SubMap.this.higherKey(k);
+ return SubMap.this.higherKey(k);
}
public K last()
{
- return SubMap.this.lastKey();
+ return SubMap.this.lastKey();
}
public K lower(K k)
{
- return SubMap.this.lowerKey(k);
+ return SubMap.this.lowerKey(k);
}
public K pollFirst()
{
- return SubMap.this.pollFirstEntry().getKey();
+ return SubMap.this.pollFirstEntry().getKey();
}
public K pollLast()
{
- return SubMap.this.pollLastEntry().getKey();
+ return SubMap.this.pollLastEntry().getKey();
}
public SortedSet subSet(K from, K to)
{
- return subSet(from, true, to, false);
+ return subSet(from, true, to, false);
}
-
+
public NavigableSet subSet(K from, boolean fromInclusive,
- K to, boolean toInclusive)
+ K to, boolean toInclusive)
{
- return SubMap.this.subMap(from, fromInclusive,
- to, toInclusive).navigableKeySet();
+ return SubMap.this.subMap(from, fromInclusive,
+ to, toInclusive).navigableKeySet();
}
public SortedSet tailSet(K from)
{
- return tailSet(from, true);
+ return tailSet(from, true);
}
-
+
public NavigableSet tailSet(K from, boolean inclusive)
{
- return SubMap.this.tailMap(from, inclusive).navigableKeySet();
+ return SubMap.this.tailMap(from, inclusive).navigableKeySet();
}
-
+
} // class SubMap.NavigableKeySet
/**
@@ -2027,54 +2027,54 @@ public class TreeMap extends AbstractMap
private class EntrySet
extends AbstractSet>
{
-
+
public int size()
{
return SubMap.this.size();
}
-
+
public Iterator> iterator()
{
Node first = lowestGreaterThan(minKey, true);
Node max = lowestGreaterThan(maxKey, false);
return new TreeIterator(ENTRIES, first, max);
}
-
+
public void clear()
{
SubMap.this.clear();
}
-
+
public boolean contains(Object o)
{
if (! (o instanceof Map.Entry))
- return false;
+ return false;
Map.Entry me = (Map.Entry) o;
K key = me.getKey();
if (! keyInRange(key))
- return false;
+ return false;
Node n = getNode(key);
return n != nil && AbstractSet.equals(me.getValue(), n.value);
}
-
+
public boolean remove(Object o)
{
if (! (o instanceof Map.Entry))
- return false;
+ return false;
Map.Entry me = (Map.Entry) o;
K key = me.getKey();
if (! keyInRange(key))
- return false;
+ return false;
Node n = getNode(key);
if (n != nil && AbstractSet.equals(me.getValue(), n.value))
- {
- removeNode(n);
- return true;
- }
+ {
+ removeNode(n);
+ return true;
+ }
return false;
}
} // class SubMap.EntrySet
-
+
private final class NavigableEntrySet
extends EntrySet
implements NavigableSet>
@@ -2082,103 +2082,103 @@ public class TreeMap extends AbstractMap
public Entry ceiling(Entry e)
{
- return SubMap.this.ceilingEntry(e.getKey());
+ return SubMap.this.ceilingEntry(e.getKey());
}
-
+
public Comparator super Entry> comparator()
{
- return new Comparator>()
- {
- public int compare(Entry t1, Entry t2)
- {
- return comparator.compare(t1.getKey(), t2.getKey());
- }
- };
+ return new Comparator>()
+ {
+ public int compare(Entry t1, Entry t2)
+ {
+ return comparator.compare(t1.getKey(), t2.getKey());
+ }
+ };
}
-
+
public Iterator> descendingIterator()
{
- return descendingSet().iterator();
+ return descendingSet().iterator();
}
-
+
public NavigableSet> descendingSet()
{
- return new DescendingSet(this);
+ return new DescendingSet(this);
}
-
+
public Entry first()
{
- return SubMap.this.firstEntry();
+ return SubMap.this.firstEntry();
}
-
+
public Entry floor(Entry e)
{
- return SubMap.this.floorEntry(e.getKey());
+ return SubMap.this.floorEntry(e.getKey());
}
-
+
public SortedSet> headSet(Entry to)
{
- return headSet(to, false);
+ return headSet(to, false);
}
public NavigableSet> headSet(Entry to, boolean inclusive)
{
- return (NavigableSet>)
- SubMap.this.headMap(to.getKey(), inclusive).entrySet();
+ return (NavigableSet>)
+ SubMap.this.headMap(to.getKey(), inclusive).entrySet();
}
public Entry higher(Entry e)
{
- return SubMap.this.higherEntry(e.getKey());
+ return SubMap.this.higherEntry(e.getKey());
}
public Entry last()
{
- return SubMap.this.lastEntry();
+ return SubMap.this.lastEntry();
}
public Entry lower(Entry