You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ge...@apache.org on 2005/12/01 07:04:00 UTC
svn commit: r350181 [104/198] - in
/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core: ./ depends/
depends/files/ depends/jars/ depends/libs/ depends/libs/linux.IA32/
depends/libs/win.IA32/ depends/oss/ depends/oss/linux.IA32/
depends/oss/win....
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ClassNotFoundException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ClassNotFoundException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ClassNotFoundException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ClassNotFoundException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,78 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This exception is thrown when a classloader is unable to find a class.
+ */
+public class ClassNotFoundException extends Exception {
+
+ static final long serialVersionUID = 9176873029745254542L;
+
+ private Throwable ex;
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public ClassNotFoundException() {
+ super((Throwable) null);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public ClassNotFoundException(String detailMessage) {
+ super(detailMessage, null);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback, message and
+ * exception filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ * @param exception
+ * Throwable The exception which occurred while loading the
+ * class.
+ */
+ public ClassNotFoundException(String detailMessage, Throwable exception) {
+ super(detailMessage);
+ ex = exception;
+ }
+
+ /**
+ * Answers the exception which occured when loading the class.
+ *
+ * @return Throwable The exception which occurred while loading the class.
+ */
+ public Throwable getException() {
+ return ex;
+ }
+
+ /**
+ * Answers the cause of this Throwable, or null if there is no cause.
+ *
+ * @return Throwable The receiver's cause.
+ */
+ public Throwable getCause() {
+ return ex;
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/CloneNotSupportedException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/CloneNotSupportedException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/CloneNotSupportedException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/CloneNotSupportedException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This exception is thrown when a program attempts to clone an object which
+ * does not support the Cloneable interface.
+ *
+ * @see Cloneable
+ */
+public class CloneNotSupportedException extends Exception {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public CloneNotSupportedException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public CloneNotSupportedException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Cloneable.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Cloneable.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Cloneable.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Cloneable.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,30 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This (empty) interface should be implemented by all classes which wish to
+ * support cloning. The implementation of clone in class Object checks to ensure
+ * that the object being cloned implements this interface, and throws
+ * CloneNotSupportedException if not.
+ *
+ * @see Object#clone
+ * @see CloneNotSupportedException
+ */
+public interface Cloneable {
+ // Marker interface
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Comparable.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Comparable.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Comparable.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Comparable.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,49 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This interface should be implemented by all classes which wish to define a
+ * <em>natural ordering</em> of their instances. The ordering rule must be
+ * transitive and invertable (i.e. the sign of the result of x.compareTo(y) must
+ * equal the negation of the sign of the result of y.compareTo(x) for all x and
+ * y).
+ * <p>
+ * In addition, it is desireable (but not required) that when the result of
+ * x.compareTo(y) is zero (and only then) the result of x.equals(y) should be
+ * true.
+ *
+ */
+public interface Comparable {
+
+ /**
+ * Answers an integer indicating the relative positions of the receiver and
+ * the argument in the natural order of elements of the receiver's class.
+ *
+ *
+ * @return int which should be <0 if the receiver should sort before the
+ * argument, 0 if the receiver should sort in the same position as
+ * the argument, and >0 if the receiver should sort after the
+ * argument.
+ * @param another
+ * Object an object to compare the receiver to
+ * @throws ClassCastException
+ * if the argument can not be converted into something
+ * comparable with the receiver.
+ */
+ int compareTo(Object another);
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Double.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Double.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Double.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Double.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,342 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * Doubles are objects (non-base types) which represent double values.
+ */
+public final class Double extends Number implements Comparable {
+
+ static final long serialVersionUID = -9172774392245257468L;
+
+ /**
+ * The value which the receiver represents.
+ */
+ final double value;
+
+ /**
+ * Largest and smallest possible double values.
+ */
+ public static final double MAX_VALUE = 1.79769313486231570e+308;
+
+ public static final double MIN_VALUE = 5e-324;
+
+ /* 4.94065645841246544e-324 gets rounded to 9.88131e-324 */
+
+ /**
+ * A value which represents all invalid double results (NaN ==> Not a
+ * Number)
+ */
+ public static final double NaN = 0.0 / 0.0;
+
+ /**
+ * Values to represent infinite results
+ */
+ public static final double POSITIVE_INFINITY = 1.0 / 0.0;
+
+ public static final double NEGATIVE_INFINITY = -1.0 / 0.0;
+
+ /**
+ * The java.lang.Class that represents this class.
+ */
+ public static final Class TYPE = new double[0].getClass()
+ .getComponentType();
+
+ // Note: This can't be set to "double.class", since *that* is
+ // defined to be "java.lang.Double.TYPE";
+
+ /**
+ * Constructs a new instance of the receiver which represents the double
+ * valued argument.
+ *
+ * @param value
+ * the double to store in the new instance.
+ */
+ public Double(double value) {
+ this.value = value;
+ }
+
+ /**
+ * Constructs a new instance of this class given a string.
+ *
+ * @param string
+ * a string representation of a double quantity.
+ * @exception NumberFormatException
+ * if the argument could not be parsed as a double quantity.
+ */
+ public Double(String string) throws NumberFormatException {
+ this(parseDouble(string));
+ }
+
+ /**
+ * Compares the receiver with the Double parameter.
+ *
+ * @param object
+ * the Double to compare to the receiver
+ *
+ * @return Returns greater than zero when this.doubleValue() >
+ * object.doubleValue(), zero when this.doubleValue() ==
+ * object.doubleValue(), and less than zero when this.doubleValue() <
+ * object.doubleValue()
+ */
+ public int compareTo(Double object) {
+ return value > object.value ? 1 : (value < object.value ? -1 : 0);
+ }
+
+ /**
+ * Compares the receiver with a Double parameter.
+ *
+ * @param object
+ * the Double to compare to the receiver
+ *
+ * @return Returns greater than zero when this.doubleValue() >
+ * object.doubleValue(), zero when this.doubleValue() ==
+ * object.doubleValue(), and less than zero when this.doubleValue() <
+ * object.doubleValue()
+ *
+ * @throws ClassCastException
+ * when object is not a Double
+ */
+ public int compareTo(Object object) {
+ return compareTo((Double) object);
+ }
+
+ /**
+ * Answers the byte value which the receiver represents
+ *
+ * @return byte the value of the receiver.
+ */
+ public byte byteValue() {
+ return (byte) value;
+ }
+
+ /**
+ * Answers the binary representation of the argument, as a long.
+ *
+ * @param value
+ * The double value to convert
+ * @return the bits of the double.
+ */
+ public static native long doubleToLongBits(double value);
+
+ /**
+ * Answers the binary representation of the argument, as a long.
+ *
+ * @param value
+ * The double value to convert
+ * @return the bits of the double.
+ */
+ public static native long doubleToRawLongBits(double value);
+
+ /**
+ * Answers the receiver's value as a double.
+ *
+ * @return the receiver's value
+ */
+ public double doubleValue() {
+ return value;
+ }
+
+ /**
+ * Compares the argument to the receiver, and answers true if they represent
+ * the <em>same</em> object using a class specific comparison. For
+ * Doubles, the check verifies that the receiver's value's bit pattern
+ * matches the bit pattern of the argument, which must also be a Double.
+ *
+ * @param object
+ * 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
+ */
+ public boolean equals(Object object) {
+ return (object == this)
+ || (object instanceof Double)
+ && (doubleToLongBits(this.value) == doubleToLongBits(((Double) object).value));
+ }
+
+ /**
+ * Answers the float value which the receiver represents
+ *
+ * @return float the value of the receiver.
+ */
+ public float floatValue() {
+ return (float) value;
+ }
+
+ /**
+ * 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
+ */
+ public int hashCode() {
+ long v = doubleToLongBits(value);
+ return (int) (v ^ (v >>> 32));
+ }
+
+ /**
+ * Answers the receiver's value as an integer.
+ *
+ * @return the receiver's value as an integer
+ */
+ public int intValue() {
+ return (int) value;
+ }
+
+ /**
+ * Answers true if the receiver represents an infinite quantity, and false
+ * otherwise.
+ *
+ * @return <code>true</code> if the argument is positive or negative
+ * infinity <code>false</code> if it is not an infinite value
+ */
+ public boolean isInfinite() {
+ return isInfinite(value);
+ }
+
+ /**
+ * Answers true if the argument represents an infinite quantity, and false
+ * otherwise.
+ *
+ * @param d
+ * value to check for infinitness.
+ * @return <code>true</code> if the argument is positive or negative
+ * infinity <code>false</code> if it is not an infinite value
+ */
+ public static boolean isInfinite(double d) {
+ return (d == POSITIVE_INFINITY) || (d == NEGATIVE_INFINITY);
+ }
+
+ /**
+ * Answers true if the receiver does not represent a valid float quantity.
+ *
+ * @return <code>true</code> if the argument is Not A Number
+ * <code>false</code> if it is a (potentially infinite) float
+ * number
+ */
+ public boolean isNaN() {
+ return isNaN(value);
+ }
+
+ /**
+ * Answers true if the argument does not represent a valid double quantity.
+ *
+ * @param d
+ * value to check for numberness.
+ * @return <code>true</code> if the argument is Not A Number
+ * <code>false</code> if it is a (potentially infinite) double
+ * number
+ */
+ public static boolean isNaN(double d) {
+ return d != d;
+ }
+
+ /**
+ * Answers a double built from the binary representation given in the
+ * argument.
+ *
+ * @param bits
+ * the bits of the double
+ * @return the double which matches the bits
+ */
+ public static native double longBitsToDouble(long bits);
+
+ /**
+ * Answers the long value which the receiver represents
+ *
+ * @return long the value of the receiver.
+ */
+ public long longValue() {
+ return (long) value;
+ }
+
+ /**
+ * Answers the double which matches the passed in string.
+ * NumberFormatException is thrown if the string does not represent a valid
+ * double.
+ *
+ * @param string
+ * the value to convert
+ * @return a double which would print as the argument
+ */
+ public static double parseDouble(String string)
+ throws NumberFormatException {
+ return com.ibm.oti.util.FloatingPointParser.parseDouble(string);
+ }
+
+ /**
+ * Answers the short value which the receiver represents
+ *
+ * @return short the value of the receiver.
+ */
+ public short shortValue() {
+ return (short) value;
+ }
+
+ /**
+ * Answers a string containing a concise, human-readable description of the
+ * receiver.
+ *
+ * @return a printable representation for the receiver.
+ */
+ public String toString() {
+ return Double.toString(value);
+ }
+
+ /**
+ * Answers a string containing a printable representation of the argument.
+ *
+ * @param d
+ * the double to print
+ * @return a printable representation of the argument.
+ */
+ public static String toString(double d) {
+ return com.ibm.oti.util.NumberConverter.convert(d);
+ }
+
+ /**
+ * Answers the double which matches the passed in string.
+ * NumberFormatException is thrown if the string does not represent a valid
+ * double.
+ *
+ * @param string
+ * the value to convert
+ * @return a double which would print as the argument
+ */
+ public static Double valueOf(String string) throws NumberFormatException {
+ return new Double(parseDouble(string));
+ }
+
+ /**
+ * Compares the two doubles.
+ *
+ * @param double1
+ * the first value to compare
+ * @param double2
+ * the second value to compare
+ *
+ * @return Returns greater than zero when double1 > double2, zero when
+ * double1 == double2, and less than zero when double1 < double2
+ */
+ public static int compare(double double1, double double2) {
+ return double1 > double2 ? 1 : (double1 < double2 ? -1 : 0);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Error.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Error.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Error.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Error.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,73 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This class is the superclass of all classes which represent unrecoverable
+ * errors. When Errors are thrown, they should not be caught by application
+ * code.
+ *
+ * @see Throwable
+ * @see Exception
+ * @see RuntimeException
+ */
+public class Error extends Throwable {
+
+ static final long serialVersionUID = 4980196508277280342L;
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public Error() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public Error(String detailMessage) {
+ super(detailMessage);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback, message and
+ * cause filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ * @param throwable
+ * The cause of this Throwable
+ */
+ public Error(String detailMessage, Throwable throwable) {
+ super(detailMessage, throwable);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and cause
+ * filled in.
+ *
+ * @param throwable
+ * The cause of this Throwable
+ */
+ public Error(Throwable throwable) {
+ super(throwable);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Exception.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Exception.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Exception.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Exception.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,72 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This class is the superclass of all classes which represent recoverable
+ * exceptions. When Exceptions are thrown, they may be caught by application
+ * code.
+ *
+ * @see Throwable
+ * @see Error
+ * @see RuntimeException
+ */
+public class Exception extends Throwable {
+ static final long serialVersionUID = -3387516993124229948L;
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public Exception() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public Exception(String detailMessage) {
+ super(detailMessage);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback, message and
+ * cause filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ * @param throwable
+ * The cause of this Throwable
+ */
+ public Exception(String detailMessage, Throwable throwable) {
+ super(detailMessage, throwable);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and cause
+ * filled in.
+ *
+ * @param throwable
+ * The cause of this Throwable
+ */
+ public Exception(Throwable throwable) {
+ super(throwable);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ExceptionInInitializerError.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ExceptionInInitializerError.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ExceptionInInitializerError.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/ExceptionInInitializerError.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,77 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This error is thrown when an exception occurs during class initialization.
+ */
+public class ExceptionInInitializerError extends LinkageError {
+
+ static final long serialVersionUID = 1521711792217232256L;
+
+ private Throwable exception;
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public ExceptionInInitializerError() {
+ super();
+ initCause(null);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public ExceptionInInitializerError(String detailMessage) {
+ super(detailMessage);
+ initCause(null);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and exception
+ * filled in. The exception should be the one which originally occured in
+ * the class initialization code.
+ *
+ * @param exception
+ * Throwable The exception which caused the problem.
+ */
+ public ExceptionInInitializerError(Throwable exception) {
+ super();
+ this.exception = exception;
+ initCause(exception);
+ }
+
+ /**
+ * Answers the exception which was passed in when the instance was created.
+ */
+ public Throwable getException() {
+ return exception;
+ }
+
+ /**
+ * Answers the cause of this Throwable, or null if there is no cause.
+ *
+ * @return Throwable The receiver's cause.
+ */
+ public Throwable getCause() {
+ return exception;
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Float.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Float.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Float.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Float.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,347 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * Floats are objects (non-base types) which represent float values.
+ */
+public final class Float extends Number implements Comparable {
+
+ static final long serialVersionUID = -2671257302660747028L;
+
+ /**
+ * The value which the receiver represents.
+ */
+ final float value;
+
+ /**
+ * Largest and smallest possible float values.
+ */
+ public static final float MAX_VALUE = 3.40282346638528860e+38f;
+
+ public static final float MIN_VALUE = 1.40129846432481707e-45f;
+
+ /**
+ * A value which represents all invalid float results (NaN ==> Not a Number)
+ */
+ public static final float NaN = 0.0f / 0.0f;
+
+ /**
+ * Values to represent infinite results
+ */
+ public static final float POSITIVE_INFINITY = 1.0f / 0.0f;
+
+ public static final float NEGATIVE_INFINITY = -1.0f / 0.0f;
+
+ /**
+ * The java.lang.Class that represents this class.
+ */
+ public static final Class TYPE = new float[0].getClass().getComponentType();
+
+ // Note: This can't be set to "float.class", since *that* is
+ // defined to be "java.lang.Float.TYPE";
+
+ /**
+ * Constructs a new instance of the receiver which represents the float
+ * valued argument.
+ *
+ * @param value
+ * the float to store in the new instance.
+ */
+ public Float(float value) {
+ this.value = value;
+ }
+
+ /**
+ * Constructs a new instance of the receiver which represents the double
+ * valued argument.
+ *
+ * @param value
+ * the double to store in the new instance.
+ */
+ public Float(double value) {
+ this.value = (float) value;
+ }
+
+ /**
+ * Constructs a new instance of this class given a string.
+ *
+ * @param string
+ * a string representation of a float quantity.
+ * @exception NumberFormatException
+ * if the argument could not be parsed as a float quantity.
+ */
+ public Float(String string) throws NumberFormatException {
+ this(parseFloat(string));
+ }
+
+ /**
+ * Compares the receiver with the Float parameter.
+ *
+ * @param object
+ * the Float to compare to the receiver
+ *
+ * @return Returns greater than zero when this.floatValue() >
+ * object.floatValue(), zero when this.floatValue() ==
+ * object.floatValue(), and less than zero when this.floatValue() <
+ * object.floatValue()
+ */
+ public int compareTo(Float object) {
+ return value > object.value ? 1 : (value < object.value ? -1 : 0);
+ }
+
+ /**
+ * Compares the receiver with a Float parameter.
+ *
+ * @param object
+ * the Float to compare to the receiver
+ *
+ * @return Returns greater than zero when this.floatValue() >
+ * object.floatValue(), zero when this.floatValue() ==
+ * object.floatValue(), and less than zero when this.floatValue() <
+ * object.floatValue()
+ *
+ * @throws ClassCastException
+ * when object is not a Float
+ */
+ public int compareTo(Object object) {
+ return compareTo((Float) object);
+ }
+
+ /**
+ * Answers the byte value which the receiver represents
+ *
+ * @return byte the value of the receiver.
+ */
+ public byte byteValue() {
+ return (byte) value;
+ }
+
+ /**
+ * Answers the double value which the receiver represents
+ *
+ * @return double the value of the receiver.
+ */
+ public double doubleValue() {
+ return value;
+ }
+
+ /**
+ * Compares the argument to the receiver, and answers true if they represent
+ * the <em>same</em> object using a class specific comparison. For Floats,
+ * the check verifies that the receiver's value's bit pattern matches the
+ * bit pattern of the argument, which must also be a Float.
+ *
+ * @param object
+ * 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
+ */
+ public boolean equals(Object object) {
+ return (object == this)
+ || (object instanceof Float)
+ && (floatToIntBits(this.value) == floatToIntBits(((Float) object).value));
+ }
+
+ /**
+ * Answers the binary representation of the argument, as an int.
+ *
+ * @param value
+ * The float value to convert
+ * @return the bits of the float.
+ */
+ public static native int floatToIntBits(float value);
+
+ /**
+ * Answers the binary representation of the argument, as an int.
+ *
+ * @param value
+ * The float value to convert
+ * @return the bits of the float.
+ */
+ public static native int floatToRawIntBits(float value);
+
+ /**
+ * Answers the receiver's value as a float.
+ *
+ * @return the receiver's value
+ */
+ public float floatValue() {
+ return value;
+ }
+
+ /**
+ * 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
+ */
+ public int hashCode() {
+ return floatToIntBits(value);
+ }
+
+ /**
+ * Answers a float built from the binary representation given in the
+ * argument.
+ *
+ * @param bits
+ * the bits of the float
+ * @return the float which matches the bits
+ */
+ public static native float intBitsToFloat(int bits);
+
+ /**
+ * Answers the int value which the receiver represents
+ *
+ * @return int the value of the receiver.
+ */
+ public int intValue() {
+ return (int) value;
+ }
+
+ /**
+ * Answers true if the receiver represents an infinite quantity, and false
+ * otherwise.
+ *
+ * @return <code>true</code> if the argument is positive or negative
+ * infinity <code>false</code> if it is not an infinite value
+ */
+ public boolean isInfinite() {
+ return isInfinite(value);
+ }
+
+ /**
+ * Answers true if the argument represents an infinite quantity, and false
+ * otherwise.
+ *
+ * @param f
+ * value to check for infinitness.
+ * @return <code>true</code> if the argument is positive or negative
+ * infinity <code>false</code> if it is not an infinite value
+ */
+ public static boolean isInfinite(float f) {
+ return (f == POSITIVE_INFINITY) || (f == NEGATIVE_INFINITY);
+ }
+
+ /**
+ * Answers true if the receiver does not represent a valid float quantity.
+ *
+ * @return <code>true</code> if the argument is Not A Number
+ * <code>false</code> if it is a (potentially infinite) float
+ * number
+ */
+ public boolean isNaN() {
+ return isNaN(value);
+ }
+
+ /**
+ * Answers true if the argument does not represent a valid float quantity.
+ *
+ * @param f
+ * value to check for numberness.
+ * @return <code>true</code> if the argument is Not A Number
+ * <code>false</code> if it is a (potentially infinite) float
+ * number
+ */
+ public static boolean isNaN(float f) {
+ return f != f;
+ }
+
+ /**
+ * Answers the long value which the receiver represents
+ *
+ * @return long the value of the receiver.
+ */
+ public long longValue() {
+ return (long) value;
+ }
+
+ /**
+ * Answers the float which matches the passed in string.
+ * NumberFormatException is thrown if the string does not represent a valid
+ * float.
+ *
+ * @param string
+ * the value to convert
+ * @return a float which would print as the argument
+ */
+ public static float parseFloat(String string) throws NumberFormatException {
+ return com.ibm.oti.util.FloatingPointParser.parseFloat(string);
+ }
+
+ /**
+ * Answers the short value which the receiver represents
+ *
+ * @return short the value of the receiver.
+ */
+ public short shortValue() {
+ return (short) value;
+ }
+
+ /**
+ * Answers a string containing a concise, human-readable description of the
+ * receiver.
+ *
+ * @return a printable representation for the receiver.
+ */
+ public String toString() {
+ return Float.toString(value);
+ }
+
+ /**
+ * Answers a string containing a printable representation of the argument.
+ *
+ * @param f
+ * the float to print
+ * @return a printable representation of the argument.
+ */
+ public static String toString(float f) {
+ return com.ibm.oti.util.NumberConverter.convert(f);
+ }
+
+ /**
+ * Answers the float which matches the passed in string.
+ * NumberFormatException is thrown if the string does not represent a valid
+ * float.
+ *
+ * @param string
+ * the value to convert
+ * @return a float which would print as the argument
+ */
+ public static Float valueOf(String string) throws NumberFormatException {
+ return new Float(parseFloat(string));
+ }
+
+ /**
+ * Compares the two floats.
+ *
+ * @param float1
+ * the first value to compare
+ * @param float2
+ * the second value to compare
+ *
+ * @return Returns greater than zero when float1 > float2, zero when float1 ==
+ * float2, and less than zero when float1 < float2
+ */
+ public static int compare(float float1, float float2) {
+ return float1 > float2 ? 1 : (float1 < float2 ? -1 : 0);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalAccessError.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalAccessError.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalAccessError.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalAccessError.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This error is thrown when the VM notices that a an attempt is being made to
+ * access a field which is not accessable from where it is referenced.
+ * <p>
+ * Note that this can only occur when inconsistant class files are being loaded.
+ */
+public class IllegalAccessError extends IncompatibleClassChangeError {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public IllegalAccessError() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public IllegalAccessError(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalAccessException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalAccessException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalAccessException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalAccessException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This exception is thrown when a program attempts to access a field or method
+ * which is not accessible from the location where the reference is made.
+ *
+ */
+public class IllegalAccessException extends Exception {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public IllegalAccessException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public IllegalAccessException(String detailMessage) {
+ super(detailMessage);
+ }
+
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalArgumentException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalArgumentException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalArgumentException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalArgumentException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,42 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This runtime exception is thrown when a method is invoked with an argument
+ * which it can not reasonably deal with.
+ */
+public class IllegalArgumentException extends RuntimeException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public IllegalArgumentException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public IllegalArgumentException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalMonitorStateException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalMonitorStateException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalMonitorStateException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalMonitorStateException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,43 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This runtime exception is thrown when a monitor operation is attempted when
+ * the monitor is not in the correct state, for example when a thread attempts
+ * to exit a monitor which it did not own.
+ */
+public class IllegalMonitorStateException extends RuntimeException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public IllegalMonitorStateException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public IllegalMonitorStateException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalStateException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalStateException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalStateException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalStateException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,42 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This runtime exception is thrown when an action is attempted at a time when
+ * the virtual machine is not in the correct state.
+ */
+public class IllegalStateException extends RuntimeException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public IllegalStateException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public IllegalStateException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalThreadStateException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalThreadStateException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalThreadStateException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IllegalThreadStateException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,43 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This runtime exception is thrown when an operation is attempted which is not
+ * possible given the state that the executing thread is in.
+ */
+public class IllegalThreadStateException extends
+ java.lang.IllegalArgumentException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public IllegalThreadStateException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public IllegalThreadStateException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IncompatibleClassChangeError.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IncompatibleClassChangeError.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IncompatibleClassChangeError.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IncompatibleClassChangeError.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This class is the superclass of all classes which represent errors which
+ * occur when inconsistant class files are loaded into the same running image.
+ *
+ * @see Error
+ */
+public class IncompatibleClassChangeError extends java.lang.LinkageError {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public IncompatibleClassChangeError() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public IncompatibleClassChangeError(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IndexOutOfBoundsException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IndexOutOfBoundsException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IndexOutOfBoundsException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/IndexOutOfBoundsException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,43 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This runtime exception is thrown when a program attempts to access a value in
+ * an indexable collection using a value which is outside the possible range of
+ * indices.
+ */
+public class IndexOutOfBoundsException extends RuntimeException {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public IndexOutOfBoundsException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public IndexOutOfBoundsException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InheritableThreadLocal.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InheritableThreadLocal.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InheritableThreadLocal.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InheritableThreadLocal.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * An InheritableThreadLocal is very similar to a ThreadLocal, with the added
+ * functionality that a child Thread inherits all InheritableThreadLocal from
+ * its parent Thread upon Thread creation time.
+ *
+ * @see java.lang.Thread
+ * @see java.lang.ThreadLocal
+ */
+
+public class InheritableThreadLocal extends java.lang.ThreadLocal {
+ /**
+ * Constructs a new InheritableThreadLocal object
+ */
+ public InheritableThreadLocal() {
+ super();
+ }
+
+ /**
+ * Computes the created Thread's initial value for this
+ * InheritableThreadLocal based on the current value of the same local on
+ * the creator Thread.
+ */
+ protected Object childValue(Object parentValue) {
+ return parentValue;
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InstantiationError.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InstantiationError.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InstantiationError.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InstantiationError.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,60 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This error is thrown when the VM notices that a an attempt is being made to
+ * create a new instance of a class which has no visible constructors from the
+ * location where new is invoked.
+ * <p>
+ * Note that this can only occur when inconsistant class files are being loaded.
+ *
+ */
+public class InstantiationError extends IncompatibleClassChangeError {
+ static final long serialVersionUID = -4885810657349421204L;
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ *
+ */
+ public InstantiationError() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public InstantiationError(String detailMessage) {
+ super(detailMessage);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param clazz
+ * Class The class which cannot be instantiated.
+ */
+ InstantiationError(Class clazz) {
+ super(clazz.getName());
+ }
+
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InstantiationException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InstantiationException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InstantiationException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InstantiationException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,56 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This exception is thrown when a program attempts to access a constructor
+ * which is not accessible from the location where the reference is made.
+ *
+ */
+public class InstantiationException extends Exception {
+ static final long serialVersionUID = -8441929162975509110L;
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ *
+ */
+ public InstantiationException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public InstantiationException(String detailMessage) {
+ super(detailMessage);
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param clazz
+ * Class The class which cannot be instantiated.
+ */
+ InstantiationException(Class clazz) {
+ super(clazz.getName());
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Integer.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Integer.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Integer.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/Integer.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,518 @@
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * Integers are objects (non-base types) which represent int values.
+ */
+public final class Integer extends Number implements Comparable {
+
+ static final long serialVersionUID = 1360826667806852920L;
+
+ /**
+ * The value which the receiver represents.
+ */
+ final int value;
+
+ /**
+ * Most positive and most negative possible int values.
+ */
+ public static final int MAX_VALUE = 0x7FFFFFFF;
+
+ public static final int MIN_VALUE = 0x80000000;
+
+ /**
+ * The java.lang.Class that represents this class.
+ */
+ public static final Class TYPE = new int[0].getClass().getComponentType();
+
+ // Note: This can't be set to "int.class", since *that* is
+ // defined to be "java.lang.Integer.TYPE";
+
+ /**
+ * 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.
+ */
+ public byte byteValue() {
+ return (byte) value;
+ }
+
+ public int compareTo(Integer object) {
+ return value > object.value ? 1 : (value < object.value ? -1 : 0);
+ }
+
+ public int compareTo(Object object) {
+ return compareTo((Integer) object);
+ }
+
+ /**
+ * 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)
+ throw new NumberFormatException(string);
+ firstDigit = string.charAt(++i);
+ }
+
+ int base = 10;
+ if (firstDigit == '0') {
+ if (++i == length)
+ return new Integer(0);
+ 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)
+ throw new NumberFormatException(string);
+ i++;
+ base = 16;
+ }
+
+ int result = parse(string, i, base, negative);
+ return new Integer(result);
+ }
+
+ /**
+ * Answers the double value which the receiver represents
+ *
+ * @return double the value of the receiver.
+ */
+ public double doubleValue() {
+ 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
+ */
+ 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.
+ */
+ public float floatValue() {
+ 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)
+ return 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 reperesenting 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 new Integer(defaultValue);
+ String prop = System.getProperty(string);
+ if (prop == null)
+ return new Integer(defaultValue);
+ try {
+ return decode(prop);
+ } catch (NumberFormatException ex) {
+ return new Integer(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)
+ return defaultValue;
+ 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
+ */
+ public int hashCode() {
+ return value;
+ }
+
+ /**
+ * Answers the int value which the receiver represents
+ *
+ * @return int the value of the receiver.
+ */
+ public int intValue() {
+ return value;
+ }
+
+ /**
+ * Answers the long value which the receiver represents
+ *
+ * @return long the value of the receiver.
+ */
+ public long longValue() {
+ 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)
+ throw new NumberFormatException();
+ int length = string.length(), i = 0;
+ if (length == 0)
+ throw new NumberFormatException(string);
+ boolean negative = string.charAt(i) == '-';
+ if (negative && ++i == length)
+ throw new NumberFormatException(string);
+
+ 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)
+ throw new NumberFormatException(string);
+ if (max > result)
+ throw new NumberFormatException(string);
+ int next = result * radix - digit;
+ if (next > result)
+ throw new NumberFormatException(string);
+ 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.
+ */
+ public short shortValue() {
+ 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;
+
+ if (i < 0)
+ count = 32;
+ else
+ while ((j >>>= 1) != 0)
+ count++;
+
+ 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;
+
+ if (i < 0)
+ count = 8;
+ else
+ while ((j >>>= 4) != 0)
+ count++;
+
+ 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;
+
+ if (i < 0)
+ count = 11;
+ else
+ while ((j >>>= 3) != 0)
+ count++;
+
+ 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.
+ */
+ public String toString() {
+ 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, 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";
+
+ 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)
+ ch = ch - 10 + 'a';
+ else
+ ch += '0';
+ buffer[--count] = (char) ch;
+ } while ((j /= radix) != 0);
+ if (negative)
+ buffer[0] = '-';
+ 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 new Integer(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 new Integer(parseInt(string, radix));
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InternalError.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InternalError.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InternalError.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InternalError.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,42 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This error is thrown when the VM notices that it has gotten into a state
+ * which it does not understand.
+ */
+public class InternalError extends VirtualMachineError {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public InternalError() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public InternalError(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InterruptedException.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InterruptedException.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InterruptedException.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/InterruptedException.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,42 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This exception is thrown when a waiting thread is activated before the
+ * condition it was waiting on has been satisfied.
+ */
+public class InterruptedException extends Exception {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public InterruptedException() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public InterruptedException(String detailMessage) {
+ super(detailMessage);
+ }
+}
Added: incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/LinkageError.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/LinkageError.java?rev=350181&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/LinkageError.java (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/ibm_core/java-src/luni/src/java/lang/LinkageError.java Wed Nov 30 21:29:27 2005
@@ -0,0 +1,44 @@
+/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+
+/**
+ * This class is the superclass of all classes which represent errors that occur
+ * when loading and linking class files.
+ *
+ * @see Error
+ */
+public class LinkageError extends Error {
+
+ /**
+ * Constructs a new instance of this class with its walkback filled in.
+ */
+ public LinkageError() {
+ super();
+ }
+
+ /**
+ * Constructs a new instance of this class with its walkback and message
+ * filled in.
+ *
+ * @param detailMessage
+ * String The detail message for the exception.
+ */
+ public LinkageError(String detailMessage) {
+ super(detailMessage);
+ }
+}