harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r491123 [2/3] - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/java: java/io/ java/lang/ org/apache/harmony/luni/internal/nls/
Date Fri, 29 Dec 2006 22:36:59 GMT
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Integer.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Integer.java?view=diff&rev=491123&r1=491122&r2=491123
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Integer.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Integer.java Fri Dec 29 14:36:58 2006
@@ -34,9 +34,9 @@
  */
 public final class Integer extends Number implements Comparable<Integer> {
 
-	private static final long serialVersionUID = 1360826667806852920L;
+    private static final long serialVersionUID = 1360826667806852920L;
 
-	/**
+    /**
      * The value which the receiver represents.
      */
     private final int value;
@@ -64,16 +64,16 @@
      * @since 1.5
      */
     public static final int SIZE = 32;
-    
-	/**
-	 * The java.lang.Class that represents this class.
-	 */
+
+    /**
+     * The java.lang.Class that represents this class.
+     */
     @SuppressWarnings("unchecked")
     public static final Class<Integer> TYPE = (Class<Integer>) new int[0]
             .getClass().getComponentType();
 
-	// Note: This can't be set to "int.class", since *that* is
-	// defined to be "java.lang.Integer.TYPE";
+    // Note: This can't be set to "int.class", since *that* is
+    // defined to be "java.lang.Integer.TYPE";
 
     /**
      * <p>
@@ -81,39 +81,39 @@
      * </p>
      */
     private static final Integer[] CACHE = new Integer[256];
-    
-	/**
-	 * Constructs a new instance of the receiver which represents the int valued
-	 * argument.
-	 * 
-	 * @param value
-	 *            the int to store in the new instance.
-	 */
-	public Integer(int value) {
-		this.value = value;
-	}
-
-	/**
-	 * Constructs a new instance of this class given a string.
-	 * 
-	 * @param string
-	 *            a string representation of an int quantity.
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an int quantity.
-	 */
-	public Integer(String string) throws NumberFormatException {
-		this(parseInt(string));
-	}
-
-	/**
-	 * Answers the byte value which the receiver represents
-	 * 
-	 * @return byte the value of the receiver.
-	 */
-	@Override
+
+    /**
+     * Constructs a new instance of the receiver which represents the int valued
+     * argument.
+     * 
+     * @param value
+     *            the int to store in the new instance.
+     */
+    public Integer(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Constructs a new instance of this class given a string.
+     * 
+     * @param string
+     *            a string representation of an int quantity.
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an int quantity.
+     */
+    public Integer(String string) throws NumberFormatException {
+        this(parseInt(string));
+    }
+
+    /**
+     * Answers the byte value which the receiver represents
+     * 
+     * @return byte the value of the receiver.
+     */
+    @Override
     public byte byteValue() {
-		return (byte) value;
-	}
+        return (byte) value;
+    }
 
     /**
      * <p>
@@ -125,309 +125,310 @@
      * positive value is returned.
      * </p>
      * 
-     * @param object The instance to compare to.
-     * @throws NullPointerException if <code>object</code> is
-     *         <code>null</code>.
+     * @param object
+     *            The instance to compare to.
+     * @throws NullPointerException
+     *             if <code>object</code> is <code>null</code>.
      * @since 1.2
      */
-	public int compareTo(Integer object) {
-		return value > object.value ? 1 : (value < object.value ? -1 : 0);
-	}
-
-	/**
-	 * Parses the string argument as if it was an int value and returns the
-	 * result. Throws NumberFormatException if the string does not represent an
-	 * int quantity. The string may be a hexadecimal ("0x..."), octal ("0..."),
-	 * or decimal ("...") representation of an integer
-	 * 
-	 * @param string
-	 *            a string representation of an int quantity.
-	 * @return Integer the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an int quantity.
-	 */
-	public static Integer decode(String string) throws NumberFormatException {
-		int length = string.length(), i = 0;
-		if (length == 0) {
+    public int compareTo(Integer object) {
+        return value > object.value ? 1 : (value < object.value ? -1 : 0);
+    }
+
+    /**
+     * Parses the string argument as if it was an int value and returns the
+     * result. Throws NumberFormatException if the string does not represent an
+     * int quantity. The string may be a hexadecimal ("0x..."), octal ("0..."),
+     * or decimal ("...") representation of an integer
+     * 
+     * @param string
+     *            a string representation of an int quantity.
+     * @return Integer the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an int quantity.
+     */
+    public static Integer decode(String string) throws NumberFormatException {
+        int length = string.length(), i = 0;
+        if (length == 0) {
             throw new NumberFormatException();
         }
-		char firstDigit = string.charAt(i);
-		boolean negative = firstDigit == '-';
-		if (negative) {
-			if (length == 1) {
+        char firstDigit = string.charAt(i);
+        boolean negative = firstDigit == '-';
+        if (negative) {
+            if (length == 1) {
                 throw new NumberFormatException(string);
             }
-			firstDigit = string.charAt(++i);
-		}
+            firstDigit = string.charAt(++i);
+        }
 
-		int base = 10;
-		if (firstDigit == '0') {
-			if (++i == length) {
+        int base = 10;
+        if (firstDigit == '0') {
+            if (++i == length) {
                 return valueOf(0);
             }
-			if ((firstDigit = string.charAt(i)) == 'x' || firstDigit == 'X') {
-				if (i == length) {
+            if ((firstDigit = string.charAt(i)) == 'x' || firstDigit == 'X') {
+                if (i == length) {
                     throw new NumberFormatException(string);
                 }
-				i++;
-				base = 16;
-			} else {
-				base = 8;
-			}
-		} else if (firstDigit == '#') {
-			if (i == length) {
+                i++;
+                base = 16;
+            } else {
+                base = 8;
+            }
+        } else if (firstDigit == '#') {
+            if (i == length) {
                 throw new NumberFormatException(string);
             }
-			i++;
-			base = 16;
-		}
-
-		int result = parse(string, i, base, negative);
-		return valueOf(result);
-	}
-
-	/**
-	 * Answers the double value which the receiver represents
-	 * 
-	 * @return double the value of the receiver.
-	 */
-	@Override
+            i++;
+            base = 16;
+        }
+
+        int result = parse(string, i, base, negative);
+        return valueOf(result);
+    }
+
+    /**
+     * Answers the double value which the receiver represents
+     * 
+     * @return double the value of the receiver.
+     */
+    @Override
     public double doubleValue() {
-		return value;
-	}
+        return value;
+    }
 
-	/**
-	 * Compares the argument to the receiver, and answers true if they represent
-	 * the <em>same</em> object using a class specific comparison.
-	 * <p>
-	 * In this case, the argument must also be an Integer, and the receiver and
-	 * argument must represent the same int value.
-	 * 
-	 * @param o
-	 *            the object to compare with this object
-	 * @return <code>true</code> if the object is the same as this object
-	 *         <code>false</code> if it is different from this object
-	 * @see #hashCode
-	 */
-	@Override
+    /**
+     * Compares the argument to the receiver, and answers true if they represent
+     * the <em>same</em> object using a class specific comparison.
+     * <p>
+     * In this case, the argument must also be an Integer, and the receiver and
+     * argument must represent the same int value.
+     * 
+     * @param o
+     *            the object to compare with this object
+     * @return <code>true</code> if the object is the same as this object
+     *         <code>false</code> if it is different from this object
+     * @see #hashCode
+     */
+    @Override
     public boolean equals(Object o) {
-		return (o == this) || (o instanceof Integer)
-				&& (value == ((Integer) o).value);
-	}
-
-	/**
-	 * Answers the float value which the receiver represents
-	 * 
-	 * @return float the value of the receiver.
-	 */
-	@Override
+        return (o == this) || (o instanceof Integer)
+                && (value == ((Integer) o).value);
+    }
+
+    /**
+     * Answers the float value which the receiver represents
+     * 
+     * @return float the value of the receiver.
+     */
+    @Override
     public float floatValue() {
-		return value;
-	}
+        return value;
+    }
 
-	/**
-	 * Answers an Integer representing the integer value of the property named
-	 * by the argument. If the property could not be found, or its value could
-	 * not be parsed as an integer, answer null.
-	 * 
-	 * @param string
-	 *            The name of the desired integer property.
-	 * @return Integer An Integer representing the value of the property.
-	 */
-	public static Integer getInteger(String string) {
-		if (string == null || string.length() == 0) {
+    /**
+     * Answers an Integer representing the integer value of the property named
+     * by the argument. If the property could not be found, or its value could
+     * not be parsed as an integer, answer null.
+     * 
+     * @param string
+     *            The name of the desired integer property.
+     * @return Integer An Integer representing the value of the property.
+     */
+    public static Integer getInteger(String string) {
+        if (string == null || string.length() == 0) {
             return null;
         }
-		String prop = System.getProperty(string);
-		if (prop == null) {
+        String prop = System.getProperty(string);
+        if (prop == null) {
             return null;
         }
-		try {
-			return decode(prop);
-		} catch (NumberFormatException ex) {
-			return null;
-		}
-	}
-
-	/**
-	 * Answers an Integer representing the integer value of the property named
-	 * by the argument. If the property could not be found, or its value could
-	 * not be parsed as an integer, answer an Integer representing the second
-	 * argument.
-	 * 
-	 * @param string
-	 *            The name of the desired integer property.
-	 * @return Integer An Integer representing the value of the property.
-	 */
-	public static Integer getInteger(String string, int defaultValue) {
-		if (string == null || string.length() == 0) {
+        try {
+            return decode(prop);
+        } catch (NumberFormatException ex) {
+            return null;
+        }
+    }
+
+    /**
+     * Answers an Integer representing the integer value of the property named
+     * by the argument. If the property could not be found, or its value could
+     * not be parsed as an integer, answer an Integer representing the second
+     * argument.
+     * 
+     * @param string
+     *            The name of the desired integer property.
+     * @return Integer An Integer representing the value of the property.
+     */
+    public static Integer getInteger(String string, int defaultValue) {
+        if (string == null || string.length() == 0) {
+            return valueOf(defaultValue);
+        }
+        String prop = System.getProperty(string);
+        if (prop == null) {
             return valueOf(defaultValue);
         }
-		String prop = System.getProperty(string);
-		if (prop == null) {
+        try {
+            return decode(prop);
+        } catch (NumberFormatException ex) {
             return valueOf(defaultValue);
         }
-		try {
-			return decode(prop);
-		} catch (NumberFormatException ex) {
-			return valueOf(defaultValue);
-		}
-	}
-
-	/**
-	 * Answers an Integer representing the integer value of the property named
-	 * by the argument. If the property could not be found, or its value could
-	 * not be parsed as an integer, answer the second argument.
-	 * 
-	 * @param string
-	 *            The name of the desired integer property.
-	 * @return Integer An Integer representing the value of the property.
-	 */
-	public static Integer getInteger(String string, Integer defaultValue) {
-		if (string == null || string.length() == 0) {
+    }
+
+    /**
+     * Answers an Integer representing the integer value of the property named
+     * by the argument. If the property could not be found, or its value could
+     * not be parsed as an integer, answer the second argument.
+     * 
+     * @param string
+     *            The name of the desired integer property.
+     * @return Integer An Integer representing the value of the property.
+     */
+    public static Integer getInteger(String string, Integer defaultValue) {
+        if (string == null || string.length() == 0) {
+            return defaultValue;
+        }
+        String prop = System.getProperty(string);
+        if (prop == null) {
             return defaultValue;
         }
-		String prop = System.getProperty(string);
-		if (prop == null) {
+        try {
+            return decode(prop);
+        } catch (NumberFormatException ex) {
             return defaultValue;
         }
-		try {
-			return decode(prop);
-		} catch (NumberFormatException ex) {
-			return defaultValue;
-		}
-	}
-
-	/**
-	 * Answers an integer hash code for the receiver. Any two objects which
-	 * answer <code>true</code> when passed to <code>equals</code> must
-	 * answer the same value for this method.
-	 * 
-	 * @return the receiver's hash
-	 * 
-	 * @see #equals
-	 */
-	@Override
+    }
+
+    /**
+     * Answers an integer hash code for the receiver. Any two objects which
+     * answer <code>true</code> when passed to <code>equals</code> must
+     * answer the same value for this method.
+     * 
+     * @return the receiver's hash
+     * 
+     * @see #equals
+     */
+    @Override
     public int hashCode() {
-		return value;
-	}
+        return value;
+    }
 
-	/**
-	 * Answers the int value which the receiver represents
-	 * 
-	 * @return int the value of the receiver.
-	 */
-	@Override
+    /**
+     * Answers the int value which the receiver represents
+     * 
+     * @return int the value of the receiver.
+     */
+    @Override
     public int intValue() {
-		return value;
-	}
+        return value;
+    }
 
-	/**
-	 * Answers the long value which the receiver represents
-	 * 
-	 * @return long the value of the receiver.
-	 */
-	@Override
+    /**
+     * Answers the long value which the receiver represents
+     * 
+     * @return long the value of the receiver.
+     */
+    @Override
     public long longValue() {
-		return value;
-	}
+        return value;
+    }
 
-	/**
-	 * Parses the string argument as if it was an int value and returns the
-	 * result. Throws NumberFormatException if the string does not represent an
-	 * int quantity.
-	 * 
-	 * @param string
-	 *            a string representation of an int quantity.
-	 * @return int the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an int quantity.
-	 */
-	public static int parseInt(String string) throws NumberFormatException {
-		return parseInt(string, 10);
-	}
-
-	/**
-	 * Parses the string argument as if it was an int value and returns the
-	 * result. Throws NumberFormatException if the string does not represent an
-	 * int quantity. The second argument specifies the radix to use when parsing
-	 * the value.
-	 * 
-	 * @param string
-	 *            a string representation of an int quantity.
-	 * @param radix
-	 *            the base to use for conversion.
-	 * @return int the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an int quantity.
-	 */
-	public static int parseInt(String string, int radix)
-			throws NumberFormatException {
-		if (string == null || radix < Character.MIN_RADIX
-				|| radix > Character.MAX_RADIX) {
+    /**
+     * Parses the string argument as if it was an int value and returns the
+     * result. Throws NumberFormatException if the string does not represent an
+     * int quantity.
+     * 
+     * @param string
+     *            a string representation of an int quantity.
+     * @return int the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an int quantity.
+     */
+    public static int parseInt(String string) throws NumberFormatException {
+        return parseInt(string, 10);
+    }
+
+    /**
+     * Parses the string argument as if it was an int value and returns the
+     * result. Throws NumberFormatException if the string does not represent an
+     * int quantity. The second argument specifies the radix to use when parsing
+     * the value.
+     * 
+     * @param string
+     *            a string representation of an int quantity.
+     * @param radix
+     *            the base to use for conversion.
+     * @return int the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an int quantity.
+     */
+    public static int parseInt(String string, int radix)
+            throws NumberFormatException {
+        if (string == null || radix < Character.MIN_RADIX
+                || radix > Character.MAX_RADIX) {
             throw new NumberFormatException();
         }
-		int length = string.length(), i = 0;
-		if (length == 0) {
+        int length = string.length(), i = 0;
+        if (length == 0) {
             throw new NumberFormatException(string);
         }
-		boolean negative = string.charAt(i) == '-';
-		if (negative && ++i == length) {
+        boolean negative = string.charAt(i) == '-';
+        if (negative && ++i == length) {
             throw new NumberFormatException(string);
         }
 
-		return parse(string, i, radix, negative);
-	}
+        return parse(string, i, radix, negative);
+    }
 
-	private static int parse(String string, int offset, int radix,
-			boolean negative) throws NumberFormatException {
-		int max = Integer.MIN_VALUE / radix;
-		int result = 0, length = string.length();
-		while (offset < length) {
-			int digit = Character.digit(string.charAt(offset++), radix);
-			if (digit == -1) {
+    private static int parse(String string, int offset, int radix,
+            boolean negative) throws NumberFormatException {
+        int max = Integer.MIN_VALUE / radix;
+        int result = 0, length = string.length();
+        while (offset < length) {
+            int digit = Character.digit(string.charAt(offset++), radix);
+            if (digit == -1) {
                 throw new NumberFormatException(string);
             }
-			if (max > result) {
+            if (max > result) {
                 throw new NumberFormatException(string);
             }
-			int next = result * radix - digit;
-			if (next > result) {
+            int next = result * radix - digit;
+            if (next > result) {
                 throw new NumberFormatException(string);
             }
-			result = next;
-		}
-		if (!negative) {
-			result = -result;
-			if (result < 0) {
+            result = next;
+        }
+        if (!negative) {
+            result = -result;
+            if (result < 0) {
                 throw new NumberFormatException(string);
             }
-		}
-		return result;
-	}
-
-	/**
-	 * Answers the short value which the receiver represents
-	 * 
-	 * @return short the value of the receiver.
-	 */
-	@Override
+        }
+        return result;
+    }
+
+    /**
+     * Answers the short value which the receiver represents
+     * 
+     * @return short the value of the receiver.
+     */
+    @Override
     public short shortValue() {
-		return (short) value;
-	}
+        return (short) value;
+    }
 
-	/**
-	 * Answers a string containing '0' and '1' characters which describe the
-	 * binary representation of the argument.
-	 * 
-	 * @param i
-	 *            an int to get the binary representation of
-	 * @return String the binary representation of the argument
-	 */
-	public static String toBinaryString(int i) {
-		int count = 1, j = i;
+    /**
+     * Answers a string containing '0' and '1' characters which describe the
+     * binary representation of the argument.
+     * 
+     * @param i
+     *            an int to get the binary representation of
+     * @return String the binary representation of the argument
+     */
+    public static String toBinaryString(int i) {
+        int count = 1, j = i;
 
-		if (i < 0) {
+        if (i < 0) {
             count = 32;
         } else {
             while ((j >>>= 1) != 0) {
@@ -435,26 +436,26 @@
             }
         }
 
-		char[] buffer = new char[count];
-		do {
-			buffer[--count] = (char) ((i & 1) + '0');
-			i >>>= 1;
-		} while (count > 0);
-		return new String(0, buffer.length, buffer);
-	}
-
-	/**
-	 * Answers a string containing characters in the range 0..9, a..f which
-	 * describe the hexadecimal representation of the argument.
-	 * 
-	 * @param i
-	 *            an int to get the hex representation of
-	 * @return String the hex representation of the argument
-	 */
-	public static String toHexString(int i) {
-		int count = 1, j = i;
+        char[] buffer = new char[count];
+        do {
+            buffer[--count] = (char) ((i & 1) + '0');
+            i >>>= 1;
+        } while (count > 0);
+        return new String(0, buffer.length, buffer);
+    }
 
-		if (i < 0) {
+    /**
+     * Answers a string containing characters in the range 0..9, a..f which
+     * describe the hexadecimal representation of the argument.
+     * 
+     * @param i
+     *            an int to get the hex representation of
+     * @return String the hex representation of the argument
+     */
+    public static String toHexString(int i) {
+        int count = 1, j = i;
+
+        if (i < 0) {
             count = 8;
         } else {
             while ((j >>>= 4) != 0) {
@@ -462,32 +463,32 @@
             }
         }
 
-		char[] buffer = new char[count];
-		do {
-			int t = i & 15;
-			if (t > 9) {
+        char[] buffer = new char[count];
+        do {
+            int t = i & 15;
+            if (t > 9) {
                 t = t - 10 + 'a';
             } else {
                 t += '0';
             }
-			buffer[--count] = (char) t;
-			i >>>= 4;
-		} while (count > 0);
-		return new String(0, buffer.length, buffer);
-	}
-
-	/**
-	 * Answers a string containing characters in the range 0..7 which describe
-	 * the octal representation of the argument.
-	 * 
-	 * @param i
-	 *            an int to get the octal representation of
-	 * @return String the hex representation of the argument
-	 */
-	public static String toOctalString(int i) {
-		int count = 1, j = i;
+            buffer[--count] = (char) t;
+            i >>>= 4;
+        } while (count > 0);
+        return new String(0, buffer.length, buffer);
+    }
+
+    /**
+     * Answers a string containing characters in the range 0..7 which describe
+     * the octal representation of the argument.
+     * 
+     * @param i
+     *            an int to get the octal representation of
+     * @return String the hex representation of the argument
+     */
+    public static String toOctalString(int i) {
+        int count = 1, j = i;
 
-		if (i < 0) {
+        if (i < 0) {
             count = 11;
         } else {
             while ((j >>>= 3) != 0) {
@@ -495,121 +496,125 @@
             }
         }
 
-		char[] buffer = new char[count];
-		do {
-			buffer[--count] = (char) ((i & 7) + '0');
-			i >>>= 3;
-		} while (count > 0);
-		return new String(0, buffer.length, buffer);
-	}
-
-	/**
-	 * Answers a string containing a concise, human-readable description of the
-	 * receiver.
-	 * 
-	 * @return a printable representation for the receiver.
-	 */
-	@Override
+        char[] buffer = new char[count];
+        do {
+            buffer[--count] = (char) ((i & 7) + '0');
+            i >>>= 3;
+        } while (count > 0);
+        return new String(0, buffer.length, buffer);
+    }
+
+    /**
+     * Answers a string containing a concise, human-readable description of the
+     * receiver.
+     * 
+     * @return a printable representation for the receiver.
+     */
+    @Override
     public String toString() {
-		return Integer.toString(value);
-	}
+        return Integer.toString(value);
+    }
+
+    /**
+     * Answers a string containing characters in the range 0..9 which describe
+     * the decimal representation of the argument.
+     * 
+     * @param i
+     *            an int to get the representation of
+     * @return String the representation of the argument
+     */
+    public static String toString(int i) {
+        return toString(i, 10);
+    }
 
-	/**
-	 * Answers a string containing characters in the range 0..9 which describe
-	 * the decimal representation of the argument.
-	 * 
-	 * @param i
-	 *            an int to get the representation of
-	 * @return String the representation of the argument
-	 */
-	public static String toString(int i) {
-		return toString(i, 10);
-	}
-
-	/**
-	 * Answers a string containing characters in the range 0..9, a..z (depending
-	 * on the radix) which describe the representation of the argument in that
-	 * radix.
-	 * 
-	 * @param i
-	 *            an int to get the representation of
-	 * @param radix
-	 *            the base to use for conversion.
-	 * @return String the representation of the argument
-	 */
-	public static String toString(int i, int radix) {
-		if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
+    /**
+     * Answers a string containing characters in the range 0..9, a..z (depending
+     * on the radix) which describe the representation of the argument in that
+     * radix.
+     * 
+     * @param i
+     *            an int to get the representation of
+     * @param radix
+     *            the base to use for conversion.
+     * @return String the representation of the argument
+     */
+    public static String toString(int i, int radix) {
+        if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
             radix = 10;
         }
-		if (i == 0) {
-            return "0";
+        if (i == 0) {
+            return "0"; //$NON-NLS-1$
         }
 
-		int count = 2, j = i;
-		boolean negative = i < 0;
-		if (!negative) {
-			count = 1;
-			j = -i;
-		}
-		while ((i /= radix) != 0) {
+        int count = 2, j = i;
+        boolean negative = i < 0;
+        if (!negative) {
+            count = 1;
+            j = -i;
+        }
+        while ((i /= radix) != 0) {
             count++;
         }
 
-		char[] buffer = new char[count];
-		do {
-			int ch = 0 - (j % radix);
-			if (ch > 9) {
+        char[] buffer = new char[count];
+        do {
+            int ch = 0 - (j % radix);
+            if (ch > 9) {
                 ch = ch - 10 + 'a';
             } else {
                 ch += '0';
             }
-			buffer[--count] = (char) ch;
-		} while ((j /= radix) != 0);
-		if (negative) {
+            buffer[--count] = (char) ch;
+        } while ((j /= radix) != 0);
+        if (negative) {
             buffer[0] = '-';
         }
-		return new String(0, buffer.length, buffer);
-	}
+        return new String(0, buffer.length, buffer);
+    }
+
+    /**
+     * Parses the string argument as if it was an int value and returns the
+     * result. Throws NumberFormatException if the string does not represent an
+     * int quantity.
+     * 
+     * @param string
+     *            a string representation of an int quantity.
+     * @return Integer the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an int quantity.
+     */
+    public static Integer valueOf(String string) throws NumberFormatException {
+        return valueOf(parseInt(string));
+    }
 
-	/**
-	 * Parses the string argument as if it was an int value and returns the
-	 * result. Throws NumberFormatException if the string does not represent an
-	 * int quantity.
-	 * 
-	 * @param string
-	 *            a string representation of an int quantity.
-	 * @return Integer the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an int quantity.
-	 */
-	public static Integer valueOf(String string) throws NumberFormatException {
-		return valueOf(parseInt(string));
-	}
-
-	/**
-	 * Parses the string argument as if it was an int value and returns the
-	 * result. Throws NumberFormatException if the string does not represent an
-	 * int quantity. The second argument specifies the radix to use when parsing
-	 * the value.
-	 * 
-	 * @param string
-	 *            a string representation of an int quantity.
-	 * @param radix
-	 *            the base to use for conversion.
-	 * @return Integer the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an int quantity.
-	 */
-	public static Integer valueOf(String string, int radix)
-			throws NumberFormatException {
-		return valueOf(parseInt(string, radix));
-	}
-    
-    /**
-     * <p>Determines the highest (leftmost) bit that is 1 and returns
-     * the value that is the bit mask for that bit. This is sometimes
-     * referred to as the Most Significant 1 Bit.</p>
-     * @param i The <code>int</code> to interrogate.
+    /**
+     * Parses the string argument as if it was an int value and returns the
+     * result. Throws NumberFormatException if the string does not represent an
+     * int quantity. The second argument specifies the radix to use when parsing
+     * the value.
+     * 
+     * @param string
+     *            a string representation of an int quantity.
+     * @param radix
+     *            the base to use for conversion.
+     * @return Integer the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an int quantity.
+     */
+    public static Integer valueOf(String string, int radix)
+            throws NumberFormatException {
+        return valueOf(parseInt(string, radix));
+    }
+
+    /**
+     * <p>
+     * Determines the highest (leftmost) bit that is 1 and returns the value
+     * that is the bit mask for that bit. This is sometimes referred to as the
+     * Most Significant 1 Bit.
+     * </p>
+     * 
+     * @param i
+     *            The <code>int</code> to interrogate.
      * @return The bit mask indicating the highest 1 bit.
      * @since 1.5
      */
@@ -623,10 +628,14 @@
     }
 
     /**
-     * <p>Determines the lowest (rightmost) bit that is 1 and returns
-     * the value that is the bit mask for that bit. This is sometimes
-     * referred to as the Least Significant 1 Bit.</p>
-     * @param i The <code>int</code> to interrogate.
+     * <p>
+     * Determines the lowest (rightmost) bit that is 1 and returns the value
+     * that is the bit mask for that bit. This is sometimes referred to as the
+     * Least Significant 1 Bit.
+     * </p>
+     * 
+     * @param i
+     *            The <code>int</code> to interrogate.
      * @return The bit mask indicating the lowest 1 bit.
      * @since 1.5
      */
@@ -635,9 +644,13 @@
     }
 
     /**
-     * <p>Determines the number of leading zeros in the
-     * <code>int</code> passed prior to the {@link #highestOneBit(int) highest one bit}.</p>
-     * @param i The <code>int</code> to process.
+     * <p>
+     * Determines the number of leading zeros in the <code>int</code> passed
+     * prior to the {@link #highestOneBit(int) highest one bit}.
+     * </p>
+     * 
+     * @param i
+     *            The <code>int</code> to process.
      * @return The number of leading zeros.
      * @since 1.5
      */
@@ -651,9 +664,13 @@
     }
 
     /**
-     * <p>Determines the number of trailing zeros in the
-     * <code>int</code> passed after the {@link #lowestOneBit(int) lowest one bit}.</p>
-     * @param i The <code>int</code> to process.
+     * <p>
+     * Determines the number of trailing zeros in the <code>int</code> passed
+     * after the {@link #lowestOneBit(int) lowest one bit}.
+     * </p>
+     * 
+     * @param i
+     *            The <code>int</code> to process.
      * @return The number of trailing zeros.
      * @since 1.5
      */
@@ -662,10 +679,13 @@
     }
 
     /**
-     * <p>Counts the number of 1 bits in the <code>int</code>
-     * value passed; this is sometimes referred to as a 
-     * population count.</p>
-     * @param i The <code>int</code> value to process.
+     * <p>
+     * Counts the number of 1 bits in the <code>int</code> value passed; this
+     * is sometimes referred to as a population count.
+     * </p>
+     * 
+     * @param i
+     *            The <code>int</code> value to process.
      * @return The number of 1 bits.
      * @since 1.5
      */
@@ -679,10 +699,15 @@
     }
 
     /**
-     * <p>Rotates the bits of <code>i</code> to the left by
-     * the <code>distance</code> bits.</p>
-     * @param i The <code>int</code> value to rotate left.
-     * @param distance The number of bits to rotate.
+     * <p>
+     * Rotates the bits of <code>i</code> to the left by the
+     * <code>distance</code> bits.
+     * </p>
+     * 
+     * @param i
+     *            The <code>int</code> value to rotate left.
+     * @param distance
+     *            The number of bits to rotate.
      * @return The rotated value.
      * @since 1.5
      */
@@ -699,10 +724,15 @@
     }
 
     /**
-     * <p>Rotates the bits of <code>i</code> to the right by
-     * the <code>distance</code> bits.</p>
-     * @param i The <code>int</code> value to rotate right.
-     * @param distance The number of bits to rotate.
+     * <p>
+     * Rotates the bits of <code>i</code> to the right by the
+     * <code>distance</code> bits.
+     * </p>
+     * 
+     * @param i
+     *            The <code>int</code> value to rotate right.
+     * @param distance
+     *            The number of bits to rotate.
      * @return The rotated value.
      * @since 1.5
      */
@@ -723,7 +753,8 @@
      * Reverses the bytes of a <code>int</code>.
      * </p>
      * 
-     * @param i The <code>int</code> to reverse.
+     * @param i
+     *            The <code>int</code> to reverse.
      * @return The reversed value.
      * @since 1.5
      */
@@ -740,12 +771,13 @@
      * Reverses the bytes of a <code>int</code>.
      * </p>
      * 
-     * @param i The <code>int</code> to reverse.
+     * @param i
+     *            The <code>int</code> to reverse.
      * @return The reversed value.
      * @since 1.5
      */
     public static int reverse(int i) {
-        //From Hacker's Delight, 7-1, Figure 7-1
+        // From Hacker's Delight, 7-1, Figure 7-1
         i = (i & 0x55555555) << 1 | (i >> 1) & 0x55555555;
         i = (i & 0x33333333) << 2 | (i >> 2) & 0x33333333;
         i = (i & 0x0F0F0F0F) << 4 | (i >> 4) & 0x0F0F0F0F;
@@ -753,9 +785,14 @@
     }
 
     /**
-     * <p>The <code>signum</code> function for <code>int</code> values. This method returns -1 for
-     * negative values, 1 for positive values and 0 for the value 0.</p>
-     * @param i The <code>int</code> value.
+     * <p>
+     * The <code>signum</code> function for <code>int</code> values. This
+     * method returns -1 for negative values, 1 for positive values and 0 for
+     * the value 0.
+     * </p>
+     * 
+     * @param i
+     *            The <code>int</code> value.
      * @return -1 if negative, 1 if positive otherwise 0.
      * @since 1.5
      */
@@ -770,7 +807,8 @@
      * method may maintain a cache of instances.
      * </p>
      * 
-     * @param i The int value.
+     * @param i
+     *            The int value.
      * @return A <code>Integer</code> instance.
      * @since 1.5
      */

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Long.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Long.java?view=diff&rev=491123&r1=491122&r2=491123
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Long.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/Long.java Fri Dec 29 14:36:58 2006
@@ -34,36 +34,36 @@
  */
 public final class Long extends Number implements Comparable<Long> {
 
-	private static final long serialVersionUID = 4290774380558885855L;
+    private static final long serialVersionUID = 4290774380558885855L;
 
-	/**
-	 * The value which the receiver represents.
-	 */
-	private final long value;
+    /**
+     * The value which the receiver represents.
+     */
+    private final long value;
 
     /**
      * <p>
      * Constant for the maximum <code>long</code> value, 2<sup>63</sup>-1.
      * </p>
      */
-	public static final long MAX_VALUE = 0x7FFFFFFFFFFFFFFFL;
+    public static final long MAX_VALUE = 0x7FFFFFFFFFFFFFFFL;
 
     /**
      * <p>
      * Constant for the minimum <code>long</code> value, -2<sup>31</sup>.
      * </p>
      */
-	public static final long MIN_VALUE = 0x8000000000000000L;
+    public static final long MIN_VALUE = 0x8000000000000000L;
 
-	/**
-	 * The java.lang.Class that represents this class.
-	 */
+    /**
+     * The java.lang.Class that represents this class.
+     */
     @SuppressWarnings("unchecked")
     public static final Class<Long> TYPE = (Class<Long>) new long[0].getClass()
             .getComponentType();
 
-	// Note: This can't be set to "long.class", since *that* is
-	// defined to be "java.lang.Long.TYPE";
+    // Note: This can't be set to "long.class", since *that* is
+    // defined to be "java.lang.Long.TYPE";
 
     /**
      * <p>
@@ -74,360 +74,361 @@
      * @since 1.5
      */
     public static final int SIZE = 64;
-    
+
     /**
      * <p>
      * A cache of instances used by {@link #valueOf(long)} and auto-boxing.
      * </p>
      */
     private static final Long[] CACHE = new Long[256];
-    
-	/**
-	 * Constructs a new instance of the receiver which represents the long valued
-	 * argument.
-	 * 
-	 * @param value
-	 *            the long to store in the new instance.
-	 */
-	public Long(long value) {
-		this.value = value;
-	}
-
-	/**
-	 * Constructs a new instance of this class given a string.
-	 * 
-	 * @param string
-	 *            a string representation of an long quantity.
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as a long quantity.
-	 */
-	public Long(String string) throws NumberFormatException {
-		this(parseLong(string));
-	}
-
-	/**
-	 * Answers the byte value which the receiver represents
-	 * 
-	 * @return byte the value of the receiver.
-	 */
-	@Override
+
+    /**
+     * Constructs a new instance of the receiver which represents the long
+     * valued argument.
+     * 
+     * @param value
+     *            the long to store in the new instance.
+     */
+    public Long(long value) {
+        this.value = value;
+    }
+
+    /**
+     * Constructs a new instance of this class given a string.
+     * 
+     * @param string
+     *            a string representation of an long quantity.
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as a long quantity.
+     */
+    public Long(String string) throws NumberFormatException {
+        this(parseLong(string));
+    }
+
+    /**
+     * Answers the byte value which the receiver represents
+     * 
+     * @return byte the value of the receiver.
+     */
+    @Override
     public byte byteValue() {
-		return (byte) value;
-	}
+        return (byte) value;
+    }
 
     /**
      * <p>
-     * Compares this <code>Long</code> to the <code>Long</code>
-     * passed. If this instance's value is equal to the value of the instance
-     * passed, then 0 is returned. If this instance's value is less than the
-     * value of the instance passed, then a negative value is returned. If this
-     * instance's value is greater than the value of the instance passed, then a
-     * positive value is returned.
+     * Compares this <code>Long</code> to the <code>Long</code> passed. If
+     * this instance's value is equal to the value of the instance passed, then
+     * 0 is returned. If this instance's value is less than the value of the
+     * instance passed, then a negative value is returned. If this instance's
+     * value is greater than the value of the instance passed, then a positive
+     * value is returned.
      * </p>
      * 
-     * @param object The instance to compare to.
-     * @throws NullPointerException if <code>object</code> is
-     *         <code>null</code>.
+     * @param object
+     *            The instance to compare to.
+     * @throws NullPointerException
+     *             if <code>object</code> is <code>null</code>.
      * @since 1.2
      */
-	public int compareTo(Long object) {
-		return value > object.value ? 1 : (value < object.value ? -1 : 0);
-	}
-
-	/**
-	 * Parses the string argument as if it was a long value and returns the
-	 * result. Throws NumberFormatException if the string does not represent a
-	 * long quantity. The string may be a hexadecimal ("0x..."), octal ("0..."),
-	 * or decimal ("...") representation of a long.
-	 * 
-	 * @param string
-	 *            a string representation of an long quantity.
-	 * @return Long the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an long quantity.
-	 */
-	public static Long decode(String string) throws NumberFormatException {
-		int length = string.length(), i = 0;
-		if (length == 0) {
+    public int compareTo(Long object) {
+        return value > object.value ? 1 : (value < object.value ? -1 : 0);
+    }
+
+    /**
+     * Parses the string argument as if it was a long value and returns the
+     * result. Throws NumberFormatException if the string does not represent a
+     * long quantity. The string may be a hexadecimal ("0x..."), octal ("0..."),
+     * or decimal ("...") representation of a long.
+     * 
+     * @param string
+     *            a string representation of an long quantity.
+     * @return Long the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an long quantity.
+     */
+    public static Long decode(String string) throws NumberFormatException {
+        int length = string.length(), i = 0;
+        if (length == 0) {
             throw new NumberFormatException();
         }
-		char firstDigit = string.charAt(i);
-		boolean negative = firstDigit == '-';
-		if (negative) {
-			if (length == 1) {
+        char firstDigit = string.charAt(i);
+        boolean negative = firstDigit == '-';
+        if (negative) {
+            if (length == 1) {
                 throw new NumberFormatException(string);
             }
-			firstDigit = string.charAt(++i);
-		}
+            firstDigit = string.charAt(++i);
+        }
 
-		int base = 10;
-		if (firstDigit == '0') {
-			if (++i == length) {
+        int base = 10;
+        if (firstDigit == '0') {
+            if (++i == length) {
                 return valueOf(0L);
             }
-			if ((firstDigit = string.charAt(i)) == 'x' || firstDigit == 'X') {
-				if (i == length) {
+            if ((firstDigit = string.charAt(i)) == 'x' || firstDigit == 'X') {
+                if (i == length) {
                     throw new NumberFormatException(string);
                 }
-				i++;
-				base = 16;
-			} else {
-				base = 8;
-			}
-		} else if (firstDigit == '#') {
-			if (i == length) {
+                i++;
+                base = 16;
+            } else {
+                base = 8;
+            }
+        } else if (firstDigit == '#') {
+            if (i == length) {
                 throw new NumberFormatException(string);
             }
-			i++;
-			base = 16;
-		}
-
-		long result = parse(string, i, base, negative);
-		return valueOf(result);
-	}
-
-	/**
-	 * Answers the double value which the receiver represents
-	 * 
-	 * @return double the value of the receiver.
-	 */
-	@Override
+            i++;
+            base = 16;
+        }
+
+        long result = parse(string, i, base, negative);
+        return valueOf(result);
+    }
+
+    /**
+     * Answers the double value which the receiver represents
+     * 
+     * @return double the value of the receiver.
+     */
+    @Override
     public double doubleValue() {
-		return value;
-	}
+        return value;
+    }
 
-	/**
-	 * Compares the argument to the receiver, and answers true if they represent
-	 * the <em>same</em> object using a class specific comparison.
-	 * <p>
-	 * In this case, the argument must also be an Long, and the receiver and
-	 * argument must represent the same long value.
-	 * 
-	 * @param o
-	 *            the object to compare with this object
-	 * @return <code>true</code> if the object is the same as this object
-	 *         <code>false</code> if it is different from this object
-	 * @see #hashCode
-	 */
-	@Override
+    /**
+     * Compares the argument to the receiver, and answers true if they represent
+     * the <em>same</em> object using a class specific comparison.
+     * <p>
+     * In this case, the argument must also be an Long, and the receiver and
+     * argument must represent the same long value.
+     * 
+     * @param o
+     *            the object to compare with this object
+     * @return <code>true</code> if the object is the same as this object
+     *         <code>false</code> if it is different from this object
+     * @see #hashCode
+     */
+    @Override
     public boolean equals(Object o) {
-		return (o == this) || (o instanceof Long)
-				&& (value == ((Long) o).value);
-	}
-
-	/**
-	 * Answers the float value which the receiver represents
-	 * 
-	 * @return float the value of the receiver.
-	 */
-	@Override
+        return (o == this) || (o instanceof Long)
+                && (value == ((Long) o).value);
+    }
+
+    /**
+     * Answers the float value which the receiver represents
+     * 
+     * @return float the value of the receiver.
+     */
+    @Override
     public float floatValue() {
-		return value;
-	}
+        return value;
+    }
 
-	/**
-	 * Answers a Long representing the long value of the property named by the
-	 * argument. If the property could not be found, or its value could not be
-	 * parsed as a long, answer null.
-	 * 
-	 * @param string
-	 *            The name of the desired integer property.
-	 * @return Long A Long representing the value of the property.
-	 */
-	public static Long getLong(String string) {
-		if (string == null || string.length() == 0) {
+    /**
+     * Answers a Long representing the long value of the property named by the
+     * argument. If the property could not be found, or its value could not be
+     * parsed as a long, answer null.
+     * 
+     * @param string
+     *            The name of the desired integer property.
+     * @return Long A Long representing the value of the property.
+     */
+    public static Long getLong(String string) {
+        if (string == null || string.length() == 0) {
             return null;
         }
-		String prop = System.getProperty(string);
-		if (prop == null) {
+        String prop = System.getProperty(string);
+        if (prop == null) {
             return null;
         }
-		try {
-			return decode(prop);
-		} catch (NumberFormatException ex) {
-			return null;
-		}
-	}
-
-	/**
-	 * Answers a Long representing the long value of the property named by the
-	 * argument. If the property could not be found, or its value could not be
-	 * parsed as a long, answer a Long representing the second argument.
-	 * 
-	 * @param string
-	 *            The name of the desired long property.
-	 * @return Long An Long representing the value of the property.
-	 */
-	public static Long getLong(String string, long defaultValue) {
-		if (string == null || string.length() == 0) {
+        try {
+            return decode(prop);
+        } catch (NumberFormatException ex) {
+            return null;
+        }
+    }
+
+    /**
+     * Answers a Long representing the long value of the property named by the
+     * argument. If the property could not be found, or its value could not be
+     * parsed as a long, answer a Long representing the second argument.
+     * 
+     * @param string
+     *            The name of the desired long property.
+     * @return Long An Long representing the value of the property.
+     */
+    public static Long getLong(String string, long defaultValue) {
+        if (string == null || string.length() == 0) {
+            return valueOf(defaultValue);
+        }
+        String prop = System.getProperty(string);
+        if (prop == null) {
             return valueOf(defaultValue);
         }
-		String prop = System.getProperty(string);
-		if (prop == null) {
+        try {
+            return decode(prop);
+        } catch (NumberFormatException ex) {
             return valueOf(defaultValue);
         }
-		try {
-			return decode(prop);
-		} catch (NumberFormatException ex) {
-			return valueOf(defaultValue);
-		}
-	}
-
-	/**
-	 * Answers an Long representing the long value of the property named by the
-	 * argument. If the property could not be found, or its value could not be
-	 * parsed as an long, answer the second argument.
-	 * 
-	 * @param string
-	 *            The name of the desired long property.
-	 * @return Long An Long representing the value of the property.
-	 */
-	public static Long getLong(String string, Long defaultValue) {
-		if (string == null || string.length() == 0) {
+    }
+
+    /**
+     * Answers an Long representing the long value of the property named by the
+     * argument. If the property could not be found, or its value could not be
+     * parsed as an long, answer the second argument.
+     * 
+     * @param string
+     *            The name of the desired long property.
+     * @return Long An Long representing the value of the property.
+     */
+    public static Long getLong(String string, Long defaultValue) {
+        if (string == null || string.length() == 0) {
             return defaultValue;
         }
-		String prop = System.getProperty(string);
-		if (prop == null) {
+        String prop = System.getProperty(string);
+        if (prop == null) {
             return defaultValue;
         }
-		try {
-			return decode(prop);
-		} catch (NumberFormatException ex) {
-			return defaultValue;
-		}
-	}
-
-	/**
-	 * Answers an integer hash code for the receiver. Any two objects which
-	 * answer <code>true</code> when passed to <code>equals</code> must
-	 * answer the same value for this method.
-	 * 
-	 * @return the receiver's hash
-	 * 
-	 * @see #equals
-	 */
-	@Override
+        try {
+            return decode(prop);
+        } catch (NumberFormatException ex) {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Answers an integer hash code for the receiver. Any two objects which
+     * answer <code>true</code> when passed to <code>equals</code> must
+     * answer the same value for this method.
+     * 
+     * @return the receiver's hash
+     * 
+     * @see #equals
+     */
+    @Override
     public int hashCode() {
-		return (int) (value ^ (value >>> 32));
-	}
+        return (int) (value ^ (value >>> 32));
+    }
 
-	/**
-	 * Answers the int value which the receiver represents
-	 * 
-	 * @return int the value of the receiver.
-	 */
-	@Override
+    /**
+     * Answers the int value which the receiver represents
+     * 
+     * @return int the value of the receiver.
+     */
+    @Override
     public int intValue() {
-		return (int) value;
-	}
+        return (int) value;
+    }
 
-	/**
-	 * Answers the long value which the receiver represents
-	 * 
-	 * @return long the value of the receiver.
-	 */
-	@Override
+    /**
+     * Answers the long value which the receiver represents
+     * 
+     * @return long the value of the receiver.
+     */
+    @Override
     public long longValue() {
-		return value;
-	}
+        return value;
+    }
+
+    /**
+     * Parses the string argument as if it was a long value and returns the
+     * result. Throws NumberFormatException if the string does not represent a
+     * long quantity.
+     * 
+     * @param string
+     *            a string representation of a long quantity.
+     * @return long the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as a long quantity.
+     */
+    public static long parseLong(String string) throws NumberFormatException {
+        return parseLong(string, 10);
+    }
 
-	/**
-	 * Parses the string argument as if it was a long value and returns the
-	 * result. Throws NumberFormatException if the string does not represent a
-	 * long quantity.
-	 * 
-	 * @param string
-	 *            a string representation of a long quantity.
-	 * @return long the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as a long quantity.
-	 */
-	public static long parseLong(String string) throws NumberFormatException {
-		return parseLong(string, 10);
-	}
-
-	/**
-	 * Parses the string argument as if it was an long value and returns the
-	 * result. Throws NumberFormatException if the string does not represent an
-	 * long quantity. The second argument specifies the radix to use when
-	 * parsing the value.
-	 * 
-	 * @param string
-	 *            a string representation of an long quantity.
-	 * @param radix
-	 *            the base to use for conversion.
-	 * @return long the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an long quantity.
-	 */
-	public static long parseLong(String string, int radix)
-			throws NumberFormatException {
-		if (string == null || radix < Character.MIN_RADIX
-				|| radix > Character.MAX_RADIX) {
+    /**
+     * Parses the string argument as if it was an long value and returns the
+     * result. Throws NumberFormatException if the string does not represent an
+     * long quantity. The second argument specifies the radix to use when
+     * parsing the value.
+     * 
+     * @param string
+     *            a string representation of an long quantity.
+     * @param radix
+     *            the base to use for conversion.
+     * @return long the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an long quantity.
+     */
+    public static long parseLong(String string, int radix)
+            throws NumberFormatException {
+        if (string == null || radix < Character.MIN_RADIX
+                || radix > Character.MAX_RADIX) {
             throw new NumberFormatException();
         }
-		int length = string.length(), i = 0;
-		if (length == 0) {
+        int length = string.length(), i = 0;
+        if (length == 0) {
             throw new NumberFormatException(string);
         }
-		boolean negative = string.charAt(i) == '-';
-		if (negative && ++i == length) {
+        boolean negative = string.charAt(i) == '-';
+        if (negative && ++i == length) {
             throw new NumberFormatException(string);
         }
 
-		return parse(string, i, radix, negative);
-	}
+        return parse(string, i, radix, negative);
+    }
 
-	private static long parse(String string, int offset, int radix,
-			boolean negative) {
-		long max = Long.MIN_VALUE / radix;
-		long result = 0, length = string.length();
-		while (offset < length) {
-			int digit = Character.digit(string.charAt(offset++), radix);
-			if (digit == -1) {
+    private static long parse(String string, int offset, int radix,
+            boolean negative) {
+        long max = Long.MIN_VALUE / radix;
+        long result = 0, length = string.length();
+        while (offset < length) {
+            int digit = Character.digit(string.charAt(offset++), radix);
+            if (digit == -1) {
                 throw new NumberFormatException(string);
             }
-			if (max > result) {
+            if (max > result) {
                 throw new NumberFormatException(string);
             }
-			long next = result * radix - digit;
-			if (next > result) {
+            long next = result * radix - digit;
+            if (next > result) {
                 throw new NumberFormatException(string);
             }
-			result = next;
-		}
-		if (!negative) {
-			result = -result;
-			if (result < 0) {
+            result = next;
+        }
+        if (!negative) {
+            result = -result;
+            if (result < 0) {
                 throw new NumberFormatException(string);
             }
-		}
-		return result;
-	}
-
-	/**
-	 * Answers the short value which the receiver represents
-	 * 
-	 * @return short the value of the receiver.
-	 */
-	@Override
+        }
+        return result;
+    }
+
+    /**
+     * Answers the short value which the receiver represents
+     * 
+     * @return short the value of the receiver.
+     */
+    @Override
     public short shortValue() {
-		return (short) value;
-	}
+        return (short) value;
+    }
 
-	/**
-	 * Answers a string containing '0' and '1' characters which describe the
-	 * binary representation of the argument.
-	 * 
-	 * @param l
-	 *            a long to get the binary representation of
-	 * @return String the binary representation of the argument
-	 */
-	public static String toBinaryString(long l) {
-		int count = 1;
-		long j = l;
+    /**
+     * Answers a string containing '0' and '1' characters which describe the
+     * binary representation of the argument.
+     * 
+     * @param l
+     *            a long to get the binary representation of
+     * @return String the binary representation of the argument
+     */
+    public static String toBinaryString(long l) {
+        int count = 1;
+        long j = l;
 
-		if (l < 0) {
+        if (l < 0) {
             count = 64;
         } else {
             while ((j >>= 1) != 0) {
@@ -435,27 +436,27 @@
             }
         }
 
-		char[] buffer = new char[count];
-		do {
-			buffer[--count] = (char) ((l & 1) + '0');
-			l >>= 1;
-		} while (count > 0);
-		return new String(0, buffer.length, buffer);
-	}
-
-	/**
-	 * Answers a string containing characters in the range 0..7, a..f which
-	 * describe the hexadecimal representation of the argument.
-	 * 
-	 * @param l
-	 *            a long to get the hex representation of
-	 * @return String the hex representation of the argument
-	 */
-	public static String toHexString(long l) {
-		int count = 1;
-		long j = l;
+        char[] buffer = new char[count];
+        do {
+            buffer[--count] = (char) ((l & 1) + '0');
+            l >>= 1;
+        } while (count > 0);
+        return new String(0, buffer.length, buffer);
+    }
+
+    /**
+     * Answers a string containing characters in the range 0..7, a..f which
+     * describe the hexadecimal representation of the argument.
+     * 
+     * @param l
+     *            a long to get the hex representation of
+     * @return String the hex representation of the argument
+     */
+    public static String toHexString(long l) {
+        int count = 1;
+        long j = l;
 
-		if (l < 0) {
+        if (l < 0) {
             count = 16;
         } else {
             while ((j >>= 4) != 0) {
@@ -463,33 +464,33 @@
             }
         }
 
-		char[] buffer = new char[count];
-		do {
-			int t = (int) (l & 15);
-			if (t > 9) {
+        char[] buffer = new char[count];
+        do {
+            int t = (int) (l & 15);
+            if (t > 9) {
                 t = t - 10 + 'a';
             } else {
                 t += '0';
             }
-			buffer[--count] = (char) t;
-			l >>= 4;
-		} while (count > 0);
-		return new String(0, buffer.length, buffer);
-	}
-
-	/**
-	 * Answers a string containing characters in the range 0..7 which describe
-	 * the octal representation of the argument.
-	 * 
-	 * @param l
-	 *            a long to get the octal representation of
-	 * @return String the octal representation of the argument
-	 */
-	public static String toOctalString(long l) {
-		int count = 1;
-		long j = l;
+            buffer[--count] = (char) t;
+            l >>= 4;
+        } while (count > 0);
+        return new String(0, buffer.length, buffer);
+    }
+
+    /**
+     * Answers a string containing characters in the range 0..7 which describe
+     * the octal representation of the argument.
+     * 
+     * @param l
+     *            a long to get the octal representation of
+     * @return String the octal representation of the argument
+     */
+    public static String toOctalString(long l) {
+        int count = 1;
+        long j = l;
 
-		if (l < 0) {
+        if (l < 0) {
             count = 22;
         } else {
             while ((j >>>= 3) != 0) {
@@ -497,117 +498,117 @@
             }
         }
 
-		char[] buffer = new char[count];
-		do {
-			buffer[--count] = (char) ((l & 7) + '0');
-			l >>>= 3;
-		} while (count > 0);
-		return new String(0, buffer.length, buffer);
-	}
-
-	/**
-	 * Answers a string containing a concise, human-readable description of the
-	 * receiver.
-	 * 
-	 * @return a printable representation for the receiver.
-	 */
-	@Override
+        char[] buffer = new char[count];
+        do {
+            buffer[--count] = (char) ((l & 7) + '0');
+            l >>>= 3;
+        } while (count > 0);
+        return new String(0, buffer.length, buffer);
+    }
+
+    /**
+     * Answers a string containing a concise, human-readable description of the
+     * receiver.
+     * 
+     * @return a printable representation for the receiver.
+     */
+    @Override
     public String toString() {
-		return Long.toString(value);
-	}
+        return Long.toString(value);
+    }
+
+    /**
+     * Answers a string containing characters in the range 0..9 which describe
+     * the decimal representation of the argument.
+     * 
+     * @param l
+     *            a long to get the representation of
+     * @return String the representation of the argument
+     */
+    public static String toString(long l) {
+        return toString(l, 10);
+    }
 
-	/**
-	 * Answers a string containing characters in the range 0..9 which describe
-	 * the decimal representation of the argument.
-	 * 
-	 * @param l
-	 *            a long to get the representation of
-	 * @return String the representation of the argument
-	 */
-	public static String toString(long l) {
-		return toString(l, 10);
-	}
-
-	/**
-	 * Answers a string containing characters in the range 0..9, a..z (depending
-	 * on the radix) which describe the representation of the argument in that
-	 * radix.
-	 * 
-	 * @param l
-	 *            a long to get the representation of
-	 * @param radix
-	 *            the base to use for conversion.
-	 * @return String the representation of the argument
-	 */
-	public static String toString(long l, int radix) {
-		if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
+    /**
+     * Answers a string containing characters in the range 0..9, a..z (depending
+     * on the radix) which describe the representation of the argument in that
+     * radix.
+     * 
+     * @param l
+     *            a long to get the representation of
+     * @param radix
+     *            the base to use for conversion.
+     * @return String the representation of the argument
+     */
+    public static String toString(long l, int radix) {
+        if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX) {
             radix = 10;
         }
-		if (l == 0) {
-            return "0";
+        if (l == 0) {
+            return "0"; //$NON-NLS-1$
         }
 
-		int count = 2;
-		long j = l;
-		boolean negative = l < 0;
-		if (!negative) {
-			count = 1;
-			j = -l;
-		}
-		while ((l /= radix) != 0) {
+        int count = 2;
+        long j = l;
+        boolean negative = l < 0;
+        if (!negative) {
+            count = 1;
+            j = -l;
+        }
+        while ((l /= radix) != 0) {
             count++;
         }
 
-		char[] buffer = new char[count];
-		do {
-			int ch = 0 - (int) (j % radix);
-			if (ch > 9) {
+        char[] buffer = new char[count];
+        do {
+            int ch = 0 - (int) (j % radix);
+            if (ch > 9) {
                 ch = ch - 10 + 'a';
             } else {
                 ch += '0';
             }
-			buffer[--count] = (char) ch;
-		} while ((j /= radix) != 0);
-		if (negative) {
+            buffer[--count] = (char) ch;
+        } while ((j /= radix) != 0);
+        if (negative) {
             buffer[0] = '-';
         }
-		return new String(0, buffer.length, buffer);
-	}
+        return new String(0, buffer.length, buffer);
+    }
+
+    /**
+     * Parses the string argument as if it was an long value and returns the
+     * result. Throws NumberFormatException if the string does not represent an
+     * long quantity.
+     * 
+     * @param string
+     *            a string representation of an long quantity.
+     * @return Long the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an long quantity.
+     */
+    public static Long valueOf(String string) throws NumberFormatException {
+        return valueOf(parseLong(string));
+    }
+
+    /**
+     * Parses the string argument as if it was an long value and returns the
+     * result. Throws NumberFormatException if the string does not represent an
+     * long quantity. The second argument specifies the radix to use when
+     * parsing the value.
+     * 
+     * @param string
+     *            a string representation of an long quantity.
+     * @param radix
+     *            the base to use for conversion.
+     * @return Long the value represented by the argument
+     * @exception NumberFormatException
+     *                if the argument could not be parsed as an long quantity.
+     */
+    public static Long valueOf(String string, int radix)
+            throws NumberFormatException {
+        return valueOf(parseLong(string, radix));
+    }
 
-	/**
-	 * Parses the string argument as if it was an long value and returns the
-	 * result. Throws NumberFormatException if the string does not represent an
-	 * long quantity.
-	 * 
-	 * @param string
-	 *            a string representation of an long quantity.
-	 * @return Long the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an long quantity.
-	 */
-	public static Long valueOf(String string) throws NumberFormatException {
-		return valueOf(parseLong(string));
-	}
-
-	/**
-	 * Parses the string argument as if it was an long value and returns the
-	 * result. Throws NumberFormatException if the string does not represent an
-	 * long quantity. The second argument specifies the radix to use when
-	 * parsing the value.
-	 * 
-	 * @param string
-	 *            a string representation of an long quantity.
-	 * @param radix
-	 *            the base to use for conversion.
-	 * @return Long the value represented by the argument
-	 * @exception NumberFormatException
-	 *                if the argument could not be parsed as an long quantity.
-	 */
-	public static Long valueOf(String string, int radix)
-			throws NumberFormatException {
-		return valueOf(parseLong(string, radix));
-	}
-    
     /**
      * <p>
      * Determines the highest (leftmost) bit that is 1 and returns the value
@@ -615,7 +616,8 @@
      * Most Significant 1 Bit.
      * </p>
      * 
-     * @param lng The <code>long</code> to interrogate.
+     * @param lng
+     *            The <code>long</code> to interrogate.
      * @return The bit mask indicating the highest 1 bit.
      * @since 1.5
      */
@@ -636,7 +638,8 @@
      * Least Significant 1 Bit.
      * </p>
      * 
-     * @param lng The <code>long</code> to interrogate.
+     * @param lng
+     *            The <code>long</code> to interrogate.
      * @return The bit mask indicating the lowest 1 bit.
      * @since 1.5
      */
@@ -650,7 +653,8 @@
      * prior to the {@link #highestOneBit(long) highest one bit}.
      * </p>
      * 
-     * @param lng The <code>long</code> to process.
+     * @param lng
+     *            The <code>long</code> to process.
      * @return The number of leading zeros.
      * @since 1.5
      */
@@ -670,7 +674,8 @@
      * after the {@link #lowestOneBit(long) lowest one bit}.
      * </p>
      * 
-     * @param lng The <code>long</code> to process.
+     * @param lng
+     *            The <code>long</code> to process.
      * @return The number of trailing zeros.
      * @since 1.5
      */
@@ -684,7 +689,8 @@
      * is sometimes referred to as a population count.
      * </p>
      * 
-     * @param lng The <code>long</code> value to process.
+     * @param lng
+     *            The <code>long</code> value to process.
      * @return The number of 1 bits.
      * @since 1.5
      */
@@ -705,8 +711,10 @@
      * <code>distance</code> bits.
      * </p>
      * 
-     * @param lng The <code>long</code> value to rotate left.
-     * @param distance The number of bits to rotate.
+     * @param lng
+     *            The <code>long</code> value to rotate left.
+     * @param distance
+     *            The number of bits to rotate.
      * @return The rotated value.
      * @since 1.5
      */
@@ -728,8 +736,10 @@
      * <code>distance</code> bits.
      * </p>
      * 
-     * @param lng The <code>long</code> value to rotate right.
-     * @param distance The number of bits to rotate.
+     * @param lng
+     *            The <code>long</code> value to rotate right.
+     * @param distance
+     *            The number of bits to rotate.
      * @return The rotated value.
      * @since 1.5
      */
@@ -750,7 +760,8 @@
      * Reverses the bytes of a <code>long</code>.
      * </p>
      * 
-     * @param lng The <code>long</code> to reverse.
+     * @param lng
+     *            The <code>long</code> to reverse.
      * @return The reversed value.
      * @since 1.5
      */
@@ -771,7 +782,8 @@
      * Reverses the bytes of a <code>long</code>.
      * </p>
      * 
-     * @param lng The <code>long</code> to reverse.
+     * @param lng
+     *            The <code>long</code> to reverse.
      * @return The reversed value.
      * @since 1.5
      */
@@ -793,7 +805,8 @@
      * the value 0.
      * </p>
      * 
-     * @param lng The <code>long</code> value.
+     * @param lng
+     *            The <code>long</code> value.
      * @return -1 if negative, 1 if positive otherwise 0.
      * @since 1.5
      */
@@ -808,7 +821,8 @@
      * maintain a cache of instances.
      * </p>
      * 
-     * @param lng The long value.
+     * @param lng
+     *            The long value.
      * @return A <code>Long</code> instance.
      * @since 1.5
      */

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ProcessBuilder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ProcessBuilder.java?view=diff&rev=491123&r1=491122&r2=491123
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ProcessBuilder.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ProcessBuilder.java Fri Dec 29 14:36:58 2006
@@ -44,7 +44,8 @@
      * Constructs an instance with the given command.
      * </p>
      * 
-     * @param command The program and arguments.
+     * @param command
+     *            The program and arguments.
      */
     public ProcessBuilder(String... command) {
         this(toList(command));
@@ -55,9 +56,10 @@
      * Constructs an instance with the given command.
      * </p>
      * 
-     * @param command The program and arguments.
-     * @throws NullPointerException if <code>command</code> is
-     *         <code>null</code>.
+     * @param command
+     *            The program and arguments.
+     * @throws NullPointerException
+     *             if <code>command</code> is <code>null</code>.
      */
     public ProcessBuilder(List<String> command) {
         super();
@@ -65,7 +67,8 @@
             throw new NullPointerException();
         }
         this.command = command;
-        this.environment = new org.apache.harmony.luni.platform.Environment.EnvironmentMap(System.getenv());
+        this.environment = new org.apache.harmony.luni.platform.Environment.EnvironmentMap(
+                System.getenv());
     }
 
     /**
@@ -86,7 +89,8 @@
      * Changes the program and arguments to the command given.
      * </p>
      * 
-     * @param command The program and arguments.
+     * @param command
+     *            The program and arguments.
      * @return A reference to this instance.
      */
     public ProcessBuilder command(String... command) {
@@ -100,10 +104,11 @@
      * instance's state.
      * </p>
      * 
-     * @param command The program and arguments.
+     * @param command
+     *            The program and arguments.
      * @return A reference to this instance.
-     * @throws NullPointerException if <code>command</code> is
-     *         <code>null</code>.
+     * @throws NullPointerException
+     *             if <code>command</code> is <code>null</code>.
      */
     public ProcessBuilder command(List<String> command) {
         if (command == null) {
@@ -133,7 +138,8 @@
      * process is used when a process is started.
      * </p>
      * 
-     * @param directory The working directory to set.
+     * @param directory
+     *            The working directory to set.
      * @return A reference to this instance.
      */
     public ProcessBuilder directory(File directory) {
@@ -174,8 +180,9 @@
      * Changes the state of whether or not standard error is redirected.
      * </p>
      * 
-     * @param redirectErrorStream <code>true</code> to redirect standard
-     *        error, <code>false</code> if not.
+     * @param redirectErrorStream
+     *            <code>true</code> to redirect standard error,
+     *            <code>false</code> if not.
      * @return A reference to this instance.
      */
     public ProcessBuilder redirectErrorStream(boolean redirectErrorStream) {
@@ -189,12 +196,16 @@
      * </p>
      * 
      * @return The new process that was started.
-     * @throws NullPointerException if any of the elements of {@link #command()}
-     *         are <code>null</code>.
-     * @throws IndexOutOfBoundsException if {@link #command()} is empty.
-     * @throws SecurityException if {@link SecurityManager#checkExec(String)}
-     *         doesn't allow process creation.
-     * @throws IOException if an I/O error happens.
+     * @throws NullPointerException
+     *             if any of the elements of {@link #command()} are
+     *             <code>null</code>.
+     * @throws IndexOutOfBoundsException
+     *             if {@link #command()} is empty.
+     * @throws SecurityException
+     *             if {@link SecurityManager#checkExec(String)} doesn't allow
+     *             process creation.
+     * @throws IOException
+     *             if an I/O error happens.
      */
     public Process start() throws IOException {
         if (command.isEmpty()) {
@@ -209,13 +220,14 @@
         String[] envArray = new String[environment.size()];
         int i = 0;
         for (Map.Entry<String, String> entry : environment.entrySet()) {
-            envArray[i++] = entry.getKey() + "=" + entry.getValue();
+            envArray[i++] = entry.getKey() + "=" + entry.getValue(); //$NON-NLS-1$
         }
-        Process process = Runtime.getRuntime().exec(cmdArray, envArray, directory);
+        Process process = Runtime.getRuntime().exec(cmdArray, envArray,
+                directory);
         // TODO implement support for redirectErrorStream
         return process;
     }
-    
+
     private static List<String> toList(String[] strings) {
         ArrayList<String> arrayList = new ArrayList<String>(strings.length);
         for (String string : strings) {
@@ -224,4 +236,3 @@
         return arrayList;
     }
 }
-

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/RuntimePermission.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/RuntimePermission.java?view=diff&rev=491123&r1=491122&r2=491123
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/RuntimePermission.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/RuntimePermission.java Fri Dec 29 14:36:58 2006
@@ -17,7 +17,6 @@
 
 package java.lang;
 
-
 import java.security.BasicPermission;
 
 /**
@@ -25,78 +24,78 @@
  */
 public final class RuntimePermission extends BasicPermission {
 
-	private static final long serialVersionUID = 7399184964622342223L;
+    private static final long serialVersionUID = 7399184964622342223L;
 
-	/**
-	 * Constants for runtime permissions used in this package.
-	 */
-	static final RuntimePermission permissionToSetSecurityManager = new RuntimePermission(
-			"setSecurityManager");
-
-	static final RuntimePermission permissionToCreateSecurityManager = new RuntimePermission(
-			"createSecurityManager");
-
-	static final RuntimePermission permissionToGetProtectionDomain = new RuntimePermission(
-			"getProtectionDomain");
-
-	static final RuntimePermission permissionToGetClassLoader = new RuntimePermission(
-			"getClassLoader");
-
-	static final RuntimePermission permissionToCreateClassLoader = new RuntimePermission(
-			"createClassLoader");
-
-	static final RuntimePermission permissionToModifyThread = new RuntimePermission(
-			"modifyThread");
-
-	static final RuntimePermission permissionToModifyThreadGroup = new RuntimePermission(
-			"modifyThreadGroup");
-
-	static final RuntimePermission permissionToExitVM = new RuntimePermission(
-			"exitVM");
-
-	static final RuntimePermission permissionToReadFileDescriptor = new RuntimePermission(
-			"readFileDescriptor");
-
-	static final RuntimePermission permissionToWriteFileDescriptor = new RuntimePermission(
-			"writeFileDescriptor");
-
-	static final RuntimePermission permissionToQueuePrintJob = new RuntimePermission(
-			"queuePrintJob");
-
-	static final RuntimePermission permissionToSetFactory = new RuntimePermission(
-			"setFactory");
-
-	static final RuntimePermission permissionToSetIO = new RuntimePermission(
-			"setIO");
-
-	static final RuntimePermission permissionToStopThread = new RuntimePermission(
-			"stopThread");
-
-	static final RuntimePermission permissionToSetContextClassLoader = new RuntimePermission(
-			"setContextClassLoader");
-
-	/**
-	 * Creates an instance of this class with the given name.
-	 * 
-	 * 
-	 * @param permissionName
-	 *            String the name of the new permission.
-	 */
-	public RuntimePermission(String permissionName) {
-		super(permissionName);
-	}
-
-	/**
-	 * Creates an instance of this class with the given name and action list.
-	 * The action list is ignored.
-	 * 
-	 * 
-	 * @param name
-	 *            String the name of the new permission.
-	 * @param actions
-	 *            String ignored.
-	 */
-	public RuntimePermission(String name, String actions) {
-		super(name, actions);
-	}
+    /**
+     * Constants for runtime permissions used in this package.
+     */
+    static final RuntimePermission permissionToSetSecurityManager = new RuntimePermission(
+            "setSecurityManager"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToCreateSecurityManager = new RuntimePermission(
+            "createSecurityManager"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToGetProtectionDomain = new RuntimePermission(
+            "getProtectionDomain"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToGetClassLoader = new RuntimePermission(
+            "getClassLoader"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToCreateClassLoader = new RuntimePermission(
+            "createClassLoader"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToModifyThread = new RuntimePermission(
+            "modifyThread"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToModifyThreadGroup = new RuntimePermission(
+            "modifyThreadGroup"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToExitVM = new RuntimePermission(
+            "exitVM"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToReadFileDescriptor = new RuntimePermission(
+            "readFileDescriptor"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToWriteFileDescriptor = new RuntimePermission(
+            "writeFileDescriptor"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToQueuePrintJob = new RuntimePermission(
+            "queuePrintJob"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToSetFactory = new RuntimePermission(
+            "setFactory"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToSetIO = new RuntimePermission(
+            "setIO"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToStopThread = new RuntimePermission(
+            "stopThread"); //$NON-NLS-1$
+
+    static final RuntimePermission permissionToSetContextClassLoader = new RuntimePermission(
+            "setContextClassLoader"); //$NON-NLS-1$
+
+    /**
+     * Creates an instance of this class with the given name.
+     * 
+     * 
+     * @param permissionName
+     *            String the name of the new permission.
+     */
+    public RuntimePermission(String permissionName) {
+        super(permissionName);
+    }
+
+    /**
+     * Creates an instance of this class with the given name and action list.
+     * The action list is ignored.
+     * 
+     * 
+     * @param name
+     *            String the name of the new permission.
+     * @param actions
+     *            String ignored.
+     */
+    public RuntimePermission(String name, String actions) {
+        super(name, actions);
+    }
 }



Mime
View raw message