summaryrefslogtreecommitdiff
path: root/libjava/classpath/java/lang
diff options
context:
space:
mode:
authordoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-04 10:53:49 +0000
committerdoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-04 10:53:49 +0000
commitbfd03af53013b43663c88995c6d5943815e8d75b (patch)
tree871b70a606d87369d5aa9d6f621baedc13b49eba /libjava/classpath/java/lang
parentbefb0bace8afefe156fe5718f9d1f202d28560c7 (diff)
downloadgcc-bfd03af53013b43663c88995c6d5943815e8d75b.tar.gz
libjava/
2007-08-04 Matthias Klose <doko@ubuntu.com> Import GNU Classpath (libgcj-import-20070727). * Regenerate class and header files. * Regenerate auto* files. * include/jvm.h: * jni-libjvm.cc (Jv_JNI_InvokeFunctions): Rename type. * jni.cc (_Jv_JNIFunctions, _Jv_JNI_InvokeFunctions): Likewise. * jni.cc (_Jv_JNI_CallAnyMethodA, _Jv_JNI_CallAnyVoidMethodA, _Jv_JNI_CallMethodA, _Jv_JNI_CallVoidMethodA, _Jv_JNI_CallStaticMethodA, _Jv_JNI_CallStaticVoidMethodA, _Jv_JNI_NewObjectA, _Jv_JNI_SetPrimitiveArrayRegion): Constify jvalue parameter. * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Likewise. * java/lang/VMFloat.java (toString, parseFloat): New. * gnu/awt/xlib/XToolkit.java (setAlwaysOnTop, isModalityTypeSupported, isModalExclusionTypeSupported): New (stub only). * gnu/awt/xlib/XCanvasPeer.java (requestFocus): Likewise. * gnu/awt/xlib/XFramePeer.java (updateMinimumSize, updateIconImages, updateFocusableWindowState, setModalBlocked, getBoundsPrivate, setAlwaysOnTop): Likewise. * gnu/awt/xlib/XFontPeer.java (canDisplay): Update signature. * scripts/makemake.tcl: Ignore gnu/javax/sound/sampled/gstreamer, ignore javax.sound.sampled.spi.MixerProvider, ignore .in files. * HACKING: Mention --enable-gstreamer-peer, removal of generated files. libjava/classpath/ 2007-08-04 Matthias Klose <doko@ubuntu.com> * java/util/EnumMap.java (clone): Add cast. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127204 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/java/lang')
-rw-r--r--libjava/classpath/java/lang/Float.java10
-rw-r--r--libjava/classpath/java/lang/Integer.java7
-rw-r--r--libjava/classpath/java/lang/reflect/Array.java11
3 files changed, 14 insertions, 14 deletions
diff --git a/libjava/classpath/java/lang/Float.java b/libjava/classpath/java/lang/Float.java
index 1e85922be72..dc39ec2af20 100644
--- a/libjava/classpath/java/lang/Float.java
+++ b/libjava/classpath/java/lang/Float.java
@@ -181,7 +181,7 @@ public final class Float extends Number implements Comparable<Float>
*/
public static String toString(float f)
{
- return VMDouble.toString(f, true);
+ return VMFloat.toString(f);
}
/**
@@ -331,9 +331,9 @@ public final class Float extends Number implements Comparable<Float>
*
* @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
+ * @throws NumberFormatException if <code>str</code> cannot be parsed as a
* <code>float</code>
- * @throws NullPointerException if <code>s</code> is null
+ * @throws NullPointerException if <code>str</code> is null
* @see #MIN_VALUE
* @see #MAX_VALUE
* @see #POSITIVE_INFINITY
@@ -342,9 +342,7 @@ public final class Float extends Number implements Comparable<Float>
*/
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 VMFloat.parseFloat(str);
}
/**
diff --git a/libjava/classpath/java/lang/Integer.java b/libjava/classpath/java/lang/Integer.java
index e38eb53edd3..62907ff7753 100644
--- a/libjava/classpath/java/lang/Integer.java
+++ b/libjava/classpath/java/lang/Integer.java
@@ -705,10 +705,13 @@ public final class Integer extends Number implements Comparable<Integer>
if (len == 0)
throw new NumberFormatException("string length is null");
int ch = str.charAt(index);
- if (ch == '-')
+ if (ch == '-' || ch == '+')
{
if (len == 1)
- throw new NumberFormatException("pure '-'");
+ if (ch == '-')
+ throw new NumberFormatException("pure '-'");
+ else if (ch == '+')
+ throw new NumberFormatException("pure '+'");
isNeg = true;
ch = str.charAt(++index);
}
diff --git a/libjava/classpath/java/lang/reflect/Array.java b/libjava/classpath/java/lang/reflect/Array.java
index 373bf204c8e..fee9f0172ee 100644
--- a/libjava/classpath/java/lang/reflect/Array.java
+++ b/libjava/classpath/java/lang/reflect/Array.java
@@ -147,8 +147,7 @@ public final class Array
{
if (dimensions.length <= 0)
throw new IllegalArgumentException ("Empty dimensions array.");
- return createMultiArray(componentType, dimensions,
- dimensions.length - 1);
+ return createMultiArray(componentType, dimensions, 0);
}
/**
@@ -638,10 +637,10 @@ public final class Array
private static Object createMultiArray(Class type, int[] dimensions,
int index)
{
- if (index == 0)
- return newInstance(type, dimensions[0]);
+ if (index == dimensions.length - 1)
+ return newInstance(type, dimensions[index]);
- Object toAdd = createMultiArray(type, dimensions, index - 1);
+ Object toAdd = createMultiArray(type, dimensions, index + 1);
Class thisType = toAdd.getClass();
Object[] retval
= (Object[]) VMArray.createObjectArray(thisType, dimensions[index]);
@@ -649,7 +648,7 @@ public final class Array
retval[0] = toAdd;
int i = dimensions[index];
while (--i > 0)
- retval[i] = createMultiArray(type, dimensions, index - 1);
+ retval[i] = createMultiArray(type, dimensions, index + 1);
return retval;
}