diff options
| author | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-04 10:53:49 +0000 |
|---|---|---|
| committer | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-08-04 10:53:49 +0000 |
| commit | bfd03af53013b43663c88995c6d5943815e8d75b (patch) | |
| tree | 871b70a606d87369d5aa9d6f621baedc13b49eba /libjava/classpath/java/util | |
| parent | befb0bace8afefe156fe5718f9d1f202d28560c7 (diff) | |
| download | ppe42-gcc-bfd03af53013b43663c88995c6d5943815e8d75b.tar.gz ppe42-gcc-bfd03af53013b43663c88995c6d5943815e8d75b.zip | |
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/util')
| -rw-r--r-- | libjava/classpath/java/util/Arrays.java | 3 | ||||
| -rw-r--r-- | libjava/classpath/java/util/Currency.java | 5 | ||||
| -rw-r--r-- | libjava/classpath/java/util/EnumMap.java | 19 |
3 files changed, 22 insertions, 5 deletions
diff --git a/libjava/classpath/java/util/Arrays.java b/libjava/classpath/java/util/Arrays.java index 9443ced5bdd..e5f772778c2 100644 --- a/libjava/classpath/java/util/Arrays.java +++ b/libjava/classpath/java/util/Arrays.java @@ -3941,7 +3941,8 @@ public class Arrays if (from > to) throw new IllegalArgumentException("The initial index is after " + "the final index."); - T[] newArray = (T[]) new Object[to - from]; + Class elemType = original.getClass().getComponentType(); + T[] newArray = (T[]) Array.newInstance(elemType, to - from); if (to > original.length) { System.arraycopy(original, from, newArray, 0, diff --git a/libjava/classpath/java/util/Currency.java b/libjava/classpath/java/util/Currency.java index a0933eca2f6..b5da13c37f1 100644 --- a/libjava/classpath/java/util/Currency.java +++ b/libjava/classpath/java/util/Currency.java @@ -273,6 +273,11 @@ public final class Currency throw new NullPointerException("The locale or its country is null."); } + + /* Check that country of locale given is valid. */ + if (country.length() != 2) + throw new IllegalArgumentException(); + /* Attempt to get the currency from the cache */ String code = (String) countryMap.get(country); if (code == null) diff --git a/libjava/classpath/java/util/EnumMap.java b/libjava/classpath/java/util/EnumMap.java index 477dff8e0ab..b7187b935f2 100644 --- a/libjava/classpath/java/util/EnumMap.java +++ b/libjava/classpath/java/util/EnumMap.java @@ -1,5 +1,5 @@ /* EnumMap.java - Map where keys are enum constants - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -140,7 +140,8 @@ public class EnumMap<K extends Enum<K>, V> Enum<K> e = (Enum<K>) key; if (e.getDeclaringClass() != enumClass) return null; - return store[e.ordinal()]; + V o = store[e.ordinal()]; + return o == emptySlot ? null : o; } public V put(K key, V value) @@ -387,8 +388,18 @@ public class EnumMap<K extends Enum<K>, V> public EnumMap<K, V> clone() { - /* This constructor provides this functionality */ - return new EnumMap(this); + EnumMap<K, V> result; + try + { + result = (EnumMap<K, V>) super.clone(); + } + catch (CloneNotSupportedException ignore) + { + // Can't happen. + result = null; + } + result.store = (V[]) store.clone(); + return result; } } |

