LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Cvs-checkins > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: cvs at opencores.org<cvs@o...>
    Date: Thu Oct 26 02:51:40 CEST 2006
    Subject: [cvs-checkins] MODIFIED: jop ...
    Top
    Date: 00/06/10 26:02:51

    Added: jop/java/target/src/jdk14/java/lang ArithmeticException.java
    Boolean.java Byte.java ClassCastException.java
    ClassNotFoundException.java Cloneable.java
    Comparable.java Double.java Float.java
    IllegalMonitorStateException.java
    IllegalStateException.java
    IllegalThreadStateException.java
    InstantiationException.java InternalError.java
    InterruptedException.java Iterable.java Math.java
    NegativeArraySizeException.java
    NoSuchFieldException.java
    NoSuchMethodException.java Number.java
    SecurityException.java Short.java Thread.java
    TypeNotPresentException.java
    UnsupportedOperationException.java
    VirtualMachineError.java
    Log:
    merge with Nelsons JDK and split into three source directories


    Revision Changes Path
    1.1 jop/java/target/src/jdk14/java/lang/ArithmeticException.java

    http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/ArithmeticException.java?rev=1.1&content-type=text/x-cvsweb-markup

    Index: ArithmeticException.java
    ===================================================================
    /* ArithmeticException.java -- exception thrown to indicate conditions
    like divide by zero.
    Copyright (C) 1998, 1999, 2001, 2002, 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.lang;

    /**
    * Thrown when a math error has occured, such as trying to divide an
    * integer by zero. For example:<br>
    * <pre>
    * int i = 0;
    * int j = 2 / i;
    * </pre>
    *
    * @author Brian Jones
    * @author Warren Levy (warrenl@c...)
    * @status updated to 1.4
    */
    public class ArithmeticException extends RuntimeException
    {
    /**
    * Compatible with JDK 1.0+.
    */
    private static final long serialVersionUID = 2256477558314496007L;

    /**
    * Create an exception without a message.
    */
    public ArithmeticException()
    {
    }

    /**
    * Create an exception with a message.
    *
    * @param s the message
    */
    public ArithmeticException(String s)
    { super(s); } } 1.1 jop/java/target/src/jdk14/java/lang/Boolean.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/Boolean.java?rev=1.1&content-type=text/x-cvsweb-markup Index: Boolean.java =================================================================== /* Boolean.java -- object wrapper for boolean Copyright (C) 1998, 2001, 2002, 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.lang; import java.io.Serializable; /** * Instances of class <code>Boolean</code> represent primitive * <code>boolean</code> values. * * @author Paul Fisher * @author Eric Blake (ebb9@e...) * @since 1.0 * @status updated to 1.5 */ public final class Boolean implements Serializable, Comparable { /** * Compatible with JDK 1.0.2+. */ private static final long serialVersionUID = -3665804199014368530L; /** * This field is a <code>Boolean</code> object representing the * primitive value <code>true</code>. This instance is returned * by the static <code>valueOf()</code> methods if they return * a <code>Boolean</code> representing <code>true</code>. */ public static final Boolean TRUE = new Boolean(true); /** * This field is a <code>Boolean</code> object representing the * primitive value <code>false</code>. This instance is returned * by the static <code>valueOf()</code> methods if they return * a <code>Boolean</code> representing <code>false</code>. */ public static final Boolean FALSE = new Boolean(false); /** * The primitive type <code>boolean</code> is represented by this * <code>Class</code> object. * * @since 1.1 */ // public static final Class TYPE = VMClassLoader.getPrimitiveClass('Z'); /** * The immutable value of this Boolean. * @serial the wrapped value */ private final boolean value; /** * Create a <code>Boolean</code> object representing the value of the * argument <code>value</code>. In general the use of the static * method <code>valueof(boolean)</code> is more efficient since it will * not create a new object. * * @param value the primitive value of this <code>Boolean</code> * @see #valueOf(boolean) */ public Boolean(boolean value) { this.value = value; } /** * Creates a <code>Boolean</code> object representing the primitive * <code>true</code> if and only if <code>s</code> matches * the string "true" ignoring case, otherwise the object will represent * the primitive <code>false</code>. In general the use of the static * method <code>valueof(String)</code> is more efficient since it will * not create a new object. * * @param s the <code>String</code> representation of <code>true</code> * or false */ public Boolean(String s) { value = "true".equalsIgnoreCase(s); } /** * Return the primitive <code>boolean</code> value of this * <code>Boolean</code> object. * * @return true or false, depending on the value of this Boolean */ public boolean booleanValue() { return value; } /** * Returns the Boolean <code>TRUE</code> if the given boolean is * <code>true</code>, otherwise it will return the Boolean * <code>FALSE</code>. * * @param b the boolean to wrap * @return the wrapper object * @see #TRUE * @see #FALSE * @since 1.4 */ public static Boolean valueOf(boolean b) { return b ? TRUE : FALSE; } /** * Returns the Boolean <code>TRUE</code> if and only if the given * String is equal, ignoring case, to the the String "true", otherwise * it will return the Boolean <code>FALSE</code>. * * @param s the string to convert * @return a wrapped boolean from the string */ public static Boolean valueOf(String s) { return "true".equalsIgnoreCase(s) ? TRUE : FALSE; } /** * Returns "true" if the value of the give boolean is <code>true</code> and * returns "false" if the value of the given boolean is <code>false</code>. * * @param b the boolean to convert * @return the string representation of the boolean * @since 1.4 */ public static String toString(boolean b) { return b ? "true" : "false"; } /** * Returns "true" if the value of this object is <code>true</code> and * returns "false" if the value of this object is <code>false</code>. * * @return the string representation of this */ public String toString() { return value ? "true" : "false"; } /** * Returns the integer <code>1231</code> if this object represents * the primitive <code>true</code> and the integer <code>1237</code> * otherwise. * * @return the hash code */ public int hashCode() { return value ? 1231 : 1237; } /** * If the <code>obj</code> is an instance of <code>Boolean</code> and * has the same primitive value as this object then <code>true</code> * is returned. In all other cases, including if the <code>obj</code> * is <code>null</code>, <code>false</code> is returned. * * @param obj possibly an instance of any <code>Class</code> * @return true if <code>obj</code> equals this */ public boolean equals(Object obj) { return obj instanceof Boolean && value == ((Boolean) obj).value; } /** * If the value of the system property <code>name</code> matches * "true" ignoring case then the function returns <code>true</code>. * * @param name the property name to look up * @return true if the property resulted in "true" * @throws SecurityException if accessing the system property is forbidden * @see System#getProperty(String) */ public static boolean getBoolean(String name) { if (name == null || "".equals(name)) return false; return "true".equalsIgnoreCase(System.getProperty(name)); } /** * Compares this Boolean to another. * * @param other the Boolean to compare this Boolean to * @return 0 if both Booleans represent the same value, a positive number * if this Boolean represents true and the other false, and a negative * number otherwise. * @since 1.5 */ public int compareTo(Boolean other) { return value == other.value ? 0 : (value ? 1 : -1); } /** * Bridge method */ public int compareTo(Object other) { return compareTo((Boolean)other); } /** * If the String argument is "true", ignoring case, return true. * Otherwise, return false. * * @param b String to parse * @since 1.5 */ public static boolean parseBoolean(String b) { return "true".equalsIgnoreCase(b) ? true : false; } } 1.1 jop/java/target/src/jdk14/java/lang/Byte.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/Byte.java?rev=1.1&content-type=text/x-cvsweb-markup Index: Byte.java =================================================================== /* Byte.java -- object wrapper for byte Copyright (C) 1998, 2001, 2002, 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.lang; /** * Instances of class <code>Byte</code> represent primitive <code>byte</code> * values. * * Additionally, this class provides various helper functions and variables * useful to bytes. * * @author Paul Fisher * @author John Keiser * @author Per Bothner * @author Eric Blake (ebb9@e...) * @since 1.1 * @status updated to 1.5 */ public final class Byte extends Number implements Comparable { /** * Compatible with JDK 1.1+. */ private static final long serialVersionUID = -7183698231559129828L; /** * The minimum value a <code>byte</code> can represent is -128 (or * -2<sup>7</sup>). */ public static final byte MIN_VALUE = -128; /** * The maximum value a <code>byte</code> can represent is 127 (or * 2<sup>7</sup> - 1). */ public static final byte MAX_VALUE = 127; /** * The primitive type <code>byte</code> is represented by this * <code>Class</code> object. */ // public static final Class TYPE = VMClassLoader.getPrimitiveClass('B'); /** * The number of bits needed to represent a <code>byte</code>. * @since 1.5 */ public static final int SIZE = 8; // This caches Byte values, and is used by boxing conversions via // valueOf(). We're required to cache all possible values here. private static Byte[] byteCache = new Byte[MAX_VALUE - MIN_VALUE + 1]; /** * The immutable value of this Byte. * * @serial the wrapped byte */ private final byte value; /** * Create a <code>Byte</code> object representing the value of the * <code>byte</code> argument. * * @param value the value to use */ public Byte(byte value) { this.value = value; } /** * Create a <code>Byte</code> object representing the value specified * by the <code>String</code> argument * * @param s the string to convert * @throws NumberFormatException if the String does not contain a byte * @see #valueOf(String) */ public Byte(String s) { value = parseByte(s, 10); } /** * Converts the <code>byte</code> to a <code>String</code> and assumes * a radix of 10. * * @param b the <code>byte</code> to convert to <code>String</code> * @return the <code>String</code> representation of the argument */ public static String toString(byte b) { throw new Error("NYI"); // return String.valueOf(b); } /** * Converts the specified <code>String</code> into a <code>byte</code>. * This function assumes a radix of 10. * * @param s the <code>String</code> to convert * @return the <code>byte</code> value of <code>s</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> * @see #parseByte(String) */ public static byte parseByte(String s) { return parseByte(s, 10); } /** * Converts the specified <code>String</code> into an <code>int</code> * using the specified radix (base). The string must not be <code>null</code> * or empty. It may begin with an optional '-', which will negate the answer, * provided that there are also valid digits. Each digit is parsed as if by * <code>Character.digit(d, radix)</code>, and must be in the range * <code>0</code> to <code>radix - 1</code>. Finally, the result must be * within <code>MIN_VALUE</code> to <code>MAX_VALUE</code>, inclusive. * Unlike Double.parseDouble, you may not have a leading '+'. * * @param s the <code>String</code> to convert * @param radix the radix (base) to use in the conversion * @return the <code>String</code> argument converted to <code>byte</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> */ public static byte parseByte(String s, int radix) { throw new Error("NYI"); // int i = Integer.parseInt(s, radix, false); // if ((byte) i != i) // throw new NumberFormatException(); // return (byte) i; } /** * Creates a new <code>Byte</code> object using the <code>String</code> * and specified radix (base). * * @param s the <code>String</code> to convert * @param radix the radix (base) to convert with * @return the new <code>Byte</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> * @see #parseByte(String, int) */ public static Byte valueOf(String s, int radix) { return new Byte(parseByte(s, radix)); } /** * Creates a new <code>Byte</code> object using the <code>String</code>, * assuming a radix of 10. * * @param s the <code>String</code> to convert * @return the new <code>Byte</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> * @see #Byte(String) * @see #parseByte(String) */ public static Byte valueOf(String s) { return new Byte(parseByte(s, 10)); } /** * Returns a <code>Byte</code> object wrapping the value. * In contrast to the <code>Byte</code> constructor, this method * will cache some values. It is used by boxing conversion. * * @param val the value to wrap * @return the <code>Byte</code> * * @since 1.5 */ public static Byte valueOf(byte val) { synchronized (byteCache) { if (byteCache[val - MIN_VALUE] == null) byteCache[val - MIN_VALUE] = new Byte(val); return byteCache[val - MIN_VALUE]; } } /** * Convert the specified <code>String</code> into a <code>Byte</code>. * The <code>String</code> may represent decimal, hexadecimal, or * octal numbers. * * <p>The extended BNF grammar is as follows:<br> * <pre> * <em>DecodableString</em>: * ( [ <code>-</code> ] <em>DecimalNumber</em> ) * | ( [ <code>-</code> ] ( <code>0x</code> | <code>0X</code> * | <code>#</code> ) { <em>HexDigit</em> }+ ) * | ( [ <code>-</code> ] <code>0</code> { <em>OctalDigit</em> } ) * <em>DecimalNumber</em>: * <em>DecimalDigit except '0'</em> { <em>DecimalDigit</em> } * <em>DecimalDigit</em>: * <em>Character.digit(d, 10) has value 0 to 9</em> * <em>OctalDigit</em>: * <em>Character.digit(d, 8) has value 0 to 7</em> * <em>DecimalDigit</em>: * <em>Character.digit(d, 16) has value 0 to 15</em> * </pre> * Finally, the value must be in the range <code>MIN_VALUE</code> to * <code>MAX_VALUE</code>, or an exception is thrown. * * @param s the <code>String</code> to interpret * @return the value of the String as a <code>Byte</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>byte</code> * @throws NullPointerException if <code>s</code> is null * @see Integer#decode(String) */ public static Byte decode(String s) { throw new Error("NYI"); // int i = Integer.parseInt(s, 10, true); // if ((byte) i != i) // throw new NumberFormatException(); // return new Byte((byte) i); } /** * Return the value of this <code>Byte</code>. * * @return the byte value */ public byte byteValue() { return value; } /** * Return the value of this <code>Byte</code> as a <code>short</code>. * * @return the short value */ public short shortValue() { return value; } /** * Return the value of this <code>Byte</code> as an <code>int</code>. * * @return the int value */ public int intValue() { return value; } /** * Return the value of this <code>Byte</code> as a <code>long</code>. * * @return the long value */ public long longValue() { return value; } /** * Return the value of this <code>Byte</code> as a <code>float</code>. * * @return the float value */ public float floatValue() { return value; } /** * Return the value of this <code>Byte</code> as a <code>double</code>. * * @return the double value */ public double doubleValue() { return value; } /** * Converts the <code>Byte</code> value to a <code>String</code> and * assumes a radix of 10. * * @return the <code>String</code> representation of this <code>Byte</code> * @see Integer#toString() */ public String toString() { throw new Error("NYI"); // return String.valueOf(value); } /** * Return a hashcode representing this Object. <code>Byte</code>'s hash * code is simply its value. * * @return this Object's hash code */ public int hashCode() { return value; } /** * Returns <code>true</code> if <code>obj</code> is an instance of * <code>Byte</code> and represents the same byte value. * * @param obj the object to compare * @return whether these Objects are semantically equal */ public boolean equals(Object obj) { return obj instanceof Byte && value == ((Byte) obj).value; } /** * Compare two Bytes numerically by comparing their <code>byte</code> values. * The result is positive if the first is greater, negative if the second * is greater, and 0 if the two are equal. * * @param b the Byte to compare * @return the comparison * @since 1.2 */ public int compareTo(Byte b) { return value - b.value; } /** * Behaves like <code>compareTo(Byte)</code> unless the Object * is not a <code>Byte</code>. * * @param o the object to compare * @return the comparison * @throws ClassCastException if the argument is not a <code>Byte</code> * @see #compareTo(Byte) * @see Comparable * @since 1.2 */ public int compareTo(Object o) { return compareTo((Byte) o); } } 1.1 jop/java/target/src/jdk14/java/lang/ClassCastException.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/ClassCastException.java?rev=1.1&content-type=text/x-cvsweb-markup Index: ClassCastException.java =================================================================== /* ClassCastException.java -- exception thrown on bad cast Copyright (C) 1998, 1999, 2001, 2002, 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.lang; /** * Thrown when an attempt is made to cast an object which is not of the * appropriate runtime type. For example:<br> * <pre> * Object o = new Vector(); * String s = (String) o; * </pre> * * @author Brian Jones * @author Warren Levy (warrenl@c...) * @status updated to 1.4 */ public class ClassCastException extends RuntimeException { /** * Compatible with JDK 1.0+. */ private static final long serialVersionUID = -9223365651070458532L; /** * Create an exception without a message. */ public ClassCastException() { } /** * Create an exception with a message. * * @param s the message */ public ClassCastException(String s) { super(s); } } 1.1 jop/java/target/src/jdk14/java/lang/ClassNotFoundException.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/ClassNotFoundException.java?rev=1.1&content-type=text/x-cvsweb-markup Index: ClassNotFoundException.java =================================================================== /* ClassNotFoundException.java -- thrown when class definition cannot be found Copyright (C) 1998, 2002, 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.lang; /** * Thrown when a class is requested by reflection, but the class definition * cannot be found. This exception is often chained from another Throwable. * * @author Brian Jones * @author Eric Blake (ebb9@e...) * @see Class#forName(String) * @see ClassLoader#findSystemClass(String) * @see ClassLoader#loadClass(String, boolean) * @status updated to 1.4 */ public class ClassNotFoundException extends Exception { /** * Compatible with JDK 1.0+. */ private static final long serialVersionUID = 9176873029745254542L; /** * The cause of this exception (duplicates the one stored in Throwable). * * @serial the exception cause * @since 1.2 */ private final Throwable ex; /** * Create an exception without a message. Note that this initializes the * cause to null. */ public ClassNotFoundException() { this(null); } /** * Create an exception with a message. Note that this initializes the * cause to null. * * @param s the message */ public ClassNotFoundException(String s) { super(s); ex = null; } /** * Create an exception with a message and chain it to the exception * which occurred while loading the class. * * @param s the message * @param ex the chained exception * @since 1.2 */ public ClassNotFoundException(String s, Throwable ex) { super(s, ex); this.ex = ex; } /** * Returns the exception which occurred while loading the class, * otherwise returns null. This is a legacy method; the preferred choice * now is {@link Throwable#getCause()}. * * @return the cause of this exception * @since 1.2 */ public Throwable getException() { return ex; } /** * Returns the exception which occurred while loading the class, * otherwise returns null. * * @return the cause of this exception * @since 1.4 */ public Throwable getCause() { return ex; } } 1.1 jop/java/target/src/jdk14/java/lang/Cloneable.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/Cloneable.java?rev=1.1&content-type=text/x-cvsweb-markup Index: Cloneable.java =================================================================== /* Cloneable.java -- Interface for marking objects cloneable by Object.clone() Copyright (C) 1998, 1999, 2001, 2002, 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.lang; /** * This interface should be implemented by classes wishing to * support of override <code>Object.clone()</code>. The default * behaviour of <code>clone()</code> performs a shallow copy, but * subclasses often change this to perform a deep copy. Therefore, * it is a good idea to document how deep your clone will go. * If <code>clone()</code> is called on an object which does not * implement this interface, a <code>CloneNotSupportedException</code> * will be thrown. * * <p>This interface is simply a tagging interface; it carries no * requirements on methods to implement. However, it is typical for * a Cloneable class to implement at least <code>equals</code>, * <code>hashCode</code>, and <code>clone</code>, sometimes * increasing the accessibility of clone to be public. The typical * implementation of <code>clone</code> invokes <code>super.clone()</code> * rather than a constructor, but this is not a requirement. * * <p>If an object that implement Cloneable should not be cloned, * simply override the <code>clone</code> method to throw a * <code>CloneNotSupportedException</code>. * * <p>All array types implement Cloneable, and have a public * <code>clone</code> method that will never fail with a * <code>CloneNotSupportedException</code>. * * @author Paul Fisher * @author Eric Blake (ebb9@e...) * @author Warren Levy (warrenl@c...) * @see Object#clone() * @see CloneNotSupportedException * @since 1.0 * @status updated to 1.4 */ public interface Cloneable { // Tagging interface only. } 1.1 jop/java/target/src/jdk14/java/lang/Comparable.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/Comparable.java?rev=1.1&content-type=text/x-cvsweb-markup Index: Comparable.java =================================================================== /* Comparable.java -- Interface for comparaing objects to obtain an ordering Copyright (C) 1998, 1999, 2001, 2002, 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.lang; /** * Interface for objects that can be ordering among other objects. The * ordering can be <em>total</em>, such that two objects only compare equal * if they are also equal by the equals method, or <em>partial</em> such * that this is not necessarily true. For example, a case-sensitive * dictionary order comparison of Strings is total, but if it is * case-insensitive it is partial, because "abc" and "ABC" compare as * equal even though "abc".equals("ABC") returns false. However, if you use * a partial ordering, it is a good idea to document your class as * "inconsistent with equals", because the behavior of your class in a * SortedMap will be different than in a HashMap. * * <p>Lists, arrays, and sets of objects that implement this interface can * be sorted automatically, without the need for an explicit * {@link java.util.Comparator}. Note that <code>e1.compareTo(null)</code> * should throw an Exception; as should comparison between incompatible * classes. * * @author Geoff Berry * @author Warren Levy (warrenl@c...) * @see java.util.Comparator * @see java.util.Collections#sort(java.util.List) * @see java.util.Arrays#sort(Object[]) * @see java.util.SortedSet * @see java.util.SortedMap * @see java.util.TreeSet * @see java.util.TreeMap * @since 1.2 * @status updated to 1.4 */ public interface Comparable { /** * Compares this object with another, and returns a numerical result based * on the comparison. If the result is negative, this object sorts less * than the other; if 0, the two are equal, and if positive, this object * sorts greater than the other. To translate this into boolean, simply * perform <code>o1.compareTo(o2) <em>&lt;op&gt;</em> 0</code>, where op * is one of &lt;, &lt;=, =, !=, &gt;, or &gt;=. * * <p>You must make sure that the comparison is mutual, ie. * <code>sgn(x.compareTo(y)) == -sgn(y.compareTo(x))</code> (where sgn() is * defined as -1, 0, or 1 based on the sign). This includes throwing an * exception in either direction if the two are not comparable; hence, * <code>compareTo(null)</code> should always throw an Exception. * * <p>You should also ensure transitivity, in two forms: * <code>x.compareTo(y) &gt; 0 && y.compareTo(z) &gt; 0</code> implies * <code>x.compareTo(z) &gt; 0</code>; and <code>x.compareTo(y) == 0</code> * implies <code>x.compareTo(z) == y.compareTo(z)</code>. * * @param o the object to be compared * @return an integer describing the comparison * @throws NullPointerException if o is null * @throws ClassCastException if o cannot be compared */ int compareTo(Object o); } 1.1 jop/java/target/src/jdk14/java/lang/Double.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/Double.java?rev=1.1&content-type=text/x-cvsweb-markup Index: Double.java =================================================================== /* Double.java -- object wrapper for double Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 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.lang; import com.jopdesign.sys.Native; /** * Instances of class <code>Double</code> represent primitive * <code>double</code> values. * * Additionally, this class provides various helper functions and variables * related to doubles. * * @author Paul Fisher * @author Andrew Haley (aph@c...) * @author Eric Blake (ebb9@e...) * @since 1.0 * @status updated to 1.4 */ public final class Double extends Number implements Comparable { /** * Compatible with JDK 1.0+. */ private static final long serialVersionUID = -9172774392245257468L; /** * The maximum positive value a <code>double</code> may represent * is 1.7976931348623157e+308. */ public static final double MAX_VALUE = 1.7976931348623157e+308; /** * The minimum positive value a <code>double</code> may represent * is 5e-324. */ public static final double MIN_VALUE = 5e-324; /** * The value of a double representation -1.0/0.0, negative * infinity. */ public static final double NEGATIVE_INFINITY = -1.0 / 0.0; /** * The value of a double representing 1.0/0.0, positive infinity. */ public static final double POSITIVE_INFINITY = 1.0 / 0.0; /** * All IEEE 754 values of NaN have the same value in Java. */ public static final double NaN = 0.0 / 0.0; /** * The number of bits needed to represent a <code>double</code>. * @since 1.5 */ public static final int SIZE = 64; /** * The primitive type <code>double</code> is represented by this * <code>Class</code> object. * @since 1.1 */ // public static final Class TYPE = VMClassLoader.getPrimitiveClass('D'); /** * The immutable value of this Double. * * @serial the wrapped double */ private final double value; /** * Create a <code>Double</code> from the primitive <code>double</code> * specified. * * @param value the <code>double</code> argument */ public Double(double value) { this.value = value; } /** * Create a <code>Double</code> from the specified <code>String</code>. * This method calls <code>Double.parseDouble()</code>. * * @param s the <code>String</code> to convert * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>double</code> * @throws NullPointerException if <code>s</code> is null * @see #parseDouble(String) */ public Double(String s) { value = parseDouble(s); } /** * Convert the <code>double</code> to a <code>String</code>. * Floating-point string representation is fairly complex: here is a * rundown of the possible values. "<code>[-]</code>" indicates that a * negative sign will be printed if the value (or exponent) is negative. * "<code>&lt;number&gt;</code>" means a string of digits ('0' to '9'). * "<code>&lt;digit&gt;</code>" means a single digit ('0' to '9').<br> * * <table border=1> * <tr><th>Value of Double</th><th>String Representation</th></tr> * <tr><td>[+-] 0</td> <td><code>[-]0.0</code></td></tr> * <tr><td>Between [+-] 10<sup>-3</sup> and 10<sup>7</sup>, exclusive</td> * <td><code>[-]number.number</code></td></tr> * <tr><td>Other numeric value</td> * <td><code>[-]&lt;digit&gt;.&lt;number&gt; * E[-]&lt;number&gt;</code></td></tr> * <tr><td>[+-] infinity</td> <td><code>[-]Infinity</code></td></tr> * <tr><td>NaN</td> <td><code>NaN</code></td></tr> * </table> * * Yes, negative zero <em>is</em> a possible value. Note that there is * <em>always</em> a <code>.</code> and at least one digit printed after * it: even if the number is 3, it will be printed as <code>3.0</code>. * After the ".", all digits will be printed except trailing zeros. The * result is rounded to the shortest decimal number which will parse back * to the same double. * * <p>To create other output formats, use {@link java.text.NumberFormat}. * * @XXX specify where we are not in accord with the spec. * * @param d the <code>double</code> to convert * @return the <code>String</code> representing the <code>double</code> */ public static String toString(double d) { // return VMDouble.toString(d, false); return "NYI"; } /** * Convert a double value to a hexadecimal string. This converts as * follows: * <ul> * <li> A NaN value is converted to the string "NaN". * <li> Positive infinity is converted to the string "Infinity". * <li> Negative infinity is converted to the string "-Infinity". * <li> For all other values, the first character of the result is '-' * if the value is negative. This is followed by '0x1.' if the * value is normal, and '0x0.' if the value is denormal. This is * then followed by a (lower-case) hexadecimal representation of the * mantissa, with leading zeros as required for denormal values. * The next character is a 'p', and this is followed by a decimal * representation of the unbiased exponent. * </ul> * @param d the double value * @return the hexadecimal string representation * @since 1.5 */ // public static String toHexString(double d) // { // if (isNaN(d)) // return "NaN"; // if (isInfinite(d)) // return d < 0 ? "-Infinity" : "Infinity"; // // long bits = doubleToLongBits(d); // StringBuilder result = new StringBuilder(); // // if (bits < 0) // result.append('-'); // result.append("0x"); // // final int mantissaBits = 52; // final int exponentBits = 11; // long mantMask = (1L << mantissaBits) - 1; // long mantissa = bits & mantMask; // long expMask = (1L << exponentBits) - 1; // long exponent = (bits >>> mantissaBits) & expMask; // // result.append(exponent == 0 ? '0' : '1'); // result.append('.'); // result.append(Long.toHexString(mantissa)); // if (exponent == 0 && mantissa != 0) // { // // Treat denormal specially by inserting '0's to make // // the length come out right. The constants here are // // to account for things like the '0x'. // int offset = 4 + ((bits < 0) ? 1 : 0); // // The silly +3 is here to keep the code the same between // // the Float and Double cases. In Float the value is // // not a multiple of 4. // int desiredLength = offset + (mantissaBits + 3) / 4; // while (result.length() < desiredLength) // result.insert(offset, '0'); // } // result.append('p'); // if (exponent == 0 && mantissa == 0) // { // // Zero, so do nothing special. // } // else // { // // Apply bias. // boolean denormal = exponent == 0; // exponent -= (1 << (exponentBits - 1)) - 1; // // Handle denormal. // if (denormal) // ++exponent; // } // // result.append(Long.toString(exponent)); // return result.toString(); // } /** * Returns a <code>Double</code> object wrapping the value. * In contrast to the <code>Double</code> constructor, this method * may cache some values. It is used by boxing conversion. * * @param val the value to wrap * @return the <code>Double</code> * * @since 1.5 */ public static Double valueOf(double val) { // We don't actually cache, but we could. return new Double(val); } /** * Create a new <code>Double</code> object using the <code>String</code>. * * @param s the <code>String</code> to convert * @return the new <code>Double</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>double</code> * @throws NullPointerException if <code>s</code> is null. * @see #parseDouble(String) */ public static Double valueOf(String s) { return new Double(parseDouble(s)); } /** * Parse the specified <code>String</code> as a <code>double</code>. The * extended BNF grammar is as follows:<br> * <pre> * <em>DecodableString</em>: * ( [ <code>-</code> | <code>+</code> ] <code>NaN</code> ) * | ( [ <code>-</code> | <code>+</code> ] <code>Infinity</code> ) * | ( [ <code>-</code> | <code>+</code> ] <em>FloatingPoint</em> * [ <code>f</code> | <code>F</code> | <code>d</code> * | <code>D</code>] ) * <em>FloatingPoint</em>: * ( { <em>Digit</em> }+ [ <code>.</code> { <em>Digit</em> } ] * [ <em>Exponent</em> ] ) * | ( <code>.</code> { <em>Digit</em> }+ [ <em>Exponent</em> ] ) * <em>Exponent</em>: * ( ( <code>e</code> | <code>E</code> ) * [ <code>-</code> | <code>+</code> ] { <em>Digit</em> }+ ) * <em>Digit</em>: <em><code>'0'</code> through <code>'9'</code></em> * </pre> * * <p>NaN and infinity are special cases, to allow parsing of the output * of toString. Otherwise, the result is determined by calculating * <em>n * 10<sup>exponent</sup></em> to infinite precision, then rounding * to the nearest double. Remember that many numbers cannot be precisely * represented in floating point. In case of overflow, infinity is used, * and in case of underflow, signed zero is used. Unlike Integer.parseInt, * this does not accept Unicode digits outside the ASCII range. * * <p>If an unexpected character is found in the <code>String</code>, a * <code>NumberFormatException</code> will be thrown. Leading and trailing * 'whitespace' is ignored via <code>String.trim()</code>, but spaces * internal to the actual number are not allowed. * * <p>To parse numbers according to another format, consider using * {@link java.text.NumberFormat}. * * @XXX specify where/how we are not in accord with the spec. * * @param str the <code>String</code> to convert * @return the <code>double</code> value of <code>s</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>double</code> * @throws NullPointerException if <code>s</code> is null * @see #MIN_VALUE * @see #MAX_VALUE * @see #POSITIVE_INFINITY * @see #NEGATIVE_INFINITY * @since 1.2 */ public static double parseDouble(String str) { // return VMDouble.parseDouble(str); System.out.println("NYI"); throw new RuntimeException(); } /** * Return <code>true</code> if the <code>double</code> has the same * value as <code>NaN</code>, otherwise return <code>false</code>. * * @param v the <code>double</code> to compare * @return whether the argument is <code>NaN</code>. */ public static boolean isNaN(double v) { // This works since NaN != NaN is the only reflexive inequality // comparison which returns true. return v != v; } /** * Return <code>true</code> if the <code>double</code> has a value * equal to either <code>NEGATIVE_INFINITY</code> or * <code>POSITIVE_INFINITY</code>, otherwise return <code>false</code>. * * @param v the <code>double</code> to compare * @return whether the argument is (-/+) infinity. */ public static boolean isInfinite(double v) { return v == POSITIVE_INFINITY || v == NEGATIVE_INFINITY; } /** * Return <code>true</code> if the value of this <code>Double</code> * is the same as <code>NaN</code>, otherwise return <code>false</code>. * * @return whether this <code>Double</code> is <code>NaN</code> */ public boolean isNaN() { return isNaN(value); } /** * Return <code>true</code> if the value of this <code>Double</code> * is the same as <code>NEGATIVE_INFINITY</code> or * <code>POSITIVE_INFINITY</code>, otherwise return <code>false</code>. * * @return whether this <code>Double</code> is (-/+) infinity */ public boolean isInfinite() { return isInfinite(value); } /** * Convert the <code>double</code> value of this <code>Double</code> * to a <code>String</code>. This method calls * <code>Double.toString(double)</code> to do its dirty work. * * @return the <code>String</code> representation * @see #toString(double) */ public String toString() { return toString(value); } /** * Return the value of this <code>Double</code> as a <code>byte</code>. * * @return the byte value * @since 1.1 */ public byte byteValue() { return (byte) value; } /** * Return the value of this <code>Double</code> as a <code>short</code>. * * @return the short value * @since 1.1 */ public short shortValue() { return (short) value; } /** * Return the value of this <code>Double</code> as an <code>int</code>. * * @return the int value */ public int intValue() { return (int) value; } /** * Return the value of this <code>Double</code> as a <code>long</code>. * * @return the long value */ public long longValue() { return (long) value; } /** * Return the value of this <code>Double</code> as a <code>float</code>. * * @return the float value */ public float floatValue() { return (float) value; } /** * Return the value of this <code>Double</code>. * * @return the double value */ public double doubleValue() { return value; } /** * Return a hashcode representing this Object. <code>Double</code>'s hash * code is calculated by:<br> * <code>long v = Double.doubleToLongBits(doubleValue());<br> * int hash = (int)(v^(v&gt;&gt;32))</code>. * * @return this Object's hash code * @see #doubleToLongBits(double) */ public int hashCode() { long v = doubleToLongBits(value); return (int) (v ^ (v >>> 32)); } /** * Returns <code>true</code> if <code>obj</code> is an instance of * <code>Double</code> and represents the same double value. Unlike comparing * two doubles with <code>==</code>, this treats two instances of * <code>Double.NaN</code> as equal, but treats <code>0.0</code> and * <code>-0.0</code> as unequal. * * <p>Note that <code>d1.equals(d2)</code> is identical to * <code>doubleToLongBits(d1.doubleValue()) == * doubleToLongBits(d2.doubleValue())</code>. * * @param obj the object to compare * @return whether the objects are semantically equal */ public boolean equals(Object obj) { if (! (obj instanceof Double)) return false; double d = ((Double) obj).value; // Avoid call to native method. However, some implementations, like gcj, // are better off using floatToIntBits(value) == floatToIntBits(f). // Check common case first, then check NaN and 0. if (value == d) return (value != 0) || (1 / value == 1 / d); return isNaN(value) && isNaN(d); } /** * Convert the double to the IEEE 754 floating-point "double format" bit * layout. Bit 63 (the most significant) is the sign bit, bits 62-52 * (masked by 0x7ff0000000000000L) represent the exponent, and bits 51-0 * (masked by 0x000fffffffffffffL) are the mantissa. This function * collapses all versions of NaN to 0x7ff8000000000000L. The result of this * function can be used as the argument to * <code>Double.longBitsToDouble(long)</code> to obtain the original * <code>double</code> value. * * @param value the <code>double</code> to convert * @return the bits of the <code>double</code> * @see #longBitsToDouble(long) */ public static long doubleToLongBits(double value) { // TODO: hanlde // TODO: handle NaN collapsing System.out.println("NYI"); return Native.toLong(value); } /** * Convert the double to the IEEE 754 floating-point "double format" bit * layout. Bit 63 (the most significant) is the sign bit, bits 62-52 * (masked by 0x7ff0000000000000L) represent the exponent, and bits 51-0 * (masked by 0x000fffffffffffffL) are the mantissa. This function * leaves NaN alone, rather than collapsing to a canonical value. The * result of this function can be used as the argument to * <code>Double.longBitsToDouble(long)</code> to obtain the original * <code>double</code> value. * * @param value the <code>double</code> to convert * @return the bits of the <code>double</code> * @see #longBitsToDouble(long) */ public static long doubleToRawLongBits(double value) { return Native.toLong(value); } /** * Convert the argument in IEEE 754 floating-point "double format" bit * layout to the corresponding float. Bit 63 (the most significant) is the * sign bit, bits 62-52 (masked by 0x7ff0000000000000L) represent the * exponent, and bits 51-0 (masked by 0x000fffffffffffffL) are the mantissa. * This function leaves NaN alone, so that you can recover the bit pattern * with <code>Double.doubleToRawLongBits(double)</code>. * * @param bits the bits to convert * @return the <code>double</code> represented by the bits * @see #doubleToLongBits(double) * @see #doubleToRawLongBits(double) */ public static double longBitsToDouble(long bits) { return Native.toDouble(bits); } /** * Compare two Doubles numerically by comparing their <code>double</code> * values. The result is positive if the first is greater, negative if the * second is greater, and 0 if the two are equal. However, this special * cases NaN and signed zero as follows: NaN is considered greater than * all other doubles, including <code>POSITIVE_INFINITY</code>, and positive * zero is considered greater than negative zero. * * @param d the Double to compare * @return the comparison * @since 1.2 */ public int compareTo(Double d) { return compare(value, d.value); } /** * Behaves like <code>compareTo(Double)</code> unless the Object * is not an <code>Double</code>. * * @param o the object to compare * @return the comparison * @throws ClassCastException if the argument is not a <code>Double</code> * @see #compareTo(Double) * @see Comparable * @since 1.2 */ public int compareTo(Object o) { return compare(value, ((Double) o).value); } /** * Behaves like <code>new Double(x).compareTo(new Double(y))</code>; in * other words this compares two doubles, special casing NaN and zero, * without the overhead of objects. * * @param x the first double to compare * @param y the second double to compare * @return the comparison * @since 1.4 */ public static int compare(double x, double y) { if (isNaN(x)) return isNaN(y) ? 0 : 1; if (isNaN(y)) return -1; // recall that 0.0 == -0.0, so we convert to infinites and try again if (x == 0 && y == 0) return (int) (1 / x - 1 / y); if (x == y) return 0; return x > y ? 1 : -1; } } 1.1 jop/java/target/src/jdk14/java/lang/Float.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/Float.java?rev=1.1&content-type=text/x-cvsweb-markup Index: Float.java =================================================================== /* Float.java -- object wrapper for float Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 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.lang; import com.jopdesign.sys.Native; /** * Instances of class <code>Float</code> represent primitive * <code>float</code> values. * * Additionally, this class provides various helper functions and variables * related to floats. * * @author Paul Fisher * @author Andrew Haley (aph@c...) * @author Eric Blake (ebb9@e...) * @since 1.0 * @status updated to 1.4 */ public final class Float extends Number implements Comparable { /** * Compatible with JDK 1.0+. */ private static final long serialVersionUID = -2671257302660747028L; /** * The maximum positive value a <code>double</code> may represent * is 3.4028235e+38f. */ public static final float MAX_VALUE = 3.4028235e+38f; /** * The minimum positive value a <code>float</code> may represent * is 1.4e-45. */ public static final float MIN_VALUE = 1.4e-45f; /** * The value of a float representation -1.0/0.0, negative infinity. */ public static final float NEGATIVE_INFINITY = -1.0f / 0.0f; /** * The value of a float representation 1.0/0.0, positive infinity. */ public static final float POSITIVE_INFINITY = 1.0f / 0.0f; /** * All IEEE 754 values of NaN have the same value in Java. */ public static final float NaN = 0.0f / 0.0f; /** * The primitive type <code>float</code> is represented by this * <code>Class</code> object. * @since 1.1 */ // public static final Class TYPE = VMClassLoader.getPrimitiveClass('F'); /** * The number of bits needed to represent a <code>float</code>. * @since 1.5 */ public static final int SIZE = 32; /** * The immutable value of this Float. * * @serial the wrapped float */ private final float value; /** * Create a <code>Float</code> from the primitive <code>float</code> * specified. * * @param value the <code>float</code> argument */ public Float(float value) { this.value = value; } /** * Create a <code>Float</code> from the primitive <code>double</code> * specified. * * @param value the <code>double</code> argument */ public Float(double value) { this.value = (float) value; } /** * Create a <code>Float</code> from the specified <code>String</code>. * This method calls <code>Float.parseFloat()</code>. * * @param s the <code>String</code> to convert * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>float</code> * @throws NullPointerException if <code>s</code> is null * @see #parseFloat(String) */ public Float(String s) { value = parseFloat(s); } /** * Convert the <code>float</code> to a <code>String</code>. * Floating-point string representation is fairly complex: here is a * rundown of the possible values. "<code>[-]</code>" indicates that a * negative sign will be printed if the value (or exponent) is negative. * "<code>&lt;number&gt;</code>" means a string of digits ('0' to '9'). * "<code>&lt;digit&gt;</code>" means a single digit ('0' to '9').<br> * * <table border=1> * <tr><th>Value of Float</th><th>String Representation</th></tr> * <tr><td>[+-] 0</td> <td><code>[-]0.0</code></td></tr> * <tr><td>Between [+-] 10<sup>-3</sup> and 10<sup>7</sup>, exclusive</td> * <td><code>[-]number.number</code></td></tr> * <tr><td>Other numeric value</td> * <td><code>[-]&lt;digit&gt;.&lt;number&gt; * E[-]&lt;number&gt;</code></td></tr> * <tr><td>[+-] infinity</td> <td><code>[-]Infinity</code></td></tr> * <tr><td>NaN</td> <td><code>NaN</code></td></tr> * </table> * * Yes, negative zero <em>is</em> a possible value. Note that there is * <em>always</em> a <code>.</code> and at least one digit printed after * it: even if the number is 3, it will be printed as <code>3.0</code>. * After the ".", all digits will be printed except trailing zeros. The * result is rounded to the shortest decimal number which will parse back * to the same float. * * <p>To create other output formats, use {@link java.text.NumberFormat}. * * @XXX specify where we are not in accord with the spec. * * @param f the <code>float</code> to convert * @return the <code>String</code> representing the <code>float</code> */ public static String toString(float f) { // return VMDouble.toString(f, true); return "NYI"; } /** * Convert a float value to a hexadecimal string. This converts as * follows: * <ul> * <li> A NaN value is converted to the string "NaN". * <li> Positive infinity is converted to the string "Infinity". * <li> Negative infinity is converted to the string "-Infinity". * <li> For all other values, the first character of the result is '-' * if the value is negative. This is followed by '0x1.' if the * value is normal, and '0x0.' if the value is denormal. This is * then followed by a (lower-case) hexadecimal representation of the * mantissa, with leading zeros as required for denormal values. * The next character is a 'p', and this is followed by a decimal * representation of the unbiased exponent. * </ul> * @param f the float value * @return the hexadecimal string representation * @since 1.5 */ // public static String toHexString(float f) // { // if (isNaN(f)) // return "NaN"; // if (isInfinite(f)) // return f < 0 ? "-Infinity" : "Infinity"; // // int bits = floatToIntBits(f); // StringBuilder result = new StringBuilder(); // // if (bits < 0) // result.append('-'); // result.append("0x"); // // final int mantissaBits = 23; // final int exponentBits = 8; // int mantMask = (1 << mantissaBits) - 1; // int mantissa = bits & mantMask; // int expMask = (1 << exponentBits) - 1; // int exponent = (bits >>> mantissaBits) & expMask; // // result.append(exponent == 0 ? '0' : '1'); // result.append('.'); // // For Float only, we have to adjust the mantissa. // mantissa <<= 1; // result.append(Integer.toHexString(mantissa)); // if (exponent == 0 && mantissa != 0) // { // // Treat denormal specially by inserting '0's to make // // the length come out right. The constants here are // // to account for things like the '0x'. // int offset = 4 + ((bits < 0) ? 1 : 0); // // The silly +3 is here to keep the code the same between // // the Float and Double cases. In Float the value is // // not a multiple of 4. // int desiredLength = offset + (mantissaBits + 3) / 4; // while (result.length() < desiredLength) // result.insert(offset, '0'); // } // result.append('p'); // if (exponent == 0 && mantissa == 0) // { // // Zero, so do nothing special. // } // else // { // // Apply bias. // boolean denormal = exponent == 0; // exponent -= (1 << (exponentBits - 1)) - 1; // // Handle denormal. // if (denormal) // ++exponent; // } // // result.append(Integer.toString(exponent)); // return result.toString(); // } /** * Creates a new <code>Float</code> object using the <code>String</code>. * * @param s the <code>String</code> to convert * @return the new <code>Float</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>float</code> * @throws NullPointerException if <code>s</code> is null * @see #parseFloat(String) */ public static Float valueOf(String s) { return new Float(parseFloat(s)); } /** * Returns a <code>Float</code> object wrapping the value. * In contrast to the <code>Float</code> constructor, this method * may cache some values. It is used by boxing conversion. * * @param val the value to wrap * @return the <code>Float</code> * * @since 1.5 */ public static Float valueOf(float val) { // We don't actually cache, but we could. return new Float(val); } /** * Parse the specified <code>String</code> as a <code>float</code>. The * extended BNF grammar is as follows:<br> * <pre> * <em>DecodableString</em>: * ( [ <code>-</code> | <code>+</code> ] <code>NaN</code> ) * | ( [ <code>-</code> | <code>+</code> ] <code>Infinity</code> ) * | ( [ <code>-</code> | <code>+</code> ] <em>FloatingPoint</em> * [ <code>f</code> | <code>F</code> | <code>d</code> * | <code>D</code>] ) * <em>FloatingPoint</em>: * ( { <em>Digit</em> }+ [ <code>.</code> { <em>Digit</em> } ] * [ <em>Exponent</em> ] ) * | ( <code>.</code> { <em>Digit</em> }+ [ <em>Exponent</em> ] ) * <em>Exponent</em>: * ( ( <code>e</code> | <code>E</code> ) * [ <code>-</code> | <code>+</code> ] { <em>Digit</em> }+ ) * <em>Digit</em>: <em><code>'0'</code> through <code>'9'</code></em> * </pre> * * <p>NaN and infinity are special cases, to allow parsing of the output * of toString. Otherwise, the result is determined by calculating * <em>n * 10<sup>exponent</sup></em> to infinite precision, then rounding * to the nearest float. Remember that many numbers cannot be precisely * represented in floating point. In case of overflow, infinity is used, * and in case of underflow, signed zero is used. Unlike Integer.parseInt, * this does not accept Unicode digits outside the ASCII range. * * <p>If an unexpected character is found in the <code>String</code>, a * <code>NumberFormatException</code> will be thrown. Leading and trailing * 'whitespace' is ignored via <code>String.trim()</code>, but spaces * internal to the actual number are not allowed. * * <p>To parse numbers according to another format, consider using * {@link java.text.NumberFormat}. * * @XXX specify where/how we are not in accord with the spec. * * @param str the <code>String</code> to convert * @return the <code>float</code> value of <code>s</code> * @throws NumberFormatException if <code>s</code> cannot be parsed as a * <code>float</code> * @throws NullPointerException if <code>s</code> is null * @see #MIN_VALUE * @see #MAX_VALUE * @see #POSITIVE_INFINITY * @see #NEGATIVE_INFINITY * @since 1.2 */ public static float parseFloat(String str) { // XXX Rounding parseDouble() causes some errors greater than 1 ulp from // the infinitely precise decimal. return (float) Double.parseDouble(str); } /** * Return <code>true</code> if the <code>float</code> has the same * value as <code>NaN</code>, otherwise return <code>false</code>. * * @param v the <code>float</code> to compare * @return whether the argument is <code>NaN</code> */ public static boolean isNaN(float v) { // This works since NaN != NaN is the only reflexive inequality // comparison which returns true. return v != v; } /** * Return <code>true</code> if the <code>float</code> has a value * equal to either <code>NEGATIVE_INFINITY</code> or * <code>POSITIVE_INFINITY</code>, otherwise return <code>false</code>. * * @param v the <code>float</code> to compare * @return whether the argument is (-/+) infinity */ public static boolean isInfinite(float v) { return v == POSITIVE_INFINITY || v == NEGATIVE_INFINITY; } /** * Return <code>true</code> if the value of this <code>Float</code> * is the same as <code>NaN</code>, otherwise return <code>false</code>. * * @return whether this <code>Float</code> is <code>NaN</code> */ public boolean isNaN() { return isNaN(value); } /** * Return <code>true</code> if the value of this <code>Float</code> * is the same as <code>NEGATIVE_INFINITY</code> or * <code>POSITIVE_INFINITY</code>, otherwise return <code>false</code>. * * @return whether this <code>Float</code> is (-/+) infinity */ public boolean isInfinite() { return isInfinite(value); } /** * Convert the <code>float</code> value of this <code>Float</code> * to a <code>String</code>. This method calls * <code>Float.toString(float)</code> to do its dirty work. * * @return the <code>String</code> representation * @see #toString(float) */ public String toString() { return toString(value); } /** * Return the value of this <code>Float</code> as a <code>byte</code>. * * @return the byte value * @since 1.1 */ public byte byteValue() { return (byte) value; } /** * Return the value of this <code>Float</code> as a <code>short</code>. * * @return the short value * @since 1.1 */ public short shortValue() { return (short) value; } /** * Return the value of this <code>Integer</code> as an <code>int</code>. * * @return the int value */ public int intValue() { return (int) value; } /** * Return the value of this <code>Integer</code> as a <code>long</code>. * * @return the long value */ public long longValue() { return (long) value; } /** * Return the value of this <code>Float</code>. * * @return the float value */ public float floatValue() { return value; } /** * Return the value of this <code>Float</code> as a <code>double</code> * * @return the double value */ public double doubleValue() { return value; } /** * Return a hashcode representing this Object. <code>Float</code>'s hash * code is calculated by calling <code>floatToIntBits(floatValue())</code>. * * @return this Object's hash code * @see #floatToIntBits(float) */ public int hashCode() { return floatToIntBits(value); } /** * Returns <code>true</code> if <code>obj</code> is an instance of * <code>Float</code> and represents the same float value. Unlike comparing * two floats with <code>==</code>, this treats two instances of * <code>Float.NaN</code> as equal, but treats <code>0.0</code> and * <code>-0.0</code> as unequal. * * <p>Note that <code>f1.equals(f2)</code> is identical to * <code>floatToIntBits(f1.floatValue()) == * floatToIntBits(f2.floatValue())</code>. * * @param obj the object to compare * @return whether the objects are semantically equal */ public boolean equals(Object obj) { if (! (obj instanceof Float)) return false; float f = ((Float) obj).value; // Avoid call to native method. However, some implementations, like gcj, // are better off using floatToIntBits(value) == floatToIntBits(f). // Check common case first, then check NaN and 0. if (value == f) return (value != 0) || (1 / value == 1 / f); return isNaN(value) && isNaN(f); } /** * Convert the float to the IEEE 754 floating-point "single format" bit * layout. Bit 31 (the most significant) is the sign bit, bits 30-23 * (masked by 0x7f800000) represent the exponent, and bits 22-0 * (masked by 0x007fffff) are the mantissa. This function collapses all * versions of NaN to 0x7fc00000. The result of this function can be used * as the argument to <code>Float.intBitsToFloat(int)</code> to obtain the * original <code>float</code> value. * * @param value the <code>float</code> to convert * @return the bits of the <code>float</code> * @see #intBitsToFloat(int) */ public static int floatToIntBits(float value) { // TODO: handle NaN collapsing System.out.println("NYI"); return Native.toInt(value); // return VMFloat.floatToIntBits(value); } /** * Convert the float to the IEEE 754 floating-point "single format" bit * layout. Bit 31 (the most significant) is the sign bit, bits 30-23 * (masked by 0x7f800000) represent the exponent, and bits 22-0 * (masked by 0x007fffff) are the mantissa. This function leaves NaN alone, * rather than collapsing to a canonical value. The result of this function * can be used as the argument to <code>Float.intBitsToFloat(int)</code> to * obtain the original <code>float</code> value. * * @param value the <code>float</code> to convert * @return the bits of the <code>float</code> * @see #intBitsToFloat(int) */ public static int floatToRawIntBits(float value) { return Native.toInt(value); } /** * Convert the argument in IEEE 754 floating-point "single format" bit * layout to the corresponding float. Bit 31 (the most significant) is the * sign bit, bits 30-23 (masked by 0x7f800000) represent the exponent, and * bits 22-0 (masked by 0x007fffff) are the mantissa. This function leaves * NaN alone, so that you can recover the bit pattern with * <code>Float.floatToRawIntBits(float)</code>. * * @param bits the bits to convert * @return the <code>float</code> represented by the bits * @see #floatToIntBits(float) * @see #floatToRawIntBits(float) */ public static float intBitsToFloat(int bits) { return Native.toFloat(bits); } /** * Compare two Floats numerically by comparing their <code>float</code> * values. The result is positive if the first is greater, negative if the * second is greater, and 0 if the two are equal. However, this special * cases NaN and signed zero as follows: NaN is considered greater than * all other floats, including <code>POSITIVE_INFINITY</code>, and positive * zero is considered greater than negative zero. * * @param f the Float to compare * @return the comparison * @since 1.2 */ public int compareTo(Float f) { return compare(value, f.value); } /** * Behaves like <code>compareTo(Float)</code> unless the Object * is not an <code>Float</code>. * * @param o the object to compare * @return the comparison * @throws ClassCastException if the argument is not a <code>Float</code> * @see #compareTo(Float) * @see Comparable * @since 1.2 */ public int compareTo(Object o) { return compare(value, ((Float) o).value); } /** * Behaves like <code>new Float(x).compareTo(new Float(y))</code>; in * other words this compares two floats, special casing NaN and zero, * without the overhead of objects. * * @param x the first float to compare * @param y the second float to compare * @return the comparison * @since 1.4 */ public static int compare(float x, float y) { if (isNaN(x)) return isNaN(y) ? 0 : 1; if (isNaN(y)) return -1; // recall that 0.0 == -0.0, so we convert to infinities and try again if (x == 0 && y == 0) return (int) (1 / x - 1 / y); if (x == y) return 0; return x > y ? 1 : -1; } } 1.1 jop/java/target/src/jdk14/java/lang/IllegalMonitorStateException.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/IllegalMonitorStateException.java?rev=1.1&content-type=text/x-cvsweb-markup Index: IllegalMonitorStateException.java =================================================================== /* IllegalMonitorStateException.java -- thrown when trying to wait or notify a monitor that is not owned Copyright (C) 1998, 1999, 2001, 2002, 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.lang; /** * Thrown when a thread attempts to wait or notify on a monitor that it * does not own (ie. it has not synchronized on the object). For example:<br> * <pre> * void m() { * notify(); * } * </pre> * * @author Brian Jones * @author Warren Levy (warrenl@c...) * @status updated to 1.4 */ public class IllegalMonitorStateException extends RuntimeException { /** * Compatible with JDK 1.0+. */ private static final long serialVersionUID = 3713306369498869069L; /** * Create an exception without a message. */ public IllegalMonitorStateException() { } /** * Create an exception with a message. * * @param s the message */ public IllegalMonitorStateException(String s) { super(s); } } 1.1 jop/java/target/src/jdk14/java/lang/IllegalStateException.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/IllegalStateException.java?rev=1.1&content-type=text/x-cvsweb-markup Index: IllegalStateException.java =================================================================== /* IllegalStateException.java -- thrown when invoking a method at an illegal or inappropriate time Copyright (C) 1998, 1999, 2001, 2002, 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.lang; /** * Thrown when a method is invoked at an illegal or inappropriate time. For * example:<br> * <pre> * void m(Collecion c) * { * c.iterator().remove(); * } * </pre> * * @author Brian Jones * @author Warren Levy (warrenl@c...) * @author Andrew John Hughes (gnu_andrew@m...) * @since 1.1 * @status updated to 1.5 */ public class IllegalStateException extends RuntimeException { /** * Compatible with JDK 1.1+. */ private static final long serialVersionUID = -1848914673093119416L; /** * Create an exception without a message. */ public IllegalStateException() { } /** * Create an exception with a message. * * @param s the message */ public IllegalStateException(String s) { super(s); } /** * <p> * Constructs a <code>IllegalStateException</code> using * the specified error message, which should give further details * as to the reason for this exception. The specified cause * <code>Throwable</code> may be used to provide additional history, * with regards to the root of the problem. It is perfectly valid * for this to be null, if the cause of the problem is unknown. * </p> * <p> * <strong>Note</strong>: the detail message from the cause is not * automatically incorporated into the resulting detail message of * this exception. * </p> * * @param message the detail message, which should give the reason for * this exception being thrown. * @param cause the cause of this exception, or null if the cause * is unknown. * @since 1.5 */ public IllegalStateException(String message, Throwable cause) { super(message, cause); } /** * <p> * Constructs a <code>IllegalStateException</code> using * the specified cause <code>Throwable</code>, which may be used * to provide additional history, with regards to the root of the * problem. It is perfectly valid for this to be null, if the * cause of the problem is unknown. * </p> * <p> * The detail message is automatically constructed from the detail * message of the supplied causal exception. If the cause is null, * then the detail message will also be null. Otherwise, the detail * message of this exception will be that of the causal exception. * This makes this constructor very useful for simply wrapping another * exception. * </p> * * @param cause the cause of this exception, or null if the cause * is unknown. * @since 1.5 */ public IllegalStateException(Throwable cause) { super(cause); } } 1.1 jop/java/target/src/jdk14/java/lang/IllegalThreadStateException.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/jdk14/java/lang/IllegalThreadStateException.java?rev=1.1&content-type=text/x-cvsweb-markup Index: IllegalThreadStateException.java =================================================================== /* IllegalThreadStateException.java -- thrown when trying to manipulate a Thread when it is not in an appropriate state Copyright (C) 1998, 1999, 2001, 2002, 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.lang; /** * Thrown When trying to manipulate a Thread which is in an inappropriate * state. Since the documentation suggests that this can happen with * <code>Thread.suspend</code> or <code>Thread.resume</code>, but these * two methods are deprecated, this exception is likely very rare. * * @author Brian Jones * @author Warren Levy (warrenl@c...) * @status updated to 1.4 */ public class IllegalThreadStateException extends IllegalArgumentException { /** * Compatible with JDK 1.0+. */ private static final long serialVersionUID = -7626246362397460174L; /** * Create an exception without a message. */ public IllegalThreadStateException() { } /** * Create an exception with a message. * * @param s the message */ public IllegalThreadStateException(String s) { super(s); } } 1.1 jop/java/target/src/jdk14/java/lang/InstantiationException.java