You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(97) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(127) |
Feb
(34) |
Mar
(16) |
Apr
(26) |
May
(55) |
Jun
(107) |
Jul
(36) |
Aug
(72) |
Sep
(90) |
Oct
(41) |
Nov
(27) |
Dec
(13) |
| 2008 |
Jan
(37) |
Feb
(39) |
Mar
(98) |
Apr
(115) |
May
(134) |
Jun
(120) |
Jul
(86) |
Aug
(149) |
Sep
(68) |
Oct
(66) |
Nov
(104) |
Dec
(49) |
| 2009 |
Jan
(131) |
Feb
(132) |
Mar
(125) |
Apr
(172) |
May
(161) |
Jun
(43) |
Jul
(47) |
Aug
(38) |
Sep
(18) |
Oct
(6) |
Nov
(1) |
Dec
(15) |
| 2010 |
Jan
(21) |
Feb
(8) |
Mar
(10) |
Apr
(4) |
May
(9) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(4) |
| 2011 |
Jan
(23) |
Feb
(10) |
Mar
(13) |
Apr
(3) |
May
|
Jun
(19) |
Jul
(11) |
Aug
(22) |
Sep
|
Oct
(4) |
Nov
(2) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(7) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(1) |
Aug
(30) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(8) |
| 2013 |
Jan
(3) |
Feb
(40) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(12) |
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
|
From: <ls...@us...> - 2007-08-11 20:33:39
|
Revision: 3393
http://jnode.svn.sourceforge.net/jnode/?rev=3393&view=rev
Author: lsantha
Date: 2007-08-11 13:33:38 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/java/java/util/Arrays.java
trunk/core/src/openjdk/java/java/util/BitSet.java
trunk/core/src/openjdk/java/java/util/EnumSet.java
trunk/core/src/openjdk/java/java/util/JumboEnumSet.java
trunk/core/src/openjdk/java/java/util/RegularEnumSet.java
Removed Paths:
-------------
trunk/core/src/classpath/java/java/util/Arrays.java
trunk/core/src/classpath/java/java/util/BitSet.java
trunk/core/src/classpath/java/java/util/EnumSet.java
Deleted: trunk/core/src/classpath/java/java/util/Arrays.java
===================================================================
--- trunk/core/src/classpath/java/java/util/Arrays.java 2007-08-11 19:58:14 UTC (rev 3392)
+++ trunk/core/src/classpath/java/java/util/Arrays.java 2007-08-11 20:33:38 UTC (rev 3393)
@@ -1,4028 +0,0 @@
-/* Arrays.java -- Utility class with methods to operate on arrays
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
- Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package java.util;
-
-import java.io.Serializable;
-import java.lang.reflect.Array;
-
-/**
- * This class contains various static utility methods performing operations on
- * arrays, and a method to provide a List "view" of an array to facilitate
- * using arrays with Collection-based APIs. All methods throw a
- * {@link NullPointerException} if the parameter array is null.
- * <p>
- *
- * Implementations may use their own algorithms, but must obey the general
- * properties; for example, the sort must be stable and n*log(n) complexity.
- * Sun's implementation of sort, and therefore ours, is a tuned quicksort,
- * adapted from Jon L. Bentley and M. Douglas McIlroy's "Engineering a Sort
- * Function", Software-Practice and Experience, Vol. 23(11) P. 1249-1265
- * (November 1993). This algorithm offers n*log(n) performance on many data
- * sets that cause other quicksorts to degrade to quadratic performance.
- *
- * @author Original author unknown
- * @author Bryce McKinlay
- * @author Eric Blake (eb...@em...)
- * @see Comparable
- * @see Comparator
- * @since 1.2
- * @status updated to 1.4
- */
-public class Arrays
-{
- /**
- * This class is non-instantiable.
- */
- private Arrays()
- {
- }
-
-
-// binarySearch
- /**
- * Perform a binary search of a byte array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(byte[] a, byte key)
- {
- if (a.length == 0)
- return -1;
- return binarySearch(a, 0, a.length - 1, key);
- }
-
- /**
- * Perform a binary search of a range of a byte array for a key. The range
- * must be sorted (as by the <code>sort(byte[], int, int)</code> method) -
- * if it is not, the behaviour of this method is undefined, and may be an
- * infinite loop. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param low the lowest index to search from.
- * @param hi the highest index to search to.
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws IllegalArgumentException if <code>low > hi</code>
- * @throws ArrayIndexOutOfBoundsException if <code>low < 0</code> or
- * <code>hi > a.length</code>.
- */
- public static int binarySearch(byte[] a, int low, int hi, byte key)
- {
- if (low > hi)
- throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
- if (low < 0 || hi > a.length)
- throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >>> 1;
- final byte d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a char array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(char[] a, char key)
- {
- if (a.length == 0)
- return -1;
- return binarySearch(a, 0, a.length - 1, key);
- }
-
- /**
- * Perform a binary search of a range of a char array for a key. The range
- * must be sorted (as by the <code>sort(char[], int, int)</code> method) -
- * if it is not, the behaviour of this method is undefined, and may be an
- * infinite loop. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param low the lowest index to search from.
- * @param hi the highest index to search to.
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws IllegalArgumentException if <code>low > hi</code>
- * @throws ArrayIndexOutOfBoundsException if <code>low < 0</code> or
- * <code>hi > a.length</code>.
- */
- public static int binarySearch(char[] a, int low, int hi, char key)
- {
- if (low > hi)
- throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
- if (low < 0 || hi > a.length)
- throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >>> 1;
- final char d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a short array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(short[] a, short key)
- {
- if (a.length == 0)
- return -1;
- return binarySearch(a, 0, a.length - 1, key);
- }
-
- /**
- * Perform a binary search of a range of a short array for a key. The range
- * must be sorted (as by the <code>sort(short[], int, int)</code> method) -
- * if it is not, the behaviour of this method is undefined, and may be an
- * infinite loop. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param low the lowest index to search from.
- * @param hi the highest index to search to.
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws IllegalArgumentException if <code>low > hi</code>
- * @throws ArrayIndexOutOfBoundsException if <code>low < 0</code> or
- * <code>hi > a.length</code>.
- */
- public static int binarySearch(short[] a, int low, int hi, short key)
- {
- if (low > hi)
- throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
- if (low < 0 || hi > a.length)
- throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >>> 1;
- final short d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of an int array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(int[] a, int key)
- {
- if (a.length == 0)
- return -1;
- return binarySearch(a, 0, a.length - 1, key);
- }
-
- /**
- * Perform a binary search of a range of an integer array for a key. The range
- * must be sorted (as by the <code>sort(int[], int, int)</code> method) -
- * if it is not, the behaviour of this method is undefined, and may be an
- * infinite loop. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param low the lowest index to search from.
- * @param hi the highest index to search to.
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws IllegalArgumentException if <code>low > hi</code>
- * @throws ArrayIndexOutOfBoundsException if <code>low < 0</code> or
- * <code>hi > a.length</code>.
- */
- public static int binarySearch(int[] a, int low, int hi, int key)
- {
- if (low > hi)
- throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
- if (low < 0 || hi > a.length)
- throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >>> 1;
- final int d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a long array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(long[] a, long key)
- {
- if (a.length == 0)
- return -1;
- return binarySearch(a, 0, a.length - 1, key);
- }
-
- /**
- * Perform a binary search of a range of a long array for a key. The range
- * must be sorted (as by the <code>sort(long[], int, int)</code> method) -
- * if it is not, the behaviour of this method is undefined, and may be an
- * infinite loop. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param low the lowest index to search from.
- * @param hi the highest index to search to.
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws IllegalArgumentException if <code>low > hi</code>
- * @throws ArrayIndexOutOfBoundsException if <code>low < 0</code> or
- * <code>hi > a.length</code>.
- */
- public static int binarySearch(long[] a, int low, int hi, long key)
- {
- if (low > hi)
- throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
- if (low < 0 || hi > a.length)
- throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >>> 1;
- final long d = a[mid];
- if (d == key)
- return mid;
- else if (d > key)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop.
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a float array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(float[] a, float key)
- {
- if (a.length == 0)
- return -1;
- return binarySearch(a, 0, a.length - 1, key);
- }
-
- /**
- * Perform a binary search of a range of a float array for a key. The range
- * must be sorted (as by the <code>sort(float[], int, int)</code> method) -
- * if it is not, the behaviour of this method is undefined, and may be an
- * infinite loop. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param low the lowest index to search from.
- * @param hi the highest index to search to.
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws IllegalArgumentException if <code>low > hi</code>
- * @throws ArrayIndexOutOfBoundsException if <code>low < 0</code> or
- * <code>hi > a.length</code>.
- */
- public static int binarySearch(float[] a, int low, int hi, float key)
- {
- if (low > hi)
- throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
- if (low < 0 || hi > a.length)
- throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
- // Must use Float.compare to take into account NaN, +-0.
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >>> 1;
- final int r = Float.compare(a[mid], key);
- if (r == 0)
- return mid;
- else if (r > 0)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of a double array for a key. The array must be
- * sorted (as by the sort() method) - if it is not, the behaviour of this
- * method is undefined, and may be an infinite loop. If the array contains
- * the key more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(double[] a, double key)
- {
- if (a.length == 0)
- return -1;
- return binarySearch(a, 0, a.length - 1, key);
- }
-
- /**
- * Perform a binary search of a range of a double array for a key. The range
- * must be sorted (as by the <code>sort(double[], int, int)</code> method) -
- * if it is not, the behaviour of this method is undefined, and may be an
- * infinite loop. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param low the lowest index to search from.
- * @param hi the highest index to search to.
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws IllegalArgumentException if <code>low > hi</code>
- * @throws ArrayIndexOutOfBoundsException if <code>low < 0</code> or
- * <code>hi > a.length</code>.
- */
- public static int binarySearch(double[] a, int low, int hi, double key)
- {
- if (low > hi)
- throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
- if (low < 0 || hi > a.length)
- throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
- // Must use Double.compare to take into account NaN, +-0.
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >>> 1;
- final int r = Double.compare(a[mid], key);
- if (r == 0)
- return mid;
- else if (r > 0)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop
- low = ++mid;
- }
- return -mid - 1;
- }
-
- /**
- * Perform a binary search of an Object array for a key, using the natural
- * ordering of the elements. The array must be sorted (as by the sort()
- * method) - if it is not, the behaviour of this method is undefined, and may
- * be an infinite loop. Further, the key must be comparable with every item
- * in the array. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this (JCL)
- * implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws ClassCastException if key could not be compared with one of the
- * elements of a
- * @throws NullPointerException if a null element in a is compared
- */
- public static int binarySearch(Object[] a, Object key)
- {
- if (a.length == 0)
- return -1;
- return binarySearch(a, key, null);
- }
-
- /**
- * Perform a binary search of a range of an Object array for a key. The range
- * must be sorted (as by the <code>sort(Object[], int, int)</code> method) -
- * if it is not, the behaviour of this method is undefined, and may be an
- * infinite loop. If the array contains the key more than once, any one of
- * them may be found. Note: although the specification allows for an infinite
- * loop if the array is unsorted, it will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param low the lowest index to search from.
- * @param hi the highest index to search to.
- * @param key the value to search for
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- */
- public static int binarySearch(Object[] a, int low, int hi, Object key)
- {
- return binarySearch(a, low, hi, key, null);
- }
-
- /**
- * Perform a binary search of an Object array for a key, using a supplied
- * Comparator. The array must be sorted (as by the sort() method with the
- * same Comparator) - if it is not, the behaviour of this method is
- * undefined, and may be an infinite loop. Further, the key must be
- * comparable with every item in the array. If the array contains the key
- * more than once, any one of them may be found. Note: although the
- * specification allows for an infinite loop if the array is unsorted, it
- * will not happen in this (JCL) implementation.
- *
- * @param a the array to search (must be sorted)
- * @param key the value to search for
- * @param c the comparator by which the array is sorted; or null to
- * use the elements' natural order
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws ClassCastException if key could not be compared with one of the
- * elements of a
- * @throws NullPointerException if a null element is compared with natural
- * ordering (only possible when c is null)
- */
- public static <T> int binarySearch(T[] a, T key, Comparator<? super T> c)
- {
- if (a.length == 0)
- return -1;
- return binarySearch(a, 0, a.length - 1, key, c);
- }
-
- /**
- * Perform a binary search of a range of an Object array for a key using
- * a {@link Comparator}. The range must be sorted (as by the
- * <code>sort(Object[], int, int)</code> method) - if it is not, the
- * behaviour of this method is undefined, and may be an infinite loop. If
- * the array contains the key more than once, any one of them may be found.
- * Note: although the specification allows for an infinite loop if the array
- * is unsorted, it will not happen in this implementation.
- *
- * @param a the array to search (must be sorted)
- * @param low the lowest index to search from.
- * @param hi the highest index to search to.
- * @param key the value to search for
- * @param c the comparator by which the array is sorted; or null to
- * use the elements' natural order
- * @return the index at which the key was found, or -n-1 if it was not
- * found, where n is the index of the first value higher than key or
- * a.length if there is no such value.
- * @throws ClassCastException if key could not be compared with one of the
- * elements of a
- * @throws IllegalArgumentException if <code>low > hi</code>
- * @throws ArrayIndexOutOfBoundsException if <code>low < 0</code> or
- * <code>hi > a.length</code>.
- */
- public static <T> int binarySearch(T[] a, int low, int hi, T key,
- Comparator<? super T> c)
- {
- if (low > hi)
- throw new IllegalArgumentException("The start index is higher than " +
- "the finish index.");
- if (low < 0 || hi > a.length)
- throw new ArrayIndexOutOfBoundsException("One of the indices is out " +
- "of bounds.");
- int mid = 0;
- while (low <= hi)
- {
- mid = (low + hi) >>> 1;
- final int d = Collections.compare(key, a[mid], c);
- if (d == 0)
- return mid;
- else if (d < 0)
- hi = mid - 1;
- else
- // This gets the insertion point right on the last loop
- low = ++mid;
- }
- return -mid - 1;
- }
-
-
-// equals
- /**
- * Compare two boolean arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(boolean[] a1, boolean[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- 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;
- }
- return false;
- }
-
- /**
- * Compare two byte arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(byte[] a1, byte[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- 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;
- }
- return false;
- }
-
- /**
- * Compare two char arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(char[] a1, char[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- 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;
- }
- return false;
- }
-
- /**
- * Compare two short arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(short[] a1, short[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- 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;
- }
- return false;
- }
-
- /**
- * Compare two int arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(int[] a1, int[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- 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;
- }
- return false;
- }
-
- /**
- * Compare two long arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(long[] a1, long[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- 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;
- }
- return false;
- }
-
- /**
- * Compare two float arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(float[] a1, float[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- if (null == a1 || null == a2)
- return false;
-
- // Must use Float.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 (Float.compare(a1[i], a2[i]) != 0)
- return false;
- return true;
- }
- return false;
- }
-
- /**
- * Compare two double arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a2 is of the same length
- * as a1, and for each 0 <= i < a1.length, a1[i] == a2[i]
- */
- public static boolean equals(double[] a1, double[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- 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;
- }
- return false;
- }
-
- /**
- * Compare two Object arrays for equality.
- *
- * @param a1 the first array to compare
- * @param a2 the second array to compare
- * @return true if a1 and a2 are both null, or if a1 is of the same length
- * as a2, and for each 0 <= i < a.length, a1[i] == null ?
- * a2[i] == null : a1[i].equals(a2[i]).
- */
- public static boolean equals(Object[] a1, Object[] a2)
- {
- // Quick test which saves comparing elements of the same array, and also
- // catches the case that both are null.
- if (a1 == a2)
- return true;
-
- 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;
- }
- return false;
- }
-
-
-// fill
- /**
- * Fill an array with a boolean value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(boolean[] a, boolean val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a boolean value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void fill(boolean[] a, int fromIndex, int toIndex, boolean val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a byte value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(byte[] a, byte val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a byte value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void fill(byte[] a, int fromIndex, int toIndex, byte val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a char value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(char[] a, char val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a char value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void fill(char[] a, int fromIndex, int toIndex, char val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a short value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(short[] a, short val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a short value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void fill(short[] a, int fromIndex, int toIndex, short val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with an int value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(int[] a, int val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with an int value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void fill(int[] a, int fromIndex, int toIndex, int val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a long value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(long[] a, long val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a long value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void fill(long[] a, int fromIndex, int toIndex, long val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a float value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(float[] a, float val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a float value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void fill(float[] a, int fromIndex, int toIndex, float val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with a double value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- */
- public static void fill(double[] a, double val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with a double value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void fill(double[] a, int fromIndex, int toIndex, double val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
- /**
- * Fill an array with an Object value.
- *
- * @param a the array to fill
- * @param val the value to fill it with
- * @throws ClassCastException if val is not an instance of the element
- * type of a.
- */
- public static void fill(Object[] a, Object val)
- {
- fill(a, 0, a.length, val);
- }
-
- /**
- * Fill a range of an array with an Object value.
- *
- * @param a the array to fill
- * @param fromIndex the index to fill from, inclusive
- * @param toIndex the index to fill to, exclusive
- * @param val the value to fill with
- * @throws ClassCastException if val is not an instance of the element
- * type of a.
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void fill(Object[] a, int fromIndex, int toIndex, Object val)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- for (int i = fromIndex; i < toIndex; i++)
- a[i] = val;
- }
-
-
-// sort
- // Thanks to Paul Fisher (ra...@gn...) for finding this quicksort algorithm
- // as specified by Sun and porting it to Java. The algorithm is an optimised
- // quicksort, as described in Jon L. Bentley and M. Douglas McIlroy's
- // "Engineering a Sort Function", Software-Practice and Experience, Vol.
- // 23(11) P. 1249-1265 (November 1993). This algorithm gives n*log(n)
- // performance on many arrays that would take quadratic time with a standard
- // quicksort.
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the byte array to sort
- */
- public static void sort(byte[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the byte array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void sort(byte[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, byte[] d)
- {
- return (d[a] < d[b]
- ? (d[b] < d[c] ? b : d[a] < d[c] ? c : a)
- : (d[b] > d[c] ? b : d[a] > d[c] ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, byte[] a)
- {
- byte c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, byte[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(byte[] array, int from, int count)
- {
- // Use an insertion sort on small 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);
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = array[b] - array[from]) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = array[c] - array[from]) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the char array to sort
- */
- public static void sort(char[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the char array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void sort(char[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, char[] d)
- {
- return (d[a] < d[b]
- ? (d[b] < d[c] ? b : d[a] < d[c] ? c : a)
- : (d[b] > d[c] ? b : d[a] > d[c] ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, char[] a)
- {
- char c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, char[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(char[] array, int from, int count)
- {
- // Use an insertion sort on small 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);
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = array[b] - array[from]) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = array[c] - array[from]) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the short array to sort
- */
- public static void sort(short[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the short array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void sort(short[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, short[] d)
- {
- return (d[a] < d[b]
- ? (d[b] < d[c] ? b : d[a] < d[c] ? c : a)
- : (d[b] > d[c] ? b : d[a] > d[c] ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, short[] a)
- {
- short c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, short[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Performs a recursive modified quicksort.
- *
- * @param array the array to sort
- * @param from the start index (inclusive)
- * @param count the number of elements to sort
- */
- private static void qsort(short[] array, int from, int count)
- {
- // Use an insertion sort on small 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);
- return;
- }
-
- // Determine a good median element.
- int mid = count / 2;
- int lo = from;
- int hi = from + count - 1;
-
- if (count > 40)
- { // big arrays, pseudomedian of 9
- int s = count / 8;
- lo = med3(lo, lo + s, lo + 2 * s, array);
- mid = med3(mid - s, mid, mid + s, array);
- hi = med3(hi - 2 * s, hi - s, hi, array);
- }
- mid = med3(lo, mid, hi, array);
-
- int a, b, c, d;
- int comp;
-
- // Pull the median element out of the fray, and use it as a pivot.
- swap(from, mid, array);
- a = b = from;
- c = d = from + count - 1;
-
- // Repeatedly move b and c to each other, swapping elements so
- // that all elements before index b are less than the pivot, and all
- // elements after index c are greater than the pivot. a and b track
- // the elements equal to the pivot.
- while (true)
- {
- while (b <= c && (comp = array[b] - array[from]) <= 0)
- {
- if (comp == 0)
- {
- swap(a, b, array);
- a++;
- }
- b++;
- }
- while (c >= b && (comp = array[c] - array[from]) >= 0)
- {
- if (comp == 0)
- {
- swap(c, d, array);
- d--;
- }
- c--;
- }
- if (b > c)
- break;
- swap(b, c, array);
- b++;
- c--;
- }
-
- // Swap pivot(s) back in place, the recurse on left and right sections.
- hi = from + count;
- int span;
- span = Math.min(a - from, b - a);
- vecswap(from, b - span, span, array);
-
- span = Math.min(d - c, hi - d - 1);
- vecswap(b, hi - span, span, array);
-
- span = b - a;
- if (span > 1)
- qsort(array, from, span);
-
- span = d - c;
- if (span > 1)
- qsort(array, hi - span, span);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the int array to sort
- */
- public static void sort(int[] a)
- {
- qsort(a, 0, a.length);
- }
-
- /**
- * Performs a stable sort on the elements, arranging them according to their
- * natural order.
- *
- * @param a the int array to sort
- * @param fromIndex the first index to sort (inclusive)
- * @param toIndex the last index to sort (exclusive)
- * @throws IllegalArgumentException if fromIndex > toIndex
- * @throws ArrayIndexOutOfBoundsException if fromIndex < 0
- * || toIndex > a.length
- */
- public static void sort(int[] a, int fromIndex, int toIndex)
- {
- if (fromIndex > toIndex)
- throw new IllegalArgumentException();
- if (fromIndex < 0)
- throw new ArrayIndexOutOfBoundsException();
- qsort(a, fromIndex, toIndex - fromIndex);
- }
-
- /**
- * Finds the index of the median of three array elements.
- *
- * @param a the first index
- * @param b the second index
- * @param c the third index
- * @param d the array
- * @return the index (a, b, or c) which has the middle value of the three
- */
- private static int med3(int a, int b, int c, int[] d)
- {
- return (d[a] < d[b]
- ? (d[b] < d[c] ? b : d[a] < d[c] ? c : a)
- : (d[b] > d[c] ? b : d[a] > d[c] ? c : a));
- }
-
- /**
- * Swaps the elements at two locations of an array
- *
- * @param i the first index
- * @param j the second index
- * @param a the array
- */
- private static void swap(int i, int j, int[] a)
- {
- int c = a[i];
- a[i] = a[j];
- a[j] = c;
- }
-
- /**
- * Swaps two ranges of an array.
- *
- * @param i the first range start
- * @param j the second range start
- * @param n the element count
- * @param a the array
- */
- private static void vecswap(int i, int j, int n, int[] a)
- {
- for ( ; n > 0; i++, j++, n--)
- swap(i, j, a);
- }
-
- /**
- * Compares two integers in natural order, sin...
[truncated message content] |
|
From: <ls...@us...> - 2007-08-11 19:58:16
|
Revision: 3392
http://jnode.svn.sourceforge.net/jnode/?rev=3392&view=rev
Author: lsantha
Date: 2007-08-11 12:58:14 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Removed Paths:
-------------
trunk/core/src/classpath/java/java/util/Collection.java
trunk/core/src/classpath/java/java/util/Comparator.java
trunk/core/src/classpath/java/java/util/ConcurrentModificationException.java
trunk/core/src/classpath/java/java/util/Deque.java
trunk/core/src/classpath/java/java/util/DuplicateFormatFlagsException.java
trunk/core/src/classpath/java/java/util/EmptyStackException.java
trunk/core/src/classpath/java/java/util/Enumeration.java
trunk/core/src/classpath/java/java/util/Iterator.java
trunk/core/src/classpath/java/java/util/List.java
trunk/core/src/classpath/java/java/util/Map.java
trunk/core/src/classpath/java/java/util/Queue.java
trunk/core/src/classpath/java/java/util/RandomAccess.java
trunk/core/src/classpath/java/java/util/Set.java
trunk/core/src/classpath/java/java/util/SortedMap.java
trunk/core/src/classpath/java/java/util/SortedSet.java
trunk/core/src/classpath/java/java/util/package.html
Deleted: trunk/core/src/classpath/java/java/util/Collection.java
===================================================================
--- trunk/core/src/classpath/java/java/util/Collection.java 2007-08-11 19:55:49 UTC (rev 3391)
+++ trunk/core/src/classpath/java/java/util/Collection.java 2007-08-11 19:58:14 UTC (rev 3392)
@@ -1,290 +0,0 @@
-/* Collection.java -- Interface that represents a collection of objects
- Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package java.util;
-
-/**
- * Interface that represents a collection of objects. This interface is the
- * root of the collection hierarchy, and does not provide any guarantees about
- * the order of its elements or whether or not duplicate elements are
- * permitted.
- * <p>
- * All methods of this interface that are defined to modify the collection are
- * defined as <dfn>optional</dfn>. An optional operation may throw an
- * UnsupportedOperationException if the data backing this collection does not
- * support such a modification. This may mean that the data structure is
- * immutable, or that it is read-only but may change ("unmodifiable"), or
- * that it is modifiable but of fixed size (such as an array), or any number
- * of other combinations.
- * <p>
- * A class that wishes to implement this interface should consider subclassing
- * AbstractCollection, which provides basic implementations of most of the
- * methods of this interface. Classes that are prepared to make guarantees
- * about ordering or about absence of duplicate elements should consider
- * implementing List or Set respectively, both of which are subinterfaces of
- * Collection.
- * <p>
- * A general-purpose implementation of the Collection interface should in most
- * cases provide at least two constructors: One which takes no arguments and
- * creates an empty collection, and one which takes a Collection as an argument
- * and returns a collection containing the same elements (that is, creates a
- * copy of the argument using its own implementation).
- *
- * @author Original author unknown
- * @author Eric Blake (eb...@em...)
- * @author Tom Tromey (tr...@re...)
- * @author Andrew John Hughes (gnu...@me...)
- * @see List
- * @see Set
- * @see Map
- * @see SortedSet
- * @see SortedMap
- * @see HashSet
- * @see TreeSet
- * @see ArrayList
- * @see LinkedList
- * @see Vector
- * @see Collections
- * @see Arrays
- * @see AbstractCollection
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Collection<E> extends Iterable<E>
-{
- /**
- * Add an element to this collection.
- *
- * @param o the object to add.
- * @return true if the collection was modified as a result of this action.
- * @throws UnsupportedOperationException if this collection does not
- * support the add operation.
- * @throws ClassCastException if o cannot be added to this collection due
- * to its type.
- * @throws NullPointerException if o is null and this collection doesn't
- * support the addition of null values.
- * @throws IllegalArgumentException if o cannot be added to this
- * collection for some other reason.
- */
- boolean add(E o);
-
- /**
- * Add the contents of a given collection to this collection.
- *
- * @param c the collection to add.
- * @return true if the collection was modified as a result of this action.
- * @throws UnsupportedOperationException if this collection does not
- * support the addAll operation.
- * @throws ClassCastException if some element of c cannot be added to this
- * collection due to its type.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support the addition of null values.
- * @throws NullPointerException if c itself is null.
- * @throws IllegalArgumentException if some element of c cannot be added
- * to this collection for some other reason.
- */
- boolean addAll(Collection<? extends E> c);
-
- /**
- * Clear the collection, such that a subsequent call to isEmpty() would
- * return true.
- *
- * @throws UnsupportedOperationException if this collection does not
- * support the clear operation.
- */
- void clear();
-
- /**
- * Test whether this collection contains a given object as one of its
- * elements.
- *
- * @param o the element to look for.
- * @return true if this collection contains at least one element e such that
- * <code>o == null ? e == null : o.equals(e)</code>.
- * @throws ClassCastException if the type of o is not a valid type for this
- * collection.
- * @throws NullPointerException if o is null and this collection doesn't
- * support null values.
- */
- boolean contains(Object o);
-
- /**
- * Test whether this collection contains every element in a given collection.
- *
- * @param c the collection to test for.
- * @return true if for every element o in c, contains(o) would return true.
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this collection.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support null values.
- * @throws NullPointerException if c itself is null.
- */
- boolean containsAll(Collection<?> c);
-
- /**
- * Test whether this collection is equal to some object. The Collection
- * interface does not explicitly require any behaviour from this method, and
- * it may be left to the default implementation provided by Object. The Set
- * and List interfaces do, however, require specific behaviour from this
- * method.
- * <p>
- * If an implementation of Collection, which is not also an implementation of
- * Set or List, should choose to implement this method, it should take care
- * to obey the contract of the equals method of Object. In particular, care
- * should be taken to return false when o is a Set or a List, in order to
- * preserve the symmetry of the relation.
- *
- * @param o the object to compare to this collection.
- * @return true if the o is equal to this collection.
- */
- boolean equals(Object o);
-
- /**
- * Obtain a hash code for this collection. The Collection interface does not
- * explicitly require any behaviour from this method, and it may be left to
- * the default implementation provided by Object. The Set and List interfaces
- * do, however, require specific behaviour from this method.
- * <p>
- * If an implementation of Collection, which is not also an implementation of
- * Set or List, should choose to implement this method, it should take care
- * to obey the contract of the hashCode method of Object. Note that this
- * method renders it impossible to correctly implement both Set and List, as
- * the required implementations are mutually exclusive.
- *
- * @return a hash code for this collection.
- */
- int hashCode();
-
- /**
- * Test whether this collection is empty, that is, if size() == 0.
- *
- * @return true if this collection contains no elements.
- */
- boolean isEmpty();
-
- /**
- * Obtain an Iterator over this collection.
- *
- * @return an Iterator over the elements of this collection, in any order.
- */
- Iterator<E> iterator();
-
- /**
- * Remove a single occurrence of an object from this collection. That is,
- * remove an element e, if one exists, such that <code>o == null ? e == null
- * : o.equals(e)</code>.
- *
- * @param o the object to remove.
- * @return true if the collection changed as a result of this call, that is,
- * if the collection contained at least one occurrence of o.
- * @throws UnsupportedOperationException if this collection does not
- * support the remove operation.
- * @throws ClassCastException if the type of o is not a valid type
- * for this collection.
- * @throws NullPointerException if o is null and the collection doesn't
- * support null values.
- */
- boolean remove(Object o);
-
- /**
- * Remove all elements of a given collection from this collection. That is,
- * remove every element e such that c.contains(e).
- *
- * @param c The collection of objects to be removed.
- * @return true if this collection was modified as a result of this call.
- * @throws UnsupportedOperationException if this collection does not
- * support the removeAll operation.
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this collection.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support removing null values.
- * @throws NullPointerException if c itself is null.
- */
- boolean removeAll(Collection<?> c);
-
- /**
- * Remove all elements of this collection that are not contained in a given
- * collection. That is, remove every element e such that !c.contains(e).
- *
- * @param c The collection of objects to be retained.
- * @return true if this collection was modified as a result of this call.
- * @throws UnsupportedOperationException if this collection does not
- * support the retainAll operation.
- * @throws ClassCastException if the type of any element in c is not a valid
- * type for this collection.
- * @throws NullPointerException if some element of c is null and this
- * collection does not support retaining null values.
- * @throws NullPointerException if c itself is null.
- */
- boolean retainAll(Collection<?> c);
-
- /**
- * Get the number of elements in this collection.
- *
- * @return the number of elements in the collection.
- */
- int size();
-
- /**
- * Copy the current contents of this collection into an array.
- *
- * @return an array of type Object[] and length equal to the size of this
- * collection, containing the elements currently in this collection, in
- * any order.
- */
- Object[] toArray();
-
- /**
- * Copy the current contents of this collection into an array. If the array
- * passed as an argument has length less than the size of this collection, an
- * array of the same run-time type as a, and length equal to the size of this
- * collection, is allocated using Reflection. Otherwise, a itself is used.
- * The elements of this collection are copied into it, and if there is space
- * in the array, the following element is set to null. The resultant array is
- * returned.
- * Note: The fact that the following element is set to null is only useful
- * if it is known that this collection does not contain any null elements.
- *
- * @param a the array to copy this collection into.
- * @return an array containing the elements currently in this collection, in
- * any order.
- * @throws ArrayStoreException if the type of any element of the
- * collection is not a subtype of the element type of a.
- */
- <T> T[] toArray(T[] a);
-}
Deleted: trunk/core/src/classpath/java/java/util/Comparator.java
===================================================================
--- trunk/core/src/classpath/java/java/util/Comparator.java 2007-08-11 19:55:49 UTC (rev 3391)
+++ trunk/core/src/classpath/java/java/util/Comparator.java 2007-08-11 19:58:14 UTC (rev 3392)
@@ -1,119 +0,0 @@
-/* Comparator.java -- Interface for objects that specify an ordering
- Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package java.util;
-
-/**
- * Interface for objects that specify an ordering between objects. The ordering
- * should be <em>total</em>, such that any two objects of the correct type
- * can be compared, and the comparison is reflexive, anti-symmetric, and
- * transitive. It is also recommended that the comparator be <em>consistent
- * with equals</em>, although this is not a strict requirement. A relation
- * is consistent with equals if these two statements always have the same
- * results (if no exceptions occur):<br>
- * <code>compare((Object) e1, (Object) e2) == 0</code> and
- * <code>e1.equals((Object) e2)</code><br>
- * Comparators that violate consistency with equals may cause strange behavior
- * in sorted lists and sets. For example, a case-sensitive dictionary order
- * comparison of Strings is consistent with equals, but if it is
- * case-insensitive it is not, because "abc" and "ABC" compare as equal even
- * though "abc".equals("ABC") returns false.
- * <P>
- * In general, Comparators should be Serializable, because when they are passed
- * to Serializable data structures such as SortedMap or SortedSet, the entire
- * data structure will only serialize correctly if the comparator is
- * Serializable.
- *
- * @author Original author unknown
- * @author Eric Blake (eb...@em...)
- * @see Comparable
- * @see TreeMap
- * @see TreeSet
- * @see SortedMap
- * @see SortedSet
- * @see Arrays#sort(Object[], Comparator)
- * @see java.io.Serializable
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Comparator<T>
-{
- /**
- * Return an integer that is negative, zero or positive depending on whether
- * the first argument is less than, equal to or greater than the second
- * according to this ordering. This method should obey the following
- * contract:
- * <ul>
- * <li>if compare(a, b) < 0 then compare(b, a) > 0</li>
- * <li>if compare(a, b) throws an exception, so does compare(b, a)</li>
- * <li>if compare(a, b) < 0 and compare(b, c) < 0 then compare(a, c)
- * < 0</li>
- * <li>if compare(a, b) == 0 then compare(a, c) and compare(b, c) must
- * have the same sign</li>
- * </ul>
- * To be consistent with equals, the following additional constraint is
- * in place:
- * <ul>
- * <li>if a.equals(b) or both a and b are null, then
- * compare(a, b) == 0.</li>
- * </ul><p>
- *
- * Although it is permissible for a comparator to provide an order
- * inconsistent with equals, that should be documented.
- *
- * @param o1 the first object
- * @param o2 the second object
- * @return the comparison
- * @throws ClassCastException if the elements are not of types that can be
- * compared by this ordering.
- */
- int compare(T o1, T o2);
-
- /**
- * Return true if the object is equal to this object. To be
- * considered equal, the argument object must satisfy the constraints
- * of <code>Object.equals()</code>, be a Comparator, and impose the
- * same ordering as this Comparator. The default implementation
- * inherited from Object is usually adequate.
- *
- * @param obj The object
- * @return true if it is a Comparator that imposes the same order
- * @see Object#equals(Object)
- */
- boolean equals(Object obj);
-}
Deleted: trunk/core/src/classpath/java/java/util/ConcurrentModificationException.java
===================================================================
--- trunk/core/src/classpath/java/java/util/ConcurrentModificationException.java 2007-08-11 19:55:49 UTC (rev 3391)
+++ trunk/core/src/classpath/java/java/util/ConcurrentModificationException.java 2007-08-11 19:58:14 UTC (rev 3392)
@@ -1,92 +0,0 @@
-/* ConcurrentModificationException.java -- Data structure concurrently modified
- Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package java.util;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- */
-
-/**
- * Exception that is thrown by the collections classes when it is detected that
- * a modification has been made to a data structure when this is not allowed,
- * such as when a collection is structurally modified while an Iterator is
- * operating over it. In cases where this can be detected, a
- * ConcurrentModificationException will be thrown. An Iterator that detects
- * this condition is referred to as fail-fast. Notice that this can occur
- * even in single-threaded designs, if you call methods out of order.
- *
- * @author Warren Levy (wa...@cy...)
- * @author Eric Blake (eb...@em...)
- * @see Collection
- * @see Iterator
- * @see ListIterator
- * @see Vector
- * @see LinkedList
- * @see HashSet
- * @see Hashtable
- * @see TreeMap
- * @see AbstractList
- * @since 1.2
- * @status updated to 1.4
- */
-public class ConcurrentModificationException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.2.
- */
- private static final long serialVersionUID = -3666751008965953603L;
-
- /**
- * Constructs a ConcurrentModificationException with no detail message.
- */
- public ConcurrentModificationException()
- {
- }
-
- /**
- * Constructs a ConcurrentModificationException with a detail message.
- *
- * @param detail the detail message for the exception
- */
- public ConcurrentModificationException(String detail)
- {
- super(detail);
- }
-}
Deleted: trunk/core/src/classpath/java/java/util/Deque.java
===================================================================
--- trunk/core/src/classpath/java/java/util/Deque.java 2007-08-11 19:55:49 UTC (rev 3391)
+++ trunk/core/src/classpath/java/java/util/Deque.java 2007-08-11 19:58:14 UTC (rev 3392)
@@ -1,547 +0,0 @@
-/*
- * Written by Doug Lea and Josh Bloch with assistance from members of
- * JCP JSR-166 Expert Group and released to the public domain, as explained
- * at http://creativecommons.org/licenses/publicdomain
- */
-
-package java.util;
-
-/**
- * A linear collection that supports element insertion and removal at
- * both ends. The name <i>deque</i> is short for "double ended queue"
- * and is usually pronounced "deck". Most <tt>Deque</tt>
- * implementations place no fixed limits on the number of elements
- * they may contain, but this interface supports capacity-restricted
- * deques as well as those with no fixed size limit.
- *
- * <p>This interface defines methods to access the elements at both
- * ends of the deque. Methods are provided to insert, remove, and
- * examine the element. Each of these methods exists in two forms:
- * one throws an exception if the operation fails, the other returns a
- * special value (either <tt>null</tt> or <tt>false</tt>, depending on
- * the operation). The latter form of the insert operation is
- * designed specifically for use with capacity-restricted
- * <tt>Deque</tt> implementations; in most implementations, insert
- * operations cannot fail.
- *
- * <p>The twelve methods described above are summarized in the
- * following table:
- *
- * <p>
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
- * <tr>
- * <td></td>
- * <td ALIGN=CENTER COLSPAN = 2> <b>First Element (Head)</b></td>
- * <td ALIGN=CENTER COLSPAN = 2> <b>Last Element (Tail)</b></td>
- * </tr>
- * <tr>
- * <td></td>
- * <td ALIGN=CENTER><em>Throws exception</em></td>
- * <td ALIGN=CENTER><em>Special value</em></td>
- * <td ALIGN=CENTER><em>Throws exception</em></td>
- * <td ALIGN=CENTER><em>Special value</em></td>
- * </tr>
- * <tr>
- * <td><b>Insert</b></td>
- * <td>{@link #addFirst addFirst(e)}</td>
- * <td>{@link #offerFirst offerFirst(e)}</td>
- * <td>{@link #addLast addLast(e)}</td>
- * <td>{@link #offerLast offerLast(e)}</td>
- * </tr>
- * <tr>
- * <td><b>Remove</b></td>
- * <td>{@link #removeFirst removeFirst()}</td>
- * <td>{@link #pollFirst pollFirst()}</td>
- * <td>{@link #removeLast removeLast()}</td>
- * <td>{@link #pollLast pollLast()}</td>
- * </tr>
- * <tr>
- * <td><b>Examine</b></td>
- * <td>{@link #getFirst getFirst()}</td>
- * <td>{@link #peekFirst peekFirst()}</td>
- * <td>{@link #getLast getLast()}</td>
- * <td>{@link #peekLast peekLast()}</td>
- * </tr>
- * </table>
- *
- * <p>This interface extends the {@link Queue} interface. When a deque is
- * used as a queue, FIFO (First-In-First-Out) behavior results. Elements are
- * added at the end of the deque and removed from the beginning. The methods
- * inherited from the <tt>Queue</tt> interface are precisely equivalent to
- * <tt>Deque</tt> methods as indicated in the following table:
- *
- * <p>
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
- * <tr>
- * <td ALIGN=CENTER> <b><tt>Queue</tt> Method</b></td>
- * <td ALIGN=CENTER> <b>Equivalent <tt>Deque</tt> Method</b></td>
- * </tr>
- * <tr>
- * <td>{@link java.util.Queue#add add(e)}</td>
- * <td>{@link #addLast addLast(e)}</td>
- * </tr>
- * <tr>
- * <td>{@link java.util.Queue#offer offer(e)}</td>
- * <td>{@link #offerLast offerLast(e)}</td>
- * </tr>
- * <tr>
- * <td>{@link java.util.Queue#remove remove()}</td>
- * <td>{@link #removeFirst removeFirst()}</td>
- * </tr>
- * <tr>
- * <td>{@link java.util.Queue#poll poll()}</td>
- * <td>{@link #pollFirst pollFirst()}</td>
- * </tr>
- * <tr>
- * <td>{@link java.util.Queue#element element()}</td>
- * <td>{@link #getFirst getFirst()}</td>
- * </tr>
- * <tr>
- * <td>{@link java.util.Queue#peek peek()}</td>
- * <td>{@link #peek peekFirst()}</td>
- * </tr>
- * </table>
- *
- * <p>Deques can also be used as LIFO (Last-In-First-Out) stacks. This
- * interface should be used in preference to the legacy {@link Stack} class.
- * When a deque is used as a stack, elements are pushed and popped from the
- * beginning of the deque. Stack methods are precisely equivalent to
- * <tt>Deque</tt> methods as indicated in the table below:
- *
- * <p>
- * <table BORDER CELLPADDING=3 CELLSPACING=1>
- * <tr>
- * <td ALIGN=CENTER> <b>Stack Method</b></td>
- * <td ALIGN=CENTER> <b>Equivalent <tt>Deque</tt> Method</b></td>
- * </tr>
- * <tr>
- * <td>{@link #push push(e)}</td>
- * <td>{@link #addFirst addFirst(e)}</td>
- * </tr>
- * <tr>
- * <td>{@link #pop pop()}</td>
- * <td>{@link #removeFirst removeFirst()}</td>
- * </tr>
- * <tr>
- * <td>{@link #peek peek()}</td>
- * <td>{@link #peekFirst peekFirst()}</td>
- * </tr>
- * </table>
- *
- * <p>Note that the {@link #peek peek} method works equally well when
- * a deque is used as a queue or a stack; in either case, elements are
- * drawn from the beginning of the deque.
- *
- * <p>This interface provides two methods to remove interior
- * elements, {@link #removeFirstOccurrence removeFirstOccurrence} and
- * {@link #removeLastOccurrence removeLastOccurrence}.
- *
- * <p>Unlike the {@link List} interface, this interface does not
- * provide support for indexed access to elements.
- *
- * <p>While <tt>Deque</tt> implementations are not strictly required
- * to prohibit the insertion of null elements, they are strongly
- * encouraged to do so. Users of any <tt>Deque</tt> implementations
- * that do allow null elements are strongly encouraged <i>not</i> to
- * take advantage of the ability to insert nulls. This is so because
- * <tt>null</tt> is used as a special return value by various methods
- * to indicated that the deque is empty.
- *
- * <p><tt>Deque</tt> implementations generally do not define
- * element-based versions of the <tt>equals</tt> and <tt>hashCode</tt>
- * methods, but instead inherit the identity-based versions from class
- * <tt>Object</tt>.
- *
- * <p>This interface is a member of the <a
- * href="{@docRoot}/../technotes/guides/collections/index.html"> Java Collections
- * Framework</a>.
- *
- * @author Doug Lea
- * @author Josh Bloch
- * @since 1.6
- * @param <E> the type of elements held in this collection
- */
-
-public interface Deque<E> extends Queue<E> {
- /**
- * Inserts the specified element at the front of this deque if it is
- * possible to do so immediately without violating capacity restrictions.
- * When using a capacity-restricted deque, it is generally preferable to
- * use method {@link #offerFirst}.
- *
- * @param e the element to add
- * @throws IllegalStateException if the element cannot be added at this
- * time due to capacity restrictions
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this deque
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this deque
- */
- void addFirst(E e);
-
- /**
- * Inserts the specified element at the end of this deque if it is
- * possible to do so immediately without violating capacity restrictions.
- * When using a capacity-restricted deque, it is generally preferable to
- * use method {@link #offerLast}.
- *
- * <p>This method is equivalent to {@link #add}.
- *
- * @param e the element to add
- * @throws IllegalStateException if the element cannot be added at this
- * time due to capacity restrictions
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this deque
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this deque
- */
- void addLast(E e);
-
- /**
- * Inserts the specified element at the front of this deque unless it would
- * violate capacity restrictions. When using a capacity-restricted deque,
- * this method is generally preferable to the {@link #addFirst} method,
- * which can fail to insert an element only by throwing an exception.
- *
- * @param e the element to add
- * @return <tt>true</tt> if the element was added to this deque, else
- * <tt>false</tt>
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this deque
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this deque
- */
- boolean offerFirst(E e);
-
- /**
- * Inserts the specified element at the end of this deque unless it would
- * violate capacity restrictions. When using a capacity-restricted deque,
- * this method is generally preferable to the {@link #addLast} method,
- * which can fail to insert an element only by throwing an exception.
- *
- * @param e the element to add
- * @return <tt>true</tt> if the element was added to this deque, else
- * <tt>false</tt>
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this deque
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this deque
- */
- boolean offerLast(E e);
-
- /**
- * Retrieves and removes the first element of this deque. This method
- * differs from {@link #pollFirst pollFirst} only in that it throws an
- * exception if this deque is empty.
- *
- * @return the head of this deque
- * @throws NoSuchElementException if this deque is empty
- */
- E removeFirst();
-
- /**
- * Retrieves and removes the last element of this deque. This method
- * differs from {@link #pollLast pollLast} only in that it throws an
- * exception if this deque is empty.
- *
- * @return the tail of this deque
- * @throws NoSuchElementException if this deque is empty
- */
- E removeLast();
-
- /**
- * Retrieves and removes the first element of this deque,
- * or returns <tt>null</tt> if this deque is empty.
- *
- * @return the head of this deque, or <tt>null</tt> if this deque is empty
- */
- E pollFirst();
-
- /**
- * Retrieves and removes the last element of this deque,
- * or returns <tt>null</tt> if this deque is empty.
- *
- * @return the tail of this deque, or <tt>null</tt> if this deque is empty
- */
- E pollLast();
-
- /**
- * Retrieves, but does not remove, the first element of this deque.
- *
- * This method differs from {@link #peekFirst peekFirst} only in that it
- * throws an exception if this deque is empty.
- *
- * @return the head of this deque
- * @throws NoSuchElementException if this deque is empty
- */
- E getFirst();
-
- /**
- * Retrieves, but does not remove, the last element of this deque.
- * This method differs from {@link #peekLast peekLast} only in that it
- * throws an exception if this deque is empty.
- *
- * @return the tail of this deque
- * @throws NoSuchElementException if this deque is empty
- */
- E getLast();
-
- /**
- * Retrieves, but does not remove, the first element of this deque,
- * or returns <tt>null</tt> if this deque is empty.
- *
- * @return the head of this deque, or <tt>null</tt> if this deque is empty
- */
- E peekFirst();
-
- /**
- * Retrieves, but does not remove, the last element of this deque,
- * or returns <tt>null</tt> if this deque is empty.
- *
- * @return the tail of this deque, or <tt>null</tt> if this deque is empty
- */
- E peekLast();
-
- /**
- * Removes the first occurrence of the specified element from this deque.
- * If the deque does not contain the element, it is unchanged.
- * More formally, removes the first element <tt>e</tt> such that
- * <tt>(o==null ? e==null : o.equals(e))</tt>
- * (if such an element exists).
- * Returns <tt>true</tt> if this deque contained the specified element
- * (or equivalently, if this deque changed as a result of the call).
- *
- * @param o element to be removed from this deque, if present
- * @return <tt>true</tt> if an element was removed as a result of this call
- * @throws ClassCastException if the class of the specified element
- * is incompatible with this deque (optional)
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements (optional)
- */
- boolean removeFirstOccurrence(Object o);
-
- /**
- * Removes the last occurrence of the specified element from this deque.
- * If the deque does not contain the element, it is unchanged.
- * More formally, removes the last element <tt>e</tt> such that
- * <tt>(o==null ? e==null : o.equals(e))</tt>
- * (if such an element exists).
- * Returns <tt>true</tt> if this deque contained the specified element
- * (or equivalently, if this deque changed as a result of the call).
- *
- * @param o element to be removed from this deque, if present
- * @return <tt>true</tt> if an element was removed as a result of this call
- * @throws ClassCastException if the class of the specified element
- * is incompatible with this deque (optional)
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements (optional)
- */
- boolean removeLastOccurrence(Object o);
-
- // *** Queue methods ***
-
- /**
- * Inserts the specified element into the queue represented by this deque
- * (in other words, at the tail of this deque) if it is possible to do so
- * immediately without violating capacity restrictions, returning
- * <tt>true</tt> upon success and throwing an
- * <tt>IllegalStateException</tt> if no space is currently available.
- * When using a capacity-restricted deque, it is generally preferable to
- * use {@link #offer(Object) offer}.
- *
- * <p>This method is equivalent to {@link #addLast}.
- *
- * @param e the element to add
- * @return <tt>true</tt> (as specified by {@link Collection#add})
- * @throws IllegalStateException if the element cannot be added at this
- * time due to capacity restrictions
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this deque
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this deque
- */
- boolean add(E e);
-
- /**
- * Inserts the specified element into the queue represented by this deque
- * (in other words, at the tail of this deque) if it is possible to do so
- * immediately without violating capacity restrictions, returning
- * <tt>true</tt> upon success and <tt>false</tt> if no space is currently
- * available. When using a capacity-restricted deque, this method is
- * generally preferable to the {@link #add} method, which can fail to
- * insert an element only by throwing an exception.
- *
- * <p>This method is equivalent to {@link #offerLast}.
- *
- * @param e the element to add
- * @return <tt>true</tt> if the element was added to this deque, else
- * <tt>false</tt>
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this deque
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this deque
- */
- boolean offer(E e);
-
- /**
- * Retrieves and removes the head of the queue represented by this deque
- * (in other words, the first element of this deque).
- * This method differs from {@link #poll poll} only in that it throws an
- * exception if this deque is empty.
- *
- * <p>This method is equivalent to {@link #removeFirst()}.
- *
- * @return the head of the queue represented by this deque
- * @throws NoSuchElementException if this deque is empty
- */
- E remove();
-
- /**
- * Retrieves and removes the head of the queue represented by this deque
- * (in other words, the first element of this deque), or returns
- * <tt>null</tt> if this deque is empty.
- *
- * <p>This method is equivalent to {@link #pollFirst()}.
- *
- * @return the first element of this deque, or <tt>null</tt> if
- * this deque is empty
- */
- E poll();
-
- /**
- * Retrieves, but does not remove, the head of the queue represented by
- * this deque (in other words, the first element of this deque).
- * This method differs from {@link #peek peek} only in that it throws an
- * exception if this deque is empty.
- *
- * <p>This method is equivalent to {@link #getFirst()}.
- *
- * @return the head of the queue represented by this deque
- * @throws NoSuchElementException if this deque is empty
- */
- E element();
-
- /**
- * Retrieves, but does not remove, the head of the queue represented by
- * this deque (in other words, the first element of this deque), or
- * returns <tt>null</tt> if this deque is empty.
- *
- * <p>This method is equivalent to {@link #peekFirst()}.
- *
- * @return the head of the queue represented by this deque, or
- * <tt>null</tt> if this deque is empty
- */
- E peek();
-
-
- // *** Stack methods ***
-
- /**
- * Pushes an element onto the stack represented by this deque (in other
- * words, at the head of this deque) if it is possible to do so
- * immediately without violating capacity restrictions, returning
- * <tt>true</tt> upon success and throwing an
- * <tt>IllegalStateException</tt> if no space is currently available.
- *
- * <p>This method is equivalent to {@link #addFirst}.
- *
- * @param e the element to push
- * @throws IllegalStateException if the element cannot be added at this
- * time due to capacity restrictions
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this deque
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this deque
- */
- void push(E e);
-
- /**
- * Pops an element from the stack represented by this deque. In other
- * words, removes and returns the first element of this deque.
- *
- * <p>This method is equivalent to {@link #removeFirst()}.
- *
- * @return the element at the front of this deque (which is the top
- * of the stack represented by this deque)
- * @throws NoSuchElementException if this deque is empty
- */
- E pop();
-
-
- // *** Collection methods ***
-
- /**
- * Removes the first occurrence of the specified element from this deque.
- * If the deque does not contain the element, it is unchanged.
- * More formally, removes the first element <tt>e</tt> such that
- * <tt>(o==null ? e==null : o.equals(e))</tt>
- * (if such an element exists).
- * Returns <tt>true</tt> if this deque contained the specified element
- * (or equivalently, if this deque changed as a result of the call).
- *
- * <p>This method is equivalent to {@link #removeFirstOccurrence}.
- *
- * @param o element to be removed from this deque, if present
- * @return <tt>true</tt> if an element was removed as a result of this call
- * @throws ClassCastException if the class of the specified element
- * is incompatible with this deque (optional)
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements (optional)
- */
- boolean remove(Object o);
-
- /**
- * Returns <tt>true</tt> if this deque contains the specified element.
- * More formally, returns <tt>true</tt> if and only if this deque contains
- * at least one element <tt>e</tt> such that
- * <tt>(o==null ? e==null : o.equals(e))</tt>.
- *
- * @param o element whose presence in this deque is to be tested
- * @return <tt>true</tt> if this deque contains the specified element
- * @throws ClassCastException if the type of the specified element
- * is incompatible with this deque (optional)
- * @throws NullPointerException if the specified element is null and this
- * deque does not permit null elements (optional)
- */
- boolean contains(Object o);
-
- /**
- * Returns the number of elements in this deque.
- *
- * @return the number of elements in this deque
- */
- public int size();
-
- /**
- * Returns an iterator over the elements in this deque in proper sequence.
- * The elements will be returned in order from first (head) to last (tail).
- *
- * @return an iterator over the elements in this deque in proper sequence
- */
- Iterator<E> iterator();
-
- /**
- * Returns an iterator over the elements in this deque in reverse
- * sequential order. The elements will be returned in order from
- * last (tail) to first (head).
- *
- * @return an iterator over the elements in this deque in reverse
- * sequence
- */
- Iterator<E> descendingIterator();
-
-}
Deleted: trunk/core/src/classpath/java/java/util/DuplicateFormatFlagsException.java
===================================================================
--- trunk/core/src/classpath/java/java/util/DuplicateFormatFlagsException.java 2007-08-11 19:55:49 UTC (rev 3391)
+++ trunk/core/src/classpath/java/java/util/DuplicateFormatFlagsException.java 2007-08-11 19:58:14 UTC (rev 3392)
@@ -1,88 +0,0 @@
-/* DuplicateFormatFlagsException.java
- Copyright (C) 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-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 (tr...@re...)
- * @author Andrew John Hughes (gnu...@me...)
- * @since 1.5
- */
-public class DuplicateFormatFlagsException
- extends IllegalFormatException
-{
- private static final long serialVersionUID = 18890531L;
-
- /**
- * The flags which contain a duplicate.
- *
- * @serial the flags containing a duplicate.
- */
- // Note: name fixed by serialization.
- private String flags;
-
- /**
- * Constructs a new <code>DuplicateFormatFlagsException</code>
- * which specifies that the supplied set of flags contains a
- * duplicate.
- *
- * @param flags the flags containing a duplicate.
- * @throws NullPointerException if <code>flags</code> is null.
- */
- public DuplicateFormatFlagsException(String flags)
- {
- super("Duplicate flag passed in " + flags);
- if (flags == null)
- throw new
- NullPointerException("Null flags value passed to constructor.");
- this.flags = flags;
- }
-
- /**
- * Returns the flags which contain a duplicate.
- *
- * @return the flags.
- */
- public String getFlags()
- {
- return flags;
- }
-}
Deleted: trunk/core/src/classpath/java/java/util/EmptyStackException.java
===================================================================
--- trunk/core/src/classpath/java/java/util/EmptyStackException.java 2007-08-11 19:55:49 UTC (rev 3391)
+++ trunk/core/src/classpath/java/java/util/EmptyStackException.java 2007-08-11 19:58:14 UTC (rev 3392)
@@ -1,69 +0,0 @@
-/* EmptyStackException.java -- Attempt to pop from an empty stack
- Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package java.util;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1
- * plus online API docs for JDK 1.2 beta from http://www.javasoft.com.
- */
-
-/**
- * This exception is thrown by the Stack class when an attempt is made to pop
- * or otherwise access elements from an empty stack.
- *
- * @author Warren Levy (wa...@cy...)
- * @author Eric Blake (eb...@em...)
- * @see Stack
- * @since 1.0
- * @status updated to 1.4
- */
-public class EmptyStackException extends RuntimeException
-{
- /**
- * Compatible with JDK 1.0.
- */
- private static final long serialVersionUID = 5084686378493302095L;
-
- /**
- * Constructs an EmptyStackException with no detail message.
- */
- public EmptyStackException()
- {
- }
-}
Deleted: trunk/core/src/classpath/java/java/util/Enumeration.java
===================================================================
--- trunk/core/src/classpath/java/java/util/Enumeration.java 2007-08-11 19:55:49 UTC (rev 3391)
+++ trunk/core/src/classpath/java/java/util/Enumeration.java 2007-08-11 19:58:14 UTC (rev 3392)
@@ -1,82 +0,0 @@
-/* Enumeration.java -- Interface for enumerating lists of objects
- Copyright (C) 1998, 1999, 2001, 2004, 2005
- Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.util;
-
-/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
- * "The Java Language Specification", ISBN 0-201-63451-1.
- * Status: Believed complete and correct
- */
-
-/**
- * Interface for lists of objects that can be returned in sequence. Successive
- * objects are obtained by the nextElement method.
- * <p>
- * As of Java 1.2, the Iterator interface provides the same functionality, but
- * with shorter method names and a new optional method to remove items from the
- * list. If writing for 1.2, consider using Iterator instead. Enumerations over
- * the new collections classes, for use with legacy APIs that require them, can
- * be obtained by the enumeration method in class Collections.
- *
- * @author Warren Levy (wa...@cy...)
- * @author Eric Blake (eb...@em...)
- * @see Iterator
- * @see Hashtable
- * @see Vector
- * @since 1.0
- * @status updated to 1.4
- */
-public interface Enumeration<E>
-{
- /**
- * Tests whether there are elements remaining in the enumeration.
- *
- * @return true if there is at least one more element in the enumeration,
- * that is, if the next call to nextElement will not throw a
- * NoSuchElementException.
- */
- boolean hasMoreElements();
-
- /**
- * Obtain the next element in the enumeration.
- *
- * @return the next element in the enumeration
- * @throws NoSuchElementException if there are no more elements
- */
- E nextElement();
-}
Deleted: trunk/core/src/classpath/java/java/util/Iterator.java
===================================================================
--- trunk/core/src/classpath/java/java/util/Iterator.java 2007-08-11 19:55:49 UTC (rev 3391)
+++ trunk/core/src/classpath/java/java/util/Iterator.java 2007-08-11 19:58:14 UTC (rev 3392)
@@ -1,87 +0,0 @@
-/* Iterator.java -- Interface for iterating over collections
- Copyright (C) 1998, 2001, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package java.util;
-
-/**
- * An object which iterates over a collection. An Iterator is used to return
- * the items once only, in sequence, by successive calls to the next method.
- * It is also possible to remove elements from the underlying collection by
- * using the optional remove method. Iterator is intended as a replacement
- * for the Enumeration interface of previous versions of Java, which did not
- * have the remove method and had less conveniently named methods.
- *
- * @author Original author unknown
- * @author Eric Blake (eb...@em...)
- * @see Collection
- * @see ListIterator
- * @see Enumeration
- * @since 1.2
- * @status updated to 1.4
- */
-public interface Iterator<E>
-{
- /**
- * Tests whether there are elements remaining in the collection. In other
- * words, calling <code>next()</code> will not throw an exception.
- *
- * @return true if there is at least one more element in the collection
- */
- boolean hasNext();
-
- /**
- * Obtain the next element in the collection.
- *
- * @return the next element in the collection
- * @throws NoSuchElementException if there are no more elements
- */
- E next();
-
- /**
- * Remove from the underlying collection the last element returned by next
- * (optional operation). This method can be called only once after each
- * call to <code>next()</code>. It does not affect what will be returned
- * by subsequent calls to next.
- *
- * @throws IllegalStateException if next has not yet been called or remove
- * has already been called since the last call to next.
- * @throws UnsupportedOperationException if this Iterator does not support
- * the remove operation.
- */
- void remove();
-}
Deleted: trunk/core/src/classpath/java/java/util/List.java
===================================================================
--- trunk/core/src/classpath/java/java/util/List.java 2007-08-11 19:55:49 UTC (rev 3391)
+++ trunk/core/src/classpath/java/java/util/List.java 2007-08-11 19:58:14 UTC (rev 3392)
@@ -1,451 +0,0 @@
-/* List.java -- An ordered collection which ...
[truncated message content] |
|
From: <ls...@us...> - 2007-08-11 19:55:50
|
Revision: 3391
http://jnode.svn.sourceforge.net/jnode/?rev=3391&view=rev
Author: lsantha
Date: 2007-08-11 12:55:49 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/java/java/util/Collection.java
trunk/core/src/openjdk/java/java/util/Comparator.java
trunk/core/src/openjdk/java/java/util/ConcurrentModificationException.java
trunk/core/src/openjdk/java/java/util/Deque.java
trunk/core/src/openjdk/java/java/util/DuplicateFormatFlagsException.java
trunk/core/src/openjdk/java/java/util/EmptyStackException.java
trunk/core/src/openjdk/java/java/util/Enumeration.java
trunk/core/src/openjdk/java/java/util/Iterator.java
trunk/core/src/openjdk/java/java/util/List.java
trunk/core/src/openjdk/java/java/util/Map.java
trunk/core/src/openjdk/java/java/util/Queue.java
trunk/core/src/openjdk/java/java/util/RandomAccess.java
trunk/core/src/openjdk/java/java/util/Set.java
trunk/core/src/openjdk/java/java/util/SortedMap.java
trunk/core/src/openjdk/java/java/util/SortedSet.java
trunk/core/src/openjdk/java/java/util/package.html
trunk/core/src/openjdk/vm/sun/reflect/NativeConstantPool.java
Added: trunk/core/src/openjdk/java/java/util/Collection.java
===================================================================
--- trunk/core/src/openjdk/java/java/util/Collection.java (rev 0)
+++ trunk/core/src/openjdk/java/java/util/Collection.java 2007-08-11 19:55:49 UTC (rev 3391)
@@ -0,0 +1,441 @@
+/*
+ * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.util;
+
+/**
+ * The root interface in the <i>collection hierarchy</i>. A collection
+ * represents a group of objects, known as its <i>elements</i>. Some
+ * collections allow duplicate elements and others do not. Some are ordered
+ * and others unordered. The JDK does not provide any <i>direct</i>
+ * implementations of this interface: it provides implementations of more
+ * specific subinterfaces like <tt>Set</tt> and <tt>List</tt>. This interface
+ * is typically used to pass collections around and manipulate them where
+ * maximum generality is desired.
+ *
+ * <p><i>Bags</i> or <i>multisets</i> (unordered collections that may contain
+ * duplicate elements) should implement this interface directly.
+ *
+ * <p>All general-purpose <tt>Collection</tt> implementation classes (which
+ * typically implement <tt>Collection</tt> indirectly through one of its
+ * subinterfaces) should provide two "standard" constructors: a void (no
+ * arguments) constructor, which creates an empty collection, and a
+ * constructor with a single argument of type <tt>Collection</tt>, which
+ * creates a new collection with the same elements as its argument. In
+ * effect, the latter constructor allows the user to copy any collection,
+ * producing an equivalent collection of the desired implementation type.
+ * There is no way to enforce this convention (as interfaces cannot contain
+ * constructors) but all of the general-purpose <tt>Collection</tt>
+ * implementations in the Java platform libraries comply.
+ *
+ * <p>The "destructive" methods contained in this interface, that is, the
+ * methods that modify the collection on which they operate, are specified to
+ * throw <tt>UnsupportedOperationException</tt> if this collection does not
+ * support the operation. If this is the case, these methods may, but are not
+ * required to, throw an <tt>UnsupportedOperationException</tt> if the
+ * invocation would have no effect on the collection. For example, invoking
+ * the {@link #addAll(Collection)} method on an unmodifiable collection may,
+ * but is not required to, throw the exception if the collection to be added
+ * is empty.
+ *
+ * <p>Some collection implementations have restrictions on the elements that
+ * they may contain. For example, some implementations prohibit null elements,
+ * and some have restrictions on the types of their elements. Attempting to
+ * add an ineligible element throws an unchecked exception, typically
+ * <tt>NullPointerException</tt> or <tt>ClassCastException</tt>. Attempting
+ * to query the presence of an ineligible element may throw an exception,
+ * or it may simply return false; some implementations will exhibit the former
+ * behavior and some will exhibit the latter. More generally, attempting an
+ * operation on an ineligible element whose completion would not result in
+ * the insertion of an ineligible element into the collection may throw an
+ * exception or it may succeed, at the option of the implementation.
+ * Such exceptions are marked as "optional" in the specification for this
+ * interface.
+ *
+ * <p>It is up to each collection to determine its own synchronization
+ * policy. In the absence of a stronger guarantee by the
+ * implementation, undefined behavior may result from the invocation
+ * of any method on a collection that is being mutated by another
+ * thread; this includes direct invocations, passing the collection to
+ * a method that might perform invocations, and using an existing
+ * iterator to examine the collection.
+ *
+ * <p>Many methods in Collections Framework interfaces are defined in
+ * terms of the {@link Object#equals(Object) equals} method. For example,
+ * the specification for the {@link #contains(Object) contains(Object o)}
+ * method says: "returns <tt>true</tt> if and only if this collection
+ * contains at least one element <tt>e</tt> such that
+ * <tt>(o==null ? e==null : o.equals(e))</tt>." This specification should
+ * <i>not</i> be construed to imply that invoking <tt>Collection.contains</tt>
+ * with a non-null argument <tt>o</tt> will cause <tt>o.equals(e)</tt> to be
+ * invoked for any element <tt>e</tt>. Implementations are free to implement
+ * optimizations whereby the <tt>equals</tt> invocation is avoided, for
+ * example, by first comparing the hash codes of the two elements. (The
+ * {@link Object#hashCode()} specification guarantees that two objects with
+ * unequal hash codes cannot be equal.) More generally, implementations of
+ * the various Collections Framework interfaces are free to take advantage of
+ * the specified behavior of underlying {@link Object} methods wherever the
+ * implementor deems it appropriate.
+ *
+ * <p>This interface is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @author Josh Bloch
+ * @author Neal Gafter
+ * @version 1.61, 05/05/07
+ * @see Set
+ * @see List
+ * @see Map
+ * @see SortedSet
+ * @see SortedMap
+ * @see HashSet
+ * @see TreeSet
+ * @see ArrayList
+ * @see LinkedList
+ * @see Vector
+ * @see Collections
+ * @see Arrays
+ * @see AbstractCollection
+ * @since 1.2
+ */
+
+public interface Collection<E> extends Iterable<E> {
+ // Query Operations
+
+ /**
+ * Returns the number of elements in this collection. If this collection
+ * contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
+ * <tt>Integer.MAX_VALUE</tt>.
+ *
+ * @return the number of elements in this collection
+ */
+ int size();
+
+ /**
+ * Returns <tt>true</tt> if this collection contains no elements.
+ *
+ * @return <tt>true</tt> if this collection contains no elements
+ */
+ boolean isEmpty();
+
+ /**
+ * Returns <tt>true</tt> if this collection contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this collection
+ * contains at least one element <tt>e</tt> such that
+ * <tt>(o==null ? e==null : o.equals(e))</tt>.
+ *
+ * @param o element whose presence in this collection is to be tested
+ * @return <tt>true</tt> if this collection contains the specified
+ * element
+ * @throws ClassCastException if the type of the specified element
+ * is incompatible with this collection (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * collection does not permit null elements (optional)
+ */
+ boolean contains(Object o);
+
+ /**
+ * Returns an iterator over the elements in this collection. There are no
+ * guarantees concerning the order in which the elements are returned
+ * (unless this collection is an instance of some class that provides a
+ * guarantee).
+ *
+ * @return an <tt>Iterator</tt> over the elements in this collection
+ */
+ Iterator<E> iterator();
+
+ /**
+ * Returns an array containing all of the elements in this collection.
+ * If this collection makes any guarantees as to what order its elements
+ * are returned by its iterator, this method must return the elements in
+ * the same order.
+ *
+ * <p>The returned array will be "safe" in that no references to it are
+ * maintained by this collection. (In other words, this method must
+ * allocate a new array even if this collection is backed by an array).
+ * The caller is thus free to modify the returned array.
+ *
+ * <p>This method acts as bridge between array-based and collection-based
+ * APIs.
+ *
+ * @return an array containing all of the elements in this collection
+ */
+ Object[] toArray();
+
+ /**
+ * Returns an array containing all of the elements in this collection;
+ * the runtime type of the returned array is that of the specified array.
+ * If the collection fits in the specified array, it is returned therein.
+ * Otherwise, a new array is allocated with the runtime type of the
+ * specified array and the size of this collection.
+ *
+ * <p>If this collection fits in the specified array with room to spare
+ * (i.e., the array has more elements than this collection), the element
+ * in the array immediately following the end of the collection is set to
+ * <tt>null</tt>. (This is useful in determining the length of this
+ * collection <i>only</i> if the caller knows that this collection does
+ * not contain any <tt>null</tt> elements.)
+ *
+ * <p>If this collection makes any guarantees as to what order its elements
+ * are returned by its iterator, this method must return the elements in
+ * the same order.
+ *
+ * <p>Like the {@link #toArray()} method, this method acts as bridge between
+ * array-based and collection-based APIs. Further, this method allows
+ * precise control over the runtime type of the output array, and may,
+ * under certain circumstances, be used to save allocation costs.
+ *
+ * <p>Suppose <tt>x</tt> is a collection known to contain only strings.
+ * The following code can be used to dump the collection into a newly
+ * allocated array of <tt>String</tt>:
+ *
+ * <pre>
+ * String[] y = x.toArray(new String[0]);</pre>
+ *
+ * Note that <tt>toArray(new Object[0])</tt> is identical in function to
+ * <tt>toArray()</tt>.
+ *
+ * @param a the array into which the elements of this collection are to be
+ * stored, if it is big enough; otherwise, a new array of the same
+ * runtime type is allocated for this purpose.
+ * @return an array containing all of the elements in this collection
+ * @throws ArrayStoreException if the runtime type of the specified array
+ * is not a supertype of the runtime type of every element in
+ * this collection
+ * @throws NullPointerException if the specified array is null
+ */
+ <T> T[] toArray(T[] a);
+
+ // Modification Operations
+
+ /**
+ * Ensures that this collection contains the specified element (optional
+ * operation). Returns <tt>true</tt> if this collection changed as a
+ * result of the call. (Returns <tt>false</tt> if this collection does
+ * not permit duplicates and already contains the specified element.)<p>
+ *
+ * Collections that support this operation may place limitations on what
+ * elements may be added to this collection. In particular, some
+ * collections will refuse to add <tt>null</tt> elements, and others will
+ * impose restrictions on the type of elements that may be added.
+ * Collection classes should clearly specify in their documentation any
+ * restrictions on what elements may be added.<p>
+ *
+ * If a collection refuses to add a particular element for any reason
+ * other than that it already contains the element, it <i>must</i> throw
+ * an exception (rather than returning <tt>false</tt>). This preserves
+ * the invariant that a collection always contains the specified element
+ * after this call returns.
+ *
+ * @param e element whose presence in this collection is to be ensured
+ * @return <tt>true</tt> if this collection changed as a result of the
+ * call
+ * @throws UnsupportedOperationException if the <tt>add</tt> operation
+ * is not supported by this collection
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this collection
+ * @throws NullPointerException if the specified element is null and this
+ * collection does not permit null elements
+ * @throws IllegalArgumentException if some property of the element
+ * prevents it from being added to this collection
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to insertion restrictions
+ */
+ boolean add(E e);
+
+ /**
+ * Removes a single instance of the specified element from this
+ * collection, if it is present (optional operation). More formally,
+ * removes an element <tt>e</tt> such that
+ * <tt>(o==null ? e==null : o.equals(e))</tt>, if
+ * this collection contains one or more such elements. Returns
+ * <tt>true</tt> if this collection contained the specified element (or
+ * equivalently, if this collection changed as a result of the call).
+ *
+ * @param o element to be removed from this collection, if present
+ * @return <tt>true</tt> if an element was removed as a result of this call
+ * @throws ClassCastException if the type of the specified element
+ * is incompatible with this collection (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * collection does not permit null elements (optional)
+ * @throws UnsupportedOperationException if the <tt>remove</tt> operation
+ * is not supported by this collection
+ */
+ boolean remove(Object o);
+
+
+ // Bulk Operations
+
+ /**
+ * Returns <tt>true</tt> if this collection contains all of the elements
+ * in the specified collection.
+ *
+ * @param c collection to be checked for containment in this collection
+ * @return <tt>true</tt> if this collection contains all of the elements
+ * in the specified collection
+ * @throws ClassCastException if the types of one or more elements
+ * in the specified collection are incompatible with this
+ * collection (optional)
+ * @throws NullPointerException if the specified collection contains one
+ * or more null elements and this collection does not permit null
+ * elements (optional), or if the specified collection is null
+ * @see #contains(Object)
+ */
+ boolean containsAll(Collection<?> c);
+
+ /**
+ * Adds all of the elements in the specified collection to this collection
+ * (optional operation). The behavior of this operation is undefined if
+ * the specified collection is modified while the operation is in progress.
+ * (This implies that the behavior of this call is undefined if the
+ * specified collection is this collection, and this collection is
+ * nonempty.)
+ *
+ * @param c collection containing elements to be added to this collection
+ * @return <tt>true</tt> if this collection changed as a result of the call
+ * @throws UnsupportedOperationException if the <tt>addAll</tt> operation
+ * is not supported by this collection
+ * @throws ClassCastException if the class of an element of the specified
+ * collection prevents it from being added to this collection
+ * @throws NullPointerException if the specified collection contains a
+ * null element and this collection does not permit null elements,
+ * or if the specified collection is null
+ * @throws IllegalArgumentException if some property of an element of the
+ * specified collection prevents it from being added to this
+ * collection
+ * @throws IllegalStateException if not all the elements can be added at
+ * this time due to insertion restrictions
+ * @see #add(Object)
+ */
+ boolean addAll(Collection<? extends E> c);
+
+ /**
+ * Removes all of this collection's elements that are also contained in the
+ * specified collection (optional operation). After this call returns,
+ * this collection will contain no elements in common with the specified
+ * collection.
+ *
+ * @param c collection containing elements to be removed from this collection
+ * @return <tt>true</tt> if this collection changed as a result of the
+ * call
+ * @throws UnsupportedOperationException if the <tt>removeAll</tt> method
+ * is not supported by this collection
+ * @throws ClassCastException if the types of one or more elements
+ * in this collection are incompatible with the specified
+ * collection (optional)
+ * @throws NullPointerException if this collection contains one or more
+ * null elements and the specified collection does not support
+ * null elements (optional), or if the specified collection is null
+ * @see #remove(Object)
+ * @see #contains(Object)
+ */
+ boolean removeAll(Collection<?> c);
+
+ /**
+ * Retains only the elements in this collection that are contained in the
+ * specified collection (optional operation). In other words, removes from
+ * this collection all of its elements that are not contained in the
+ * specified collection.
+ *
+ * @param c collection containing elements to be retained in this collection
+ * @return <tt>true</tt> if this collection changed as a result of the call
+ * @throws UnsupportedOperationException if the <tt>retainAll</tt> operation
+ * is not supported by this collection
+ * @throws ClassCastException if the types of one or more elements
+ * in this collection are incompatible with the specified
+ * collection (optional)
+ * @throws NullPointerException if this collection contains one or more
+ * null elements and the specified collection does not permit null
+ * elements (optional), or if the specified collection is null
+ * @see #remove(Object)
+ * @see #contains(Object)
+ */
+ boolean retainAll(Collection<?> c);
+
+ /**
+ * Removes all of the elements from this collection (optional operation).
+ * The collection will be empty after this method returns.
+ *
+ * @throws UnsupportedOperationException if the <tt>clear</tt> operation
+ * is not supported by this collection
+ */
+ void clear();
+
+
+ // Comparison and hashing
+
+ /**
+ * Compares the specified object with this collection for equality. <p>
+ *
+ * While the <tt>Collection</tt> interface adds no stipulations to the
+ * general contract for the <tt>Object.equals</tt>, programmers who
+ * implement the <tt>Collection</tt> interface "directly" (in other words,
+ * create a class that is a <tt>Collection</tt> but is not a <tt>Set</tt>
+ * or a <tt>List</tt>) must exercise care if they choose to override the
+ * <tt>Object.equals</tt>. It is not necessary to do so, and the simplest
+ * course of action is to rely on <tt>Object</tt>'s implementation, but
+ * the implementor may wish to implement a "value comparison" in place of
+ * the default "reference comparison." (The <tt>List</tt> and
+ * <tt>Set</tt> interfaces mandate such value comparisons.)<p>
+ *
+ * The general contract for the <tt>Object.equals</tt> method states that
+ * equals must be symmetric (in other words, <tt>a.equals(b)</tt> if and
+ * only if <tt>b.equals(a)</tt>). The contracts for <tt>List.equals</tt>
+ * and <tt>Set.equals</tt> state that lists are only equal to other lists,
+ * and sets to other sets. Thus, a custom <tt>equals</tt> method for a
+ * collection class that implements neither the <tt>List</tt> nor
+ * <tt>Set</tt> interface must return <tt>false</tt> when this collection
+ * is compared to any list or set. (By the same logic, it is not possible
+ * to write a class that correctly implements both the <tt>Set</tt> and
+ * <tt>List</tt> interfaces.)
+ *
+ * @param o object to be compared for equality with this collection
+ * @return <tt>true</tt> if the specified object is equal to this
+ * collection
+ *
+ * @see Object#equals(Object)
+ * @see Set#equals(Object)
+ * @see List#equals(Object)
+ */
+ boolean equals(Object o);
+
+ /**
+ * Returns the hash code value for this collection. While the
+ * <tt>Collection</tt> interface adds no stipulations to the general
+ * contract for the <tt>Object.hashCode</tt> method, programmers should
+ * take note that any class that overrides the <tt>Object.equals</tt>
+ * method must also override the <tt>Object.hashCode</tt> method in order
+ * to satisfy the general contract for the <tt>Object.hashCode</tt>method.
+ * In particular, <tt>c1.equals(c2)</tt> implies that
+ * <tt>c1.hashCode()==c2.hashCode()</tt>.
+ *
+ * @return the hash code value for this collection
+ *
+ * @see Object#hashCode()
+ * @see Object#equals(Object)
+ */
+ int hashCode();
+}
Added: trunk/core/src/openjdk/java/java/util/Comparator.java
===================================================================
--- trunk/core/src/openjdk/java/java/util/Comparator.java (rev 0)
+++ trunk/core/src/openjdk/java/java/util/Comparator.java 2007-08-11 19:55:49 UTC (rev 3391)
@@ -0,0 +1,164 @@
+/*
+ * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.util;
+
+/**
+ * A comparison function, which imposes a <i>total ordering</i> on some
+ * collection of objects. Comparators can be passed to a sort method (such
+ * as {@link Collections#sort(List,Comparator) Collections.sort} or {@link
+ * Arrays#sort(Object[],Comparator) Arrays.sort}) to allow precise control
+ * over the sort order. Comparators can also be used to control the order of
+ * certain data structures (such as {@link SortedSet sorted sets} or {@link
+ * SortedMap sorted maps}), or to provide an ordering for collections of
+ * objects that don't have a {@link Comparable natural ordering}.<p>
+ *
+ * The ordering imposed by a comparator <tt>c</tt> on a set of elements
+ * <tt>S</tt> is said to be <i>consistent with equals</i> if and only if
+ * <tt>c.compare(e1, e2)==0</tt> has the same boolean value as
+ * <tt>e1.equals(e2)</tt> for every <tt>e1</tt> and <tt>e2</tt> in
+ * <tt>S</tt>.<p>
+ *
+ * Caution should be exercised when using a comparator capable of imposing an
+ * ordering inconsistent with equals to order a sorted set (or sorted map).
+ * Suppose a sorted set (or sorted map) with an explicit comparator <tt>c</tt>
+ * is used with elements (or keys) drawn from a set <tt>S</tt>. If the
+ * ordering imposed by <tt>c</tt> on <tt>S</tt> is inconsistent with equals,
+ * the sorted set (or sorted map) will behave "strangely." In particular the
+ * sorted set (or sorted map) will violate the general contract for set (or
+ * map), which is defined in terms of <tt>equals</tt>.<p>
+ *
+ * For example, suppose one adds two elements {@code a} and {@code b} such that
+ * {@code (a.equals(b) && c.compare(a, b) != 0)}
+ * to an empty {@code TreeSet} with comparator {@code c}.
+ * The second {@code add} operation will return
+ * true (and the size of the tree set will increase) because {@code a} and
+ * {@code b} are not equivalent from the tree set's perspective, even though
+ * this is contrary to the specification of the
+ * {@link Set#add Set.add} method.<p>
+ *
+ * Note: It is generally a good idea for comparators to also implement
+ * <tt>java.io.Serializable</tt>, as they may be used as ordering methods in
+ * serializable data structures (like {@link TreeSet}, {@link TreeMap}). In
+ * order for the data structure to serialize successfully, the comparator (if
+ * provided) must implement <tt>Serializable</tt>.<p>
+ *
+ * For the mathematically inclined, the <i>relation</i> that defines the
+ * <i>imposed ordering</i> that a given comparator <tt>c</tt> imposes on a
+ * given set of objects <tt>S</tt> is:<pre>
+ * {(x, y) such that c.compare(x, y) <= 0}.
+ * </pre> The <i>quotient</i> for this total order is:<pre>
+ * {(x, y) such that c.compare(x, y) == 0}.
+ * </pre>
+ *
+ * It follows immediately from the contract for <tt>compare</tt> that the
+ * quotient is an <i>equivalence relation</i> on <tt>S</tt>, and that the
+ * imposed ordering is a <i>total order</i> on <tt>S</tt>. When we say that
+ * the ordering imposed by <tt>c</tt> on <tt>S</tt> is <i>consistent with
+ * equals</i>, we mean that the quotient for the ordering is the equivalence
+ * relation defined by the objects' {@link Object#equals(Object)
+ * equals(Object)} method(s):<pre>
+ * {(x, y) such that x.equals(y)}. </pre><p>
+ *
+ * This interface is a member of the
+ * <a href="{@docRoot}/../technotes/guides/collections/index.html">
+ * Java Collections Framework</a>.
+ *
+ * @param <T> the type of objects that may be compared by this comparator
+ *
+ * @author Josh Bloch
+ * @author Neal Gafter
+ * @version 1.32, 05/05/07
+ * @see Comparable
+ * @see java.io.Serializable
+ * @since 1.2
+ */
+
+public interface Comparator<T> {
+ /**
+ * Compares its two arguments for order. Returns a negative integer,
+ * zero, or a positive integer as the first argument is less than, equal
+ * to, or greater than the second.<p>
+ *
+ * In the foregoing description, the notation
+ * <tt>sgn(</tt><i>expression</i><tt>)</tt> designates the mathematical
+ * <i>signum</i> function, which is defined to return one of <tt>-1</tt>,
+ * <tt>0</tt>, or <tt>1</tt> according to whether the value of
+ * <i>expression</i> is negative, zero or positive.<p>
+ *
+ * The implementor must ensure that <tt>sgn(compare(x, y)) ==
+ * -sgn(compare(y, x))</tt> for all <tt>x</tt> and <tt>y</tt>. (This
+ * implies that <tt>compare(x, y)</tt> must throw an exception if and only
+ * if <tt>compare(y, x)</tt> throws an exception.)<p>
+ *
+ * The implementor must also ensure that the relation is transitive:
+ * <tt>((compare(x, y)>0) && (compare(y, z)>0))</tt> implies
+ * <tt>compare(x, z)>0</tt>.<p>
+ *
+ * Finally, the implementor must ensure that <tt>compare(x, y)==0</tt>
+ * implies that <tt>sgn(compare(x, z))==sgn(compare(y, z))</tt> for all
+ * <tt>z</tt>.<p>
+ *
+ * It is generally the case, but <i>not</i> strictly required that
+ * <tt>(compare(x, y)==0) == (x.equals(y))</tt>. Generally speaking,
+ * any comparator that violates this condition should clearly indicate
+ * this fact. The recommended language is "Note: this comparator
+ * imposes orderings that are inconsistent with equals."
+ *
+ * @param o1 the first object to be compared.
+ * @param o2 the second object to be compared.
+ * @return a negative integer, zero, or a positive integer as the
+ * first argument is less than, equal to, or greater than the
+ * second.
+ * @throws ClassCastException if the arguments' types prevent them from
+ * being compared by this comparator.
+ */
+ int compare(T o1, T o2);
+
+ /**
+ *
+ * Indicates whether some other object is "equal to" this
+ * comparator. This method must obey the general contract of
+ * {@link Object#equals(Object)}. Additionally, this method can return
+ * <tt>true</tt> <i>only</i> if the specified object is also a comparator
+ * and it imposes the same ordering as this comparator. Thus,
+ * <code>comp1.equals(comp2)</code> implies that <tt>sgn(comp1.compare(o1,
+ * o2))==sgn(comp2.compare(o1, o2))</tt> for every object reference
+ * <tt>o1</tt> and <tt>o2</tt>.<p>
+ *
+ * Note that it is <i>always</i> safe <i>not</i> to override
+ * <tt>Object.equals(Object)</tt>. However, overriding this method may,
+ * in some cases, improve performance by allowing programs to determine
+ * that two distinct comparators impose the same order.
+ *
+ * @param obj the reference object with which to compare.
+ * @return <code>true</code> only if the specified object is also
+ * a comparator and it imposes the same ordering as this
+ * comparator.
+ * @see Object#equals(Object)
+ * @see Object#hashCode()
+ */
+ boolean equals(Object obj);
+}
Added: trunk/core/src/openjdk/java/java/util/ConcurrentModificationException.java
===================================================================
--- trunk/core/src/openjdk/java/java/util/ConcurrentModificationException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/util/ConcurrentModificationException.java 2007-08-11 19:55:49 UTC (rev 3391)
@@ -0,0 +1,87 @@
+/*
+ * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.util;
+
+/**
+ * This exception may be thrown by methods that have detected concurrent
+ * modification of an object when such modification is not permissible.
+ * <p>
+ * For example, it is not generally permissible for one thread to modify a Collection
+ * while another thread is iterating over it. In general, the results of the
+ * iteration are undefined under these circumstances. Some Iterator
+ * implementations (including those of all the general purpose collection implementations
+ * provided by the JRE) may choose to throw this exception if this behavior is
+ * detected. Iterators that do this are known as <i>fail-fast</i> iterators,
+ * as they fail quickly and cleanly, rather that risking arbitrary,
+ * non-deterministic behavior at an undetermined time in the future.
+ * <p>
+ * Note that this exception does not always indicate that an object has
+ * been concurrently modified by a <i>different</i> thread. If a single
+ * thread issues a sequence of method invocations that violates the
+ * contract of an object, the object may throw this exception. For
+ * example, if a thread modifies a collection directly while it is
+ * iterating over the collection with a fail-fast iterator, the iterator
+ * will throw this exception.
+ *
+ * <p>Note that fail-fast behavior cannot be guaranteed as it is, generally
+ * speaking, impossible to make any hard guarantees in the presence of
+ * unsynchronized concurrent modification. Fail-fast operations
+ * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * Therefore, it would be wrong to write a program that depended on this
+ * exception for its correctness: <i><tt>ConcurrentModificationException</tt>
+ * should be used only to detect bugs.</i>
+ *
+ * @author Josh Bloch
+ * @version 1.26, 05/05/07
+ * @see Collection
+ * @see Iterator
+ * @see ListIterator
+ * @see Vector
+ * @see LinkedList
+ * @see HashSet
+ * @see Hashtable
+ * @see TreeMap
+ * @see AbstractList
+ * @since 1.2
+ */
+public class ConcurrentModificationException extends RuntimeException {
+ /**
+ * Constructs a ConcurrentModificationException with no
+ * detail message.
+ */
+ public ConcurrentModificationException() {
+ }
+
+ /**
+ * Constructs a <tt>ConcurrentModificationException</tt> with the
+ * specified detail message.
+ *
+ * @param message the detail message pertaining to this exception.
+ */
+ public ConcurrentModificationException(String message) {
+ super(message);
+ }
+}
Added: trunk/core/src/openjdk/java/java/util/Deque.java
===================================================================
--- trunk/core/src/openjdk/java/java/util/Deque.java (rev 0)
+++ trunk/core/src/openjdk/java/java/util/Deque.java 2007-08-11 19:55:49 UTC (rev 3391)
@@ -0,0 +1,576 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/*
+ * This file is available under and governed by the GNU General Public
+ * License version 2 only, as published by the Free Software Foundation.
+ * However, the following notice accompanied the original version of this
+ * file:
+ *
+ * Written by Doug Lea and Josh Bloch with assistance from members of
+ * JCP JSR-166 Expert Group and released to the public domain, as explained
+ * at http://creativecommons.org/licenses/publicdomain
+ */
+
+package java.util;
+
+/**
+ * A linear collection that supports element insertion and removal at
+ * both ends. The name <i>deque</i> is short for "double ended queue"
+ * and is usually pronounced "deck". Most <tt>Deque</tt>
+ * implementations place no fixed limits on the number of elements
+ * they may contain, but this interface supports capacity-restricted
+ * deques as well as those with no fixed size limit.
+ *
+ * <p>This interface defines methods to access the elements at both
+ * ends of the deque. Methods are provided to insert, remove, and
+ * examine the element. Each of these methods exists in two forms:
+ * one throws an exception if the operation fails, the other returns a
+ * special value (either <tt>null</tt> or <tt>false</tt>, depending on
+ * the operation). The latter form of the insert operation is
+ * designed specifically for use with capacity-restricted
+ * <tt>Deque</tt> implementations; in most implementations, insert
+ * operations cannot fail.
+ *
+ * <p>The twelve methods described above are summarized in the
+ * following table:
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td></td>
+ * <td ALIGN=CENTER COLSPAN = 2> <b>First Element (Head)</b></td>
+ * <td ALIGN=CENTER COLSPAN = 2> <b>Last Element (Tail)</b></td>
+ * </tr>
+ * <tr>
+ * <td></td>
+ * <td ALIGN=CENTER><em>Throws exception</em></td>
+ * <td ALIGN=CENTER><em>Special value</em></td>
+ * <td ALIGN=CENTER><em>Throws exception</em></td>
+ * <td ALIGN=CENTER><em>Special value</em></td>
+ * </tr>
+ * <tr>
+ * <td><b>Insert</b></td>
+ * <td>{@link #addFirst addFirst(e)}</td>
+ * <td>{@link #offerFirst offerFirst(e)}</td>
+ * <td>{@link #addLast addLast(e)}</td>
+ * <td>{@link #offerLast offerLast(e)}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Remove</b></td>
+ * <td>{@link #removeFirst removeFirst()}</td>
+ * <td>{@link #pollFirst pollFirst()}</td>
+ * <td>{@link #removeLast removeLast()}</td>
+ * <td>{@link #pollLast pollLast()}</td>
+ * </tr>
+ * <tr>
+ * <td><b>Examine</b></td>
+ * <td>{@link #getFirst getFirst()}</td>
+ * <td>{@link #peekFirst peekFirst()}</td>
+ * <td>{@link #getLast getLast()}</td>
+ * <td>{@link #peekLast peekLast()}</td>
+ * </tr>
+ * </table>
+ *
+ * <p>This interface extends the {@link Queue} interface. When a deque is
+ * used as a queue, FIFO (First-In-First-Out) behavior results. Elements are
+ * added at the end of the deque and removed from the beginning. The methods
+ * inherited from the <tt>Queue</tt> interface are precisely equivalent to
+ * <tt>Deque</tt> methods as indicated in the following table:
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td ALIGN=CENTER> <b><tt>Queue</tt> Method</b></td>
+ * <td ALIGN=CENTER> <b>Equivalent <tt>Deque</tt> Method</b></td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#add add(e)}</td>
+ * <td>{@link #addLast addLast(e)}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#offer offer(e)}</td>
+ * <td>{@link #offerLast offerLast(e)}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#remove remove()}</td>
+ * <td>{@link #removeFirst removeFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#poll poll()}</td>
+ * <td>{@link #pollFirst pollFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#element element()}</td>
+ * <td>{@link #getFirst getFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link java.util.Queue#peek peek()}</td>
+ * <td>{@link #peek peekFirst()}</td>
+ * </tr>
+ * </table>
+ *
+ * <p>Deques can also be used as LIFO (Last-In-First-Out) stacks. This
+ * interface should be used in preference to the legacy {@link Stack} class.
+ * When a deque is used as a stack, elements are pushed and popped from the
+ * beginning of the deque. Stack methods are precisely equivalent to
+ * <tt>Deque</tt> methods as indicated in the table below:
+ *
+ * <p>
+ * <table BORDER CELLPADDING=3 CELLSPACING=1>
+ * <tr>
+ * <td ALIGN=CENTER> <b>Stack Method</b></td>
+ * <td ALIGN=CENTER> <b>Equivalent <tt>Deque</tt> Method</b></td>
+ * </tr>
+ * <tr>
+ * <td>{@link #push push(e)}</td>
+ * <td>{@link #addFirst addFirst(e)}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #pop pop()}</td>
+ * <td>{@link #removeFirst removeFirst()}</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #peek peek()}</td>
+ * <td>{@link #peekFirst peekFirst()}</td>
+ * </tr>
+ * </table>
+ *
+ * <p>Note that the {@link #peek peek} method works equally well when
+ * a deque is used as a queue or a stack; in either case, elements are
+ * drawn from the beginning of the deque.
+ *
+ * <p>This interface provides two methods to remove interior
+ * elements, {@link #removeFirstOccurrence removeFirstOccurrence} and
+ * {@link #removeLastOccurrence removeLastOccurrence}.
+ *
+ * <p>Unlike the {@link List} interface, this interface does not
+ * provide support for indexed access to elements.
+ *
+ * <p>While <tt>Deque</tt> implementations are not strictly required
+ * to prohibit the insertion of null elements, they are strongly
+ * encouraged to do so. Users of any <tt>Deque</tt> implementations
+ * that do allow null elements are strongly encouraged <i>not</i> to
+ * take advantage of the ability to insert nulls. This is so because
+ * <tt>null</tt> is used as a special return value by various methods
+ * to indicated that the deque is empty.
+ *
+ * <p><tt>Deque</tt> implementations generally do not define
+ * element-based versions of the <tt>equals</tt> and <tt>hashCode</tt>
+ * methods, but instead inherit the identity-based versions from class
+ * <tt>Object</tt>.
+ *
+ * <p>This interface is a member of the <a
+ * href="{@docRoot}/../technotes/guides/collections/index.html"> Java Collections
+ * Framework</a>.
+ *
+ * @author Doug Lea
+ * @author Josh Bloch
+ * @since 1.6
+ * @param <E> the type of elements held in this collection
+ */
+
+public interface Deque<E> extends Queue<E> {
+ /**
+ * Inserts the specified element at the front of this deque if it is
+ * possible to do so immediately without violating capacity restrictions.
+ * When using a capacity-restricted deque, it is generally preferable to
+ * use method {@link #offerFirst}.
+ *
+ * @param e the element to add
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ void addFirst(E e);
+
+ /**
+ * Inserts the specified element at the end of this deque if it is
+ * possible to do so immediately without violating capacity restrictions.
+ * When using a capacity-restricted deque, it is generally preferable to
+ * use method {@link #offerLast}.
+ *
+ * <p>This method is equivalent to {@link #add}.
+ *
+ * @param e the element to add
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ void addLast(E e);
+
+ /**
+ * Inserts the specified element at the front of this deque unless it would
+ * violate capacity restrictions. When using a capacity-restricted deque,
+ * this method is generally preferable to the {@link #addFirst} method,
+ * which can fail to insert an element only by throwing an exception.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this deque, else
+ * <tt>false</tt>
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offerFirst(E e);
+
+ /**
+ * Inserts the specified element at the end of this deque unless it would
+ * violate capacity restrictions. When using a capacity-restricted deque,
+ * this method is generally preferable to the {@link #addLast} method,
+ * which can fail to insert an element only by throwing an exception.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this deque, else
+ * <tt>false</tt>
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offerLast(E e);
+
+ /**
+ * Retrieves and removes the first element of this deque. This method
+ * differs from {@link #pollFirst pollFirst} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * @return the head of this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E removeFirst();
+
+ /**
+ * Retrieves and removes the last element of this deque. This method
+ * differs from {@link #pollLast pollLast} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * @return the tail of this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E removeLast();
+
+ /**
+ * Retrieves and removes the first element of this deque,
+ * or returns <tt>null</tt> if this deque is empty.
+ *
+ * @return the head of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E pollFirst();
+
+ /**
+ * Retrieves and removes the last element of this deque,
+ * or returns <tt>null</tt> if this deque is empty.
+ *
+ * @return the tail of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E pollLast();
+
+ /**
+ * Retrieves, but does not remove, the first element of this deque.
+ *
+ * This method differs from {@link #peekFirst peekFirst} only in that it
+ * throws an exception if this deque is empty.
+ *
+ * @return the head of this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E getFirst();
+
+ /**
+ * Retrieves, but does not remove, the last element of this deque.
+ * This method differs from {@link #peekLast peekLast} only in that it
+ * throws an exception if this deque is empty.
+ *
+ * @return the tail of this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E getLast();
+
+ /**
+ * Retrieves, but does not remove, the first element of this deque,
+ * or returns <tt>null</tt> if this deque is empty.
+ *
+ * @return the head of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E peekFirst();
+
+ /**
+ * Retrieves, but does not remove, the last element of this deque,
+ * or returns <tt>null</tt> if this deque is empty.
+ *
+ * @return the tail of this deque, or <tt>null</tt> if this deque is empty
+ */
+ E peekLast();
+
+ /**
+ * Removes the first occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the first element <tt>e</tt> such that
+ * <tt>(o==null ? e==null : o.equals(e))</tt>
+ * (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if an element was removed as a result of this call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements (optional)
+ */
+ boolean removeFirstOccurrence(Object o);
+
+ /**
+ * Removes the last occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the last element <tt>e</tt> such that
+ * <tt>(o==null ? e==null : o.equals(e))</tt>
+ * (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if an element was removed as a result of this call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements (optional)
+ */
+ boolean removeLastOccurrence(Object o);
+
+ // *** Queue methods ***
+
+ /**
+ * Inserts the specified element into the queue represented by this deque
+ * (in other words, at the tail of this deque) if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and throwing an
+ * <tt>IllegalStateException</tt> if no space is currently available.
+ * When using a capacity-restricted deque, it is generally preferable to
+ * use {@link #offer(Object) offer}.
+ *
+ * <p>This method is equivalent to {@link #addLast}.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> (as specified by {@link Collection#add})
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean add(E e);
+
+ /**
+ * Inserts the specified element into the queue represented by this deque
+ * (in other words, at the tail of this deque) if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and <tt>false</tt> if no space is currently
+ * available. When using a capacity-restricted deque, this method is
+ * generally preferable to the {@link #add} method, which can fail to
+ * insert an element only by throwing an exception.
+ *
+ * <p>This method is equivalent to {@link #offerLast}.
+ *
+ * @param e the element to add
+ * @return <tt>true</tt> if the element was added to this deque, else
+ * <tt>false</tt>
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ boolean offer(E e);
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque
+ * (in other words, the first element of this deque).
+ * This method differs from {@link #poll poll} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #removeFirst()}.
+ *
+ * @return the head of the queue represented by this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E remove();
+
+ /**
+ * Retrieves and removes the head of the queue represented by this deque
+ * (in other words, the first element of this deque), or returns
+ * <tt>null</tt> if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #pollFirst()}.
+ *
+ * @return the first element of this deque, or <tt>null</tt> if
+ * this deque is empty
+ */
+ E poll();
+
+ /**
+ * Retrieves, but does not remove, the head of the queue represented by
+ * this deque (in other words, the first element of this deque).
+ * This method differs from {@link #peek peek} only in that it throws an
+ * exception if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #getFirst()}.
+ *
+ * @return the head of the queue represented by this deque
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E element();
+
+ /**
+ * Retrieves, but does not remove, the head of the queue represented by
+ * this deque (in other words, the first element of this deque), or
+ * returns <tt>null</tt> if this deque is empty.
+ *
+ * <p>This method is equivalent to {@link #peekFirst()}.
+ *
+ * @return the head of the queue represented by this deque, or
+ * <tt>null</tt> if this deque is empty
+ */
+ E peek();
+
+
+ // *** Stack methods ***
+
+ /**
+ * Pushes an element onto the stack represented by this deque (in other
+ * words, at the head of this deque) if it is possible to do so
+ * immediately without violating capacity restrictions, returning
+ * <tt>true</tt> upon success and throwing an
+ * <tt>IllegalStateException</tt> if no space is currently available.
+ *
+ * <p>This method is equivalent to {@link #addFirst}.
+ *
+ * @param e the element to push
+ * @throws IllegalStateException if the element cannot be added at this
+ * time due to capacity restrictions
+ * @throws ClassCastException if the class of the specified element
+ * prevents it from being added to this deque
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements
+ * @throws IllegalArgumentException if some property of the specified
+ * element prevents it from being added to this deque
+ */
+ void push(E e);
+
+ /**
+ * Pops an element from the stack represented by this deque. In other
+ * words, removes and returns the first element of this deque.
+ *
+ * <p>This method is equivalent to {@link #removeFirst()}.
+ *
+ * @return the element at the front of this deque (which is the top
+ * of the stack represented by this deque)
+ * @throws NoSuchElementException if this deque is empty
+ */
+ E pop();
+
+
+ // *** Collection methods ***
+
+ /**
+ * Removes the first occurrence of the specified element from this deque.
+ * If the deque does not contain the element, it is unchanged.
+ * More formally, removes the first element <tt>e</tt> such that
+ * <tt>(o==null ? e==null : o.equals(e))</tt>
+ * (if such an element exists).
+ * Returns <tt>true</tt> if this deque contained the specified element
+ * (or equivalently, if this deque changed as a result of the call).
+ *
+ * <p>This method is equivalent to {@link #removeFirstOccurrence}.
+ *
+ * @param o element to be removed from this deque, if present
+ * @return <tt>true</tt> if an element was removed as a result of this call
+ * @throws ClassCastException if the class of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements (optional)
+ */
+ boolean remove(Object o);
+
+ /**
+ * Returns <tt>true</tt> if this deque contains the specified element.
+ * More formally, returns <tt>true</tt> if and only if this deque contains
+ * at least one element <tt>e</tt> such that
+ * <tt>(o==null ? e==null : o.equals(e))</tt>.
+ *
+ * @param o element whose presence in this deque is to be tested
+ * @return <tt>true</tt> if this deque contains the specified element
+ * @throws ClassCastException if the type of the specified element
+ * is incompatible with this deque (optional)
+ * @throws NullPointerException if the specified element is null and this
+ * deque does not permit null elements (optional)
+ */
+ boolean contains(Object o);
+
+ /**
+ * Returns the number of elements in this deque.
+ *
+ * @return the number of elements in this deque
+ */
+ public int size();
+
+ /**
+ * Returns an iterator over the elements in this deque in proper sequence.
+ * The elements will be returned in order from first (head) to last (tail).
+ *
+ * @return an iterator over the elements in this deque in proper sequence
+ */
+ Iterator<E> iterator();
+
+ /**
+ * Returns an iterator over the elements in this deque in reverse
+ * sequential order. The elements will be returned in order from
+ * last (tail) to first (head).
+ *
+ * @return an iterator over the elements in this deque in reverse
+ * sequence
+ */
+ Iterator<E> descendin...
[truncated message content] |
|
From: <ls...@us...> - 2007-08-11 19:54:45
|
Revision: 3390
http://jnode.svn.sourceforge.net/jnode/?rev=3390&view=rev
Author: lsantha
Date: 2007-08-11 12:54:42 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Modified Paths:
--------------
trunk/core/src/openjdk/sun/sun/misc/SharedSecrets.java
Modified: trunk/core/src/openjdk/sun/sun/misc/SharedSecrets.java
===================================================================
--- trunk/core/src/openjdk/sun/sun/misc/SharedSecrets.java 2007-08-11 19:54:16 UTC (rev 3389)
+++ trunk/core/src/openjdk/sun/sun/misc/SharedSecrets.java 2007-08-11 19:54:42 UTC (rev 3390)
@@ -38,6 +38,7 @@
This framework avoids the primary disadvantage of using reflection
for this purpose, namely the loss of compile-time checking. */
+@org.jnode.vm.annotation.SharedStatics //jnode
public class SharedSecrets {
private static final Unsafe unsafe = Unsafe.getUnsafe();
private static JavaUtilJarAccess javaUtilJarAccess;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-11 19:54:17
|
Revision: 3389
http://jnode.svn.sourceforge.net/jnode/?rev=3389&view=rev
Author: lsantha
Date: 2007-08-11 12:54:16 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/vm/VmSystem.java
Modified: trunk/core/src/core/org/jnode/vm/VmSystem.java
===================================================================
--- trunk/core/src/core/org/jnode/vm/VmSystem.java 2007-08-11 19:53:05 UTC (rev 3388)
+++ trunk/core/src/core/org/jnode/vm/VmSystem.java 2007-08-11 19:54:16 UTC (rev 3389)
@@ -68,6 +68,8 @@
import org.vmmagic.unboxed.Extent;
import org.vmmagic.unboxed.ObjectReference;
import org.vmmagic.unboxed.Offset;
+import sun.reflect.annotation.AnnotationType;
+import sun.nio.ch.Interruptible;
/**
* System support for the Virtual Machine
@@ -166,9 +168,38 @@
final ConsoleAppender infoApp = new ConsoleAppender(
new PatternLayout(LAYOUT));
root.addAppender(infoApp);
+
+ initOpenJDKSpeciffics();
}
}
+ private static void initOpenJDKSpeciffics() {
+ //todo this will be moved to java.lang.System during openjdk integration
+ sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
+ public sun.reflect.ConstantPool getConstantPool(Class klass) {
+ //return klass.getConstantPool();
+ throw new UnsupportedOperationException();
+ }
+ public void setAnnotationType(Class klass, AnnotationType type) {
+ //klass.setAnnotationType(type);
+ throw new UnsupportedOperationException();
+ }
+ public AnnotationType getAnnotationType(Class klass) {
+ //return klass.getAnnotationType();
+ throw new UnsupportedOperationException();
+ }
+ public <E extends Enum<E>>
+ E[] getEnumConstantsShared(Class<E> klass) {
+ //return klass.getEnumConstantsShared();
+ return klass.getEnumConstants();
+ }
+ public void blockedOn(Thread t, Interruptible b) {
+ //t.blockedOn(b);
+ throw new UnsupportedOperationException();
+ }
+ });
+ }
+
final static boolean isInitialized() {
return inited;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-11 19:53:08
|
Revision: 3388
http://jnode.svn.sourceforge.net/jnode/?rev=3388&view=rev
Author: lsantha
Date: 2007-08-11 12:53:05 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Modified Paths:
--------------
trunk/core/descriptors/org.classpath.core.xml
Modified: trunk/core/descriptors/org.classpath.core.xml
===================================================================
--- trunk/core/descriptors/org.classpath.core.xml 2007-08-11 14:32:55 UTC (rev 3387)
+++ trunk/core/descriptors/org.classpath.core.xml 2007-08-11 19:53:05 UTC (rev 3388)
@@ -19,7 +19,11 @@
<export name="sun.misc.*"/>
<export name="sun.reflect.Reflection"/>
<export name="sun.reflect.NativeReflection"/>
+ <export name="sun.reflect.ConstantPool"/>
+ <export name="sun.reflect.NativeConstantPool"/>
+ <export name="sun.reflect.annotation.AnnotationType"/>
<export name="sun.net.www.protocol.http.InMemoryCookieStore"/>
+ <export name="sun.nio.ch.Interruptible"/>
<export name="sun.security.util.Debug"/>
<export name="sun.security.util.SecurityConstants"/>
<export name="sun.security.action.GetPropertyAction"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-11 14:33:16
|
Revision: 3387
http://jnode.svn.sourceforge.net/jnode/?rev=3387&view=rev
Author: lsantha
Date: 2007-08-11 07:32:55 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Modified Paths:
--------------
trunk/core/src/classpath/java/java/awt/AWTKeyStroke.java
trunk/core/src/classpath/java/java/awt/AlphaComposite.java
Modified: trunk/core/src/classpath/java/java/awt/AWTKeyStroke.java
===================================================================
--- trunk/core/src/classpath/java/java/awt/AWTKeyStroke.java 2007-08-11 13:49:36 UTC (rev 3386)
+++ trunk/core/src/classpath/java/java/awt/AWTKeyStroke.java 2007-08-11 14:32:55 UTC (rev 3387)
@@ -92,8 +92,8 @@
/** The largest the keystroke cache can grow. */
private static final int MAX_CACHE_SIZE = 2048;
- /** Prune stale entries. */
- protected boolean removeEldestEntry(Entry<AWTKeyStroke,AWTKeyStroke>
+ /** Prune stale entries. */ //jnode openjdk
+ protected boolean removeEldestEntry(Map.Entry<AWTKeyStroke,AWTKeyStroke>
eldest)
{
return size() > MAX_CACHE_SIZE;
Modified: trunk/core/src/classpath/java/java/awt/AlphaComposite.java
===================================================================
--- trunk/core/src/classpath/java/java/awt/AlphaComposite.java 2007-08-11 13:49:36 UTC (rev 3386)
+++ trunk/core/src/classpath/java/java/awt/AlphaComposite.java 2007-08-11 14:32:55 UTC (rev 3387)
@@ -43,6 +43,7 @@
import java.awt.image.ColorModel;
import java.util.LinkedHashMap;
import java.util.Map;
+import java.util.HashMap;
/**
*
@@ -61,7 +62,7 @@
private static final int MAX_CACHE_SIZE = 2048;
/** Prune stale entries. */
- protected boolean removeEldestEntry(Entry eldest)
+ protected boolean removeEldestEntry(Map.Entry eldest) //jnode openjdk
{
return size() > MAX_CACHE_SIZE;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-11 13:49:38
|
Revision: 3386
http://jnode.svn.sourceforge.net/jnode/?rev=3386&view=rev
Author: lsantha
Date: 2007-08-11 06:49:36 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Fixed the name of the default awt toolkit.
Modified Paths:
--------------
trunk/core/src/classpath/vm/gnu/classpath/Configuration.java
Modified: trunk/core/src/classpath/vm/gnu/classpath/Configuration.java
===================================================================
--- trunk/core/src/classpath/vm/gnu/classpath/Configuration.java 2007-08-11 11:23:39 UTC (rev 3385)
+++ trunk/core/src/classpath/vm/gnu/classpath/Configuration.java 2007-08-11 13:49:36 UTC (rev 3386)
@@ -93,5 +93,5 @@
/**
* Name of default AWT peer library.
*/
- String default_awt_peer_toolkit = "org.jnode.awt.peer.JNodeToolkit";
+ String default_awt_peer_toolkit = "org.jnode.awt.swingpeers.SwingToolkit";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-11 11:23:43
|
Revision: 3385
http://jnode.svn.sourceforge.net/jnode/?rev=3385&view=rev
Author: lsantha
Date: 2007-08-11 04:23:39 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Removed Paths:
-------------
trunk/core/src/classpath/java/java/lang/Void.java
trunk/core/src/classpath/java/java/lang/annotation/
Deleted: trunk/core/src/classpath/java/java/lang/Void.java
===================================================================
--- trunk/core/src/classpath/java/java/lang/Void.java 2007-08-11 10:57:11 UTC (rev 3384)
+++ trunk/core/src/classpath/java/java/lang/Void.java 2007-08-11 11:23:39 UTC (rev 3385)
@@ -1,68 +0,0 @@
-/* Void.class - defines void.class
- Copyright (C) 1998, 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-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
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package java.lang;
-
-
-/**
- * Void is a placeholder class so that the variable <code>Void.TYPE</code>
- * (also available as <code>void.class</code>) can be supported for
- * reflection return types.
- *
- * <p>This class could be Serializable, but that is up to Sun.</p>
- *
- * @author Paul Fisher
- * @author John Keiser
- * @author Eric Blake (eb...@em...)
- * @since 1.1
- * @status updated to 1.5
- */
-public final class Void
-{
- /**
- * The return type <code>void</code> is represented by this
- * <code>Class</code> object.
- */
- public static final Class<Void> TYPE = (Class<Void>) VMClassLoader.getPrimitiveClass('V');
-
- /**
- * Void is non-instantiable.
- */
- private Void()
- {
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-11 10:57:14
|
Revision: 3384
http://jnode.svn.sourceforge.net/jnode/?rev=3384&view=rev
Author: lsantha
Date: 2007-08-11 03:57:11 -0700 (Sat, 11 Aug 2007)
Log Message:
-----------
Openjdk integration.
Added Paths:
-----------
trunk/core/src/openjdk/java/java/lang/Void.java
trunk/core/src/openjdk/java/java/lang/annotation/
trunk/core/src/openjdk/java/java/lang/annotation/Annotation.java
trunk/core/src/openjdk/java/java/lang/annotation/AnnotationFormatError.java
trunk/core/src/openjdk/java/java/lang/annotation/AnnotationTypeMismatchException.java
trunk/core/src/openjdk/java/java/lang/annotation/Documented.java
trunk/core/src/openjdk/java/java/lang/annotation/ElementType.java
trunk/core/src/openjdk/java/java/lang/annotation/IncompleteAnnotationException.java
trunk/core/src/openjdk/java/java/lang/annotation/Inherited.java
trunk/core/src/openjdk/java/java/lang/annotation/Retention.java
trunk/core/src/openjdk/java/java/lang/annotation/RetentionPolicy.java
trunk/core/src/openjdk/java/java/lang/annotation/Target.java
trunk/core/src/openjdk/java/java/lang/annotation/package-info.java
Added: trunk/core/src/openjdk/java/java/lang/Void.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/Void.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/Void.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang;
+
+/**
+ * The {@code Void} class is an uninstantiable placeholder class to hold a
+ * reference to the {@code Class} object representing the Java keyword
+ * void.
+ *
+ * @author unascribed
+ * @version 1.22, 05/05/07
+ * @since JDK1.1
+ */
+public final
+class Void {
+
+ /**
+ * The {@code Class} object representing the pseudo-type corresponding to
+ * the keyword {@code void}.
+ */
+ public static final Class<Void> TYPE = Class.getPrimitiveClass("void");
+
+ /*
+ * The Void class cannot be instantiated.
+ */
+ private Void() {}
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Annotation.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Annotation.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Annotation.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,128 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * The common interface extended by all annotation types. Note that an
+ * interface that manually extends this one does <i>not</i> define
+ * an annotation type. Also note that this interface does not itself
+ * define an annotation type.
+ *
+ * @author Josh Bloch
+ * @since 1.5
+ */
+public interface Annotation {
+ /**
+ * Returns true if the specified object represents an annotation
+ * that is logically equivalent to this one. In other words,
+ * returns true if the specified object is an instance of the same
+ * annotation type as this instance, all of whose members are equal
+ * to the corresponding member of this annotation, as defined below:
+ * <ul>
+ * <li>Two corresponding primitive typed members whose values are
+ * <tt>x</tt> and <tt>y</tt> are considered equal if <tt>x == y</tt>,
+ * unless their type is <tt>float</tt> or <tt>double</tt>.
+ *
+ * <li>Two corresponding <tt>float</tt> members whose values
+ * are <tt>x</tt> and <tt>y</tt> are considered equal if
+ * <tt>Float.valueOf(x).equals(Float.valueOf(y))</tt>.
+ * (Unlike the <tt>==</tt> operator, NaN is considered equal
+ * to itself, and <tt>0.0f</tt> unequal to <tt>-0.0f</tt>.)
+ *
+ * <li>Two corresponding <tt>double</tt> members whose values
+ * are <tt>x</tt> and <tt>y</tt> are considered equal if
+ * <tt>Double.valueOf(x).equals(Double.valueOf(y))</tt>.
+ * (Unlike the <tt>==</tt> operator, NaN is considered equal
+ * to itself, and <tt>0.0</tt> unequal to <tt>-0.0</tt>.)
+ *
+ * <li>Two corresponding <tt>String</tt>, <tt>Class</tt>, enum, or
+ * annotation typed members whose values are <tt>x</tt> and <tt>y</tt>
+ * are considered equal if <tt>x.equals(y)</tt>. (Note that this
+ * definition is recursive for annotation typed members.)
+ *
+ * <li>Two corresponding array typed members <tt>x</tt> and <tt>y</tt>
+ * are considered equal if <tt>Arrays.equals(x, y)</tt>, for the
+ * appropriate overloading of {@link java.util.Arrays#equals}.
+ * </ul>
+ *
+ * @return true if the specified object represents an annotation
+ * that is logically equivalent to this one, otherwise false
+ */
+ boolean equals(Object obj);
+
+ /**
+ * Returns the hash code of this annotation, as defined below:
+ *
+ * <p>The hash code of an annotation is the sum of the hash codes
+ * of its members (including those with default values), as defined
+ * below:
+ *
+ * The hash code of an annotation member is (127 times the hash code
+ * of the member-name as computed by {@link String#hashCode()}) XOR
+ * the hash code of the member-value, as defined below:
+ *
+ * <p>The hash code of a member-value depends on its type:
+ * <ul>
+ * <li>The hash code of a primitive value <tt><i>v</i></tt> is equal to
+ * <tt><i>WrapperType</i>.valueOf(<i>v</i>).hashCode()</tt>, where
+ * <tt><i>WrapperType</i></tt> is the wrapper type corresponding
+ * to the primitive type of <tt><i>v</i></tt> ({@link Byte},
+ * {@link Character}, {@link Double}, {@link Float}, {@link Integer},
+ * {@link Long}, {@link Short}, or {@link Boolean}).
+ *
+ * <li>The hash code of a string, enum, class, or annotation member-value
+ I <tt><i>v</i></tt> is computed as by calling
+ * <tt><i>v</i>.hashCode()</tt>. (In the case of annotation
+ * member values, this is a recursive definition.)
+ *
+ * <li>The hash code of an array member-value is computed by calling
+ * the appropriate overloading of
+ * {@link java.util.Arrays#hashCode(long[]) Arrays.hashCode}
+ * on the value. (There is one overloading for each primitive
+ * type, and one for object reference types.)
+ * </ul>
+ *
+ * @return the hash code of this annotation
+ */
+ int hashCode();
+
+ /**
+ * Returns a string representation of this annotation. The details
+ * of the representation are implementation-dependent, but the following
+ * may be regarded as typical:
+ * <pre>
+ * @com.acme.util.Name(first=Alfred, middle=E., last=Neuman)
+ * </pre>
+ *
+ * @return a string representation of this annotation
+ */
+ String toString();
+
+ /**
+ * Returns the annotation type of this annotation.
+ */
+ Class<? extends Annotation> annotationType();
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/AnnotationFormatError.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/AnnotationFormatError.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/AnnotationFormatError.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Thrown when the annotation parser attempts to read an annotation
+ * from a class file and determines that the annotation is malformed.
+ *
+ * @author Josh Bloch
+ * @since 1.5
+ */
+public class AnnotationFormatError extends Error {
+ /**
+ * Constructs a new <tt>AnnotationFormatError</tt> with the specified
+ * detail message.
+ *
+ * @param message the detail message.
+ */
+ public AnnotationFormatError(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new <tt>AnnotationFormatError</tt> with the specified
+ * detail message and cause. Note that the detail message associated
+ * with <code>cause</code> is <i>not</i> automatically incorporated in
+ * this error's detail message.
+ *
+ * @param message the detail message
+ * @param cause the cause (A <tt>null</tt> value is permitted, and
+ * indicates that the cause is nonexistent or unknown.)
+ */
+ public AnnotationFormatError(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+
+ /**
+ * Constructs a new <tt>AnnotationFormatError</tt> with the specified
+ * cause and a detail message of
+ * <tt>(cause == null ? null : cause.toString())</tt> (which
+ * typically contains the class and detail message of <tt>cause</tt>).
+ *
+ * @param cause the cause (A <tt>null</tt> value is permitted, and
+ * indicates that the cause is nonexistent or unknown.)
+ */
+ public AnnotationFormatError(Throwable cause) {
+ super(cause);
+ }
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/AnnotationTypeMismatchException.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/AnnotationTypeMismatchException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/AnnotationTypeMismatchException.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+import java.lang.reflect.Method;
+
+/**
+ * Thrown to indicate that a program has attempted to access an element of
+ * an annotation whose type has changed after the annotation was compiled
+ * (or serialized).
+ *
+ * @author Josh Bloch
+ * @since 1.5
+ */
+public class AnnotationTypeMismatchException extends RuntimeException {
+ /**
+ * The <tt>Method</tt> object for the annotation element.
+ */
+ private final Method element;
+
+ /**
+ * The (erroneous) type of data found in the annotation. This string
+ * may, but is not required to, contain the value as well. The exact
+ * format of the string is unspecified.
+ */
+ private final String foundType;
+
+ /**
+ * Constructs an AnnotationTypeMismatchException for the specified
+ * annotation type element and found data type.
+ *
+ * @param element the <tt>Method</tt> object for the annotation element
+ * @param foundType the (erroneous) type of data found in the annotation.
+ * This string may, but is not required to, contain the value
+ * as well. The exact format of the string is unspecified.
+ */
+ public AnnotationTypeMismatchException(Method element, String foundType) {
+ super("Incorrectly typed data found for annotation element " + element
+ + " (Found data of type " + foundType + ")");
+ this.element = element;
+ this.foundType = foundType;
+ }
+
+ /**
+ * Returns the <tt>Method</tt> object for the incorrectly typed element.
+ *
+ * @return the <tt>Method</tt> object for the incorrectly typed element
+ */
+ public Method element() {
+ return this.element;
+ }
+
+ /**
+ * Returns the type of data found in the incorrectly typed element.
+ * The returned string may, but is not required to, contain the value
+ * as well. The exact format of the string is unspecified.
+ *
+ * @return the type of data found in the incorrectly typed element
+ */
+ public String foundType() {
+ return this.foundType;
+ }
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Documented.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Documented.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Documented.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Indicates that annotations with a type are to be documented by javadoc
+ * and similar tools by default. This type should be used to annotate the
+ * declarations of types whose annotations affect the use of annotated
+ * elements by their clients. If a type declaration is annotated with
+ * Documented, its annotations become part of the public API
+ * of the annotated elements.
+ *
+ * @author Joshua Bloch
+ * @version 1.12, 05/05/07
+ * @since 1.5
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Documented {
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/ElementType.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/ElementType.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/ElementType.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * A program element type. The constants of this enumerated type
+ * provide a simple classification of the declared elements in a
+ * Java program.
+ *
+ * <p>These constants are used with the {@link Target} meta-annotation type
+ * to specify where it is legal to use an annotation type.
+ *
+ * @author Joshua Bloch
+ * @since 1.5
+ */
+public enum ElementType {
+ /** Class, interface (including annotation type), or enum declaration */
+ TYPE,
+
+ /** Field declaration (includes enum constants) */
+ FIELD,
+
+ /** Method declaration */
+ METHOD,
+
+ /** Parameter declaration */
+ PARAMETER,
+
+ /** Constructor declaration */
+ CONSTRUCTOR,
+
+ /** Local variable declaration */
+ LOCAL_VARIABLE,
+
+ /** Annotation type declaration */
+ ANNOTATION_TYPE,
+
+ /** Package declaration */
+ PACKAGE
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/IncompleteAnnotationException.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/IncompleteAnnotationException.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/IncompleteAnnotationException.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Thrown to indicate that a program has attempted to access an element of
+ * an annotation type that was added to the annotation type definition after
+ * the annotation was compiled (or serialized). This exception will not be
+ * thrown if the new element has a default value.
+ *
+ * @author Josh Bloch
+ * @since 1.5
+ */
+public class IncompleteAnnotationException extends RuntimeException {
+ private Class annotationType;
+ private String elementName;
+
+
+ /**
+ * Constructs an IncompleteAnnotationException to indicate that
+ * the named element was missing from the specified annotation type.
+ *
+ * @param annotationType the Class object for the annotation type
+ * @param elementName the name of the missing element
+ */
+ public IncompleteAnnotationException(
+ Class<? extends Annotation> annotationType,
+ String elementName) {
+ super(annotationType.getName() + " missing element " + elementName);
+
+ this.annotationType = annotationType;
+ this.elementName = elementName;
+ }
+
+ /**
+ * Returns the Class object for the annotation type with the
+ * missing element.
+ *
+ * @return the Class object for the annotation type with the
+ * missing element
+ */
+ public Class<? extends Annotation> annotationType() {
+ return annotationType;
+ }
+
+ /**
+ * Returns the name of the missing element.
+ *
+ * @return the name of the missing element
+ */
+ public String elementName() {
+ return elementName;
+ }
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Inherited.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Inherited.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Inherited.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Indicates that an annotation type is automatically inherited. If
+ * an Inherited meta-annotation is present on an annotation type
+ * declaration, and the user queries the annotation type on a class
+ * declaration, and the class declaration has no annotation for this type,
+ * then the class's superclass will automatically be queried for the
+ * annotation type. This process will be repeated until an annotation for this
+ * type is found, or the top of the class hierarchy (Object)
+ * is reached. If no superclass has an annotation for this type, then
+ * the query will indicate that the class in question has no such annotation.
+ *
+ * <p>Note that this meta-annotation type has no effect if the annotated
+ * type is used to annotate anything other than a class. Note also
+ * that this meta-annotation only causes annotations to be inherited
+ * from superclasses; annotations on implemented interfaces have no
+ * effect.
+ *
+ * @author Joshua Bloch
+ * @since 1.5
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Inherited {
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Retention.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Retention.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Retention.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Indicates how long annotations with the annotated type are to
+ * be retained. If no Retention annotation is present on
+ * an annotation type declaration, the retention policy defaults to
+ * {@code RetentionPolicy.CLASS}.
+ *
+ * <p>A Retention meta-annotation has effect only if the
+ * meta-annotated type is used directly for annotation. It has no
+ * effect if the meta-annotated type is used as a member type in
+ * another annotation type.
+ *
+ * @author Joshua Bloch
+ * @since 1.5
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Retention {
+ RetentionPolicy value();
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/RetentionPolicy.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/RetentionPolicy.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/RetentionPolicy.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Annotation retention policy. The constants of this enumerated type
+ * describe the various policies for retaining annotations. They are used
+ * in conjunction with the {@link Retention} meta-annotation type to specify
+ * how long annotations are to be retained.
+ *
+ * @author Joshua Bloch
+ * @since 1.5
+ */
+public enum RetentionPolicy {
+ /**
+ * Annotations are to be discarded by the compiler.
+ */
+ SOURCE,
+
+ /**
+ * Annotations are to be recorded in the class file by the compiler
+ * but need not be retained by the VM at run time. This is the default
+ * behavior.
+ */
+ CLASS,
+
+ /**
+ * Annotations are to be recorded in the class file by the compiler and
+ * retained by the VM at run time, so they may be read reflectively.
+ *
+ * @see java.lang.reflect.AnnotatedElement
+ */
+ RUNTIME
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/Target.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/Target.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/Target.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.lang.annotation;
+
+/**
+ * Indicates the kinds of program element to which an annotation type
+ * is applicable. If a Target meta-annotation is not present on an
+ * annotation type declaration, the declared type may be used on any
+ * program element. If such a meta-annotation is present, the compiler
+ * will enforce the specified usage restriction.
+ *
+ * For example, this meta-annotation indicates that the declared type is
+ * itself a meta-annotation type. It can only be used on annotation type
+ * declarations:
+ * <pre>
+ * @Target(ElementType.ANNOTATION_TYPE)
+ * public @interface MetaAnnotationType {
+ * ...
+ * }
+ * </pre>
+ * This meta-annotation indicates that the declared type is intended solely
+ * for use as a member type in complex annotation type declarations. It
+ * cannot be used to annotate anything directly:
+ * <pre>
+ * @Target({})
+ * public @interface MemberType {
+ * ...
+ * }
+ * </pre>
+ * It is a compile-time error for a single ElementType constant to
+ * appear more than once in a Target annotation. For example, the
+ * following meta-annotation is illegal:
+ * <pre>
+ * @Target({ElementType.FIELD, ElementType.METHOD, ElementType.FIELD})
+ * public @interface Bogus {
+ * ...
+ * }
+ * </pre>
+ */
+@Documented
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.ANNOTATION_TYPE)
+public @interface Target {
+ ElementType[] value();
+}
Added: trunk/core/src/openjdk/java/java/lang/annotation/package-info.java
===================================================================
--- trunk/core/src/openjdk/java/java/lang/annotation/package-info.java (rev 0)
+++ trunk/core/src/openjdk/java/java/lang/annotation/package-info.java 2007-08-11 10:57:11 UTC (rev 3384)
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code 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 General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+/**
+ * Provides library support for the Java programming language
+ * annotation facility.
+ *
+ * @version 1.8, 05/05/07
+ * @author Josh Bloch
+ * @since 1.5
+ */
+package java.lang.annotation;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-04 13:42:50
|
Revision: 3383
http://jnode.svn.sourceforge.net/jnode/?rev=3383&view=rev
Author: lsantha
Date: 2007-08-04 06:42:48 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
Added missing source trees.
Modified Paths:
--------------
trunk/core/core.iml
Modified: trunk/core/core.iml
===================================================================
--- trunk/core/core.iml 2007-08-04 12:50:02 UTC (rev 3382)
+++ trunk/core/core.iml 2007-08-04 13:42:48 UTC (rev 3383)
@@ -6,13 +6,24 @@
<exclude-output />
<exclude-exploded />
<content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/classpath/ext" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/classpath/gnu" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/classpath/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/classpath/javax" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/classpath/org" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/classpath/tools" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/classpath/vm" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/core" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/driver" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/icedtea" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/mmtk-vm" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/nanoxml" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/openjdk/com" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/openjdk/java" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/openjdk/javax" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/openjdk/org" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/openjdk/sun" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/openjdk/vm" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/vmmagic" isTestSource="false" />
</content>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-04 12:50:07
|
Revision: 3382
http://jnode.svn.sourceforge.net/jnode/?rev=3382&view=rev
Author: lsantha
Date: 2007-08-04 05:50:02 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
Fixed the DEL key.
Modified Paths:
--------------
trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java
Modified: trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java 2007-08-04 11:27:53 UTC (rev 3381)
+++ trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java 2007-08-04 12:50:02 UTC (rev 3382)
@@ -210,11 +210,6 @@
refreshCurrentLine();
}
break;
- // if its a delete we want to remove one under the cursor
- case KeyEvent.VK_DELETE:
- currentLine.delete();
- refreshCurrentLine();
- break;
// if its an enter key we want to process the command, and then resume
// the thread
case '\n':
@@ -319,6 +314,11 @@
currentLine.moveEnd();
refreshCurrentLine();
break;
+ // if its a delete we want to remove one under the cursor
+ case KeyEvent.VK_DELETE:
+ currentLine.delete();
+ refreshCurrentLine();
+ break;
default:
// ignore other virtual keys.
return false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-04 11:27:54
|
Revision: 3381
http://jnode.svn.sourceforge.net/jnode/?rev=3381&view=rev
Author: lsantha
Date: 2007-08-04 04:27:53 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
Added missing source directory.
Modified Paths:
--------------
trunk/distr/distr.iml
Modified: trunk/distr/distr.iml
===================================================================
--- trunk/distr/distr.iml 2007-08-04 10:24:21 UTC (rev 3380)
+++ trunk/distr/distr.iml 2007-08-04 11:27:53 UTC (rev 3381)
@@ -7,6 +7,7 @@
<exclude-exploded />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/apps" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/emu" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/install" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-04 10:24:58
|
Revision: 3380
http://jnode.svn.sourceforge.net/jnode/?rev=3380&view=rev
Author: lsantha
Date: 2007-08-04 03:24:21 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
Optimized imports.
Modified Paths:
--------------
trunk/distr/src/apps/fi/iki/elonen/NanoHTTPD.java
trunk/distr/src/apps/org/jnode/apps/charvabsh/CharvaBsh.java
trunk/distr/src/apps/org/jnode/apps/console/SwingConsole.java
trunk/distr/src/apps/org/jnode/apps/debug/ListPanel.java
trunk/distr/src/apps/org/jnode/apps/debug/RootObjectPanel.java
trunk/distr/src/apps/org/jnode/apps/debug/TC.java
trunk/distr/src/apps/org/jnode/apps/edit/EditCommand.java
trunk/distr/src/apps/org/jnode/apps/edit/Editor.java
trunk/distr/src/apps/org/jnode/apps/editor/LeedCommand.java
trunk/distr/src/apps/org/jnode/apps/editor/TextEditor.java
trunk/distr/src/apps/org/jnode/apps/httpd/NanoHTTPDCommand.java
trunk/distr/src/apps/org/jnode/apps/jpartition/JPartition.java
trunk/distr/src/apps/org/jnode/apps/jpartition/commands/framework/CommandProcessor.java
trunk/distr/src/apps/org/jnode/apps/jpartition/controller/MainController.java
trunk/distr/src/apps/org/jnode/apps/jpartition/model/AbstractModel.java
trunk/distr/src/apps/org/jnode/apps/jpartition/model/DeviceModel.java
trunk/distr/src/apps/org/jnode/apps/jpartition/model/FileDeviceModel.java
trunk/distr/src/apps/org/jnode/apps/jpartition/model/PartitionModel.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/CommandProcessorView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DeviceView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DiskAreaView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/ErrorReporter.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/FileDeviceView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/MainView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/PartitionView.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/SwingViewFactory.java
trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/BaseDeviceAction.java
trunk/distr/src/apps/org/jnode/apps/jpartition/utils/BasicNameSpace.java
trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/AbstractIDEDevice.java
trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/DeviceUtils.java
trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FakeIDEDevice.java
trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FileIDEDevice.java
trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FileIDEDeviceDriver.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/ExtentDeclaration.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/IOUtils.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/VMWareDisk.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/descriptor/Descriptor.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/descriptor/DescriptorRW.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/extent/Extent.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/ExtentFactory.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/ExtentIO.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/FileDescriptor.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/IOHandler.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleDescriptorRW.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleExtentFactory.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleIOHandler.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/AllocationTable.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/AllocationTableRW.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/EntryArray.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/GrainDirectory.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/GrainTable.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseDescriptorRW.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseDiskFactory.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtent.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentFactory.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentHeader.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentHeaderRW.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentIO.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentRW.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseFileDescriptor.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseIOHandler.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/BaseTest.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/TestCreation.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/Utils.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/BaseReadWriteTest.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/TestHeader.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/TestVMWareDisk.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/tools/DiskCopier.java
trunk/distr/src/apps/org/jnode/apps/vmware/disk/tools/DiskFactory.java
trunk/distr/src/emu/org/jnode/emu/DeviceManager.java
trunk/distr/src/emu/org/jnode/emu/DummyExtensionPoint.java
trunk/distr/src/emu/org/jnode/emu/EditEmu.java
trunk/distr/src/emu/org/jnode/emu/Emu.java
trunk/distr/src/emu/org/jnode/emu/ShellEmu.java
trunk/distr/src/install/org/jnode/install/AbstractInstaller.java
trunk/distr/src/install/org/jnode/install/ProgressSupport.java
trunk/distr/src/install/org/jnode/install/action/CopyFilesAction.java
trunk/distr/src/install/org/jnode/install/action/GrubInstallerAction.java
trunk/distr/src/install/org/jnode/install/cmdline/CommandLineInstaller.java
Modified: trunk/distr/src/apps/fi/iki/elonen/NanoHTTPD.java
===================================================================
--- trunk/distr/src/apps/fi/iki/elonen/NanoHTTPD.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/fi/iki/elonen/NanoHTTPD.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -22,8 +22,10 @@
package fi.iki.elonen;
import java.io.*;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.URLEncoder;
import java.util.*;
-import java.net.*;
/**
* A simple, tiny, nicely embeddable HTTP 1.0 server in Java
Modified: trunk/distr/src/apps/org/jnode/apps/charvabsh/CharvaBsh.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/charvabsh/CharvaBsh.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/charvabsh/CharvaBsh.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -36,15 +36,14 @@
import charvax.swing.*;
import charvax.swing.border.TitledBorder;
import gnu.java.io.NullOutputStream;
+import java.io.*;
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.naming.NameNotFoundException;
import org.jnode.shell.CommandShell;
import org.jnode.shell.Shell;
import org.jnode.shell.ShellUtils;
-import javax.naming.NameNotFoundException;
-import java.io.*;
-import java.net.MalformedURLException;
-import java.net.URL;
-
/**
* User: Sam Reid
* Date: Mar 19, 2004
Modified: trunk/distr/src/apps/org/jnode/apps/console/SwingConsole.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/console/SwingConsole.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/console/SwingConsole.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,17 +1,16 @@
package org.jnode.apps.console;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import javax.swing.*;
import org.jnode.driver.console.ConsoleManager;
import org.jnode.driver.console.TextConsole;
-import org.jnode.driver.console.textscreen.TextScreenConsoleManager;
import org.jnode.driver.console.swing.SwingTextScreenConsoleManager;
+import org.jnode.driver.console.textscreen.TextScreenConsoleManager;
+import org.jnode.naming.InitialNaming;
import org.jnode.shell.CommandShell;
import org.jnode.shell.ShellManager;
-import org.jnode.naming.InitialNaming;
-import javax.swing.JFrame;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
/**
* @author Levente S\u00e1ntha
*/
Modified: trunk/distr/src/apps/org/jnode/apps/debug/ListPanel.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/debug/ListPanel.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/debug/ListPanel.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -21,18 +21,13 @@
package org.jnode.apps.debug;
-import java.util.Vector;
-
import charva.awt.Dimension;
import charva.awt.event.KeyAdapter;
import charva.awt.event.KeyEvent;
-import charvax.swing.DefaultListModel;
-import charvax.swing.JList;
-import charvax.swing.JPanel;
-import charvax.swing.JScrollPane;
-import charvax.swing.ListSelectionModel;
+import charvax.swing.*;
import charvax.swing.event.ListSelectionEvent;
import charvax.swing.event.ListSelectionListener;
+import java.util.Vector;
/**
*
Modified: trunk/distr/src/apps/org/jnode/apps/debug/RootObjectPanel.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/debug/RootObjectPanel.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/debug/RootObjectPanel.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -25,9 +25,7 @@
import java.util.Iterator;
import java.util.Set;
import java.util.Vector;
-
import javax.naming.NameNotFoundException;
-
import org.jnode.naming.InitialNaming;
/**
Modified: trunk/distr/src/apps/org/jnode/apps/debug/TC.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/debug/TC.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/debug/TC.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -20,7 +20,7 @@
*/
package org.jnode.apps.debug;
-import java.util.Vector;
+
import charva.awt.BorderLayout;
import charva.awt.Color;
import charva.awt.FlowLayout;
@@ -29,6 +29,8 @@
import charvax.swing.JPanel;
import charvax.swing.border.LineBorder;
import charvax.swing.border.TitledBorder;
+import java.util.Vector;
+
/**
* @author blind
*
Modified: trunk/distr/src/apps/org/jnode/apps/edit/EditCommand.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/edit/EditCommand.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/edit/EditCommand.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -21,13 +21,12 @@
package org.jnode.apps.edit;
+import java.io.File;
import org.jnode.shell.help.Help;
import org.jnode.shell.help.Parameter;
import org.jnode.shell.help.ParsedArguments;
import org.jnode.shell.help.argument.FileArgument;
-import java.io.File;
-
/**
* @author Levente S\u00e1ntha
*/
Modified: trunk/distr/src/apps/org/jnode/apps/edit/Editor.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/edit/Editor.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/edit/Editor.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -21,33 +21,18 @@
package org.jnode.apps.edit;
-import charvax.swing.JFileChooser;
-import charvax.swing.JFrame;
-import charvax.swing.JMenu;
-import charvax.swing.JMenuBar;
-import charvax.swing.JMenuItem;
-import charvax.swing.JOptionPane;
-import charvax.swing.JPanel;
-import charvax.swing.JScrollPane;
-import charvax.swing.JTextArea;
-import charvax.swing.ListSelectionModel;
-import charvax.swing.border.TitledBorder;
import charva.awt.BorderLayout;
-import charva.awt.Toolkit;
import charva.awt.Color;
+import charva.awt.Toolkit;
import charva.awt.event.ActionEvent;
import charva.awt.event.ActionListener;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
+import charvax.swing.*;
+import charvax.swing.border.TitledBorder;
+import gnu.java.security.action.GetPropertyAction;
+import java.io.*;
import java.security.AccessController;
import java.security.PrivilegedAction;
-
import org.apache.log4j.Logger;
-import gnu.java.security.action.GetPropertyAction;
/**
* @author Levente S\u00e1ntha
Modified: trunk/distr/src/apps/org/jnode/apps/editor/LeedCommand.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/editor/LeedCommand.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/editor/LeedCommand.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,12 +1,11 @@
package org.jnode.apps.editor;
+import java.io.File;
import org.jnode.shell.help.Help;
import org.jnode.shell.help.Parameter;
import org.jnode.shell.help.ParsedArguments;
import org.jnode.shell.help.argument.FileArgument;
-import java.io.File;
-
/**
* @author Levente S\u00e1ntha
*/
Modified: trunk/distr/src/apps/org/jnode/apps/editor/TextEditor.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/editor/TextEditor.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/editor/TextEditor.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,24 +1,19 @@
package org.jnode.apps.editor;
-import org.jnode.driver.input.KeyboardListener;
-import org.jnode.driver.input.KeyboardEvent;
+import java.awt.event.KeyEvent;
+import java.io.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.List;
import org.jnode.driver.console.ConsoleManager;
import org.jnode.driver.console.TextConsole;
import org.jnode.driver.console.textscreen.TextScreenConsoleManager;
+import org.jnode.driver.input.KeyboardEvent;
+import org.jnode.driver.input.KeyboardListener;
import org.jnode.naming.InitialNaming;
import org.jnode.shell.ShellManager;
-import java.util.List;
-import java.util.ArrayList;
-import java.io.IOException;
-import java.io.File;
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.awt.event.KeyEvent;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
/**
* @author Levente S\u00e1ntha
*/
Modified: trunk/distr/src/apps/org/jnode/apps/httpd/NanoHTTPDCommand.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/httpd/NanoHTTPDCommand.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/httpd/NanoHTTPDCommand.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -21,18 +21,12 @@
package org.jnode.apps.httpd;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.io.PrintWriter;
+import fi.iki.elonen.NanoHTTPD;
+import java.io.*;
import java.util.Properties;
-
import org.jnode.shell.Command;
import org.jnode.shell.CommandLine;
-import fi.iki.elonen.NanoHTTPD;
-
/**
* @author Martin Husted Hartvig (ha...@jn...)
*/
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/JPartition.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/JPartition.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/JPartition.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -4,12 +4,12 @@
import org.jnode.apps.jpartition.controller.MainController;
import org.jnode.apps.jpartition.swingview.SwingViewFactory;
import org.jnode.apps.jpartition.utils.BasicNameSpace;
+import org.jnode.driver.DeviceManager;
+import org.jnode.emu.Emu;
import org.jnode.naming.InitialNaming;
import org.jnode.naming.NameSpace;
import org.jnode.test.fs.driver.stubs.StubDeviceManager;
import org.jnode.util.OsUtils;
-import org.jnode.emu.Emu;
-import org.jnode.driver.DeviceManager;
public class JPartition extends Emu {
private static final Logger log = Logger.getLogger(JPartition.class);
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/commands/framework/CommandProcessor.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/commands/framework/CommandProcessor.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/commands/framework/CommandProcessor.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -3,7 +3,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
-
import org.apache.log4j.Logger;
public class CommandProcessor {
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/controller/MainController.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/controller/MainController.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/controller/MainController.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -3,12 +3,10 @@
import it.battlehorse.stamps.Dispatcher;
import it.battlehorse.stamps.factories.DispatcherRegistry;
import it.battlehorse.stamps.factories.TransformerRegistry;
-
import org.jnode.apps.jpartition.ViewFactory;
import org.jnode.apps.jpartition.model.CommandProcessorModel;
import org.jnode.apps.jpartition.model.DeviceModel;
import org.jnode.apps.jpartition.model.FileDeviceModel;
-import org.jnode.apps.jpartition.swingview.MainView;
public class MainController
{
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/model/AbstractModel.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/model/AbstractModel.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/model/AbstractModel.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,7 +1,6 @@
package org.jnode.apps.jpartition.model;
import it.battlehorse.stamps.Model;
-
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/model/DeviceModel.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/model/DeviceModel.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/model/DeviceModel.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,9 +2,7 @@
import java.util.ArrayList;
import java.util.List;
-
import javax.naming.NameNotFoundException;
-
import org.apache.log4j.Logger;
import org.jnode.driver.Device;
import org.jnode.driver.DeviceListener;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/model/FileDeviceModel.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/model/FileDeviceModel.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/model/FileDeviceModel.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,7 +2,6 @@
import java.util.ArrayList;
import java.util.List;
-
import org.jnode.apps.jpartition.utils.device.DeviceUtils;
import org.jnode.driver.bus.ide.IDEDevice;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/model/PartitionModel.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/model/PartitionModel.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/model/PartitionModel.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,7 +1,6 @@
package org.jnode.apps.jpartition.model;
import it.battlehorse.stamps.annotations.Refreshable;
-
import org.jnode.partitions.ibm.IBMPartitionTableEntry;
import org.jnode.partitions.ibm.IBMPartitionTypes;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/CommandProcessorView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/CommandProcessorView.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/CommandProcessorView.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,18 +1,10 @@
package org.jnode.apps.jpartition.swingview;
import it.battlehorse.stamps.annotations.ModelDependent;
-
-import java.awt.BorderLayout;
+import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-
-import javax.swing.BorderFactory;
-import javax.swing.DefaultListModel;
-import javax.swing.JButton;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-
+import javax.swing.*;
import org.apache.log4j.Logger;
import org.jnode.apps.jpartition.controller.MainController;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DeviceView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DeviceView.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DeviceView.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,12 +1,9 @@
package org.jnode.apps.jpartition.swingview;
import it.battlehorse.stamps.annotations.ModelDependent;
-
-import javax.swing.JPanel;
-
+import javax.swing.*;
import org.apache.log4j.Logger;
import org.jnode.apps.jpartition.controller.MainController;
-import org.jnode.apps.jpartition.model.DeviceModel;
public class DeviceView extends JPanel
{
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DiskAreaView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DiskAreaView.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/DiskAreaView.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,13 +1,9 @@
package org.jnode.apps.jpartition.swingview;
-import java.awt.Color;
+import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
-
-import javax.swing.BorderFactory;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
+import javax.swing.*;
import org.jnode.apps.jpartition.controller.MainController;
public class DiskAreaView extends JPanel
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/ErrorReporter.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/ErrorReporter.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/ErrorReporter.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,9 +1,8 @@
package org.jnode.apps.jpartition.swingview;
-import org.apache.log4j.Logger;
-
import charva.awt.Component;
import charvax.swing.JOptionPane;
+import org.apache.log4j.Logger;
public class ErrorReporter {
public static void reportError(Logger log, Object source, Throwable t)
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/FileDeviceView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/FileDeviceView.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/FileDeviceView.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,19 +1,10 @@
package org.jnode.apps.jpartition.swingview;
import it.battlehorse.stamps.annotations.ModelDependent;
-
-import java.awt.BorderLayout;
+import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
-
-import javax.swing.AbstractListModel;
-import javax.swing.DefaultListModel;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-
+import javax.swing.*;
import org.apache.log4j.Logger;
import org.jnode.apps.jpartition.controller.MainController;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/MainView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/MainView.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/MainView.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,16 +1,10 @@
package org.jnode.apps.jpartition.swingview;
import it.battlehorse.stamps.annotations.ModelDependent;
-
-import java.awt.BorderLayout;
+import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
-
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JFrame;
-
+import javax.swing.*;
import org.apache.log4j.Logger;
import org.jnode.apps.jpartition.controller.MainController;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/PartitionView.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/PartitionView.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/PartitionView.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,7 +1,6 @@
package org.jnode.apps.jpartition.swingview;
import it.battlehorse.stamps.annotations.ModelDependent;
-
import org.apache.log4j.Logger;
import org.jnode.apps.jpartition.controller.MainController;
import org.jnode.partitions.ibm.IBMPartitionTypes;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/SwingViewFactory.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/SwingViewFactory.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/SwingViewFactory.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,8 +1,6 @@
package org.jnode.apps.jpartition.swingview;
-import javax.swing.JComponent;
-import javax.swing.JFrame;
-
+import javax.swing.*;
import org.jnode.apps.jpartition.ViewFactory;
import org.jnode.apps.jpartition.controller.MainController;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/BaseDeviceAction.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/BaseDeviceAction.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/swingview/actions/BaseDeviceAction.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,10 +1,7 @@
package org.jnode.apps.jpartition.swingview.actions;
import java.awt.event.ActionEvent;
-
-import javax.swing.AbstractAction;
-import javax.swing.Icon;
-
+import javax.swing.*;
import org.apache.log4j.Logger;
import org.jnode.apps.jpartition.commands.BaseDeviceCommand;
import org.jnode.apps.jpartition.commands.framework.Command;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/utils/BasicNameSpace.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/utils/BasicNameSpace.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/utils/BasicNameSpace.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -6,11 +6,9 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-
import javax.naming.NameAlreadyBoundException;
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
-
import org.jnode.naming.NameSpace;
public final class BasicNameSpace implements NameSpace {
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/AbstractIDEDevice.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/AbstractIDEDevice.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/AbstractIDEDevice.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,9 +2,7 @@
import java.io.IOException;
import java.nio.ByteBuffer;
-
import javax.naming.NameNotFoundException;
-
import org.jnode.driver.DriverException;
import org.jnode.driver.block.PartitionableBlockDeviceAPI;
import org.jnode.driver.bus.ide.IDEConstants;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/DeviceUtils.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/DeviceUtils.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/DeviceUtils.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,20 +2,13 @@
import java.io.File;
import java.io.IOException;
-
import javax.naming.NameNotFoundException;
-
import org.apache.log4j.Logger;
import org.jnode.apps.jpartition.swingview.ErrorReporter;
import org.jnode.apps.jpartition.swingview.FileDeviceView;
import org.jnode.apps.vmware.disk.VMWareDisk;
import org.jnode.apps.vmware.disk.tools.DiskFactory;
-import org.jnode.driver.ApiNotFoundException;
-import org.jnode.driver.Device;
-import org.jnode.driver.DeviceAlreadyRegisteredException;
-import org.jnode.driver.DeviceManager;
-import org.jnode.driver.DeviceNotFoundException;
-import org.jnode.driver.DriverException;
+import org.jnode.driver.*;
import org.jnode.driver.bus.ide.IDEDevice;
import org.jnode.partitions.command.PartitionHelper;
import org.jnode.partitions.ibm.IBMPartitionTypes;
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FakeIDEDevice.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FakeIDEDevice.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FakeIDEDevice.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,24 +1,15 @@
package org.jnode.apps.jpartition.utils.device;
-import java.io.File;
import java.io.IOException;
-import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
-
import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-
-import org.jnode.apps.vmware.disk.VMWareDisk;
import org.jnode.apps.vmware.disk.handler.UnsupportedFormatException;
-import org.jnode.apps.vmware.disk.tools.DiskFactory;
-import org.jnode.driver.DeviceManager;
import org.jnode.driver.DriverException;
import org.jnode.driver.block.BlockDeviceAPIHelper;
import org.jnode.driver.block.PartitionableBlockDeviceAPI;
import org.jnode.driver.bus.ide.IDEDevice;
import org.jnode.driver.bus.ide.IDEDeviceFactory;
import org.jnode.driver.bus.ide.IDEDriverUtils;
-import org.jnode.naming.InitialNaming;
public class FakeIDEDevice extends AbstractIDEDevice implements PartitionableBlockDeviceAPI
{
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FileIDEDevice.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FileIDEDevice.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FileIDEDevice.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,24 +1,16 @@
package org.jnode.apps.jpartition.utils.device;
-import java.io.File;
import java.io.IOException;
-import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
-
import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-
import org.jnode.apps.vmware.disk.VMWareDisk;
import org.jnode.apps.vmware.disk.handler.UnsupportedFormatException;
-import org.jnode.apps.vmware.disk.tools.DiskFactory;
-import org.jnode.driver.DeviceManager;
import org.jnode.driver.DriverException;
import org.jnode.driver.block.BlockDeviceAPIHelper;
import org.jnode.driver.block.PartitionableBlockDeviceAPI;
import org.jnode.driver.bus.ide.IDEDevice;
import org.jnode.driver.bus.ide.IDEDeviceFactory;
import org.jnode.driver.bus.ide.IDEDriverUtils;
-import org.jnode.naming.InitialNaming;
public class FileIDEDevice extends AbstractIDEDevice implements PartitionableBlockDeviceAPI
{
Modified: trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FileIDEDeviceDriver.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FileIDEDeviceDriver.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/jpartition/utils/device/FileIDEDeviceDriver.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,7 +2,6 @@
import org.jnode.driver.Driver;
import org.jnode.driver.DriverException;
-import org.jnode.driver.DeviceAlreadyRegisteredException;
import org.jnode.driver.bus.ide.IDEDevice;
/**
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/ExtentDeclaration.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/ExtentDeclaration.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/ExtentDeclaration.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,7 +1,6 @@
package org.jnode.apps.vmware.disk;
import java.io.File;
-
import org.jnode.apps.vmware.disk.extent.Access;
import org.jnode.apps.vmware.disk.extent.ExtentType;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/IOUtils.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/IOUtils.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/IOUtils.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -10,7 +10,6 @@
import java.nio.channels.FileChannel.MapMode;
import java.util.HashMap;
import java.util.Map;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.extent.Access;
import org.jnode.apps.vmware.disk.extent.ExtentType;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/VMWareDisk.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/VMWareDisk.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/VMWareDisk.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -3,15 +3,12 @@
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
-import org.jnode.apps.vmware.disk.descriptor.DiskDatabase;
import org.jnode.apps.vmware.disk.handler.ExtentFactory;
import org.jnode.apps.vmware.disk.handler.FileDescriptor;
import org.jnode.apps.vmware.disk.handler.IOHandler;
import org.jnode.apps.vmware.disk.handler.UnsupportedFormatException;
-import org.jnode.apps.vmware.disk.handler.sparse.SparseIOHandler;
/**
* Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare)
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/descriptor/Descriptor.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/descriptor/Descriptor.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/descriptor/Descriptor.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,12 +2,8 @@
import java.io.File;
import java.util.List;
-
import org.apache.log4j.Logger;
-import org.jnode.apps.vmware.disk.VMWareDisk;
import org.jnode.apps.vmware.disk.extent.Extent;
-import org.jnode.apps.vmware.disk.handler.ExtentFactory;
-import org.jnode.apps.vmware.disk.handler.FileDescriptor;
/**
* Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare)
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/descriptor/DescriptorRW.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/descriptor/DescriptorRW.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/descriptor/DescriptorRW.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,19 +1,11 @@
package org.jnode.apps.vmware.disk.descriptor;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.RandomAccessFile;
-import java.io.Reader;
+import java.io.*;
import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.channels.FileChannel.MapMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.ExtentDeclaration;
import org.jnode.apps.vmware.disk.IOUtils;
@@ -21,10 +13,8 @@
import org.jnode.apps.vmware.disk.extent.Access;
import org.jnode.apps.vmware.disk.extent.Extent;
import org.jnode.apps.vmware.disk.extent.ExtentType;
-import org.jnode.apps.vmware.disk.handler.ExtentFactory;
import org.jnode.apps.vmware.disk.handler.FileDescriptor;
import org.jnode.apps.vmware.disk.handler.UnsupportedFormatException;
-import org.jnode.apps.vmware.disk.handler.sparse.SparseExtentHeader;
import org.jnode.util.ByteBufferInputStream;
/**
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/extent/Extent.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/extent/Extent.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/extent/Extent.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,12 +1,9 @@
package org.jnode.apps.vmware.disk.extent;
import java.io.File;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.ExtentDeclaration;
-import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
-import org.jnode.apps.vmware.disk.handler.sparse.SparseExtentFactory;
/**
* Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare)
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/ExtentFactory.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/ExtentFactory.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/ExtentFactory.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -3,16 +3,8 @@
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.channels.FileChannel.MapMode;
-
import org.apache.log4j.Logger;
-import org.jnode.apps.vmware.disk.ExtentDeclaration;
-import org.jnode.apps.vmware.disk.IOUtils;
-import org.jnode.apps.vmware.disk.descriptor.Descriptor;
import org.jnode.apps.vmware.disk.descriptor.DescriptorRW;
-import org.jnode.apps.vmware.disk.extent.Extent;
import org.jnode.apps.vmware.disk.handler.sparse.SparseExtentFactory;
/**
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/ExtentIO.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/ExtentIO.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/ExtentIO.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -4,10 +4,8 @@
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.extent.Extent;
-import org.jnode.apps.vmware.disk.handler.sparse.SparseExtentFactory;
/**
* Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare)
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/FileDescriptor.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/FileDescriptor.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/FileDescriptor.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,7 +1,6 @@
package org.jnode.apps.vmware.disk.handler;
import java.io.RandomAccessFile;
-
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
/**
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/IOHandler.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/IOHandler.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/IOHandler.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -5,10 +5,8 @@
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
-import org.jnode.apps.vmware.disk.descriptor.DescriptorRW;
import org.jnode.apps.vmware.disk.descriptor.DiskDatabase;
import org.jnode.apps.vmware.disk.extent.Extent;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleDescriptorRW.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleDescriptorRW.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleDescriptorRW.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -4,7 +4,6 @@
package org.jnode.apps.vmware.disk.handler.simple;
import java.io.IOException;
-
import org.jnode.apps.vmware.disk.ExtentDeclaration;
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
import org.jnode.apps.vmware.disk.descriptor.DescriptorRW;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleExtentFactory.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleExtentFactory.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleExtentFactory.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -3,16 +3,9 @@
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
-import java.nio.ByteBuffer;
-
-import org.jnode.apps.vmware.disk.ExtentDeclaration;
-import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
-import org.jnode.apps.vmware.disk.descriptor.DescriptorRW;
-import org.jnode.apps.vmware.disk.extent.Extent;
import org.jnode.apps.vmware.disk.handler.ExtentFactory;
import org.jnode.apps.vmware.disk.handler.FileDescriptor;
-import org.jnode.apps.vmware.disk.handler.IOHandler;
import org.jnode.apps.vmware.disk.handler.UnsupportedFormatException;
/**
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleIOHandler.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleIOHandler.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/simple/SimpleIOHandler.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -4,7 +4,6 @@
package org.jnode.apps.vmware.disk.handler.simple;
import java.io.IOException;
-
import org.jnode.apps.vmware.disk.handler.FileDescriptor;
import org.jnode.apps.vmware.disk.handler.IOHandler;
import org.jnode.apps.vmware.disk.handler.UnsupportedFormatException;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/AllocationTable.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/AllocationTable.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/AllocationTable.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,7 +1,5 @@
package org.jnode.apps.vmware.disk.handler.sparse;
-import java.io.IOException;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.test.readwrite.TestVMWareDisk;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/AllocationTableRW.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/AllocationTableRW.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/AllocationTableRW.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -5,7 +5,6 @@
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.nio.channels.FileChannel;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.handler.IOHandler;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/EntryArray.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/EntryArray.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/EntryArray.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,13 +1,6 @@
package org.jnode.apps.vmware.disk.handler.sparse;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-import java.nio.channels.FileChannel;
-
import org.apache.log4j.Logger;
-import org.jnode.apps.vmware.disk.IOUtils;
/**
* Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare)
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/GrainDirectory.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/GrainDirectory.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/GrainDirectory.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,8 +1,5 @@
package org.jnode.apps.vmware.disk.handler.sparse;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-
/**
* Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare)
*
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/GrainTable.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/GrainTable.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/GrainTable.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,8 +1,5 @@
package org.jnode.apps.vmware.disk.handler.sparse;
-import java.io.IOException;
-import java.io.RandomAccessFile;
-
/**
* Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare)
*
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseDescriptorRW.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseDescriptorRW.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseDescriptorRW.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -6,13 +6,11 @@
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.ExtentDeclaration;
import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
import org.jnode.apps.vmware.disk.descriptor.DescriptorRW;
-import org.jnode.apps.vmware.disk.extent.Extent;
import org.jnode.apps.vmware.disk.handler.FileDescriptor;
import org.jnode.apps.vmware.disk.handler.UnsupportedFormatException;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseDiskFactory.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseDiskFactory.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseDiskFactory.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -7,15 +7,10 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.ExtentDeclaration;
import org.jnode.apps.vmware.disk.IOUtils;
-import org.jnode.apps.vmware.disk.descriptor.AdapterType;
-import org.jnode.apps.vmware.disk.descriptor.CreateType;
-import org.jnode.apps.vmware.disk.descriptor.Descriptor;
-import org.jnode.apps.vmware.disk.descriptor.DiskDatabase;
-import org.jnode.apps.vmware.disk.descriptor.Header;
+import org.jnode.apps.vmware.disk.descriptor.*;
import org.jnode.apps.vmware.disk.extent.Access;
import org.jnode.apps.vmware.disk.extent.Extent;
import org.jnode.apps.vmware.disk.extent.ExtentType;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtent.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtent.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtent.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,8 +2,6 @@
import java.io.IOException;
import java.io.RandomAccessFile;
-import java.nio.channels.FileChannel;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.ExtentDeclaration;
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentFactory.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentFactory.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentFactory.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -4,7 +4,6 @@
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentHeader.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentHeader.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentHeader.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,7 +2,6 @@
import org.apache.log4j.Logger;
-import org.jnode.apps.vmware.disk.handler.UnsupportedFormatException;
/**
* Wrote from the 'Virtual Disk Format 1.0' specifications (from VMWare)
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentHeaderRW.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentHeaderRW.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentHeaderRW.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,9 +2,7 @@
import java.io.IOException;
import java.nio.ByteBuffer;
-import java.nio.channels.Channel;
import java.nio.channels.FileChannel;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.handler.UnsupportedFormatException;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentIO.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentIO.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentIO.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -3,7 +3,6 @@
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.extent.Extent;
import org.jnode.apps.vmware.disk.handler.ExtentIO;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentRW.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentRW.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseExtentRW.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -3,7 +3,6 @@
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.ExtentDeclaration;
import org.jnode.apps.vmware.disk.IOUtils;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseFileDescriptor.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseFileDescriptor.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseFileDescriptor.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,7 +1,6 @@
package org.jnode.apps.vmware.disk.handler.sparse;
import java.io.RandomAccessFile;
-
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
import org.jnode.apps.vmware.disk.handler.ExtentFactory;
import org.jnode.apps.vmware.disk.handler.FileDescriptor;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseIOHandler.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseIOHandler.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/handler/sparse/SparseIOHandler.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -5,11 +5,9 @@
import java.io.IOException;
import java.io.RandomAccessFile;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.descriptor.Descriptor;
import org.jnode.apps.vmware.disk.extent.Extent;
-import org.jnode.apps.vmware.disk.handler.ExtentIO;
import org.jnode.apps.vmware.disk.handler.IOHandler;
/**
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/BaseTest.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/BaseTest.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/BaseTest.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -2,8 +2,6 @@
import java.io.File;
import java.io.IOException;
-
-import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.tools.DiskCopier;
import org.junit.After;
import org.junit.Before;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/TestCreation.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/TestCreation.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/TestCreation.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,10 +1,7 @@
package org.jnode.apps.vmware.disk.test;
-import java.io.File;
import java.io.IOException;
-
import org.apache.log4j.Logger;
-import org.jnode.apps.vmware.disk.IOUtils;
import org.junit.Test;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/Utils.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/Utils.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/Utils.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,12 +1,7 @@
package org.jnode.apps.vmware.disk.test;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FilenameFilter;
import java.io.IOException;
-import java.nio.channels.FileChannel;
-
import org.apache.log4j.Logger;
/**
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/BaseReadWriteTest.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/BaseReadWriteTest.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/BaseReadWriteTest.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -7,18 +7,13 @@
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.VMWareDisk;
import org.jnode.apps.vmware.disk.handler.IOHandler;
import org.jnode.apps.vmware.disk.test.BaseTest;
import org.jnode.apps.vmware.disk.test.Utils;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/TestHeader.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/TestHeader.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/TestHeader.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,22 +1,11 @@
package org.jnode.apps.vmware.disk.test.readwrite;
import java.io.File;
-import java.io.FilenameFilter;
import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.log4j.Logger;
-import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.VMWareDisk;
-import org.jnode.apps.vmware.disk.handler.IOHandler;
import org.jnode.apps.vmware.disk.test.Utils;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/TestVMWareDisk.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/TestVMWareDisk.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/test/readwrite/TestVMWareDisk.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,22 +1,14 @@
package org.jnode.apps.vmware.disk.test.readwrite;
import java.io.File;
-import java.io.FilenameFilter;
import java.io.IOException;
import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-
import org.apache.log4j.Logger;
import org.jnode.apps.vmware.disk.IOUtils;
import org.jnode.apps.vmware.disk.VMWareDisk;
import org.jnode.apps.vmware.disk.handler.IOHandler;
import org.jnode.apps.vmware.disk.test.Utils;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.*;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
Modified: trunk/distr/src/apps/org/jnode/apps/vmware/disk/tools/DiskCopier.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/vmware/disk/tools/DiskCopier.java 2007-08-04 10:19:57 UTC (rev 3379)
+++ trunk/distr/src/apps/org/jnode/apps/vmware/disk/tools/DiskCopier.java 2007-08-04 10:24:21 UTC (rev 3380)
@@ -1,12 +1,7 @@
package org.jnode.apps.vmware.disk.tools;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FilenameFilter;
-import java.io.IOException;
+import java.io.*;
import java.nio.channels.FileC...
[truncated message content] |
|
From: <ls...@us...> - 2007-08-04 10:19:59
|
Revision: 3379
http://jnode.svn.sourceforge.net/jnode/?rev=3379&view=rev
Author: lsantha
Date: 2007-08-04 03:19:57 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
Optimized imports.
Modified Paths:
--------------
trunk/builder/src/builder/org/jnode/ant/taskdefs/Asm.java
trunk/builder/src/builder/org/jnode/ant/taskdefs/HeaderTask.java
trunk/builder/src/builder/org/jnode/ant/taskdefs/Native2AsciiTask.java
trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/BaseDirs.java
trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/CompareTask.java
trunk/builder/src/builder/org/jnode/build/AbstractAsmConstBuilder.java
trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java
trunk/builder/src/builder/org/jnode/build/AbstractPluginTask.java
trunk/builder/src/builder/org/jnode/build/AbstractPluginsTask.java
trunk/builder/src/builder/org/jnode/build/AddressFinder.java
trunk/builder/src/builder/org/jnode/build/BootDiskBuilder.java
trunk/builder/src/builder/org/jnode/build/BootFloppyBuilder.java
trunk/builder/src/builder/org/jnode/build/FieldInfo.java
trunk/builder/src/builder/org/jnode/build/InitJarBuilder.java
trunk/builder/src/builder/org/jnode/build/InitJarsBuilder.java
trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java
trunk/builder/src/builder/org/jnode/build/PluginList.java
trunk/builder/src/builder/org/jnode/build/PluginTask.java
trunk/builder/src/builder/org/jnode/build/VMwareBuilderTask.java
trunk/builder/src/builder/org/jnode/build/dependencies/BCELDependencyChecker.java
trunk/builder/src/builder/org/jnode/build/documentation/DotBuilder.java
trunk/builder/src/builder/org/jnode/build/documentation/PluginData.java
trunk/builder/src/builder/org/jnode/build/documentation/PluginDocumentationTask.java
trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java
trunk/builder/src/builder/org/jnode/build/x86/Disasm.java
trunk/builder/src/builder/org/jnode/jnasm/JNAsm.java
trunk/builder/src/builder/org/jnode/jnasm/assembler/Assembler.java
trunk/builder/src/builder/org/jnode/jnasm/assembler/AssemblerModule.java
trunk/builder/src/builder/org/jnode/jnasm/assembler/HardwareSupport.java
trunk/builder/src/builder/org/jnode/jnasm/assembler/PseudoInstructions.java
trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/AbstractX86Module.java
trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/MMX.java
trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Core.java
trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Support.java
trunk/builder/src/builder/org/jnode/jnasm/preprocessor/Preprocessor.java
trunk/builder/src/builder/org/jnode/linker/Elf.java
trunk/builder/src/builder/org/jnode/linker/ElfLinker.java
trunk/builder/src/builder/org/jnode/linker/Reloc.java
trunk/builder/src/builder/org/jnode/linker/Section.java
Modified: trunk/builder/src/builder/org/jnode/ant/taskdefs/Asm.java
===================================================================
--- trunk/builder/src/builder/org/jnode/ant/taskdefs/Asm.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/ant/taskdefs/Asm.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -23,12 +23,7 @@
import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
+import java.util.*;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
Modified: trunk/builder/src/builder/org/jnode/ant/taskdefs/HeaderTask.java
===================================================================
--- trunk/builder/src/builder/org/jnode/ant/taskdefs/HeaderTask.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/ant/taskdefs/HeaderTask.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,14 +21,8 @@
package org.jnode.ant.taskdefs;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.*;
import java.util.ArrayList;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
Modified: trunk/builder/src/builder/org/jnode/ant/taskdefs/Native2AsciiTask.java
===================================================================
--- trunk/builder/src/builder/org/jnode/ant/taskdefs/Native2AsciiTask.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/ant/taskdefs/Native2AsciiTask.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -26,7 +26,6 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Execute;
Modified: trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/BaseDirs.java
===================================================================
--- trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/BaseDirs.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/BaseDirs.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -24,7 +24,6 @@
import java.util.ArrayList;
import java.util.Map;
import java.util.TreeMap;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
Modified: trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/CompareTask.java
===================================================================
--- trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/CompareTask.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/ant/taskdefs/classpath/CompareTask.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,19 +21,11 @@
package org.jnode.ant.taskdefs.classpath;
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.*;
import java.util.Date;
import java.util.Map;
import java.util.TreeMap;
import java.util.TreeSet;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Execute;
Modified: trunk/builder/src/builder/org/jnode/build/AbstractAsmConstBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/AbstractAsmConstBuilder.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/AbstractAsmConstBuilder.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -31,7 +31,6 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
-
import org.jnode.vm.Vm;
import org.jnode.vm.VmArchitecture;
import org.jnode.vm.VmSystemClassLoader;
Modified: trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/AbstractBootImageBuilder.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,31 +21,16 @@
package org.jnode.build;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.*;
import java.lang.reflect.Field;
import java.net.URL;
import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
+import java.util.*;
import org.apache.tools.ant.Project;
import org.jnode.assembler.Label;
import org.jnode.assembler.NativeStream;
-import org.jnode.assembler.UnresolvedObjectRefException;
import org.jnode.assembler.NativeStream.ObjectRef;
+import org.jnode.assembler.UnresolvedObjectRefException;
import org.jnode.assembler.x86.X86BinaryAssembler;
import org.jnode.plugin.PluginDescriptor;
import org.jnode.plugin.PluginException;
@@ -56,28 +41,9 @@
import org.jnode.plugin.model.PluginRegistryModel;
import org.jnode.util.BootableHashMap;
import org.jnode.util.NumberUtils;
-import org.jnode.vm.JvmType;
-import org.jnode.vm.Unsafe;
-import org.jnode.vm.VirtualMemoryRegion;
-import org.jnode.vm.Vm;
-import org.jnode.vm.VmArchitecture;
-import org.jnode.vm.VmSystemClassLoader;
-import org.jnode.vm.VmSystemObject;
+import org.jnode.vm.*;
import org.jnode.vm.bytecode.BytecodeParser;
-import org.jnode.vm.classmgr.Modifier;
-import org.jnode.vm.classmgr.ObjectLayout;
-import org.jnode.vm.classmgr.VmArray;
-import org.jnode.vm.classmgr.VmArrayClass;
-import org.jnode.vm.classmgr.VmClassType;
-import org.jnode.vm.classmgr.VmCompiledCode;
-import org.jnode.vm.classmgr.VmField;
-import org.jnode.vm.classmgr.VmIsolatedStatics;
-import org.jnode.vm.classmgr.VmMethodCode;
-import org.jnode.vm.classmgr.VmNormalClass;
-import org.jnode.vm.classmgr.VmSharedStatics;
-import org.jnode.vm.classmgr.VmStaticField;
-import org.jnode.vm.classmgr.VmStatics;
-import org.jnode.vm.classmgr.VmType;
+import org.jnode.vm.classmgr.*;
import org.jnode.vm.compiler.NativeCodeCompiler;
import org.jnode.vm.memmgr.HeapHelper;
import org.jnode.vm.memmgr.VmHeapManager;
Modified: trunk/builder/src/builder/org/jnode/build/AbstractPluginTask.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/AbstractPluginTask.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/AbstractPluginTask.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -27,10 +27,8 @@
import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedList;
-
import nanoxml.XMLElement;
import nanoxml.XMLParseException;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.Jar;
Modified: trunk/builder/src/builder/org/jnode/build/AbstractPluginsTask.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/AbstractPluginsTask.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/AbstractPluginsTask.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -24,7 +24,6 @@
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
-
import org.apache.tools.ant.Project;
import org.jnode.plugin.PluginDescriptor;
import org.jnode.plugin.PluginException;
Modified: trunk/builder/src/builder/org/jnode/build/AddressFinder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/AddressFinder.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/AddressFinder.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,15 +21,7 @@
package org.jnode.build;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.RandomAccessFile;
-
+import java.io.*;
import org.jnode.build.x86.BootImageBuilder;
/**
Modified: trunk/builder/src/builder/org/jnode/build/BootDiskBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/BootDiskBuilder.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/BootDiskBuilder.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -26,7 +26,6 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.util.StringTokenizer;
-
import org.apache.tools.ant.Project;
import org.jnode.driver.ApiNotFoundException;
import org.jnode.driver.Device;
Modified: trunk/builder/src/builder/org/jnode/build/BootFloppyBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/BootFloppyBuilder.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/BootFloppyBuilder.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -27,7 +27,6 @@
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
Modified: trunk/builder/src/builder/org/jnode/build/FieldInfo.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/FieldInfo.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/FieldInfo.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -25,7 +25,6 @@
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
-
import org.jnode.vm.classmgr.VmField;
import org.jnode.vm.classmgr.VmType;
Modified: trunk/builder/src/builder/org/jnode/build/InitJarBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/InitJarBuilder.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/InitJarBuilder.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -24,12 +24,7 @@
import java.io.File;
import java.io.IOException;
import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
+import java.util.*;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.GZip;
import org.apache.tools.ant.taskdefs.Jar;
Modified: trunk/builder/src/builder/org/jnode/build/InitJarsBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/InitJarsBuilder.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/InitJarsBuilder.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -23,7 +23,6 @@
import java.io.File;
import java.util.ArrayList;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
Modified: trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/ObjectEmitter.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -27,7 +27,6 @@
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Set;
-
import org.jnode.assembler.BootImageNativeStream;
import org.jnode.assembler.Label;
import org.jnode.assembler.NativeStream;
@@ -35,13 +34,7 @@
import org.jnode.system.BootLog;
import org.jnode.vm.BootableObject;
import org.jnode.vm.VmSystemObject;
-import org.jnode.vm.classmgr.VmArrayClass;
-import org.jnode.vm.classmgr.VmClassLoader;
-import org.jnode.vm.classmgr.VmClassType;
-import org.jnode.vm.classmgr.VmField;
-import org.jnode.vm.classmgr.VmInstanceField;
-import org.jnode.vm.classmgr.VmNormalClass;
-import org.jnode.vm.classmgr.VmType;
+import org.jnode.vm.classmgr.*;
import org.vmmagic.unboxed.UnboxedObject;
public class ObjectEmitter {
Modified: trunk/builder/src/builder/org/jnode/build/PluginList.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/PluginList.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/PluginList.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -28,14 +28,8 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-
+import java.util.*;
import nanoxml.XMLElement;
-
import org.apache.tools.ant.taskdefs.Manifest;
import org.apache.tools.ant.taskdefs.ManifestException;
import org.jnode.plugin.PluginException;
Modified: trunk/builder/src/builder/org/jnode/build/PluginTask.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/PluginTask.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/PluginTask.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -29,16 +29,13 @@
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
-
import nanoxml.XMLElement;
import nanoxml.XMLParseException;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.Jar;
import org.apache.tools.ant.taskdefs.Manifest;
import org.apache.tools.ant.taskdefs.ManifestException;
-import org.apache.tools.ant.taskdefs.Manifest.Attribute;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.ZipFileSet;
import org.apache.tools.ant.util.FileUtils;
Modified: trunk/builder/src/builder/org/jnode/build/VMwareBuilderTask.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/VMwareBuilderTask.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/VMwareBuilderTask.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -25,7 +25,6 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
Modified: trunk/builder/src/builder/org/jnode/build/dependencies/BCELDependencyChecker.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/dependencies/BCELDependencyChecker.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/dependencies/BCELDependencyChecker.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -22,39 +22,13 @@
package org.jnode.build.dependencies;
import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.*;
import java.util.jar.JarFile;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
-import java.util.zip.ZipException;
-import java.util.zip.ZipFile;
-
-import org.apache.bcel.classfile.Constant;
-import org.apache.bcel.classfile.ConstantClass;
-import org.apache.bcel.classfile.ConstantNameAndType;
-import org.apache.bcel.classfile.ConstantPool;
-import org.apache.bcel.classfile.EmptyVisitor;
-import org.apache.bcel.classfile.Field;
-import org.apache.bcel.classfile.Method;
-import org.apache.bcel.classfile.JavaClass;
+import org.apache.bcel.classfile.*;
import org.apache.bcel.generic.Type;
import org.apache.bcel.util.ClassPath;
import org.apache.bcel.util.SyntheticRepository;
@@ -62,12 +36,9 @@
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.types.FileSet;
import org.jnode.build.AbstractPluginTask;
-import org.jnode.plugin.Extension;
-import org.jnode.plugin.Library;
import org.jnode.plugin.FragmentDescriptor;
import org.jnode.plugin.PluginDescriptor;
import org.jnode.plugin.PluginPrerequisite;
-import org.jnode.plugin.model.PluginDescriptorModel;
/**
* Task used to check dependencies between plugins.
Modified: trunk/builder/src/builder/org/jnode/build/documentation/DotBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/documentation/DotBuilder.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/documentation/DotBuilder.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -25,7 +25,6 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
-
import org.jnode.plugin.PluginPrerequisite;
/**
Modified: trunk/builder/src/builder/org/jnode/build/documentation/PluginData.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/documentation/PluginData.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/documentation/PluginData.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -22,7 +22,6 @@
package org.jnode.build.documentation;
import java.io.File;
-
import org.jnode.plugin.PluginDescriptor;
/**
Modified: trunk/builder/src/builder/org/jnode/build/documentation/PluginDocumentationTask.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/documentation/PluginDocumentationTask.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/documentation/PluginDocumentationTask.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -25,25 +25,12 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
+import java.util.*;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.types.FileSet;
import org.jnode.build.AbstractPluginTask;
-import org.jnode.plugin.ConfigurationElement;
-import org.jnode.plugin.Extension;
-import org.jnode.plugin.ExtensionPoint;
-import org.jnode.plugin.Library;
-import org.jnode.plugin.PluginDescriptor;
-import org.jnode.plugin.PluginPrerequisite;
+import org.jnode.plugin.*;
/**
* @author Martin Husted Hartvig (ha...@jn...)
Modified: trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/x86/BootImageBuilder.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -25,12 +25,11 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-
import org.apache.tools.ant.Project;
import org.jnode.assembler.Label;
import org.jnode.assembler.NativeStream;
-import org.jnode.assembler.UnresolvedObjectRefException;
import org.jnode.assembler.NativeStream.ObjectInfo;
+import org.jnode.assembler.UnresolvedObjectRefException;
import org.jnode.assembler.x86.X86BinaryAssembler;
import org.jnode.assembler.x86.X86Constants;
import org.jnode.assembler.x86.X86Register;
@@ -44,32 +43,13 @@
import org.jnode.linker.ElfLinker;
import org.jnode.plugin.PluginRegistry;
import org.jnode.util.NumberUtils;
-import org.jnode.vm.SoftByteCodes;
-import org.jnode.vm.Vm;
-import org.jnode.vm.VmArchitecture;
-import org.jnode.vm.VmSystem;
-import org.jnode.vm.VmSystemObject;
-import org.jnode.vm.classmgr.ObjectLayout;
-import org.jnode.vm.classmgr.VmArray;
-import org.jnode.vm.classmgr.VmClassType;
-import org.jnode.vm.classmgr.VmInstanceField;
-import org.jnode.vm.classmgr.VmIsolatedStatics;
-import org.jnode.vm.classmgr.VmMethod;
-import org.jnode.vm.classmgr.VmMethodCode;
-import org.jnode.vm.classmgr.VmSharedStatics;
-import org.jnode.vm.classmgr.VmStaticField;
-import org.jnode.vm.classmgr.VmType;
+import org.jnode.vm.*;
+import org.jnode.vm.classmgr.*;
import org.jnode.vm.scheduler.MonitorManager;
import org.jnode.vm.scheduler.VmProcessor;
import org.jnode.vm.scheduler.VmScheduler;
import org.jnode.vm.scheduler.VmThread;
-import org.jnode.vm.x86.VmX86Architecture;
-import org.jnode.vm.x86.VmX86Architecture32;
-import org.jnode.vm.x86.VmX86Architecture64;
-import org.jnode.vm.x86.VmX86Processor;
-import org.jnode.vm.x86.VmX86Processor32;
-import org.jnode.vm.x86.VmX86Processor64;
-import org.jnode.vm.x86.X86CpuID;
+import org.jnode.vm.x86.*;
import org.jnode.vm.x86.compiler.X86CompilerConstants;
import org.jnode.vm.x86.compiler.X86JumpTable;
Modified: trunk/builder/src/builder/org/jnode/build/x86/Disasm.java
===================================================================
--- trunk/builder/src/builder/org/jnode/build/x86/Disasm.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/build/x86/Disasm.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,11 +21,7 @@
package org.jnode.build.x86;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import java.io.*;
/**
* @author Ewout Prangsma (ep...@us...)
Modified: trunk/builder/src/builder/org/jnode/jnasm/JNAsm.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/JNAsm.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/JNAsm.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,13 +21,8 @@
package org.jnode.jnasm;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.StringWriter;
+import java.io.*;
import java.util.Map;
-
import org.jnode.assembler.NativeStream;
import org.jnode.build.AsmSourceInfo;
import org.jnode.jnasm.assembler.Assembler;
Modified: trunk/builder/src/builder/org/jnode/jnasm/assembler/Assembler.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/assembler/Assembler.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/assembler/Assembler.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,24 +21,15 @@
package org.jnode.jnasm.assembler;
-import org.jnode.assembler.Label;
-import org.jnode.assembler.NativeStream;
-import org.jnode.jnasm.assembler.x86.X86Support;
-
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.RandomAccessFile;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
+import java.io.*;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.jnode.assembler.Label;
+import org.jnode.assembler.NativeStream;
+import org.jnode.jnasm.assembler.x86.X86Support;
/**
* @author Levente S\u00e1ntha (ls...@us...)
Modified: trunk/builder/src/builder/org/jnode/jnasm/assembler/AssemblerModule.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/assembler/AssemblerModule.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/assembler/AssemblerModule.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -23,7 +23,6 @@
import java.util.List;
import java.util.Map;
-
import org.jnode.assembler.Label;
import org.jnode.assembler.NativeStream;
Modified: trunk/builder/src/builder/org/jnode/jnasm/assembler/HardwareSupport.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/assembler/HardwareSupport.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/assembler/HardwareSupport.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,11 +21,10 @@
package org.jnode.jnasm.assembler;
+import java.io.IOException;
+import java.io.OutputStream;
import org.jnode.assembler.NativeStream;
-import java.io.OutputStream;
-import java.io.IOException;
-
/**
* @author Levente S\u00e1ntha (ls...@us...)
*/
Modified: trunk/builder/src/builder/org/jnode/jnasm/assembler/PseudoInstructions.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/assembler/PseudoInstructions.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/assembler/PseudoInstructions.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,11 +21,10 @@
package org.jnode.jnasm.assembler;
-import org.jnode.assembler.NativeStream;
-import org.jnode.assembler.Label;
-
import java.util.List;
import java.util.Map;
+import org.jnode.assembler.Label;
+import org.jnode.assembler.NativeStream;
/**
* @author Levente S\u00e1ntha (ls...@us...)
Modified: trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/AbstractX86Module.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/AbstractX86Module.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/AbstractX86Module.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,17 +21,16 @@
package org.jnode.jnasm.assembler.x86;
-import org.jnode.jnasm.assembler.AssemblerModule;
-import org.jnode.jnasm.assembler.Register;
-import org.jnode.jnasm.assembler.Address;
+import java.util.List;
+import java.util.Map;
import org.jnode.assembler.Label;
import org.jnode.assembler.NativeStream;
import org.jnode.assembler.x86.X86Assembler;
import org.jnode.assembler.x86.X86Register;
+import org.jnode.jnasm.assembler.Address;
+import org.jnode.jnasm.assembler.AssemblerModule;
+import org.jnode.jnasm.assembler.Register;
-import java.util.Map;
-import java.util.List;
-
/**
* @author Levente S\u00e1ntha (ls...@us...)
*/
Modified: trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/MMX.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/MMX.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/MMX.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,15 +21,14 @@
package org.jnode.jnasm.assembler.x86;
-import org.jnode.jnasm.assembler.InstructionUtils;
-import org.jnode.jnasm.assembler.Address;
-import org.jnode.jnasm.assembler.Register;
+import java.util.List;
+import java.util.Map;
import org.jnode.assembler.Label;
import org.jnode.assembler.x86.X86Register;
+import org.jnode.jnasm.assembler.Address;
+import org.jnode.jnasm.assembler.InstructionUtils;
+import org.jnode.jnasm.assembler.Register;
-import java.util.List;
-import java.util.Map;
-
/**
* @author Levente S\u00e1ntha (ls...@us...)
*/
Modified: trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Core.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Core.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Core.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,22 +21,21 @@
package org.jnode.jnasm.assembler.x86;
-import org.jnode.jnasm.assembler.Address;
-import org.jnode.jnasm.assembler.InstructionUtils;
-import org.jnode.jnasm.assembler.Register;
-import org.jnode.jnasm.assembler.Identifier;
+import java.util.List;
+import java.util.Map;
+import org.jnode.assembler.Label;
+import org.jnode.assembler.UnresolvedObjectRefException;
import org.jnode.assembler.x86.X86Assembler;
-import org.jnode.assembler.x86.X86Register;
import org.jnode.assembler.x86.X86Constants;
+import org.jnode.assembler.x86.X86Register;
import org.jnode.assembler.x86.X86Register.CRX;
import org.jnode.assembler.x86.X86Register.GPR;
import org.jnode.assembler.x86.X86Register.SR;
-import org.jnode.assembler.Label;
-import org.jnode.assembler.UnresolvedObjectRefException;
+import org.jnode.jnasm.assembler.Address;
+import org.jnode.jnasm.assembler.Identifier;
+import org.jnode.jnasm.assembler.InstructionUtils;
+import org.jnode.jnasm.assembler.Register;
-import java.util.Map;
-import java.util.List;
-
/**
* @author Levente S\u00e1ntha (ls...@us...)
*/
Modified: trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Support.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Support.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/assembler/x86/X86Support.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,6 +21,11 @@
package org.jnode.jnasm.assembler.x86;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
import org.jnode.assembler.Label;
import org.jnode.assembler.NativeStream;
import org.jnode.assembler.x86.X86Assembler;
@@ -33,12 +38,6 @@
import org.jnode.jnasm.assembler.Instruction;
import org.jnode.vm.x86.X86CpuID;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
/**
* @author Levente S\u00e1ntha (ls...@us...)
*/
Modified: trunk/builder/src/builder/org/jnode/jnasm/preprocessor/Preprocessor.java
===================================================================
--- trunk/builder/src/builder/org/jnode/jnasm/preprocessor/Preprocessor.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/jnasm/preprocessor/Preprocessor.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -21,23 +21,12 @@
package org.jnode.jnasm.preprocessor;
-import org.jnode.build.AsmSourceInfo;
-
+import java.io.*;
+import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.io.InputStream;
-import java.io.OutputStreamWriter;
-import java.io.StringWriter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.StringReader;
-import java.io.Reader;
-import java.io.File;
-import java.io.BufferedInputStream;
-import java.lang.reflect.Constructor;
+import org.jnode.build.AsmSourceInfo;
/**
* @author Levente S\u00e1ntha (ls...@us...)
Modified: trunk/builder/src/builder/org/jnode/linker/Elf.java
===================================================================
--- trunk/builder/src/builder/org/jnode/linker/Elf.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/linker/Elf.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -47,7 +47,6 @@
import java.io.RandomAccessFile;
import java.util.Collection;
import java.util.Vector;
-
import org.jnode.assembler.UnresolvedObjectRefException;
import org.jnode.assembler.x86.X86BinaryAssembler;
import org.jnode.assembler.x86.X86BinaryAssembler.X86ObjectRef;
Modified: trunk/builder/src/builder/org/jnode/linker/ElfLinker.java
===================================================================
--- trunk/builder/src/builder/org/jnode/linker/ElfLinker.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/linker/ElfLinker.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -22,7 +22,6 @@
package org.jnode.linker;
import java.io.IOException;
-
import org.jnode.assembler.Label;
import org.jnode.assembler.NativeStream;
import org.jnode.assembler.UnresolvedObjectRefException;
Modified: trunk/builder/src/builder/org/jnode/linker/Reloc.java
===================================================================
--- trunk/builder/src/builder/org/jnode/linker/Reloc.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/linker/Reloc.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-
import org.jnode.util.NumberUtils;
public class Reloc {
Modified: trunk/builder/src/builder/org/jnode/linker/Section.java
===================================================================
--- trunk/builder/src/builder/org/jnode/linker/Section.java 2007-08-04 10:09:43 UTC (rev 3378)
+++ trunk/builder/src/builder/org/jnode/linker/Section.java 2007-08-04 10:19:57 UTC (rev 3379)
@@ -38,11 +38,7 @@
// } Elf32_Shdr;
//
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.RandomAccessFile;
+import java.io.*;
import java.util.Vector;
public class Section {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-04 10:09:46
|
Revision: 3378
http://jnode.svn.sourceforge.net/jnode/?rev=3378&view=rev
Author: lsantha
Date: 2007-08-04 03:09:43 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
Fixed the problem with file access rights in cp command.
Modified Paths:
--------------
trunk/fs/src/fs/org/jnode/fs/fat/FatRootEntry.java
trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java
trunk/fs/src/fs/org/jnode/fs/jfat/FatEntry.java
trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java
Modified: trunk/fs/src/fs/org/jnode/fs/fat/FatRootEntry.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/fat/FatRootEntry.java 2007-08-04 09:31:03 UTC (rev 3377)
+++ trunk/fs/src/fs/org/jnode/fs/fat/FatRootEntry.java 2007-08-04 10:09:43 UTC (rev 3378)
@@ -115,7 +115,7 @@
* @throws IOException
*/
public FSAccessRights getAccessRights() throws IOException {
- throw new IOException("Not implemented yet");
+ throw new UnsupportedOperationException("not implemented yet");
}
/**
Modified: trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java 2007-08-04 09:31:03 UTC (rev 3377)
+++ trunk/fs/src/fs/org/jnode/fs/iso9660/ISO9660Entry.java 2007-08-04 10:09:43 UTC (rev 3378)
@@ -114,7 +114,7 @@
* @see org.jnode.fs.FSEntry#getAccessRights()
*/
public FSAccessRights getAccessRights() throws IOException {
- throw new UnsupportedOperationException("not yet implemented");
+ throw new UnsupportedOperationException("not implemented yet");
}
/**
Modified: trunk/fs/src/fs/org/jnode/fs/jfat/FatEntry.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/jfat/FatEntry.java 2007-08-04 09:31:03 UTC (rev 3377)
+++ trunk/fs/src/fs/org/jnode/fs/jfat/FatEntry.java 2007-08-04 10:09:43 UTC (rev 3378)
@@ -210,7 +210,7 @@
* @throws IOException
*/
public FSAccessRights getAccessRights() throws IOException {
- throw new IOException("Not implemented yet");
+ throw new UnsupportedOperationException("not implemented yet");
}
Modified: trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2007-08-04 09:31:03 UTC (rev 3377)
+++ trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2007-08-04 10:09:43 UTC (rev 3378)
@@ -262,7 +262,6 @@
* are relative to the given directory.
*
* @param directory
- * @param filter
*/
public String[] list(String directory) throws IOException {
final FSEntry entry = getEntry(directory);
@@ -291,10 +290,16 @@
{
FSEntry entry = getEntry(path);
if(entry == null)
- {
- throw new FileNotFoundException("file not found: "+path);
- }
- return entry.getAccessRights();
+ throw new FileNotFoundException("file not found: "+path);
+
+ try {
+ return entry.getAccessRights();
+ }catch(UnsupportedOperationException e){
+ //todo review
+ //this feature is not implemented yet in al file system implementations
+ //return null in those cases
+ return null;
+ }
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-04 09:31:08
|
Revision: 3377
http://jnode.svn.sourceforge.net/jnode/?rev=3377&view=rev
Author: lsantha
Date: 2007-08-04 02:31:03 -0700 (Sat, 04 Aug 2007)
Log Message:
-----------
Updated Intellij IDEA module files.
Modified Paths:
--------------
trunk/all/all.iml
trunk/builder/builder.iml
trunk/core/core.iml
trunk/distr/distr.iml
trunk/fs/fs.iml
trunk/gui/gui.iml
trunk/jnode.iml
trunk/net/net.iml
trunk/shell/shell.iml
trunk/textui/textui.iml
Modified: trunk/all/all.iml
===================================================================
--- trunk/all/all.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/all/all.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
Modified: trunk/builder/builder.iml
===================================================================
--- trunk/builder/builder.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/builder/builder.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
Modified: trunk/core/core.iml
===================================================================
--- trunk/core/core.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/core/core.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
Modified: trunk/distr/distr.iml
===================================================================
--- trunk/distr/distr.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/distr/distr.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
Modified: trunk/fs/fs.iml
===================================================================
--- trunk/fs/fs.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/fs/fs.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
@@ -14,6 +14,7 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="core" />
<orderEntry type="library" name="core" level="project" />
+ <orderEntry type="module" module-name="shell" />
<orderEntryProperties />
</component>
</module>
Modified: trunk/gui/gui.iml
===================================================================
--- trunk/gui/gui.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/gui/gui.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
Modified: trunk/jnode.iml
===================================================================
--- trunk/jnode.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/jnode.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
Modified: trunk/net/net.iml
===================================================================
--- trunk/net/net.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/net/net.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
Modified: trunk/shell/shell.iml
===================================================================
--- trunk/shell/shell.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/shell/shell.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
Modified: trunk/textui/textui.iml
===================================================================
--- trunk/textui/textui.iml 2007-08-02 20:12:03 UTC (rev 3376)
+++ trunk/textui/textui.iml 2007-08-04 09:31:03 UTC (rev 3377)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
+ <component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
<exclude-exploded />
@@ -10,6 +10,8 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="core" />
+ <orderEntry type="module" module-name="shell" />
<orderEntryProperties />
</component>
</module>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-02 20:12:08
|
Revision: 3376
http://jnode.svn.sourceforge.net/jnode/?rev=3376&view=rev
Author: lsantha
Date: 2007-08-02 13:12:03 -0700 (Thu, 02 Aug 2007)
Log Message:
-----------
Patch for exception when exitting the shell after startup by Stephen Crawley.
Modified Paths:
--------------
trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java
Modified: trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java 2007-08-02 19:30:46 UTC (rev 3375)
+++ trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java 2007-08-02 20:12:03 UTC (rev 3376)
@@ -262,7 +262,7 @@
}
consoles.remove(console.getConsoleName());
- if(currentStack != null && currentStack.peek() == console) {
+ if(currentStack != null && !currentStack.empty() && currentStack.peek() == console) {
currentStack.pop();
if(!currentStack.empty()) {
current = currentStack.peek();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-02 19:30:49
|
Revision: 3375
http://jnode.svn.sourceforge.net/jnode/?rev=3375&view=rev
Author: lsantha
Date: 2007-08-02 12:30:46 -0700 (Thu, 02 Aug 2007)
Log Message:
-----------
Fixed broken command history.
Modified Paths:
--------------
trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java
Modified: trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java 2007-08-02 18:15:27 UTC (rev 3374)
+++ trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java 2007-08-02 19:30:46 UTC (rev 3375)
@@ -85,13 +85,13 @@
* -1 denotes the current line.
*/
private int historyIndex = -1;
-
+
/**
* Contains the current line; i.e. the text being entered by the user.
*/
- private String newestLine = "";
+ private String savedCurrentLine;
- public KeyboardInputStream(KeyboardAPI api, TextConsole console) {
+ public KeyboardInputStream(KeyboardAPI api, TextConsole console) {
if (api != null) {
this.api = api;
this.api.addKeyboardListener(this);
@@ -171,6 +171,7 @@
/**
* Pull a keyboard event from the queue and process it.
+ * @return true if the event was processed
*/
private boolean processEvent() {
KeyboardEvent event = queue.get();
@@ -179,8 +180,7 @@
if (ch != NO_CHAR) {
event.consume();
return !processChar(ch);
- }
- else {
+ } else {
int kc = event.getKeyCode();
int mods = event.getModifiers();
if (processVirtualKeystroke(kc, mods)) {
@@ -188,8 +188,7 @@
}
return true;
}
- }
- else {
+ } else {
return true;
}
}
@@ -197,7 +196,7 @@
/**
* Process a keystroke interpretted as a character.
*
- * @param ch
+ * @param ch the character to process
* @return <code>true</code> if the character should cause the current line
* buffer contents to be returned to the user.
*/
@@ -224,6 +223,7 @@
out.println();
currentLine.appendChar(ch);
breakChar = true;
+ historyIndex = -1;
break;
// if it's the tab key, we want to trigger command line completion
case '\t':
@@ -253,14 +253,15 @@
// otherwise add it to our current line
currentLine.appendChar(ch);
refreshCurrentLine();
+ historyIndex = -1;
}
return breakChar;
}
/**
* Process a keystroke that doesn't have an associated char value.
- * @param code
- * @param modifiers
+ * @param code key code
+ * @param modifiers key modifiers
* @return <code>true</code> if the keystroke has been recognized and
* acted on, <code>false</code> otherwise.
*/
@@ -273,22 +274,27 @@
// Previous history item
if (completer != null) {
if (historyIndex == -1) {
- newestLine = currentLine.getContent();
historyIndex = completer.getCommandHistory().size();
- }
+ savedCurrentLine = currentLine.getContent();
+ }
historyIndex--;
- redisplay();
+
+ updateCurrentLine();
}
break;
case KeyEvent.VK_DOWN:
// Next history item
if (completer != null) {
- if (historyIndex == completer.getCommandHistory().size() - 1)
+ if (historyIndex == -1)
+ savedCurrentLine = currentLine.getContent();
+
+ if (historyIndex == completer.getCommandHistory().size() - 1)
historyIndex = -2;
- else if (historyIndex == -1)
- newestLine = currentLine.getContent();
+
historyIndex++;
- redisplay();
+
+ updateCurrentLine();
+
}
break;
case KeyEvent.VK_LEFT:
@@ -320,21 +326,20 @@
return true;
}
+ private void updateCurrentLine() {
+ if (historyIndex > -1) {
+ currentLine.setContent(completer.getCommandHistory().getCommand(historyIndex));
+ } else {
+ currentLine.setContent(savedCurrentLine);
+ }
+ refreshCurrentLine();
+ currentLine.moveEnd();
+ }
+
private void refreshCurrentLine() {
currentLine.refreshCurrentLine(currentPrompt);
}
- private void redisplay() {
- if (historyIndex == -1) {
- currentLine.setContent(newestLine);
- }
- else {
- currentLine.setContent(completer.getCommandHistory().getCommand(historyIndex));
- }
- refreshCurrentLine();
- currentLine.moveEnd();
- }
-
private boolean fillBuffer() throws IOException {
int x = console.getCursorX();
int y = console.getCursorY();
@@ -425,7 +430,6 @@
}
/**
- * @param device
* @see org.jnode.driver.DeviceListener#deviceStarted(org.jnode.driver.Device)
*/
public void deviceStarted(Device device) {
@@ -435,7 +439,6 @@
}
/**
- * @param device
* @see org.jnode.driver.DeviceListener#deviceStop(org.jnode.driver.Device)
*/
public void deviceStop(Device device) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-08-02 18:15:29
|
Revision: 3374
http://jnode.svn.sourceforge.net/jnode/?rev=3374&view=rev
Author: lsantha
Date: 2007-08-02 11:15:27 -0700 (Thu, 02 Aug 2007)
Log Message:
-----------
Keyboard input patch by Stephen Crawley. This patch enables line editting in programs like js and bsh.
Modified Paths:
--------------
trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java
trunk/core/src/core/org/jnode/util/SystemInputStream.java
trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java
trunk/core/src/driver/org/jnode/driver/console/TextConsole.java
trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java
trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java
trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsoleManager.java
trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsolePlugin.java
trunk/core/src/driver/org/jnode/driver/input/AbstractKeyboardDriver.java
trunk/core/src/driver/org/jnode/driver/input/Key.java
trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java
trunk/distr/src/apps/org/jnode/apps/console/SwingConsole.java
trunk/distr/src/apps/org/jnode/apps/editor/TextEditor.java
trunk/distr/src/emu/org/jnode/emu/EditEmu.java
trunk/distr/src/emu/org/jnode/emu/ShellEmu.java
trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java
trunk/gui/src/test/org/jnode/test/gui/ConsoleTest2.java
trunk/gui/src/test/org/jnode/test/gui/FBConsole.java
trunk/shell/descriptors/org.jnode.shell.xml
trunk/shell/src/shell/org/jnode/shell/CommandShell.java
trunk/shell/src/shell/org/jnode/shell/DefaultCommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/Shell.java
trunk/shell/src/shell/org/jnode/shell/ThreadCommandInvoker.java
trunk/shell/src/shell/org/jnode/shell/command/HistoryCommand.java
trunk/shell/src/shell/org/jnode/shell/command/driver/console/ConsoleCommand.java
trunk/textui/src/textui/charva/awt/Toolkit.java
Added Paths:
-----------
trunk/core/src/driver/org/jnode/driver/console/CommandHistory.java
trunk/core/src/driver/org/jnode/driver/console/CompletionInfo.java
trunk/core/src/driver/org/jnode/driver/console/InputCompleter.java
trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java
trunk/core/src/driver/org/jnode/driver/console/textscreen/Line.java
Removed Paths:
-------------
trunk/core/src/driver/org/jnode/driver/input/KeyboardInputStream.java
trunk/shell/src/shell/org/jnode/shell/CommandHistory.java
trunk/shell/src/shell/org/jnode/shell/CompletionInfo.java
trunk/shell/src/shell/org/jnode/shell/Line.java
Modified: trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java
===================================================================
--- trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/core/org/jnode/log4j/config/Log4jConfigurePlugin.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -62,7 +62,13 @@
try {
// Create the appenders
final ConsoleManager conMgr = InitialNaming.lookup(ConsoleManager.NAME);
- final TextConsole console = (TextConsole)conMgr.createConsole("Log4j", ConsoleManager.CreateOptions.TEXT | ConsoleManager.CreateOptions.SCROLLABLE | ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR_IN);
+ final TextConsole console =
+ (TextConsole)conMgr.createConsole(
+ "Log4j",
+ (ConsoleManager.CreateOptions.TEXT |
+ ConsoleManager.CreateOptions.SCROLLABLE |
+ ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR |
+ ConsoleManager.CreateOptions.NO_LINE_EDITTING));
conMgr.registerConsole(console);
console.setAcceleratorKeyCode(KeyEvent.VK_F7);
Modified: trunk/core/src/core/org/jnode/util/SystemInputStream.java
===================================================================
--- trunk/core/src/core/org/jnode/util/SystemInputStream.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/core/org/jnode/util/SystemInputStream.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -61,7 +61,9 @@
final public void setIn(InputStream in)
{
- localeIn.set(in);
+ if (in != this) {
+ localeIn.set(in);
+ }
}
/**
@@ -101,7 +103,7 @@
*/
public void initialize(InputStream systemIn)
{
- if(this.systemIn == EMPTY) // register only the first keyboard
+ if (this.systemIn == EMPTY && systemIn != this) // register only the first keyboard
{
this.systemIn = systemIn;
}
Added: trunk/core/src/driver/org/jnode/driver/console/CommandHistory.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/CommandHistory.java (rev 0)
+++ trunk/core/src/driver/org/jnode/driver/console/CommandHistory.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -0,0 +1,94 @@
+/*
+ * $Id: CommandHistory.java 2224 2006-01-01 12:49:03Z epr $
+ *
+ * JNode.org
+ * Copyright (C) 2003-2006 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.jnode.driver.console;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/** Used to keep an archive of commands.
+ * @author Matt Paine
+ */
+public class CommandHistory {
+
+ /** Holds the commands. **/
+ private final List<String> history = new ArrayList<String>();
+
+ /** Constructs a CommandHistory object. **/
+ public CommandHistory() {
+ }
+
+ /** Adds a command to the archive.
+ * @param line The CommandLine to add to the archive.
+ **/
+ public void addCommand(String line) {
+ if( history.contains(line) )
+ history.remove(line);
+ history.add(line);
+ }
+
+ /** Returns the number of commands held in the archive.
+ * @return the number of commands held in the archive.
+ **/
+ public int size() {
+ return history.size();
+ }
+
+ /** Gets a command at a given index.
+ * TODO: make exception more specific
+ * @param index The index (starting at zero) of the command to return.
+ * @return The command at the index given or null if no command found
+ * (out of bounds index).
+ **/
+ public String getCommand(int index) {
+ String retCommand = null;
+ try {
+ retCommand = (String)history.get(index);
+ } catch (Exception ex) {
+ }
+ return retCommand;
+ }
+
+ /** Searches for the most recent command types starting with the specified
+ * string.
+ * @param start The string to search for.
+ * @return The most recent command matching the search string.
+ **/
+ public String getCommand(String start) {
+ return getCommand(findCommand(start));
+ }
+
+ /** Searches the collection for the most recent command starting with the
+ * specified string.
+ * @param start the string to search for.
+ * @return the index number of the specified string (or -1 if not found).
+ **/
+ private int findCommand(String start) {
+ for (int x = 0; x < history.size(); x++) {
+ String cmdLine = (String)history.get(x);
+ if (cmdLine != null)
+ if (cmdLine.startsWith(start))
+ return x;
+ }
+ return -1;
+ }
+
+}
Added: trunk/core/src/driver/org/jnode/driver/console/CompletionInfo.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/CompletionInfo.java (rev 0)
+++ trunk/core/src/driver/org/jnode/driver/console/CompletionInfo.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -0,0 +1,94 @@
+/*
+ * $Id: CompletionInfo.java 2224 2006-01-01 12:49:03Z epr $
+ *
+ * JNode.org
+ * Copyright (C) 2003-2006 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.jnode.driver.console;
+
+/**
+ * @author Ewout Prangsma (ep...@us...)
+ */
+public class CompletionInfo {
+ private String[] items = null;
+
+ private String completed = null;
+
+ private boolean newPrompt = false;
+
+ /**
+ * @return Returns the completed.
+ */
+ public String getCompleted() {
+ return completed;
+ }
+
+ /**
+ * @param completed
+ * The completed to set.
+ */
+ public void setCompleted(String completed) {
+ this.completed = completed;
+ }
+
+ /**
+ * get the possible completions
+ *
+ * @return Returns the items.
+ */
+ public String[] getItems() {
+ return items;
+ }
+
+ /**
+ * Specify the possible completions
+ *
+ * @param items
+ * The items to set.
+ */
+ public void setItems(String[] items) {
+ this.items = items;
+ this.completed = null;
+ this.newPrompt = true;
+ }
+
+ /**
+ * Do we have more than one possible completion ?
+ *
+ * @return
+ */
+ public boolean hasItems() {
+ return items != null;
+ }
+
+ /**
+ * Specify if we need a new prompt or not
+ *
+ * @param newPrompt
+ */
+ public void setNewPrompt(boolean newPrompt) {
+ this.newPrompt = newPrompt;
+ }
+
+ /**
+ * @return true if we need to display a new prompt
+ */
+ public boolean needNewPrompt() {
+ return newPrompt;
+ }
+}
Modified: trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/console/ConsoleManager.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -22,6 +22,7 @@
package org.jnode.driver.console;
import java.util.Set;
+import java.io.InputStream;
import java.io.PrintStream;
import org.jnode.driver.input.KeyboardListener;
@@ -112,11 +113,15 @@
/** Create a scrollable console. */
public static final int SCROLLABLE = 0x02;
- /** Do not claim System.out, err, in when focused. */
- public static final int NO_SYSTEM_OUT_ERR_IN = 0x04;
+ /** Do not claim System.out, err when focused. */
+ public static final int NO_SYSTEM_OUT_ERR = 0x04;
/** Stack console on the current screen */
public static final int STACKED = 0x08;
+
+ /** Do not create a line-editting input stream for the console.
+ * The console's input will be whatever System.in currently is. */
+ public static final int NO_LINE_EDITTING = 0x10;
}
/**
Added: trunk/core/src/driver/org/jnode/driver/console/InputCompleter.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/InputCompleter.java (rev 0)
+++ trunk/core/src/driver/org/jnode/driver/console/InputCompleter.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -0,0 +1,8 @@
+package org.jnode.driver.console;
+
+
+public interface InputCompleter {
+ CompletionInfo complete(String partial);
+
+ CommandHistory getCommandHistory();
+}
Modified: trunk/core/src/driver/org/jnode/driver/console/TextConsole.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/TextConsole.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/console/TextConsole.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -21,6 +21,7 @@
package org.jnode.driver.console;
+import java.io.InputStream;
import java.io.PrintStream;
/**
@@ -155,6 +156,12 @@
*/
public void ensureVisible(int row);
+ /**
+ * Gets the input stream of this console.
+ * @return
+ */
+ public InputStream getIn();
+
/**
* Gets the error stream of this console.
* @return
@@ -177,4 +184,17 @@
* @param visible
*/
public void setCursorVisible(boolean visible);
+
+
+ /**
+ * Get the console's input completer
+ * @return The completer or <code>null</code>.
+ */
+ public InputCompleter getCompleter();
+
+ /**
+ * Ges the console's input completer
+ * @param The new completer or <code>null</code>.
+ */
+ public void setCompleter(InputCompleter completer);
}
Modified: trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/console/spi/AbstractConsoleManager.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -98,6 +98,10 @@
}
}
+ protected KeyboardAPI getKeyboardApi() {
+ return kbApi;
+ }
+
/**
* Add a pointer device
*
Added: trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java (rev 0)
+++ trunk/core/src/driver/org/jnode/driver/console/textscreen/KeyboardInputStream.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -0,0 +1,444 @@
+package org.jnode.driver.console.textscreen;
+
+import java.awt.event.KeyEvent;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+
+import javax.naming.NameNotFoundException;
+
+import org.jnode.driver.ApiNotFoundException;
+import org.jnode.driver.Device;
+import org.jnode.driver.DeviceListener;
+import org.jnode.driver.DeviceManager;
+import org.jnode.driver.console.CompletionInfo;
+import org.jnode.driver.console.InputCompleter;
+import org.jnode.driver.console.TextConsole;
+import org.jnode.driver.input.KeyboardAPI;
+import org.jnode.driver.input.KeyboardEvent;
+import org.jnode.driver.input.KeyboardListener;
+import org.jnode.naming.InitialNaming;
+import org.jnode.system.BootLog;
+import org.jnode.system.event.FocusEvent;
+import org.jnode.system.event.FocusListener;
+import org.jnode.util.Queue;
+
+
+/**
+ * KeyInputStream maps keyboard events into a stream of characters. Current functionality includes:
+ * <ul>
+ * <li>line buffering and line editing, using a text console,
+ * <li>integrated input history and completion,
+ * <li>CTRL-D is interpretted as a 'soft' EOF mark,KeyboardInputStream
+ * <li>listens to keyboard focus events.
+ * </ul>
+ *
+ * Future enhancements include:
+ * <ul>
+ * <li>a "raw" mode in which characters and other keyboard events are delivered without line editing,
+ * <li>a "no echo" mode in which line editting occurs without echoing of input characters,
+ * <li>making the active characters and keycodes "soft",
+ * <li>making completion and history context sensitive; e.g. when switching between a shell and
+ * an application, and
+ * <li>code refactoring to support classical terminal devices and remote consoles.
+ * </ul>
+ *
+ * Bugs:
+ * <ul>
+ * <li>The current method of echoing the input is suboptimal, and is broken in the case where an
+ * application outputs a prompt string to stdout or stderr.
+ * </ul>
+ *
+ * @author cr...@jn...
+ *
+ */
+public class KeyboardInputStream extends InputStream
+implements KeyboardListener, FocusListener, DeviceListener {
+
+ public static final byte CTRL_L = 12;
+ public static final byte CTRL_D = 4;
+
+ private boolean eof;
+
+ private byte[] buffer;
+ private int pos;
+ private int lim;
+
+ private static final char NO_CHAR = 0;
+
+ private KeyboardAPI api;
+ private DeviceManager devMan;
+
+ /** The queue of keyboard events */
+ private final Queue<KeyboardEvent> queue = new Queue<KeyboardEvent>();
+
+ private final Line currentLine;
+ private final TextConsole console;
+ private InputCompleter completer;
+ private final PrintStream out;
+ private boolean hasFocus;
+
+ private String currentPrompt;
+
+ /**
+ * Contains an index to the current history line, counting from zero. The value
+ * -1 denotes the current line.
+ */
+ private int historyIndex = -1;
+
+ /**
+ * Contains the current line; i.e. the text being entered by the user.
+ */
+ private String newestLine = "";
+
+ public KeyboardInputStream(KeyboardAPI api, TextConsole console) {
+ if (api != null) {
+ this.api = api;
+ this.api.addKeyboardListener(this);
+ }
+ else {
+ try {
+ this.devMan = InitialNaming.lookup(DeviceManager.NAME);
+ this.devMan.addListener(this);
+ }
+ catch (NameNotFoundException ex) {
+ BootLog.error("DeviceManager not found", ex);
+ }
+ }
+ this.console = console;
+ this.out = console.getOut();
+ this.currentLine = new Line(console);
+ this.pos = this.lim = 0;
+ }
+
+ private void registerKeyboardApi(Device device) {
+ if (this.api == null) {
+ try {
+ this.api = device.getAPI(KeyboardAPI.class);
+ this.api.addKeyboardListener(this);
+ }
+ catch (ApiNotFoundException ex) {
+ BootLog.error("KeyboardAPI not found", ex);
+ }
+ this.devMan.removeListener(this);
+ }
+ }
+
+ public boolean isSoftEOF() {
+ return eof;
+ }
+
+ public void clearSoftEOF() {
+ eof = false;
+ }
+
+ @Override
+ public int available() throws IOException {
+ if (eof) {
+ return 0; /* per the JDK 1.6 API docs */
+ }
+ else {
+ // FIXME - what about the case where the line buffer is empty
+ // and there are unconsumed input events in the queue?
+ return currentLine.getLineLength();
+ }
+ }
+
+ /**
+ * @see org.jnode.driver.input.KeyboardListener#keyPressed(org.jnode.driver.input.KeyboardEvent)
+ */
+ public void keyPressed(KeyboardEvent event) {
+ if (hasFocus) {
+ queue.add(event);
+ }
+ }
+
+ /**
+ * @see org.jnode.driver.input.KeyboardListener#keyReleased(org.jnode.driver.input.KeyboardEvent)
+ */
+ public void keyReleased(KeyboardEvent event) {
+ }
+
+ /**
+ * @see java.io.InputStream#close()
+ */
+ public void close() throws IOException {
+ if (api != null) {
+ api.removeKeyboardListener(this);
+ }
+ super.close();
+ }
+
+ /**
+ * Pull a keyboard event from the queue and process it.
+ */
+ private boolean processEvent() {
+ KeyboardEvent event = queue.get();
+ if (!event.isConsumed()) {
+ char ch = event.getKeyChar();
+ if (ch != NO_CHAR) {
+ event.consume();
+ return !processChar(ch);
+ }
+ else {
+ int kc = event.getKeyCode();
+ int mods = event.getModifiers();
+ if (processVirtualKeystroke(kc, mods)) {
+ event.consume();
+ }
+ return true;
+ }
+ }
+ else {
+ return true;
+ }
+ }
+
+ /**
+ * Process a keystroke interpretted as a character.
+ *
+ * @param ch
+ * @return <code>true</code> if the character should cause the current line
+ * buffer contents to be returned to the user.
+ */
+ private boolean processChar(char ch) {
+ boolean breakChar = false;
+ switch (ch) {
+ // if its a backspace we want to remove one from the end of our current
+ // line
+ case KeyEvent.VK_BACK_SPACE:
+ if (currentLine.backspace()) {
+ refreshCurrentLine();
+ }
+ break;
+ // if its a delete we want to remove one under the cursor
+ case KeyEvent.VK_DELETE:
+ currentLine.delete();
+ refreshCurrentLine();
+ break;
+ // if its an enter key we want to process the command, and then resume
+ // the thread
+ case '\n':
+ currentLine.moveEnd();
+ refreshCurrentLine();
+ out.println();
+ currentLine.appendChar(ch);
+ breakChar = true;
+ break;
+ // if it's the tab key, we want to trigger command line completion
+ case '\t':
+ if (completer != null) {
+ CompletionInfo completion = currentLine.complete(currentPrompt);
+ if (completion.needNewPrompt()) {
+ currentLine.start(true);
+ }
+ refreshCurrentLine();
+ }
+ break;
+ case CTRL_D:
+ currentLine.moveEnd();
+ refreshCurrentLine();
+ out.println();
+ eof = true;
+ breakChar = true;
+ break;
+ case CTRL_L:
+ this.console.clear();
+ this.console.setCursor(0, 0);
+ out.print(currentPrompt);
+ currentLine.start();
+ refreshCurrentLine();
+ break;
+ default:
+ // otherwise add it to our current line
+ currentLine.appendChar(ch);
+ refreshCurrentLine();
+ }
+ return breakChar;
+ }
+
+ /**
+ * Process a keystroke that doesn't have an associated char value.
+ * @param code
+ * @param modifiers
+ * @return <code>true</code> if the keystroke has been recognized and
+ * acted on, <code>false</code> otherwise.
+ */
+ private boolean processVirtualKeystroke(int code, int modifiers) {
+ if (modifiers != 0) {
+ return false;
+ }
+ switch (code) {
+ case KeyEvent.VK_UP:
+ // Previous history item
+ if (completer != null) {
+ if (historyIndex == -1) {
+ newestLine = currentLine.getContent();
+ historyIndex = completer.getCommandHistory().size();
+ }
+ historyIndex--;
+ redisplay();
+ }
+ break;
+ case KeyEvent.VK_DOWN:
+ // Next history item
+ if (completer != null) {
+ if (historyIndex == completer.getCommandHistory().size() - 1)
+ historyIndex = -2;
+ else if (historyIndex == -1)
+ newestLine = currentLine.getContent();
+ historyIndex++;
+ redisplay();
+ }
+ break;
+ case KeyEvent.VK_LEFT:
+ // Left the cursor goes left
+ if (currentLine.moveLeft()) {
+ refreshCurrentLine();
+ }
+ break;
+ case KeyEvent.VK_RIGHT:
+ // Right the cursor goes right
+ if (currentLine.moveRight()) {
+ refreshCurrentLine();
+ }
+ break;
+ case KeyEvent.VK_HOME:
+ // The cursor goes at the start
+ currentLine.moveBegin();
+ refreshCurrentLine();
+ break;
+ case KeyEvent.VK_END:
+ // the cursor goes at the end of line
+ currentLine.moveEnd();
+ refreshCurrentLine();
+ break;
+ default:
+ // ignore other virtual keys.
+ return false;
+ }
+ return true;
+ }
+
+ private void refreshCurrentLine() {
+ currentLine.refreshCurrentLine(currentPrompt);
+ }
+
+ private void redisplay() {
+ if (historyIndex == -1) {
+ currentLine.setContent(newestLine);
+ }
+ else {
+ currentLine.setContent(completer.getCommandHistory().getCommand(historyIndex));
+ }
+ refreshCurrentLine();
+ currentLine.moveEnd();
+ }
+
+ private boolean fillBuffer() throws IOException {
+ int x = console.getCursorX();
+ int y = console.getCursorY();
+ StringBuffer sb = new StringBuffer(x);
+ for (int i = 0; i < x; i++) {
+ sb.append(console.getChar(i, y));
+ }
+ currentPrompt = sb.toString();
+
+ currentLine.start();
+ while (processEvent()) { /* */ }
+ buffer = currentLine.consumeBytes();
+ lim = buffer.length;
+ pos = 0;
+ return pos < lim;
+ }
+
+ @Override
+ public int read() throws IOException {
+ if (pos >= lim) {
+ if (eof || !fillBuffer()) {
+ return -1;
+ }
+ }
+ return buffer[pos++];
+ }
+
+ @Override
+ public int read(byte[] buff, int off, int len) throws IOException {
+ int nosRead = 0;
+ if (pos >= lim) {
+ if (eof || !fillBuffer()) {
+ return -1;
+ }
+ }
+ while (nosRead < len && pos < lim) {
+ buff[nosRead + off] = buffer[pos];
+ nosRead++;
+ pos++;
+ }
+ return nosRead;
+ }
+
+ @Override
+ public int read(byte[] buff) throws IOException {
+ return read(buff, 0, buff.length);
+ }
+
+ @Override
+ public void mark(int readLimit) {
+ }
+
+ @Override
+ public boolean markSupported() {
+ return false;
+ }
+
+ @Override
+ public void reset() throws IOException {
+ throw new UnsupportedOperationException("Mark/reset not supported");
+ }
+
+ @Override
+ public long skip(long n) throws IOException {
+ // I don't expect this method will be used much.
+ for (long i = 0; i < n; i++) {
+ if (read() == -1) {
+ return i;
+ }
+ }
+ return n;
+ }
+
+ public InputCompleter getCompleter() {
+ return completer;
+ }
+
+ public void setCompleter(InputCompleter completer) {
+ this.completer = completer;
+ }
+
+ public void focusGained(FocusEvent event) {
+ hasFocus = true;
+ }
+
+ public void focusLost(FocusEvent event) {
+ hasFocus = false;
+ }
+
+ /**
+ * @param device
+ * @see org.jnode.driver.DeviceListener#deviceStarted(org.jnode.driver.Device)
+ */
+ public void deviceStarted(Device device) {
+ if (device.implementsAPI(KeyboardAPI.class)) {
+ registerKeyboardApi(device);
+ }
+ }
+
+ /**
+ * @param device
+ * @see org.jnode.driver.DeviceListener#deviceStop(org.jnode.driver.Device)
+ */
+ public void deviceStop(Device device) {
+ /* Do nothing */
+ }
+}
Added: trunk/core/src/driver/org/jnode/driver/console/textscreen/Line.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/textscreen/Line.java (rev 0)
+++ trunk/core/src/driver/org/jnode/driver/console/textscreen/Line.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -0,0 +1,323 @@
+/*
+ * $Id: Line.java 3119 2007-02-11 22:25:20Z fduminy $
+ *
+ * JNode.org
+ * Copyright (C) 2003-2006 JNode.org
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This library 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; If not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+package org.jnode.driver.console.textscreen;
+
+import java.io.PrintStream;
+
+import org.jnode.driver.console.CompletionInfo;
+import org.jnode.driver.console.InputCompleter;
+import org.jnode.driver.console.TextConsole;
+
+
+/**
+ * A class that handles the content of the current command line in the shell.
+ * That can be : - a new command that the user is beeing editing - an existing
+ * command (from the command history)
+ *
+ * This class also handles the current cursor position in the command line and
+ * keep trace of the position (consoleX, consoleY) of the first character of the
+ * command line (to handle commands that are multilines).
+ *
+ * @author Ewout Prangsma (ep...@us...)
+ * @author Fabien DUMINY (fd...@jn...)
+ */
+class Line {
+ //TODO get the real screen width (in columns)
+ final static private int SCREEN_WIDTH = 80;
+
+ private int consoleX;
+
+ private int consoleY;
+
+ /**
+ * Contains the current position of the cursor on the currentLine
+ */
+ private int posOnCurrentLine = 0;
+
+ /** Contains the current line * */
+ private StringBuffer currentLine = new StringBuffer(80);
+
+ private boolean shortened = true;
+
+ private int oldLength = 0;
+
+ private int maxLength = 0;
+
+ private final TextConsole console;
+
+ private PrintStream out;
+
+ public Line(TextConsole console) {
+ this.console = console;
+ this.out = console.getOut();
+ }
+
+ public void start() {
+ start(false);
+ }
+
+ public boolean isEmpty() {
+ return currentLine.toString().trim().length() == 0;
+ }
+
+ public void start(boolean keepContent) {
+ if (keepContent) {
+ // we stay at the same position in X coordinate
+ // only Y may have changed
+ consoleY = console.getCursorY();
+ } else {
+ consoleX = console.getCursorX();
+ consoleY = console.getCursorY();
+
+ setContent("");
+ console.setCursor( consoleX,consoleY);//move the cursor to the start of the line.
+ }
+ }
+
+ public String getContent() {
+ return currentLine.toString();
+ }
+
+ public byte[] getBytes() {
+ return currentLine.toString().getBytes();
+ }
+
+ public byte[] consumeBytes() {
+ byte[] res = getBytes();
+ currentLine.setLength(0);
+ return res;
+ }
+
+ public void setContent(String content) {
+ startModif();
+ currentLine.setLength(0);
+ currentLine.append(content);
+ moveEnd();
+ endModif();
+ }
+
+ public boolean moveLeft() {
+ if (posOnCurrentLine > 0) {
+ posOnCurrentLine--;
+ return true;
+ }
+ return false;
+ }
+
+ public boolean moveRight() {
+ if (posOnCurrentLine < currentLine.length()) {
+ posOnCurrentLine++;
+ return true;
+ }
+ return false;
+ }
+
+ public void moveEnd() {
+ posOnCurrentLine = currentLine.length();
+ }
+
+ public void moveBegin() {
+ posOnCurrentLine = 0;
+ }
+
+ public boolean backspace() {
+ if (posOnCurrentLine > 0) {
+ moveLeft();
+ delete();
+ return true;
+ }
+ return false;
+ }
+
+ public void delete() {
+ if ((posOnCurrentLine >= 0)
+ && (posOnCurrentLine < currentLine.length())) {
+ startModif();
+ currentLine.deleteCharAt(posOnCurrentLine);
+ endModif();
+ }
+ }
+
+ public CompletionInfo complete(String currentPrompt) {
+ CompletionInfo info = null;
+ InputCompleter completer = console.getCompleter();
+ if (posOnCurrentLine != currentLine.length()) {
+ String ending = currentLine.substring(posOnCurrentLine);
+ info = completer.complete(currentLine.substring(0, posOnCurrentLine));
+ printList(info, currentPrompt);
+ if (info.getCompleted() != null) {
+ setContent(info.getCompleted() + ending);
+ posOnCurrentLine = currentLine.length() - ending.length();
+ }
+ } else {
+ info = completer.complete(currentLine.toString());
+ printList(info, currentPrompt);
+ if (info.getCompleted() != null) {
+ setContent(info.getCompleted());
+ posOnCurrentLine = currentLine.length();
+ }
+ }
+
+ return info;
+ }
+
+ protected void printList(CompletionInfo info, String currentPrompt) {
+ if ((info != null) && info.hasItems()) {
+ int oldPosOnCurrentLine = posOnCurrentLine;
+ moveEnd();
+ refreshCurrentLine(currentPrompt);
+
+ out.println();
+ String[] list = info.getItems();
+
+ final int minItemsToSplit = 5;
+ if(list.length > minItemsToSplit)
+ {
+ list = splitInColumns(list);
+ }
+
+ // display items column (may be single or multiple columns)
+ for (String item : list)
+ {
+ // item may actually be a single item or in fact multiple items
+ if((item.length() % SCREEN_WIDTH) == 0)
+ {
+ // we are already at the first column of the next line
+ out.print(item);
+ }
+ else
+ {
+ // we aren't at the first column of the next line
+ out.println(item);
+ }
+ }
+
+ posOnCurrentLine = oldPosOnCurrentLine;
+ }
+ }
+
+ protected String[] splitInColumns(String[] items)
+ {
+ final int separatorWidth = 3;
+
+ // compute the maximum width of items
+ int maxWidth = 0;
+ for(String item : items)
+ {
+ if(item.length() > maxWidth)
+ {
+ maxWidth = item.length();
+ }
+ }
+
+ final int columnWidth = Math.min(SCREEN_WIDTH, maxWidth + separatorWidth);
+ final int nbColumns = SCREEN_WIDTH / columnWidth;
+ final boolean lastLineIsFull = ((items.length % nbColumns) == 0);
+ final int nbLines = (items.length / nbColumns) + (lastLineIsFull ? 0 : 1);
+
+ String[] lines = new String[nbLines];
+ StringBuilder line = new StringBuilder(SCREEN_WIDTH);
+ int lineNum = 0;
+ for(int itemNum = 0 ; itemNum < items.length ; )
+ {
+ for(int c = 0 ; c < nbColumns ; c++)
+ {
+ final String item = items[itemNum++];
+ line.append(item);
+
+ // add some blanks
+ final int nbBlanks = columnWidth - item.length();
+ for(int i = 0 ; i < nbBlanks ; i++)
+ {
+ line.append(' ');
+ }
+
+ if(itemNum >= items.length) break;
+ }
+
+ lines[lineNum++] = line.toString();
+ line.setLength(0); // clear the buffer
+ }
+
+ return lines;
+ }
+
+ public void appendChar(char c) {
+ startModif();
+ if (posOnCurrentLine == currentLine.length()) {
+ currentLine.append(c);
+ } else {
+ currentLine.insert(posOnCurrentLine, c);
+ }
+ posOnCurrentLine++;
+ endModif();
+ }
+
+ protected void startModif() {
+ shortened = false;
+ oldLength = currentLine.length();
+ }
+
+ protected void endModif() {
+ maxLength = Math.max(oldLength, currentLine.length());
+ shortened = oldLength > currentLine.length();
+ oldLength = 0;
+ }
+
+ public void refreshCurrentLine(String currentPrompt) {
+ try {
+ int x = consoleX;
+ int width = console.getWidth();
+ int nbLines = ((x + maxLength) / width);
+
+ if (((x + maxLength) % width) != 0)
+ nbLines++;
+
+ // if the line has not been shortened (delete, backspace...)
+ if (!shortened)
+ // scroll up the buffer if necessary, and get the new y
+ console.ensureVisible(consoleY + nbLines - 1);
+
+ for (int i = 0; i < nbLines; i++) {
+ console.clearRow(consoleY + i);
+ }
+
+ // print the input line
+ console.setCursor(0, consoleY);
+ out.print(currentPrompt + currentLine);
+
+ int posCurX = x + posOnCurrentLine;
+ int posCurY = consoleY;
+ if (posCurX >= width) {
+ posCurY += posCurX / width;
+ posCurX = (posCurX % width);
+ }
+ console.setCursor(posCurX, posCurY);
+ } catch (Exception e) {
+ //todo: why is it ignored?
+ }
+ }
+
+ public int getLineLength() {
+ return currentLine.length();
+ }
+}
Modified: trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsole.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -21,16 +21,19 @@
package org.jnode.driver.console.textscreen;
+import java.io.InputStream;
import java.io.PrintStream;
import java.security.AccessController;
import java.security.PrivilegedAction;
import org.jnode.driver.console.ConsoleManager;
+import org.jnode.driver.console.InputCompleter;
import org.jnode.driver.console.TextConsole;
import org.jnode.driver.console.spi.AbstractConsole;
import org.jnode.driver.console.spi.ConsoleOutputStream;
import org.jnode.driver.textscreen.TextScreen;
import org.jnode.system.event.FocusEvent;
+import org.jnode.system.event.FocusListener;
import org.jnode.vm.isolate.VmIsolate;
/**
@@ -56,10 +59,14 @@
/** Current Y position */
private int curY;
+
+ private InputStream in;
private final PrintStream out;
private final PrintStream err;
+
+ private InputStream savedIn;
private PrintStream savedOut;
@@ -67,7 +74,7 @@
private boolean cursorVisible = true;
- private final boolean claimSystemOutErrIn;
+ private final boolean claimSystemOutErr;
private VmIsolate myIsolate;
@@ -86,7 +93,7 @@
this, 0x07));
this.savedErr = this.err = new PrintStream(new ConsoleOutputStream(
this, 0x04));
- this.claimSystemOutErrIn = ((options & ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR_IN) == 0);
+ this.claimSystemOutErr = ((options & ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR) == 0);
this.myIsolate = VmIsolate.currentIsolate();
}
@@ -285,7 +292,33 @@
syncScreen();
}
+ public InputCompleter getCompleter() {
+ if (in instanceof KeyboardInputStream) {
+ return ((KeyboardInputStream) in).getCompleter();
+ }
+ else {
+ return null;
+ }
+ }
+
+ public void setCompleter(InputCompleter completer) {
+ if (in instanceof KeyboardInputStream) {
+ ((KeyboardInputStream) in).setCompleter(completer);
+ }
+ }
+
/**
+ * @see org.jnode.driver.console.TextConsole#getIn()
+ */
+ public InputStream getIn() {
+ return in;
+ }
+
+ void setIn(InputStream in) {
+ this.savedIn = this.in = in;
+ }
+
+ /**
* @see org.jnode.driver.console.TextConsole#getErr()
*/
public PrintStream getErr() {
@@ -323,7 +356,10 @@
public void focusGained(FocusEvent event) {
super.focusGained(event);
syncScreen();
- if (claimSystemOutErrIn) {
+ if (in instanceof FocusListener) {
+ ((FocusListener) in).focusGained(event);
+ }
+ if (claimSystemOutErr) {
myIsolate.invokeAndWait(new Runnable() {
public void run() {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@@ -342,7 +378,10 @@
* @see org.jnode.system.event.FocusListener#focusLost(org.jnode.system.event.FocusEvent)
*/
public void focusLost(FocusEvent event) {
- if (claimSystemOutErrIn) {
+ if (in instanceof FocusListener) {
+ ((FocusListener) in).focusLost(event);
+ }
+ if (claimSystemOutErr) {
myIsolate.invokeAndWait(new Runnable() {
public void run() {
savedOut = System.out;
Modified: trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsoleManager.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsoleManager.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsoleManager.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -21,11 +21,10 @@
package org.jnode.driver.console.textscreen;
-import java.awt.event.KeyEvent;
+import java.io.InputStream;
import javax.naming.NameNotFoundException;
-import org.jnode.driver.console.Console;
import org.jnode.driver.console.ConsoleException;
import org.jnode.driver.console.spi.AbstractConsoleManager;
import org.jnode.driver.textscreen.ScrollableTextScreen;
@@ -53,7 +52,7 @@
* @see org.jnode.driver.console.ConsoleManager#createConsole(String, int)
*/
public TextScreenConsole createConsole(String name, int options) {
- if ((options & CreateOptions.TEXT) != 0) {
+ if ((options & CreateOptions.TEXT) != 0) {
final TextScreenManager tsm;
tsm = getTextScreenManager();
final TextScreenConsole console;
@@ -69,6 +68,11 @@
screen = tsm.getSystemScreen().createCompatibleBufferScreen();
console = new TextScreenConsole(this, name, screen, options);
}
+ InputStream in = System.in;
+ if ((options & CreateOptions.NO_LINE_EDITTING) == 0) {
+ in = new KeyboardInputStream(getKeyboardApi(), console);
+ }
+ console.setIn(in);
if ((options & CreateOptions.STACKED) != 0){
stackConsole(console);
} else {
@@ -81,7 +85,7 @@
throw new IllegalArgumentException("Unknown option " + options);
}
}
-
+
protected TextScreenManager getTextScreenManager() {
TextScreenManager tsm;
try {
Modified: trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsolePlugin.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsolePlugin.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/console/textscreen/TextScreenConsolePlugin.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -55,7 +55,10 @@
InitialNaming.bind(ConsoleManager.NAME, mgr);
// Create the first console
- final TextConsole first = (TextConsole)mgr.createConsole(null, ConsoleManager.CreateOptions.TEXT | ConsoleManager.CreateOptions.SCROLLABLE);
+ final TextConsole first = (TextConsole) mgr.createConsole(
+ null,
+ (ConsoleManager.CreateOptions.TEXT |
+ ConsoleManager.CreateOptions.SCROLLABLE));
mgr.focus(first);
System.setOut(first.getOut());
System.setErr(first.getErr());
Modified: trunk/core/src/driver/org/jnode/driver/input/AbstractKeyboardDriver.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/input/AbstractKeyboardDriver.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/input/AbstractKeyboardDriver.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -31,8 +31,6 @@
import org.jnode.driver.Device;
import org.jnode.driver.DriverException;
-import org.jnode.system.BootLog;
-import org.jnode.util.EmptyInputStream;
import org.jnode.util.SystemInputStream;
/**
@@ -105,18 +103,18 @@
dev.registerAPI(KeyboardAPI.class, this);
dev.registerAPI(SystemTriggerAPI.class, this);
- // If no inputstream has been defined, create and set one.
- kis = null;
- if (channel != null) {
- kis = new KeyboardInputStream(this);
- }
- final InputStream systemIn = kis;
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- SystemInputStream.getInstance().initialize(systemIn);
- return null;
- }
- });
+// // If no inputstream has been defined, create and set one.
+// kis = null;
+// if (channel != null) {
+// kis = new KeyboardInputStream(this);
+// }
+// final InputStream systemIn = kis;
+// AccessController.doPrivileged(new PrivilegedAction() {
+// public Object run() {
+// SystemInputStream.getInstance().initialize(systemIn);
+// return null;
+// }
+// });
}
/**
Modified: trunk/core/src/driver/org/jnode/driver/input/Key.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/input/Key.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/input/Key.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -125,6 +125,11 @@
{
this.upperChar = upperChar;
}
+
+ public char getControlChar()
+ {
+ return (char) (upperChar & 0x1f);
+ }
public char getAltGrChar()
{
Deleted: trunk/core/src/driver/org/jnode/driver/input/KeyboardInputStream.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/input/KeyboardInputStream.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/input/KeyboardInputStream.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -1,153 +0,0 @@
-/*
- * $Id$
- *
- * JNode.org
- * Copyright (C) 2003-2006 JNode.org
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This library 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 Lesser General Public
- * License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; If not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-package org.jnode.driver.input;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.jnode.util.Queue;
-
-/**
- * @author epr
- */
-public class KeyboardInputStream extends InputStream implements KeyboardListener {
-
- private final KeyboardAPI api;
- /** The queue of keyboard events */
- private final Queue<KeyboardEvent> queue = new Queue<KeyboardEvent>();
- /** Should we echo keys on the System.out? */
- private boolean echo = true;
-
- /**
- * Create a new instance
- * @param api the keyboard API
- */
- public KeyboardInputStream(KeyboardAPI api) {
- this.api = api;
- api.addKeyboardListener(this);
- }
-
- /**
- * @see java.io.InputStream#available()
- */
- public int available() throws IOException {
- return 0;
- }
-
- /*
- Doesn't block after the first blocking read.
- public int read(byte[] b, int off, int len) throws IOException {
- if (off < 0 || len < 0 || b.length - off < len)
- throw new IndexOutOfBoundsException();
-
- long time = System.currentTimeMillis();
-
- int i = 0;
- int ch = read(time);
-
- for(;;) {
- b[off + i ++] = (byte) ch;
-
- if(i < len && queue.size() > 0)
- ch = read(time);
- else
- break;
- }
-
- return i;
- }
- */
-
- public int read(byte[] b, int off, int len) throws IOException {
- if (off < 0 || len < 0 || b.length - off < len)
- throw new IndexOutOfBoundsException();
-
- long time = System.currentTimeMillis();
-
- int i = 0;
- int ch = read(time);
-
- for(;;) {
- b[off + i ++] = (byte) ch;
-
- if(i < len && ch != '\n')
- ch = read(time);
- else
- break;
- }
-
- return i;
- }
-
- /**
- * @see java.io.InputStream#read()
- */
- public int read() throws IOException {
- long time = System.currentTimeMillis();
- return read(time);
- }
-
- private int read(long time){
- while (true) {
- KeyboardEvent event = queue.get();
- int c = event2char(event, time);
- if(c > 0)
- return c;
- }
- }
-
- private int event2char(KeyboardEvent event, long time) {
- if (!event.isConsumed() && event.getTime() - time > -10000) {
- event.consume();
- char ch = event.getKeyChar();
- if (ch != 0) {
- if (echo) {
- System.out.print(ch);
- }
- return ch;
- }
- }
- return -1;
- }
-
- /**
- * @see org.jnode.driver.input.KeyboardListener#keyPressed(org.jnode.driver.input.KeyboardEvent)
- */
- public void keyPressed(KeyboardEvent event) {
- queue.add(event);
- }
-
- /**
- * @see org.jnode.driver.input.KeyboardListener#keyReleased(org.jnode.driver.input.KeyboardEvent)
- */
- public void keyReleased(KeyboardEvent event) {
- }
-
- /**
- * @see java.io.InputStream#close()
- */
- public void close() throws IOException {
- api.removeKeyboardListener(this);
- super.close();
- }
-
-}
Modified: trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java
===================================================================
--- trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -32,6 +32,10 @@
*/
public abstract class KeyboardInterpreter
{
+ // FIXME We are currently using the character zero (0x0000) to indicate that no
+ // (Unicode) character corresponds to a keycode. This means that we cannot represent
+ // the NUL control character. Instead we should really be using 0xffff which Unicode
+ // defines to be a non-character.
private int flags;
@@ -110,8 +114,13 @@
catch (UnsupportedKeyException e)
{
final char ch;
- if ((flags & InputEvent.SHIFT_DOWN_MASK) != 0)
+
+ if ((flags & InputEvent.CTRL_DOWN_MASK) != 0)
{
+ ch = keys.getKey(scancode).getControlChar();
+ }
+ else if ((flags & InputEvent.SHIFT_DOWN_MASK) != 0)
+ {
ch = keys.getKey(scancode).getUpperChar();
if (!extendedMode)
Modified: trunk/distr/src/apps/org/jnode/apps/console/SwingConsole.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/console/SwingConsole.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/distr/src/apps/org/jnode/apps/console/SwingConsole.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -28,9 +28,11 @@
TextScreenConsoleManager manager = (TextScreenConsoleManager) sm.getCurrentShell().getConsole().getManager();
SwingTextScreenConsoleManager cm = new SwingTextScreenConsoleManager();
cm.setParent(manager);
- new Thread(new CommandShell((TextConsole) cm.createConsole(null,
- ConsoleManager.CreateOptions.TEXT | ConsoleManager.CreateOptions.SCROLLABLE)), "SwingConsoleCommandShell").
- start();
+ TextConsole console = cm.createConsole(
+ null,
+ (ConsoleManager.CreateOptions.TEXT |
+ ConsoleManager.CreateOptions.SCROLLABLE));
+ new Thread(new CommandShell(console), "SwingConsoleCommandShell").start();
synchronized(SwingConsole.class){
frame = cm.getFrame();
Modified: trunk/distr/src/apps/org/jnode/apps/editor/TextEditor.java
===================================================================
--- trunk/distr/src/apps/org/jnode/apps/editor/TextEditor.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/distr/src/apps/org/jnode/apps/editor/TextEditor.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -36,10 +36,12 @@
ShellManager sm = InitialNaming.lookup(ShellManager.NAME);
TextScreenConsoleManager manager = (TextScreenConsoleManager) sm.getCurrentShell().getConsole().getManager();
- TextConsole console = manager.createConsole("editor",
- ConsoleManager.CreateOptions.TEXT |
- ConsoleManager.CreateOptions.STACKED |
- ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR_IN);
+ TextConsole console = manager.createConsole(
+ "editor",
+ (ConsoleManager.CreateOptions.TEXT |
+ ConsoleManager.CreateOptions.STACKED |
+ ConsoleManager.CreateOptions.NO_LINE_EDITTING |
+ ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR));
manager.focus(console);
TextEditor te = new TextEditor(console);
Modified: trunk/distr/src/emu/org/jnode/emu/EditEmu.java
===================================================================
--- trunk/distr/src/emu/org/jnode/emu/EditEmu.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/distr/src/emu/org/jnode/emu/EditEmu.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -21,8 +21,11 @@
}
SwingTextScreenConsoleManager cm = new SwingTextScreenConsoleManager();
- final TextScreenConsole console = cm.createConsole(null,
- ConsoleManager.CreateOptions.TEXT | ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR_IN);
+ final TextScreenConsole console = cm.createConsole(
+ null,
+ (ConsoleManager.CreateOptions.TEXT |
+ ConsoleManager.CreateOptions.NO_SYSTEM_OUT_ERR |
+ ConsoleManager.CreateOptions.NO_LINE_EDITTING));
TextEditor te = new TextEditor(console);
File f = new File(argv[0]);
Modified: trunk/distr/src/emu/org/jnode/emu/ShellEmu.java
===================================================================
--- trunk/distr/src/emu/org/jnode/emu/ShellEmu.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/distr/src/emu/org/jnode/emu/ShellEmu.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -12,8 +12,9 @@
public static void main(String[] argv) throws Exception {
initEnv();
SwingTextScreenConsoleManager cm = new SwingTextScreenConsoleManager();
- new Thread(new CommandShell(cm.createConsole("Console 1",
- ConsoleManager.CreateOptions.TEXT | ConsoleManager.CreateOptions.SCROLLABLE))).
- start();
+ new Thread(new CommandShell(cm.createConsole(
+ "Console 1",
+ (ConsoleManager.CreateOptions.TEXT |
+ ConsoleManager.CreateOptions.SCROLLABLE)))).start();
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/fs/src/fs/org/jnode/fs/command/CatCommand.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -22,6 +22,7 @@
package org.jnode.fs.command;
import java.io.File;
+import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.net.MalformedURLException;
@@ -38,6 +39,7 @@
/**
* @author epr
* @author Andreas H\u00e4nel
+ * @author Stephen Crawley
*/
public class CatCommand implements Command{
@@ -45,8 +47,10 @@
"the file (or URL) to print out");
public static Help.Info HELP_INFO = new Help.Info("cat",
- "Print the contents of the given file (or URL)",
- new Parameter[] { new Parameter(ARG_FILE, Parameter.MANDATORY)});
+ "Print the contents of the given file (or URL). " +
+ "If the file is omitted, standard input is read until EOF is reached; " +
+ "e.g. ^D when reading keyboard input.",
+ new Parameter[] { new Parameter(ARG_FILE, Parameter.OPTIONAL)});
public static void main(String[] args) throws Exception {
new CatCommand().execute(new CommandLine(args), System.in, System.out, System.err);
@@ -54,20 +58,40 @@
public void execute(CommandLine commandLine, InputStream in, PrintStream out, PrintStream err) throws Exception {
ParsedArguments cmdLine = HELP_INFO.parse(commandLine.toStringArray());
- URL url = openURL(ARG_FILE.getValue(cmdLine));
- InputStream is = url.openStream();
- if (is == null) {
- err.println("Not found " + ARG_FILE.getValue(cmdLine));
- } else {
- int len;
- final byte[] buf = new byte[ 1024];
- while ((len = is.read(buf)) > 0) {
- out.write(buf, 0, len);
- }
- out.println();
- out.flush();
- is.close();
- }
+ String fileName = ARG_FILE.getValue(cmdLine);
+ InputStream is = null;
+ try {
+ if (fileName == null) {
+ is = in;
+ }
+ else {
+ URL url = openURL(fileName);
+ try {
+ is = url.openStream();
+ }
+ catch (IOException ex) {
+ /* drop through ... */
+ }
+ if (is == null) {
+ err.println("Not found " + ARG_FILE.getValue(cmdLine));
+ // FIXME ... System.exit(1);
+ return;
+ }
+ }
+ int len;
+ final byte[] buf = new byte[ 1024];
+ while ((len = is.read(buf)) > 0) {
+ out.write(buf, 0, len);
+ }
+ // FIXME ... Why are we adding an extra newline???
+ out.println();
+ out.flush();
+ }
+ finally {
+ if (is != null && fileName != null) {
+ is.close();
+ }
+ }
}
private URL openURL(String fname) throws MalformedURLException {
Modified: trunk/gui/src/test/org/jnode/test/gui/ConsoleTest2.java
===================================================================
--- trunk/gui/src/test/org/jnode/test/gui/ConsoleTest2.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/gui/src/test/org/jnode/test/gui/ConsoleTest2.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -62,7 +62,8 @@
screen = new JTextAreaTextScreen(80,24);
manager = new TextScreenConsoleManager();
- console = new TextScreenConsole(manager, "test", screen, ConsoleManager.CreateOptions.TEXT);
+ console = new TextScreenConsole(
+ manager, "test", screen, ConsoleManager.CreateOptions.TEXT);
manager.focus(console);
CommandShell commandShell = new CommandShell(console);
Modified: trunk/gui/src/test/org/jnode/test/gui/FBConsole.java
===================================================================
--- trunk/gui/src/test/org/jnode/test/gui/FBConsole.java 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/gui/src/test/org/jnode/test/gui/FBConsole.java 2007-08-02 18:15:27 UTC (rev 3374)
@@ -58,7 +58,8 @@
ScrollableTextScreen ts = new FBConsole.FBPcTextScreen(g).createCompatibleScrollableBufferScreen(500);
- ScrollableTextScreenConsole first = new ScrollableTextScreenConsole(mgr, "console", ts,
+ ScrollableTextScreenConsole first =
+ new ScrollableTextScreenConsole(mgr, "console", ts,
ConsoleManager.CreateOptions.TEXT |
ConsoleManager.CreateOptions.SCROLLABLE);
Modified: trunk/shell/descriptors/org.jnode.shell.xml
===================================================================
--- trunk/shell/descriptors/org.jnode.shell.xml 2007-07-31 18:23:49 UTC (rev 3373)
+++ trunk/shell/descriptors/org.jnode.shell.xml 2007-08-02 18:15:27 UTC (rev 3374)
@@ -32,6 +32,7 @@
<permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="read,write"/>
<permission class="java.lang.RuntimePermission" name="modifyThreadGroup"/>
<permission class="java.lang.RuntimePermission" name="modifyThread"/>
+ <permission class="java.lang.RuntimePermission" name="setIO"/>
<permission class="java.net.SocketPermission" name="*" actions="resolve,listen,connect"/>
<permission class="java.net.SocketPermission" name="*:0-" actions="connect,reso...
[truncated message content] |
|
From: <fd...@us...> - 2007-07-31 18:23:51
|
Revision: 3373
http://jnode.svn.sourceforge.net/jnode/?rev=3373&view=rev
Author: fduminy
Date: 2007-07-31 11:23:49 -0700 (Tue, 31 Jul 2007)
Log Message:
-----------
fixed case where FSAccessRights is null : we default to read/write/execute allowed
Modified Paths:
--------------
trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java
Modified: trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2007-07-29 05:12:04 UTC (rev 3372)
+++ trunk/fs/src/fs/org/jnode/fs/service/def/FileSystemAPIImpl.java 2007-07-31 18:23:49 UTC (rev 3373)
@@ -25,12 +25,14 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.VMFileSystemAPI;
+import java.io.VMIOUtils;
import java.io.VMOpenMode;
import java.util.ArrayList;
import java.util.Iterator;
import org.apache.log4j.Logger;
import org.jnode.driver.Device;
+import org.jnode.fs.FSAccessRights;
import org.jnode.fs.FSDirectory;
import org.jnode.fs.FSEntry;
import org.jnode.fs.FileSystem;
@@ -100,8 +102,8 @@
* @param file
*/
public boolean canRead(String file) throws IOException {
- final FSEntry entry = getEntry(file);
- return (entry != null) && (entry.getAccessRights().canRead());
+ final FSAccessRights rights = getAccessRights(file);
+ return (rights == null) || rights.canRead();
}
/**
@@ -110,8 +112,8 @@
* @param file
*/
public boolean canWrite(String file) throws IOException {
- final FSEntry entry = getEntry(file);
- return (entry != null) && (entry.getAccessRights().canWrite());
+ final FSAccessRights rights = getAccessRights(file);
+ return (rights == null) || rights.canWrite();
}
/**
@@ -120,30 +122,45 @@
* @param file
*/
public boolean canExecute(String file) throws IOException {
- final FSEntry entry = getEntry(file);
- return (entry != null) && (entry.getAccessRights().canExecute());
+ final FSAccessRights rights = getAccessRights(file);
+ return (rights == null) || rights.canExecute();
}
public boolean setReadable(String file, boolean enable,
boolean owneronly) throws IOException
{
- final FSEntry entry = getEntry(file);
- return (entry != null) && (entry.getAccessRights().setReadable(enable, owneronly));
+ final FSAccessRights rights = getAccessRights(file);
+ if(rights == null)
+ {
+ return false;
+ }
+
+ return rights.setReadable(enable, owneronly);
}
public boolean setWritable(String file, boolean enable,
boolean owneronly) throws IOException
{
- final FSEntry entry = getEntry(file);
- return (entry != null) && (entry.getAccessRights().setWritable(enable, owneronly));
+ final FSAccessRights rights = getAccessRights(file);
+ if(rights == null)
+ {
+ return false;
+ }
+
+ return rights.setWritable(enable, owneronly);
}
public boolean setExecutable(String file, boolean enable,
boolean owneronly) throws IOException
{
- final FSEntry entry = getEntry(file);
- return (entry != null) && (entry.getAccessRights().setExecutable(enable, owneronly));
+ final FSAccessRights rights = getAccessRights(file);
+ if(rights == null)
+ {
+ return false;
+ }
+
+ return rights.setExecutable(enable, owneronly);
}
/**
@@ -269,6 +286,16 @@
}
return list.toArray(new String[list.size()]);
}
+
+ private FSAccessRights getAccessRights(String path) throws IOException
+ {
+ FSEntry entry = getEntry(path);
+ if(entry == null)
+ {
+ throw new FileNotFoundException("file not found: "+path);
+ }
+ return entry.getAccessRights();
+ }
/**
* Gets the FSEntry for the given path, or null if not found.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-07-29 05:12:07
|
Revision: 3372
http://jnode.svn.sourceforge.net/jnode/?rev=3372&view=rev
Author: lsantha
Date: 2007-07-28 22:12:04 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Progress with isolates.
Modified Paths:
--------------
trunk/net/src/net/org/jnode/net/arp/ARPNetworkLayer.java
Modified: trunk/net/src/net/org/jnode/net/arp/ARPNetworkLayer.java
===================================================================
--- trunk/net/src/net/org/jnode/net/arp/ARPNetworkLayer.java 2007-07-28 09:16:42 UTC (rev 3371)
+++ trunk/net/src/net/org/jnode/net/arp/ARPNetworkLayer.java 2007-07-29 05:12:04 UTC (rev 3372)
@@ -42,10 +42,12 @@
import org.jnode.net.ethernet.EthernetConstants;
import org.jnode.util.Statistics;
import org.jnode.util.TimeoutException;
+import org.jnode.vm.annotation.SharedStatics;
/**
* @author epr
*/
+@SharedStatics
public class ARPNetworkLayer implements NetworkLayer, ARPConstants {
/** My logger */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ls...@us...> - 2007-07-28 09:16:44
|
Revision: 3371
http://jnode.svn.sourceforge.net/jnode/?rev=3371&view=rev
Author: lsantha
Date: 2007-07-28 02:16:42 -0700 (Sat, 28 Jul 2007)
Log Message:
-----------
Progress with isolates.
Modified Paths:
--------------
trunk/core/src/classpath/vm/java/net/VMNetUtils.java
Modified: trunk/core/src/classpath/vm/java/net/VMNetUtils.java
===================================================================
--- trunk/core/src/classpath/vm/java/net/VMNetUtils.java 2007-07-27 18:19:24 UTC (rev 3370)
+++ trunk/core/src/classpath/vm/java/net/VMNetUtils.java 2007-07-28 09:16:42 UTC (rev 3371)
@@ -21,9 +21,12 @@
package java.net;
+import org.jnode.vm.annotation.SharedStatics;
+
/**
* @author Ewout Prangsma (ep...@us...)
*/
+@SharedStatics
public final class VMNetUtils {
private static VMNetAPI api;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jp...@us...> - 2007-07-27 18:19:25
|
Revision: 3370
http://jnode.svn.sourceforge.net/jnode/?rev=3370&view=rev
Author: jpg5
Date: 2007-07-27 11:19:24 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
This branch is now obsolete. There is a new branch (netng) that will serve it's cause.
Removed Paths:
-------------
branches/newNetworkingImpl/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jp...@us...> - 2007-07-27 18:17:50
|
Revision: 3369
http://jnode.svn.sourceforge.net/jnode/?rev=3369&view=rev
Author: jpg5
Date: 2007-07-27 11:17:48 -0700 (Fri, 27 Jul 2007)
Log Message:
-----------
Branch of the trunk to apply the new experimental network subsystem.
Added Paths:
-----------
branches/netng/
Copied: branches/netng (from rev 3368, trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|