diff options
author | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-03 23:18:43 +0000 |
---|---|---|
committer | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-06-03 23:18:43 +0000 |
commit | 5bf762459121cc397663d22498d62d71fa179ef6 (patch) | |
tree | a9c9e7d91c484d53fe154f9285fc57325572ce50 /libjava/java | |
parent | 6d7301dc346a198a89ac987c1008aac09f191ee6 (diff) | |
download | gcc-5bf762459121cc397663d22498d62d71fa179ef6.tar.gz |
libjava/classpath/ChangeLog.gcj:
2007-05-31 Matthias Klose <doko@ubuntu.com>
* javax/management/NotificationBroadcasterSupport.java
(getNotificationInfo): Add cast.
* native/jni/qt-peer/Makefile.am (AM_CXXFLAGS): Add libstdc++ include
directories.
* native/jni/qt-peer/Makefile.in: Regenerate.
libjava/ChangeLog:
2007-06-03 Matthias Klose <doko@ubuntu.com>
* java/io/natFileWin32.cc (setFilePermissions): New (stub only).
_access: Handle EXEC query, stub only.
2007-06-03 Matthias Klose <doko@ubuntu.com>
Merged from classpath:
* gnu/java/nio/SelectorProviderImpl.java: Whitespace merge.
* java/lang/System.java(inheritedChannel): New.
* java/lang/Character.java: Remove stray`;'.
* java/net/MulticastSocket.java: Merged.
* java/text/DateFormatSymbols.java(getInstance): New, comment updates.
* java/text/Collator.java(getInstance): Merged.
* java/util/Calendar.java: New attributes ALL_STYLES, SHORT, LONG.
getDisplayName, getDisplayNames: New.
* java/util/logging/Logger.java: Merged.
* Regenerate .class and .h files.
2007-06-03 Matthias Klose <doko@ubuntu.com>
* java/io/File.java: Merge with classpath-0.95, new method
setFilePermissions, new attribute EXEC.
* java/io/natFilePosix.cc (setFilePermissions): New.
_access: Handle EXEC query.
* classpath/lib/java/io/File.class, java/io/File.h: Regenerate.
2007-06-03 Matthias Klose <doko@ubuntu.com>
Imported GNU Classpath 0.95.
* classpath/Makefile.in,
classpath/native/jni/midi-dssi/Makefile.in,
classpath/native/jni/classpath/Makefile.in,
classpath/native/jni/Makefile.in,
classpath/native/jni/gconf-peer/Makefile.in,
classpath/native/jni/java-io/Makefile.in,
classpath/native/jni/native-lib/Makefile.in,
classpath/native/jni/java-util/Makefile.in,
classpath/native/jni/midi-alsa/Makefile.in,
classpath/native/jni/java-lang/Makefile.in,
classpath/native/jni/java-nio/Makefile.in,
classpath/native/jni/java-net/Makefile.in,
classpath/native/jni/xmlj/Makefile.in,
classpath/native/jni/qt-peer/Makefile.in,
classpath/native/jni/gtk-peer/Makefile.in,
classpath/native/Makefile.in, classpath/native/jawt/Makefile.in,
classpath/native/fdlibm/Makefile.in,
classpath/native/plugin/Makefile.in,
classpath/resource/Makefile.in, classpath/scripts/Makefile.in,
classpath/tools/Makefile.in, classpath/doc/Makefile.in,
classpath/doc/api/Makefile.in, classpath/lib/Makefile.in,
classpath/external/Makefile.in, classpath/external/jsr166/Makefile.in,
classpath/external/sax/Makefile.in,
classpath/external/w3c_dom/Makefile.in,
classpath/external/relaxngDatatype/Makefile.in,
classpath/include/Makefile.in,
classpath/examples/Makefile.in: Regenerate.
* classpath/config.guess, classpath/config.sub,
classpath/ltmain.sh : Update.
* classpath/configure, classpath/depcomp, classpath/missing,
classpath/aclocal.m4, classpath/install-sh: Regenerate.
* gnu/classpath/Configuration.java (CLASSPATH_VERSION): Now 0.95.
* sources.am: Regenerate.
* Makefile.in: Regenerate.
* Update the .class files and generated CNI header files, add new
.class and generated CNI header files.
* Remove generated files for removed java source files:
classpath/gnu/java/net/BASE64.java,
classpath/gnu/java/security/util/Base64.java,
classpath/gnu/java/awt/peer/gtk/GThreadMutex.java,
classpath/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java,
classpath/gnu/java/awt/font/autofit/Scaler.java,
classpath/gnu/classpath/jdwp/util/Value.java,
classpath/gnu/javax/net/ssl/Base64.java.
* Remove empty directories.
* Makefile.am(nat_source_files): Add natVMOperatingSystemMXBeanImpl.cc.
* java/lang/Class.java(setAccessible): Merge from classpath.
* java/util/Locale.java: Remove.
* gnu/java/lang/management/VMOperatingSystemMXBeanImpl.java,
gnu/java/lang/management/natVMOperatingSystemMXBeanImpl.cc: New.
* gcj/javaprims.h: Update class declarations.
* scripts/classes.pl: Update usage.
* HACKING: Mention to build all peers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125302 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
111 files changed, 2360 insertions, 1516 deletions
diff --git a/libjava/java/awt/Canvas.h b/libjava/java/awt/Canvas.h index 97726a2c02c..d7e031018fd 100644 --- a/libjava/java/awt/Canvas.h +++ b/libjava/java/awt/Canvas.h @@ -38,9 +38,6 @@ class java::awt::Canvas : public ::java::awt::Component public: Canvas(); Canvas(::java::awt::GraphicsConfiguration *); -public: // actually package-private - virtual ::java::awt::GraphicsConfiguration * getGraphicsConfigurationImpl(); -public: virtual void addNotify(); virtual void paint(::java::awt::Graphics *); virtual ::javax::accessibility::AccessibleContext * getAccessibleContext(); @@ -55,8 +52,7 @@ private: static const jlong serialVersionUID = -2284879212465893870LL; static jlong next_canvas_number; public: // actually package-private - ::java::awt::GraphicsConfiguration * __attribute__((aligned(__alignof__( ::java::awt::Component)))) graphicsConfiguration; - ::java::awt::image::BufferStrategy * bufferStrategy; + ::java::awt::image::BufferStrategy * __attribute__((aligned(__alignof__( ::java::awt::Component)))) bufferStrategy; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/awt/Component.h b/libjava/java/awt/Component.h index 4b14757911e..f5889d2bc0d 100644 --- a/libjava/java/awt/Component.h +++ b/libjava/java/awt/Component.h @@ -350,7 +350,6 @@ public: public: // actually package-private virtual ::java::lang::String * generateName(); virtual void setPeer(::java::awt::peer::ComponentPeer *); - virtual ::java::awt::GraphicsConfiguration * getGraphicsConfigurationImpl(); static ::java::awt::Event * translateEvent(::java::awt::AWTEvent *); virtual void dispatchEventImpl(::java::awt::AWTEvent *); virtual jboolean eventTypeEnabled(jint); diff --git a/libjava/java/awt/Desktop$Action.h b/libjava/java/awt/Desktop$Action.h new file mode 100644 index 00000000000..f862b4dc0f9 --- /dev/null +++ b/libjava/java/awt/Desktop$Action.h @@ -0,0 +1,41 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_awt_Desktop$Action__ +#define __java_awt_Desktop$Action__ + +#pragma interface + +#include <java/lang/Enum.h> +#include <gcj/array.h> + +extern "Java" +{ + namespace java + { + namespace awt + { + class Desktop$Action; + } + } +} + +class java::awt::Desktop$Action : public ::java::lang::Enum +{ + + Desktop$Action(::java::lang::String *, jint); +public: + static JArray< ::java::awt::Desktop$Action * > * values(); + static ::java::awt::Desktop$Action * valueOf(::java::lang::String *); + static ::java::awt::Desktop$Action * BROWSE; + static ::java::awt::Desktop$Action * EDIT; + static ::java::awt::Desktop$Action * MAIL; + static ::java::awt::Desktop$Action * OPEN; + static ::java::awt::Desktop$Action * PRINT; +private: + static JArray< ::java::awt::Desktop$Action * > * ENUM$VALUES; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_awt_Desktop$Action__ diff --git a/libjava/java/awt/Desktop.h b/libjava/java/awt/Desktop.h new file mode 100644 index 00000000000..8b5927d88bc --- /dev/null +++ b/libjava/java/awt/Desktop.h @@ -0,0 +1,52 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_awt_Desktop__ +#define __java_awt_Desktop__ + +#pragma interface + +#include <java/lang/Object.h> +extern "Java" +{ + namespace java + { + namespace awt + { + class Desktop; + class Desktop$Action; + namespace peer + { + class DesktopPeer; + } + } + namespace net + { + class URI; + } + } +} + +class java::awt::Desktop : public ::java::lang::Object +{ + + Desktop(); +public: + static ::java::awt::Desktop * getDesktop(); +private: + static jboolean isDesktopSupported(); +public: + virtual jboolean isSupported(::java::awt::Desktop$Action *); + virtual void browse(::java::net::URI *); + virtual void edit(::java::io::File *); + virtual void mail(); + virtual void mail(::java::net::URI *); + virtual void open(::java::io::File *); + virtual void print(::java::io::File *); +private: + ::java::awt::peer::DesktopPeer * __attribute__((aligned(__alignof__( ::java::lang::Object)))) peer; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_awt_Desktop__ diff --git a/libjava/java/awt/Frame.h b/libjava/java/awt/Frame.h index ffbf38d2af8..5b1586631c4 100644 --- a/libjava/java/awt/Frame.h +++ b/libjava/java/awt/Frame.h @@ -57,6 +57,8 @@ public: // actually protected virtual ::java::lang::String * paramString(); private: static void noteFrame(::java::awt::Frame *); +public: // actually package-private + static jboolean hasDisplayableFrames(); public: static JArray< ::java::awt::Frame * > * getFrames(); virtual void setState(jint); @@ -110,6 +112,7 @@ private: jboolean undecorated; static jlong next_frame_number; static ::java::util::ArrayList * weakFrames; + static ::java::lang::ref::ReferenceQueue * weakFramesQueue; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/awt/GraphicsConfiguration.h b/libjava/java/awt/GraphicsConfiguration.h index 58c91221d0d..603577ae4ea 100644 --- a/libjava/java/awt/GraphicsConfiguration.h +++ b/libjava/java/awt/GraphicsConfiguration.h @@ -43,6 +43,7 @@ public: virtual ::java::awt::image::VolatileImage * createCompatibleVolatileImage(jint, jint) = 0; virtual ::java::awt::image::VolatileImage * createCompatibleVolatileImage(jint, jint, ::java::awt::ImageCapabilities *); virtual ::java::awt::image::VolatileImage * createCompatibleVolatileImage(jint, jint, jint) = 0; + virtual ::java::awt::image::VolatileImage * createCompatibleVolatileImage(jint, jint, ::java::awt::ImageCapabilities *, jint); virtual ::java::awt::image::BufferedImage * createCompatibleImage(jint, jint, jint) = 0; virtual ::java::awt::image::ColorModel * getColorModel() = 0; virtual ::java::awt::image::ColorModel * getColorModel(jint) = 0; diff --git a/libjava/java/awt/Toolkit.h b/libjava/java/awt/Toolkit.h index d8af0cd1545..80528fe0571 100644 --- a/libjava/java/awt/Toolkit.h +++ b/libjava/java/awt/Toolkit.h @@ -37,6 +37,7 @@ extern "Java" class Component; class Container; class Cursor; + class Desktop; class Dialog; class Dimension; class EventQueue; @@ -101,6 +102,7 @@ extern "Java" class CheckboxMenuItemPeer; class CheckboxPeer; class ChoicePeer; + class DesktopPeer; class DialogPeer; class FileDialogPeer; class FontPeer; @@ -139,6 +141,7 @@ class java::awt::Toolkit : public ::java::lang::Object public: Toolkit(); public: // actually protected + virtual ::java::awt::peer::DesktopPeer * createDesktopPeer(::java::awt::Desktop *) = 0; virtual ::java::awt::peer::ButtonPeer * createButton(::java::awt::Button *) = 0; virtual ::java::awt::peer::TextFieldPeer * createTextField(::java::awt::TextField *) = 0; virtual ::java::awt::peer::LabelPeer * createLabel(::java::awt::Label *) = 0; diff --git a/libjava/java/awt/Window.h b/libjava/java/awt/Window.h index bf369ed99ad..c1c73992e40 100644 --- a/libjava/java/awt/Window.h +++ b/libjava/java/awt/Window.h @@ -57,9 +57,6 @@ public: Window(::java::awt::Frame *); Window(::java::awt::Window *); Window(::java::awt::Window *, ::java::awt::GraphicsConfiguration *); -public: // actually package-private - virtual ::java::awt::GraphicsConfiguration * getGraphicsConfigurationImpl(); -public: virtual void addNotify(); virtual void pack(); virtual void show(); @@ -133,7 +130,6 @@ private: ::java::awt::event::WindowListener * windowListener; ::java::awt::event::WindowFocusListener * windowFocusListener; ::java::awt::event::WindowStateListener * windowStateListener; - ::java::awt::GraphicsConfiguration * graphicsConfiguration; jboolean shown; public: // actually package-private ::java::awt::Component * windowFocusOwner; diff --git a/libjava/java/awt/datatransfer/SystemFlavorMap$1.h b/libjava/java/awt/datatransfer/SystemFlavorMap$1.h new file mode 100644 index 00000000000..bd5deaf22eb --- /dev/null +++ b/libjava/java/awt/datatransfer/SystemFlavorMap$1.h @@ -0,0 +1,38 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_awt_datatransfer_SystemFlavorMap$1__ +#define __java_awt_datatransfer_SystemFlavorMap$1__ + +#pragma interface + +#include <java/lang/Object.h> +extern "Java" +{ + namespace java + { + namespace awt + { + namespace datatransfer + { + class SystemFlavorMap; + class SystemFlavorMap$1; + } + } + } +} + +class java::awt::datatransfer::SystemFlavorMap$1 : public ::java::lang::Object +{ + +public: // actually package-private + SystemFlavorMap$1(::java::awt::datatransfer::SystemFlavorMap *); +public: + ::java::lang::Object * run(); +public: // actually package-private + ::java::awt::datatransfer::SystemFlavorMap * __attribute__((aligned(__alignof__( ::java::lang::Object)))) this$0; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_awt_datatransfer_SystemFlavorMap$1__ diff --git a/libjava/java/awt/datatransfer/SystemFlavorMap.h b/libjava/java/awt/datatransfer/SystemFlavorMap.h index 62009addb3b..de2495c8b79 100644 --- a/libjava/java/awt/datatransfer/SystemFlavorMap.h +++ b/libjava/java/awt/datatransfer/SystemFlavorMap.h @@ -29,6 +29,8 @@ class java::awt::datatransfer::SystemFlavorMap : public ::java::lang::Object { SystemFlavorMap(); +public: // actually package-private + void setupMapping(::java::util::Properties *); public: ::java::util::Map * getNativesForFlavors(JArray< ::java::awt::datatransfer::DataFlavor * > *); ::java::util::Map * getFlavorsForNatives(JArray< ::java::lang::String * > *); diff --git a/libjava/java/awt/image/ComponentSampleModel.h b/libjava/java/awt/image/ComponentSampleModel.h index 4a1d2c675cb..39fe6cdf7e4 100644 --- a/libjava/java/awt/image/ComponentSampleModel.h +++ b/libjava/java/awt/image/ComponentSampleModel.h @@ -44,8 +44,6 @@ public: virtual jint getPixelStride(); virtual jint getNumDataElements(); virtual ::java::lang::Object * getDataElements(jint, jint, ::java::lang::Object *, ::java::awt::image::DataBuffer *); - virtual ::java::lang::Object * getDataElements(jint, jint, jint, jint, ::java::lang::Object *, ::java::awt::image::DataBuffer *); - virtual void setDataElements(jint, jint, jint, jint, ::java::lang::Object *, ::java::awt::image::DataBuffer *); virtual JArray< jint > * getPixel(jint, jint, JArray< jint > *, ::java::awt::image::DataBuffer *); virtual JArray< jint > * getPixels(jint, jint, jint, jint, JArray< jint > *, ::java::awt::image::DataBuffer *); virtual jint getSample(jint, jint, jint, ::java::awt::image::DataBuffer *); @@ -61,8 +59,6 @@ public: // actually protected jint numBanks; jint scanlineStride; jint pixelStride; -private: - jboolean tightPixelPacking; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/awt/image/IndexColorModel.h b/libjava/java/awt/image/IndexColorModel.h index cbb2fac300c..a79a5312fee 100644 --- a/libjava/java/awt/image/IndexColorModel.h +++ b/libjava/java/awt/image/IndexColorModel.h @@ -60,6 +60,7 @@ public: virtual ::java::awt::image::SampleModel * createCompatibleSampleModel(jint, jint); private: void setTransparentPixel(jint); + JArray< jint > * createColorMap(jint, jint); jint __attribute__((aligned(__alignof__( ::java::awt::image::ColorModel)))) map_size; jboolean opaque; jint trans; diff --git a/libjava/java/awt/image/SinglePixelPackedSampleModel.h b/libjava/java/awt/image/SinglePixelPackedSampleModel.h index 69950326992..c7bf07cd4a9 100644 --- a/libjava/java/awt/image/SinglePixelPackedSampleModel.h +++ b/libjava/java/awt/image/SinglePixelPackedSampleModel.h @@ -42,7 +42,6 @@ public: virtual jint getScanlineStride(); virtual ::java::awt::image::SampleModel * createSubsetSampleModel(JArray< jint > *); virtual ::java::lang::Object * getDataElements(jint, jint, ::java::lang::Object *, ::java::awt::image::DataBuffer *); - virtual ::java::lang::Object * getDataElements(jint, jint, jint, jint, ::java::lang::Object *, ::java::awt::image::DataBuffer *); virtual JArray< jint > * getPixel(jint, jint, JArray< jint > *, ::java::awt::image::DataBuffer *); virtual JArray< jint > * getPixels(jint, jint, jint, jint, JArray< jint > *, ::java::awt::image::DataBuffer *); virtual jint getSample(jint, jint, jint, ::java::awt::image::DataBuffer *); diff --git a/libjava/java/awt/peer/DesktopPeer.h b/libjava/java/awt/peer/DesktopPeer.h new file mode 100644 index 00000000000..fa5529abe3b --- /dev/null +++ b/libjava/java/awt/peer/DesktopPeer.h @@ -0,0 +1,43 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_awt_peer_DesktopPeer__ +#define __java_awt_peer_DesktopPeer__ + +#pragma interface + +#include <java/lang/Object.h> +extern "Java" +{ + namespace java + { + namespace awt + { + class Desktop$Action; + namespace peer + { + class DesktopPeer; + } + } + namespace net + { + class URI; + } + } +} + +class java::awt::peer::DesktopPeer : public ::java::lang::Object +{ + +public: + virtual void browse(::java::net::URI *) = 0; + virtual void edit(::java::io::File *) = 0; + virtual jboolean isSupported(::java::awt::Desktop$Action *) = 0; + virtual void mail(::java::net::URI *) = 0; + virtual void mail() = 0; + virtual void open(::java::io::File *) = 0; + virtual void print(::java::io::File *) = 0; + static ::java::lang::Class class$; +} __attribute__ ((java_interface)); + +#endif // __java_awt_peer_DesktopPeer__ diff --git a/libjava/java/awt/print/PrinterJob.h b/libjava/java/awt/print/PrinterJob.h index a319de37b23..39bb9a0e9cf 100644 --- a/libjava/java/awt/print/PrinterJob.h +++ b/libjava/java/awt/print/PrinterJob.h @@ -29,6 +29,7 @@ extern "Java" namespace print { class PrintService; + class StreamPrintServiceFactory; namespace attribute { class PrintRequestAttributeSet; @@ -63,6 +64,7 @@ public: virtual void setPrintable(::java::awt::print::Printable *, ::java::awt::print::PageFormat *) = 0; virtual ::java::awt::print::PageFormat * validatePage(::java::awt::print::PageFormat *) = 0; static JArray< ::javax::print::PrintService * > * lookupPrintServices(); + static JArray< ::javax::print::StreamPrintServiceFactory * > * lookupStreamPrintServices(::java::lang::String *); virtual ::javax::print::PrintService * getPrintService(); virtual void setPrintService(::javax::print::PrintService *); private: diff --git a/libjava/java/beans/ConstructorProperties.h b/libjava/java/beans/ConstructorProperties.h new file mode 100644 index 00000000000..10c5c383cc1 --- /dev/null +++ b/libjava/java/beans/ConstructorProperties.h @@ -0,0 +1,32 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_beans_ConstructorProperties__ +#define __java_beans_ConstructorProperties__ + +#pragma interface + +#include <java/lang/Object.h> +#include <gcj/array.h> + +extern "Java" +{ + namespace java + { + namespace beans + { + class ConstructorProperties; + } + } +} + +class java::beans::ConstructorProperties : public ::java::lang::Object +{ + +public: + virtual JArray< ::java::lang::String * > * value() = 0; + virtual ::java::lang::Class * annotationType() = 0; + static ::java::lang::Class class$; +} __attribute__ ((java_interface)); + +#endif // __java_beans_ConstructorProperties__ diff --git a/libjava/java/io/File.h b/libjava/java/io/File.h index 35ca3b7dfc6..92cfbb7e1db 100644 --- a/libjava/java/io/File.h +++ b/libjava/java/io/File.h @@ -31,6 +31,7 @@ class java::io::File : public ::java::lang::Object public: virtual jboolean canRead(); virtual jboolean canWrite(); + virtual jboolean canExecute(); private: jboolean performCreate(); public: @@ -93,6 +94,15 @@ private: public: static ::java::io::File * createTempFile(::java::lang::String *, ::java::lang::String *, ::java::io::File *); private: + jboolean setFilePermissions(jboolean, jboolean, jint); +public: + virtual jboolean setReadable(jboolean); + virtual jboolean setReadable(jboolean, jboolean); + virtual jboolean setWritable(jboolean); + virtual jboolean setWritable(jboolean, jboolean); + virtual jboolean setExecutable(jboolean); + virtual jboolean setExecutable(jboolean, jboolean); +private: jboolean performSetReadOnly(); public: virtual jboolean setReadOnly(); @@ -114,6 +124,7 @@ public: private: void checkWrite(); void checkRead(); + void checkExec(); public: virtual void deleteOnExit(); private: @@ -123,6 +134,7 @@ private: static const jint READ = 0; static const jint WRITE = 1; static const jint EXISTS = 2; + static const jint EXEC = 3; static const jint DIRECTORY = 0; static const jint ISFILE = 1; static const jint ISHIDDEN = 2; diff --git a/libjava/java/io/File.java b/libjava/java/io/File.java index 33776abad7d..0026ffaeedf 100644 --- a/libjava/java/io/File.java +++ b/libjava/java/io/File.java @@ -67,6 +67,7 @@ public class File implements Serializable, Comparable private final static int READ = 0; private final static int WRITE = 1; private final static int EXISTS = 2; + private final static int EXEC = 3; // QUERY arguments to stat function. private final static int DIRECTORY = 0; @@ -182,6 +183,27 @@ public class File implements Serializable, Comparable return _access (WRITE); } + /** + * This method tests whether or not the current thread is allowed to + * to execute the file pointed to by this object. This will be true if and + * and only if 1) the file exists and 2) the <code>SecurityManager</code> + * (if any) allows access to the file via it's <code>checkExec</code> + * method 3) the file is executable. + * + * @return <code>true</code> if execution is allowed, + * <code>false</code> otherwise + * + * @exception SecurityException If the <code>SecurityManager</code> + * does not allow access to the file + */ + public boolean canExecute() + { + if (!exists()) + return false; + checkExec(); + return _access (EXEC); + } + private native boolean performCreate() throws IOException; /** @@ -1139,6 +1161,159 @@ public class File implements Serializable, Comparable } /* + * This native method sets file permissions. + */ + private native boolean setFilePermissions(boolean enable, boolean ownerOnly, + int permissions); + + /** + * This method sets the owner's read permission for the File represented by + * this object. + * + * It is the same as calling <code>setReadable(readable, true)</code>. + * + * @param <code>readable</code> <code>true</code> to set read permission, + * <code>false</code> to unset the read permission. + * @return <code>true</code> if the file permissions are changed, + * <code>false</code> otherwise. + * @exception SecurityException If write access of the file is not permitted. + * @see #setReadable(boolean, boolean) + * @since 1.6 + */ + public boolean setReadable(boolean readable) + { + return setReadable(readable, true); + } + + /** + * This method sets the read permissions for the File represented by + * this object. + * + * If <code>ownerOnly</code> is set to <code>true</code> then only the + * read permission bit for the owner of the file is changed. + * + * If <code>ownerOnly</code> is set to <code>false</code>, the file + * permissions are changed so that the file can be read by everyone. + * + * On unix like systems this sets the <code>user</code>, <code>group</code> + * and <code>other</code> read bits and is equal to call + * <code>chmod a+r</code> on the file. + * + * @param <code>readable</code> <code>true</code> to set read permission, + * <code>false</code> to unset the read permission. + * @param <code>ownerOnly</code> <code>true</code> to set read permission + * for owner only, <code>false</code> for all. + * @return <code>true</code> if the file permissions are changed, + * <code>false</code> otherwise. + * @exception SecurityException If write access of the file is not permitted. + * @see #setReadable(boolean) + * @since 1.6 + */ + public boolean setReadable(boolean readable, boolean ownerOnly) + { + checkWrite(); + return setFilePermissions(readable, ownerOnly, READ); + } + + /** + * This method sets the owner's write permission for the File represented by + * this object. + * + * It is the same as calling <code>setWritable(readable, true)</code>. + * + * @param <code>writable</code> <code>true</code> to set write permission, + * <code>false</code> to unset write permission. + * @return <code>true</code> if the file permissions are changed, + * <code>false</code> otherwise. + * @exception SecurityException If write access of the file is not permitted. + * @see #setWritable(boolean, boolean) + * @since 1.6 + */ + public boolean setWritable(boolean writable) + { + return setWritable(writable, true); + } + + /** + * This method sets the write permissions for the File represented by + * this object. + * + * If <code>ownerOnly</code> is set to <code>true</code> then only the + * write permission bit for the owner of the file is changed. + * + * If <code>ownerOnly</code> is set to <code>false</code>, the file + * permissions are changed so that the file can be written by everyone. + * + * On unix like systems this set the <code>user</code>, <code>group</code> + * and <code>other</code> write bits and is equal to call + * <code>chmod a+w</code> on the file. + * + * @param <code>writable</code> <code>true</code> to set write permission, + * <code>false</code> to unset write permission. + * @param <code>ownerOnly</code> <code>true</code> to set write permission + * for owner only, <code>false</code> for all. + * @return <code>true</code> if the file permissions are changed, + * <code>false</code> otherwise. + * @exception SecurityException If write access of the file is not permitted. + * @see #setWritable(boolean) + * @since 1.6 + */ + public boolean setWritable(boolean writable, boolean ownerOnly) + { + checkWrite(); + return setFilePermissions(writable, ownerOnly, WRITE); + } + + /** + * This method sets the owner's execute permission for the File represented + * by this object. + * + * It is the same as calling <code>setExecutable(readable, true)</code>. + * + * @param <code>executable</code> <code>true</code> to set execute permission, + * <code>false</code> to unset execute permission. + * @return <code>true</code> if the file permissions are changed, + * <code>false</code> otherwise. + * @exception SecurityException If write access of the file is not permitted. + * @see #setExecutable(boolean, boolean) + * @since 1.6 + */ + public boolean setExecutable(boolean executable) + { + return setExecutable(executable, true); + } + + /** + * This method sets the execute permissions for the File represented by + * this object. + * + * If <code>ownerOnly</code> is set to <code>true</code> then only the + * execute permission bit for the owner of the file is changed. + * + * If <code>ownerOnly</code> is set to <code>false</code>, the file + * permissions are changed so that the file can be executed by everyone. + * + * On unix like systems this set the <code>user</code>, <code>group</code> + * and <code>other</code> write bits and is equal to call + * <code>chmod a+x</code> on the file. + * + * @param <code>executable</code> <code>true</code> to set write permission, + * <code>false</code> to unset write permission. + * @param <code>ownerOnly</code> <code>true</code> to set write permission + * for owner only, <code>false</code> for all. + * @return <code>true</code> if the file permissions are changed, + * <code>false</code> otherwise. + * @exception SecurityException If write access of the file is not permitted. + * @see #setExecutable(boolean) + * @since 1.6 + */ + public boolean setExecutable(boolean executable, boolean ownerOnly) + { + checkWrite(); + return setFilePermissions(executable, ownerOnly, EXEC); + } + + /* * This native method sets the permissions to make the file read only. */ private native boolean performSetReadOnly(); @@ -1372,6 +1547,15 @@ public class File implements Serializable, Comparable s.checkRead(path); } + private void checkExec() + { + // Check the SecurityManager + SecurityManager s = System.getSecurityManager(); + + if (s != null) + s.checkExec(path); + } + /** * Calling this method requests that the file represented by this object * be deleted when the virtual machine exits. Note that this request cannot diff --git a/libjava/java/io/ObjectInputStream.h b/libjava/java/io/ObjectInputStream.h index eedf6c4aa6f..ab7c47d2b29 100644 --- a/libjava/java/io/ObjectInputStream.h +++ b/libjava/java/io/ObjectInputStream.h @@ -16,8 +16,10 @@ class java::io::ObjectInputStream : public ::java::io::InputStream public: ObjectInputStream(::java::io::InputStream *); virtual ::java::lang::Object * readObject(); + virtual ::java::lang::Object * readUnshared(); private: - ::java::lang::Object * parseContent(jbyte); + ::java::lang::Object * readObject(jboolean); + ::java::lang::Object * parseContent(jbyte, jboolean); void checkTypeConsistency(::java::lang::String *, JArray< ::java::io::ObjectStreamField * > *, JArray< ::java::io::ObjectStreamField * > *); public: // actually protected virtual ::java::io::ObjectStreamClass * readClassDescriptor(); @@ -60,10 +62,10 @@ public: // actually protected ObjectInputStream(); virtual ::java::lang::Object * readObjectOverride(); private: - jint assignNewHandle(::java::lang::Object *); - void rememberHandle(::java::lang::Object *, jint); + jint assignNewHandle(::java::lang::Object *, jboolean); + void rememberHandle(::java::lang::Object *, jboolean, jint); ::java::lang::Object * lookupHandle(jint); - ::java::lang::Object * processResolution(::java::io::ObjectStreamClass *, ::java::lang::Object *, jint); + ::java::lang::Object * processResolution(::java::io::ObjectStreamClass *, ::java::lang::Object *, jint, jboolean); void clearHandles(); void readNextBlock(); void readNextBlock(jbyte); @@ -86,7 +88,7 @@ private: jboolean useSubclassMethod; jint nextOID; jboolean resolveEnabled; - ::java::util::Vector * objectLookupTable; + ::java::util::Map * handles; ::java::lang::Object * currentObject; ::java::io::ObjectStreamClass * currentObjectStreamClass; ::java::util::TreeSet * currentObjectValidators; diff --git a/libjava/java/io/ObjectOutputStream.h b/libjava/java/io/ObjectOutputStream.h index 496da4e35aa..fe6f88f11a8 100644 --- a/libjava/java/io/ObjectOutputStream.h +++ b/libjava/java/io/ObjectOutputStream.h @@ -36,6 +36,9 @@ class java::io::ObjectOutputStream : public ::java::io::OutputStream public: ObjectOutputStream(::java::io::OutputStream *); virtual void writeObject(::java::lang::Object *); + virtual void writeUnshared(::java::lang::Object *); +private: + void writeObject(::java::lang::Object *, jboolean); public: // actually protected virtual void writeClassDescriptor(::java::io::ObjectStreamClass *); public: diff --git a/libjava/java/io/natFilePosix.cc b/libjava/java/io/natFilePosix.cc index c9bf858f187..d63625f57a5 100644 --- a/libjava/java/io/natFilePosix.cc +++ b/libjava/java/io/natFilePosix.cc @@ -43,15 +43,18 @@ java::io::File::_access (jint query) char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1); jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf); buf[total] = '\0'; - JvAssert (query == READ || query == WRITE || query == EXISTS); + JvAssert (query == READ || query == WRITE || query == EXISTS + || query == EXEC); #ifdef HAVE_ACCESS int mode; if (query == READ) mode = R_OK; else if (query == WRITE) mode = W_OK; - else + else if (query == EXISTS) mode = F_OK; + else + mode = X_OK; return ::access (buf, mode) == 0; #else return false; @@ -344,6 +347,54 @@ java::io::File::performMkdir (void) } jboolean +java::io::File::setFilePermissions (jboolean enable, + jboolean ownerOnly, + jint permissions) +{ + char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1); + jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf); + buf[total] = '\0'; + JvAssert (permissions == READ || permissions == WRITE || permissions == EXEC); +#if defined (HAVE_STAT) && defined (HAVE_CHMOD) + mode_t mode = 0; + + struct stat sb; + if (::stat (buf, &sb)) + return false; + + if (ownerOnly) + { + if (permissions == READ) + mode |= S_IRUSR; + else if (permissions == WRITE) + mode |= S_IWUSR; + else if (permissions == EXEC) + mode |= S_IXUSR; + } + else + { + if (permissions == READ) + mode |= (S_IRUSR | S_IRGRP | S_IROTH); + else if (permissions == WRITE) + mode |= (S_IWUSR | S_IWGRP | S_IWOTH); + else if (permissions == EXEC) + mode |= (S_IXUSR | S_IXGRP | S_IXOTH); + } + + if (enable) + mode = sb.st_mode | mode; + else + mode = sb.st_mode & ~mode; + + if (::chmod(buf, mode) < 0) + return false; + return true; +#else + return false; +#endif +} + +jboolean java::io::File::performSetReadOnly (void) { char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1); diff --git a/libjava/java/io/natFileWin32.cc b/libjava/java/io/natFileWin32.cc index cff86dda7e9..316977b08a9 100644 --- a/libjava/java/io/natFileWin32.cc +++ b/libjava/java/io/natFileWin32.cc @@ -44,13 +44,17 @@ java::io::File::_access (jint query) if (!canon) return false; - JvAssert (query == READ || query == WRITE || query == EXISTS); + JvAssert (query == READ || query == WRITE || query == EXISTS + || query == EXEC); // FIXME: Is it possible to differentiate between existing and reading? // If the file exists but cannot be read because of the secuirty attributes // on an NTFS disk this wont work (it reports it can be read but cant) // Could we use something from the security API? DWORD attributes = GetFileAttributes (canon); + // FIXME: handle EXEC + if (query == EXEC) + return false; if ((query == EXISTS) || (query == READ)) return (attributes == 0xffffffff) ? false : true; else @@ -212,6 +216,25 @@ java::io::File::performList (java::io::FilenameFilter *filter, } jboolean +java::io::File::setFilePermissions (jboolean enable, + jboolean ownerOnly, + jint permissions) +{ + JV_TEMP_STRING_WIN32 (canon, getCanonicalPath()); + if (!canon) + return false; + + DWORD attrs = GetFileAttributes (canon); + if (attrs != INVALID_FILE_ATTRIBUTES) + { + // FIXME: implement + return false; + } + else + return false; +} + +jboolean java::io::File::performMkdir (void) { JV_TEMP_STRING_WIN32 (cpath, path); diff --git a/libjava/java/lang/Character.java b/libjava/java/lang/Character.java index 0cc9d3c57bd..2edf72e675e 100644 --- a/libjava/java/lang/Character.java +++ b/libjava/java/lang/Character.java @@ -163,7 +163,7 @@ public final class Character implements Serializable, Comparable<Character> private final String canonicalName; /** Enumeration for the <code>forName()</code> method */ - private enum NameType { CANONICAL, NO_SPACES, CONSTANT; }; + private enum NameType { CANONICAL, NO_SPACES, CONSTANT; } /** * Constructor for strictly defined blocks. diff --git a/libjava/java/lang/Class$1.h b/libjava/java/lang/Class$1.h new file mode 100644 index 00000000000..4f68936d754 --- /dev/null +++ b/libjava/java/lang/Class$1.h @@ -0,0 +1,24 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_lang_Class$1__ +#define __java_lang_Class$1__ + +#pragma interface + +#include <java/lang/Object.h> + +class java::lang::Class$1 : public ::java::lang::Object +{ + +public: // actually package-private + Class$1(::java::lang::reflect::AccessibleObject *); +public: + ::java::lang::Object * run(); +private: + ::java::lang::reflect::AccessibleObject * __attribute__((aligned(__alignof__( ::java::lang::Object)))) val$obj; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_lang_Class$1__ diff --git a/libjava/java/lang/Class.java b/libjava/java/lang/Class.java index b0151db7e2d..67805172aa0 100644 --- a/libjava/java/lang/Class.java +++ b/libjava/java/lang/Class.java @@ -51,6 +51,8 @@ import java.lang.reflect.Method; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.Arrays; @@ -60,6 +62,7 @@ import java.util.Collection; import java.lang.reflect.AnnotatedElement; import java.lang.annotation.Annotation; import java.lang.annotation.Inherited; +import java.lang.reflect.AccessibleObject; /** * A Class represents a Java type. There will never be multiple Class @@ -1004,7 +1007,9 @@ public final class Class<T> { try { - return (T[]) getMethod("values").invoke(null); + Method m = getMethod("values"); + setAccessible(m); + return (T[]) m.invoke(null); } catch (NoSuchMethodException exception) { @@ -1402,4 +1407,19 @@ public final class Class<T> * @since 1.5 */ public native boolean isMemberClass(); + + /** + * Utility method for use by classes in this package. + */ + static void setAccessible(final AccessibleObject obj) + { + AccessController.doPrivileged(new PrivilegedAction() + { + public Object run() + { + obj.setAccessible(true); + return null; + } + }); + } } diff --git a/libjava/java/lang/Enum.h b/libjava/java/lang/Enum.h index a75f2766c93..15ccb16151d 100644 --- a/libjava/java/lang/Enum.h +++ b/libjava/java/lang/Enum.h @@ -25,6 +25,9 @@ public: virtual ::java::lang::String * name(); virtual jint ordinal(); virtual ::java::lang::Class * getDeclaringClass(); +public: // actually protected + virtual void finalize(); +public: virtual jint compareTo(::java::lang::Object *); private: static const jlong serialVersionUID = -4300926546619394005LL; diff --git a/libjava/java/lang/SecurityContext.h b/libjava/java/lang/SecurityContext.h deleted file mode 100644 index e7b0e595deb..00000000000 --- a/libjava/java/lang/SecurityContext.h +++ /dev/null @@ -1,23 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_lang_SecurityContext__ -#define __java_lang_SecurityContext__ - -#pragma interface - -#include <java/lang/Object.h> -#include <gcj/array.h> - - -class java::lang::SecurityContext : public ::java::lang::Object -{ - -public: // actually package-private - SecurityContext(JArray< ::java::lang::Class * > *); - JArray< ::java::lang::Class * > * __attribute__((aligned(__alignof__( ::java::lang::Object)))) classes; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_lang_SecurityContext__ diff --git a/libjava/java/lang/System.h b/libjava/java/lang/System.h index 5a759678328..8a67628b0cc 100644 --- a/libjava/java/lang/System.h +++ b/libjava/java/lang/System.h @@ -7,6 +7,19 @@ #pragma interface #include <java/lang/Object.h> +extern "Java" +{ + namespace java + { + namespace nio + { + namespace channels + { + class Channel; + } + } + } +} class java::lang::System : public ::java::lang::Object { @@ -44,6 +57,7 @@ private: public: // actually package-private static ::java::lang::String * getenv0(::java::lang::String *); public: + static ::java::nio::channels::Channel * inheritedChannel(); static ::java::io::InputStream * in; static ::java::io::PrintStream * out; static ::java::io::PrintStream * err; diff --git a/libjava/java/lang/System.java b/libjava/java/lang/System.java index b516a513e75..ecfad255758 100644 --- a/libjava/java/lang/System.java +++ b/libjava/java/lang/System.java @@ -46,8 +46,11 @@ import java.io.BufferedOutputStream; import java.io.FileDescriptor; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; +import java.nio.channels.Channel; +import java.nio.channels.spi.SelectorProvider; import java.util.AbstractCollection; import java.util.ArrayList; import java.util.Collection; @@ -649,6 +652,25 @@ public final class System */ static native String getenv0(String name); + /** + * Returns the inherited channel of the VM. + * + * This wraps the inheritedChannel() call of the system's default + * {@link SelectorProvider}. + * + * @return the inherited channel of the VM + * + * @throws IOException If an I/O error occurs + * @throws SecurityException If an installed security manager denies access + * to RuntimePermission("inheritedChannel") + * + * @since 1.5 + */ + public static Channel inheritedChannel() + throws IOException + { + return SelectorProvider.provider().inheritedChannel(); + } /** * This is a specialised <code>Collection</code>, providing diff --git a/libjava/java/lang/management/LockInfo.h b/libjava/java/lang/management/LockInfo.h new file mode 100644 index 00000000000..ec4291753a0 --- /dev/null +++ b/libjava/java/lang/management/LockInfo.h @@ -0,0 +1,26 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_lang_management_LockInfo__ +#define __java_lang_management_LockInfo__ + +#pragma interface + +#include <java/lang/Object.h> + +class java::lang::management::LockInfo : public ::java::lang::Object +{ + +public: + LockInfo(::java::lang::String *, jint); + virtual ::java::lang::String * getClassName(); + virtual jint getIdentityHashCode(); + virtual ::java::lang::String * toString(); +private: + ::java::lang::String * __attribute__((aligned(__alignof__( ::java::lang::Object)))) className; + jint identityHashCode; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_lang_management_LockInfo__ diff --git a/libjava/java/lang/management/ManagementFactory$ManagementInvocationHandler.h b/libjava/java/lang/management/ManagementFactory$ManagementInvocationHandler.h new file mode 100644 index 00000000000..33603be2035 --- /dev/null +++ b/libjava/java/lang/management/ManagementFactory$ManagementInvocationHandler.h @@ -0,0 +1,38 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_lang_management_ManagementFactory$ManagementInvocationHandler__ +#define __java_lang_management_ManagementFactory$ManagementInvocationHandler__ + +#pragma interface + +#include <java/lang/Object.h> +#include <gcj/array.h> + +extern "Java" +{ + namespace javax + { + namespace management + { + class MBeanServerConnection; + class ObjectName; + } + } +} + +class java::lang::management::ManagementFactory$ManagementInvocationHandler : public ::java::lang::Object +{ + +public: + ManagementFactory$ManagementInvocationHandler(::javax::management::MBeanServerConnection *, ::javax::management::ObjectName *); + virtual ::java::lang::Object * invoke(::java::lang::Object *, ::java::lang::reflect::Method *, JArray< ::java::lang::Object * > *); +private: + ::java::lang::Object * translate(::java::lang::Object *, ::java::lang::reflect::Method *); + ::javax::management::MBeanServerConnection * __attribute__((aligned(__alignof__( ::java::lang::Object)))) conn; + ::javax::management::ObjectName * bean; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_lang_management_ManagementFactory$ManagementInvocationHandler__ diff --git a/libjava/java/lang/management/ManagementFactory.h b/libjava/java/lang/management/ManagementFactory.h index a315333be05..c51809371b6 100644 --- a/libjava/java/lang/management/ManagementFactory.h +++ b/libjava/java/lang/management/ManagementFactory.h @@ -14,6 +14,7 @@ extern "Java" namespace management { class MBeanServer; + class MBeanServerConnection; } } } @@ -33,6 +34,7 @@ public: static ::java::util::List * getMemoryManagerMXBeans(); static ::java::util::List * getGarbageCollectorMXBeans(); static ::javax::management::MBeanServer * getPlatformMBeanServer(); + static ::java::lang::Object * newPlatformMXBeanProxy(::javax::management::MBeanServerConnection *, ::java::lang::String *, ::java::lang::Class *); static ::java::lang::String * CLASS_LOADING_MXBEAN_NAME; static ::java::lang::String * COMPILATION_MXBEAN_NAME; static ::java::lang::String * GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE; diff --git a/libjava/java/lang/management/MonitorInfo.h b/libjava/java/lang/management/MonitorInfo.h new file mode 100644 index 00000000000..6d2a0f01fd1 --- /dev/null +++ b/libjava/java/lang/management/MonitorInfo.h @@ -0,0 +1,39 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_lang_management_MonitorInfo__ +#define __java_lang_management_MonitorInfo__ + +#pragma interface + +#include <java/lang/management/LockInfo.h> +extern "Java" +{ + namespace javax + { + namespace management + { + namespace openmbean + { + class CompositeData; + } + } + } +} + +class java::lang::management::MonitorInfo : public ::java::lang::management::LockInfo +{ + +public: + MonitorInfo(::java::lang::String *, jint, jint, ::java::lang::StackTraceElement *); + static ::java::lang::management::MonitorInfo * from(::javax::management::openmbean::CompositeData *); + virtual jint getLockedStackDepth(); + virtual ::java::lang::StackTraceElement * getLockedStackFrame(); +private: + jint __attribute__((aligned(__alignof__( ::java::lang::management::LockInfo)))) stackDepth; + ::java::lang::StackTraceElement * stackFrame; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_lang_management_MonitorInfo__ diff --git a/libjava/java/lang/management/OperatingSystemMXBean.h b/libjava/java/lang/management/OperatingSystemMXBean.h index adb562cf516..bbf37070be7 100644 --- a/libjava/java/lang/management/OperatingSystemMXBean.h +++ b/libjava/java/lang/management/OperatingSystemMXBean.h @@ -15,6 +15,7 @@ public: virtual ::java::lang::String * getArch() = 0; virtual jint getAvailableProcessors() = 0; virtual ::java::lang::String * getName() = 0; + virtual jdouble getSystemLoadAverage() = 0; virtual ::java::lang::String * getVersion() = 0; static ::java::lang::Class class$; } __attribute__ ((java_interface)); diff --git a/libjava/java/lang/management/ThreadInfo.h b/libjava/java/lang/management/ThreadInfo.h index a06b99ce4cc..c3902b3d61f 100644 --- a/libjava/java/lang/management/ThreadInfo.h +++ b/libjava/java/lang/management/ThreadInfo.h @@ -29,13 +29,19 @@ class java::lang::management::ThreadInfo : public ::java::lang::Object { ThreadInfo(::java::lang::Thread *, jlong, jlong, ::java::lang::Object *, ::java::lang::Thread *, jlong, jlong, jboolean, jboolean, JArray< ::java::lang::StackTraceElement * > *); + ThreadInfo(::java::lang::Thread *, jlong, jlong, ::java::lang::Object *, ::java::lang::Thread *, jlong, jlong, jboolean, jboolean, JArray< ::java::lang::StackTraceElement * > *, JArray< ::java::lang::management::MonitorInfo * > *, JArray< ::java::lang::management::LockInfo * > *); ThreadInfo(jlong, ::java::lang::String *, ::java::lang::Thread$State *, jlong, jlong, ::java::lang::String *, jlong, ::java::lang::String *, jlong, jlong, jboolean, jboolean, JArray< ::java::lang::StackTraceElement * > *); + ThreadInfo(jlong, ::java::lang::String *, ::java::lang::Thread$State *, jlong, jlong, ::java::lang::String *, jlong, ::java::lang::String *, jlong, jlong, jboolean, jboolean, JArray< ::java::lang::StackTraceElement * > *, JArray< ::java::lang::management::MonitorInfo * > *, JArray< ::java::lang::management::LockInfo * > *); public: // actually package-private static void checkAttribute(::javax::management::openmbean::CompositeType *, ::java::lang::String *, ::javax::management::openmbean::OpenType *); + static ::javax::management::openmbean::CompositeType * getStackTraceType(); public: static ::java::lang::management::ThreadInfo * from(::javax::management::openmbean::CompositeData *); virtual jlong getBlockedCount(); virtual jlong getBlockedTime(); + virtual JArray< ::java::lang::management::MonitorInfo * > * getLockedMonitors(); + virtual JArray< ::java::lang::management::LockInfo * > * getLockedSynchronizers(); + virtual ::java::lang::management::LockInfo * getLockInfo(); virtual ::java::lang::String * getLockName(); virtual jlong getLockOwnerId(); virtual ::java::lang::String * getLockOwnerName(); @@ -49,6 +55,7 @@ public: virtual jboolean isSuspended(); virtual ::java::lang::String * toString(); private: + jboolean isThreadBlocked(); jlong __attribute__((aligned(__alignof__( ::java::lang::Object)))) threadId; ::java::lang::String * threadName; ::java::lang::Thread$State * threadState; @@ -62,7 +69,10 @@ private: jboolean isInNative__; jboolean isSuspended__; JArray< ::java::lang::StackTraceElement * > * trace; + JArray< ::java::lang::management::MonitorInfo * > * lockedMonitors; + JArray< ::java::lang::management::LockInfo * > * lockedSynchronizers; static ::java::lang::management::ThreadMXBean * bean; + static ::javax::management::openmbean::CompositeType * seType; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/lang/management/ThreadMXBean.h b/libjava/java/lang/management/ThreadMXBean.h index a160b088149..a1d4636c93d 100644 --- a/libjava/java/lang/management/ThreadMXBean.h +++ b/libjava/java/lang/management/ThreadMXBean.h @@ -14,6 +14,8 @@ class java::lang::management::ThreadMXBean : public ::java::lang::Object { public: + virtual JArray< ::java::lang::management::ThreadInfo * > * dumpAllThreads(jboolean, jboolean) = 0; + virtual JArray< jlong > * findDeadlockedThreads() = 0; virtual JArray< jlong > * findMonitorDeadlockedThreads() = 0; virtual JArray< jlong > * getAllThreadIds() = 0; virtual jlong getCurrentThreadCpuTime() = 0; @@ -24,11 +26,14 @@ public: virtual jlong getThreadCpuTime(jlong) = 0; virtual ::java::lang::management::ThreadInfo * getThreadInfo(jlong) = 0; virtual JArray< ::java::lang::management::ThreadInfo * > * getThreadInfo(JArray< jlong > *) = 0; + virtual JArray< ::java::lang::management::ThreadInfo * > * getThreadInfo(JArray< jlong > *, jboolean, jboolean) = 0; virtual ::java::lang::management::ThreadInfo * getThreadInfo(jlong, jint) = 0; virtual JArray< ::java::lang::management::ThreadInfo * > * getThreadInfo(JArray< jlong > *, jint) = 0; virtual jlong getThreadUserTime(jlong) = 0; virtual jlong getTotalStartedThreadCount() = 0; virtual jboolean isCurrentThreadCpuTimeSupported() = 0; + virtual jboolean isObjectMonitorUsageSupported() = 0; + virtual jboolean isSynchronizerUsageSupported() = 0; virtual jboolean isThreadContentionMonitoringEnabled() = 0; virtual jboolean isThreadContentionMonitoringSupported() = 0; virtual jboolean isThreadCpuTimeEnabled() = 0; diff --git a/libjava/java/net/MulticastSocket.java b/libjava/java/net/MulticastSocket.java index e24b1947731..efd66b3d51c 100644 --- a/libjava/java/net/MulticastSocket.java +++ b/libjava/java/net/MulticastSocket.java @@ -1,5 +1,5 @@ /* MulticastSocket.java -- Class for using multicast sockets - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -338,7 +338,7 @@ public class MulticastSocket extends DatagramSocket /** * Sets the "Time to Live" value for a socket. The value must be between - * 1 and 255. + * 0 and 255, inclusive. * * @param ttl The new TTL value * @@ -351,7 +351,7 @@ public class MulticastSocket extends DatagramSocket if (isClosed()) throw new SocketException("socket is closed"); - if (ttl <= 0 || ttl > 255) + if (ttl < 0 || ttl > 255) throw new IllegalArgumentException("Invalid ttl: " + ttl); getImpl().setTimeToLive(ttl); diff --git a/libjava/java/net/ServerSocket.h b/libjava/java/net/ServerSocket.h index af51cb6d864..98c77c61ba8 100644 --- a/libjava/java/net/ServerSocket.h +++ b/libjava/java/net/ServerSocket.h @@ -9,6 +9,16 @@ #include <java/lang/Object.h> extern "Java" { + namespace gnu + { + namespace java + { + namespace net + { + class PlainSocketImpl; + } + } + } namespace java { namespace net @@ -35,7 +45,7 @@ class java::net::ServerSocket : public ::java::lang::Object { public: // actually package-private - ServerSocket(::java::net::SocketImpl *); + ServerSocket(::gnu::java::net::PlainSocketImpl *); virtual ::java::net::SocketImpl * getImpl(); public: ServerSocket(); diff --git a/libjava/java/net/Socket.h b/libjava/java/net/Socket.h index bb0bf38b000..776d6fc473a 100644 --- a/libjava/java/net/Socket.h +++ b/libjava/java/net/Socket.h @@ -91,6 +91,7 @@ public: public: // actually package-private static ::java::net::SocketImplFactory * factory; ::java::net::SocketImpl * __attribute__((aligned(__alignof__( ::java::lang::Object)))) impl; + jboolean implCreated; jboolean bound; private: jboolean inputShutdown; diff --git a/libjava/java/net/URL$1.h b/libjava/java/net/URL$1.h index d81ebe4bc0d..7e2875e5814 100644 --- a/libjava/java/net/URL$1.h +++ b/libjava/java/net/URL$1.h @@ -24,6 +24,7 @@ class java::net::URL$1 : public ::java::lang::Object public: // actually package-private URL$1(); public: + ::java::lang::ClassLoader * URL$1$run(); ::java::lang::Object * run(); static ::java::lang::Class class$; }; diff --git a/libjava/java/net/URLClassLoader$1.h b/libjava/java/net/URLClassLoader$1.h index d7f57791125..a7fb5505b2b 100644 --- a/libjava/java/net/URLClassLoader$1.h +++ b/libjava/java/net/URLClassLoader$1.h @@ -31,6 +31,7 @@ class java::net::URLClassLoader$1 : public ::java::lang::Object public: // actually package-private URLClassLoader$1(::java::net::URLClassLoader *, ::java::lang::String *, JArray< jbyte > *, ::java::security::CodeSource *); public: + ::java::lang::Class * URLClassLoader$1$run(); ::java::lang::Object * run(); public: // actually package-private ::java::net::URLClassLoader * __attribute__((aligned(__alignof__( ::java::lang::Object)))) this$0; diff --git a/libjava/java/net/URLClassLoader$2.h b/libjava/java/net/URLClassLoader$2.h index 274d4c33a1e..c7222d3f7d0 100644 --- a/libjava/java/net/URLClassLoader$2.h +++ b/libjava/java/net/URLClassLoader$2.h @@ -13,6 +13,7 @@ extern "Java" { namespace net { + class URLClassLoader; class URLClassLoader$2; } } @@ -24,6 +25,7 @@ class java::net::URLClassLoader$2 : public ::java::lang::Object public: // actually package-private URLClassLoader$2(::java::lang::ClassLoader *, ::java::lang::Object *); public: + ::java::net::URLClassLoader * URLClassLoader$2$run(); ::java::lang::Object * run(); private: ::java::lang::ClassLoader * __attribute__((aligned(__alignof__( ::java::lang::Object)))) val$parent; diff --git a/libjava/java/net/URLClassLoader$CoreResource.h b/libjava/java/net/URLClassLoader$CoreResource.h deleted file mode 100644 index ff3314a33bf..00000000000 --- a/libjava/java/net/URLClassLoader$CoreResource.h +++ /dev/null @@ -1,46 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$CoreResource__ -#define __java_net_URLClassLoader$CoreResource__ - -#pragma interface - -#include <java/net/URLClassLoader$Resource.h> -extern "Java" -{ - namespace gnu - { - namespace gcj - { - class Core; - } - } - namespace java - { - namespace net - { - class URL; - class URLClassLoader$CoreResource; - class URLClassLoader$CoreURLLoader; - } - } -} - -class java::net::URLClassLoader$CoreResource : public ::java::net::URLClassLoader$Resource -{ - -public: // actually package-private - URLClassLoader$CoreResource(::java::net::URLClassLoader$CoreURLLoader *, ::java::lang::String *, ::gnu::gcj::Core *); - ::java::io::InputStream * getInputStream(); -public: - jint getLength(); - ::java::net::URL * getURL(); -private: - ::gnu::gcj::Core * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$Resource)))) core; - ::java::lang::String * name; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$CoreResource__ diff --git a/libjava/java/net/URLClassLoader$CoreURLLoader.h b/libjava/java/net/URLClassLoader$CoreURLLoader.h deleted file mode 100644 index 3c701cddf3a..00000000000 --- a/libjava/java/net/URLClassLoader$CoreURLLoader.h +++ /dev/null @@ -1,36 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$CoreURLLoader__ -#define __java_net_URLClassLoader$CoreURLLoader__ - -#pragma interface - -#include <java/net/URLClassLoader$URLLoader.h> -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader; - class URLClassLoader$CoreURLLoader; - class URLClassLoader$Resource; - } - } -} - -class java::net::URLClassLoader$CoreURLLoader : public ::java::net::URLClassLoader$URLLoader -{ - -public: // actually package-private - URLClassLoader$CoreURLLoader(::java::net::URLClassLoader *, ::java::net::URL *); - ::java::net::URLClassLoader$Resource * getResource(::java::lang::String *); -private: - ::java::lang::String * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$URLLoader)))) dir; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$CoreURLLoader__ diff --git a/libjava/java/net/URLClassLoader$FileResource.h b/libjava/java/net/URLClassLoader$FileResource.h deleted file mode 100644 index a98e9bf223a..00000000000 --- a/libjava/java/net/URLClassLoader$FileResource.h +++ /dev/null @@ -1,38 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$FileResource__ -#define __java_net_URLClassLoader$FileResource__ - -#pragma interface - -#include <java/net/URLClassLoader$Resource.h> -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader$FileResource; - class URLClassLoader$FileURLLoader; - } - } -} - -class java::net::URLClassLoader$FileResource : public ::java::net::URLClassLoader$Resource -{ - -public: // actually package-private - URLClassLoader$FileResource(::java::net::URLClassLoader$FileURLLoader *, ::java::io::File *); - ::java::io::InputStream * getInputStream(); -public: - jint getLength(); - ::java::net::URL * getURL(); -public: // actually package-private - ::java::io::File * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$Resource)))) file; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$FileResource__ diff --git a/libjava/java/net/URLClassLoader$FileURLLoader.h b/libjava/java/net/URLClassLoader$FileURLLoader.h deleted file mode 100644 index ff0b7dc7ce6..00000000000 --- a/libjava/java/net/URLClassLoader$FileURLLoader.h +++ /dev/null @@ -1,35 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$FileURLLoader__ -#define __java_net_URLClassLoader$FileURLLoader__ - -#pragma interface - -#include <java/net/URLClassLoader$URLLoader.h> -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader; - class URLClassLoader$FileURLLoader; - class URLClassLoader$Resource; - } - } -} - -class java::net::URLClassLoader$FileURLLoader : public ::java::net::URLClassLoader$URLLoader -{ - -public: // actually package-private - URLClassLoader$FileURLLoader(::java::net::URLClassLoader *, ::java::net::URL *, ::java::net::URL *); - ::java::net::URLClassLoader$Resource * getResource(::java::lang::String *); - ::java::io::File * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$URLLoader)))) dir; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$FileURLLoader__ diff --git a/libjava/java/net/URLClassLoader$JarURLLoader.h b/libjava/java/net/URLClassLoader$JarURLLoader.h deleted file mode 100644 index f1a36153a2c..00000000000 --- a/libjava/java/net/URLClassLoader$JarURLLoader.h +++ /dev/null @@ -1,40 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$JarURLLoader__ -#define __java_net_URLClassLoader$JarURLLoader__ - -#pragma interface - -#include <java/net/URLClassLoader$URLLoader.h> -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader; - class URLClassLoader$JarURLLoader; - class URLClassLoader$Resource; - } - } -} - -class java::net::URLClassLoader$JarURLLoader : public ::java::net::URLClassLoader$URLLoader -{ - -public: - URLClassLoader$JarURLLoader(::java::net::URLClassLoader *, ::java::net::URL *, ::java::net::URL *); -public: // actually package-private - ::java::net::URLClassLoader$Resource * getResource(::java::lang::String *); - ::java::util::jar::Manifest * getManifest(); - ::java::util::Vector * getClassPath(); - ::java::util::jar::JarFile * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$URLLoader)))) jarfile; - ::java::net::URL * baseJarURL; - ::java::util::Vector * classPath; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$JarURLLoader__ diff --git a/libjava/java/net/URLClassLoader$JarURLResource.h b/libjava/java/net/URLClassLoader$JarURLResource.h deleted file mode 100644 index 0db0fdeec99..00000000000 --- a/libjava/java/net/URLClassLoader$JarURLResource.h +++ /dev/null @@ -1,48 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$JarURLResource__ -#define __java_net_URLClassLoader$JarURLResource__ - -#pragma interface - -#include <java/net/URLClassLoader$Resource.h> -#include <gcj/array.h> - -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader$JarURLLoader; - class URLClassLoader$JarURLResource; - } - namespace security - { - namespace cert - { - class Certificate; - } - } - } -} - -class java::net::URLClassLoader$JarURLResource : public ::java::net::URLClassLoader$Resource -{ - -public: // actually package-private - URLClassLoader$JarURLResource(::java::net::URLClassLoader$JarURLLoader *, ::java::lang::String *, ::java::util::jar::JarEntry *); - ::java::io::InputStream * getInputStream(); - jint getLength(); - JArray< ::java::security::cert::Certificate * > * getCertificates(); - ::java::net::URL * getURL(); -private: - ::java::util::jar::JarEntry * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$Resource)))) entry; - ::java::lang::String * name; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$JarURLResource__ diff --git a/libjava/java/net/URLClassLoader$RemoteResource.h b/libjava/java/net/URLClassLoader$RemoteResource.h deleted file mode 100644 index 10d2622c9fe..00000000000 --- a/libjava/java/net/URLClassLoader$RemoteResource.h +++ /dev/null @@ -1,40 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$RemoteResource__ -#define __java_net_URLClassLoader$RemoteResource__ - -#pragma interface - -#include <java/net/URLClassLoader$Resource.h> -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader$RemoteResource; - class URLClassLoader$RemoteURLLoader; - } - } -} - -class java::net::URLClassLoader$RemoteResource : public ::java::net::URLClassLoader$Resource -{ - -public: // actually package-private - URLClassLoader$RemoteResource(::java::net::URLClassLoader$RemoteURLLoader *, ::java::lang::String *, ::java::net::URL *, ::java::io::InputStream *, jint); - ::java::io::InputStream * getInputStream(); -public: - jint getLength(); - ::java::net::URL * getURL(); -private: - ::java::net::URL * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$Resource)))) url; - ::java::io::InputStream * stream; - jint length; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$RemoteResource__ diff --git a/libjava/java/net/URLClassLoader$RemoteURLLoader.h b/libjava/java/net/URLClassLoader$RemoteURLLoader.h deleted file mode 100644 index 7c2876b4ef6..00000000000 --- a/libjava/java/net/URLClassLoader$RemoteURLLoader.h +++ /dev/null @@ -1,36 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$RemoteURLLoader__ -#define __java_net_URLClassLoader$RemoteURLLoader__ - -#pragma interface - -#include <java/net/URLClassLoader$URLLoader.h> -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader; - class URLClassLoader$RemoteURLLoader; - class URLClassLoader$Resource; - } - } -} - -class java::net::URLClassLoader$RemoteURLLoader : public ::java::net::URLClassLoader$URLLoader -{ - -public: // actually package-private - URLClassLoader$RemoteURLLoader(::java::net::URLClassLoader *, ::java::net::URL *); - ::java::net::URLClassLoader$Resource * getResource(::java::lang::String *); -private: - ::java::lang::String * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$URLLoader)))) protocol; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$RemoteURLLoader__ diff --git a/libjava/java/net/URLClassLoader$Resource.h b/libjava/java/net/URLClassLoader$Resource.h deleted file mode 100644 index 7fc102a9224..00000000000 --- a/libjava/java/net/URLClassLoader$Resource.h +++ /dev/null @@ -1,48 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$Resource__ -#define __java_net_URLClassLoader$Resource__ - -#pragma interface - -#include <java/lang/Object.h> -#include <gcj/array.h> - -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader$Resource; - class URLClassLoader$URLLoader; - } - namespace security - { - class CodeSource; - namespace cert - { - class Certificate; - } - } - } -} - -class java::net::URLClassLoader$Resource : public ::java::lang::Object -{ - -public: // actually package-private - URLClassLoader$Resource(::java::net::URLClassLoader$URLLoader *); - virtual ::java::security::CodeSource * getCodeSource(); - virtual JArray< ::java::security::cert::Certificate * > * getCertificates(); - virtual ::java::net::URL * getURL() = 0; - virtual jint getLength() = 0; - virtual ::java::io::InputStream * getInputStream() = 0; - ::java::net::URLClassLoader$URLLoader * __attribute__((aligned(__alignof__( ::java::lang::Object)))) loader; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$Resource__ diff --git a/libjava/java/net/URLClassLoader$SoResource.h b/libjava/java/net/URLClassLoader$SoResource.h deleted file mode 100644 index dce7601125f..00000000000 --- a/libjava/java/net/URLClassLoader$SoResource.h +++ /dev/null @@ -1,38 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$SoResource__ -#define __java_net_URLClassLoader$SoResource__ - -#pragma interface - -#include <java/net/URLClassLoader$Resource.h> -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader$SoResource; - class URLClassLoader$SoURLLoader; - } - } -} - -class java::net::URLClassLoader$SoResource : public ::java::net::URLClassLoader$Resource -{ - -public: // actually package-private - URLClassLoader$SoResource(::java::net::URLClassLoader$SoURLLoader *, ::java::net::URL *); - ::java::io::InputStream * getInputStream(); -public: - jint getLength(); - ::java::net::URL * getURL(); -public: // actually package-private - ::java::net::URL * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$Resource)))) url; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$SoResource__ diff --git a/libjava/java/net/URLClassLoader$SoURLLoader.h b/libjava/java/net/URLClassLoader$SoURLLoader.h deleted file mode 100644 index 85d2d2e991a..00000000000 --- a/libjava/java/net/URLClassLoader$SoURLLoader.h +++ /dev/null @@ -1,47 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$SoURLLoader__ -#define __java_net_URLClassLoader$SoURLLoader__ - -#pragma interface - -#include <java/net/URLClassLoader$URLLoader.h> -extern "Java" -{ - namespace gnu - { - namespace gcj - { - namespace runtime - { - class SharedLibHelper; - } - } - } - namespace java - { - namespace net - { - class URL; - class URLClassLoader; - class URLClassLoader$Resource; - class URLClassLoader$SoURLLoader; - } - } -} - -class java::net::URLClassLoader$SoURLLoader : public ::java::net::URLClassLoader$URLLoader -{ - -public: // actually package-private - URLClassLoader$SoURLLoader(::java::net::URLClassLoader *, ::java::net::URL *); - URLClassLoader$SoURLLoader(::java::net::URLClassLoader *, ::java::net::URL *, ::java::net::URL *); - ::java::lang::Class * getClass(::java::lang::String *); - ::java::net::URLClassLoader$Resource * getResource(::java::lang::String *); - ::gnu::gcj::runtime::SharedLibHelper * __attribute__((aligned(__alignof__( ::java::net::URLClassLoader$URLLoader)))) helper; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$SoURLLoader__ diff --git a/libjava/java/net/URLClassLoader$URLLoader.h b/libjava/java/net/URLClassLoader$URLLoader.h deleted file mode 100644 index f205d74b3db..00000000000 --- a/libjava/java/net/URLClassLoader$URLLoader.h +++ /dev/null @@ -1,45 +0,0 @@ - -// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- - -#ifndef __java_net_URLClassLoader$URLLoader__ -#define __java_net_URLClassLoader$URLLoader__ - -#pragma interface - -#include <java/lang/Object.h> -extern "Java" -{ - namespace java - { - namespace net - { - class URL; - class URLClassLoader; - class URLClassLoader$Resource; - class URLClassLoader$URLLoader; - } - namespace security - { - class CodeSource; - } - } -} - -class java::net::URLClassLoader$URLLoader : public ::java::lang::Object -{ - -public: // actually package-private - URLClassLoader$URLLoader(::java::net::URLClassLoader *, ::java::net::URL *); - URLClassLoader$URLLoader(::java::net::URLClassLoader *, ::java::net::URL *, ::java::net::URL *); - virtual ::java::lang::Class * getClass(::java::lang::String *); - virtual ::java::net::URLClassLoader$Resource * getResource(::java::lang::String *) = 0; - virtual ::java::util::jar::Manifest * getManifest(); - virtual ::java::util::Vector * getClassPath(); - ::java::net::URLClassLoader * __attribute__((aligned(__alignof__( ::java::lang::Object)))) classloader; - ::java::net::URL * baseURL; - ::java::security::CodeSource * noCertCodeSource; -public: - static ::java::lang::Class class$; -}; - -#endif // __java_net_URLClassLoader$URLLoader__ diff --git a/libjava/java/nio/channels/spi/SelectorProvider.h b/libjava/java/nio/channels/spi/SelectorProvider.h index 6dcf15c5fb4..a6b7052beab 100644 --- a/libjava/java/nio/channels/spi/SelectorProvider.h +++ b/libjava/java/nio/channels/spi/SelectorProvider.h @@ -15,6 +15,7 @@ extern "Java" { namespace channels { + class Channel; class DatagramChannel; class Pipe; class ServerSocketChannel; @@ -40,6 +41,7 @@ public: virtual ::java::nio::channels::spi::AbstractSelector * openSelector() = 0; virtual ::java::nio::channels::ServerSocketChannel * openServerSocketChannel() = 0; virtual ::java::nio::channels::SocketChannel * openSocketChannel() = 0; + virtual ::java::nio::channels::Channel * inheritedChannel(); static ::java::nio::channels::spi::SelectorProvider * provider(); private: static ::java::nio::channels::spi::SelectorProvider * systemDefaultProvider; diff --git a/libjava/java/security/cert/X509CertSelector.h b/libjava/java/security/cert/X509CertSelector.h index 69dd81e50eb..f1d5b3a8fbd 100644 --- a/libjava/java/security/cert/X509CertSelector.h +++ b/libjava/java/security/cert/X509CertSelector.h @@ -18,6 +18,13 @@ extern "Java" namespace security { class OID; + namespace x509 + { + namespace ext + { + class GeneralName; + } + } } } } @@ -60,51 +67,61 @@ extern "Java" class java::security::cert::X509CertSelector : public ::java::lang::Object { + static jboolean checkOid(JArray< jint > *); + static ::gnu::java::security::x509::ext::GeneralName * makeName(jint, ::java::lang::String *); public: X509CertSelector(); + virtual void addPathToName(jint, JArray< jbyte > *); + virtual void addPathToName(jint, ::java::lang::String *); + virtual void addSubjectAlternativeName(jint, JArray< jbyte > *); + virtual void addSubjectAlternativeName(jint, ::java::lang::String *); + virtual ::java::lang::Object * clone(); + virtual JArray< jbyte > * getAuthorityKeyIdentifier(); + virtual jint getBasicConstraints(); virtual ::java::security::cert::X509Certificate * getCertificate(); - virtual void setCertificate(::java::security::cert::X509Certificate *); - virtual ::java::math::BigInteger * getSerialNumber(); - virtual void setSerialNumber(::java::math::BigInteger *); - virtual ::java::lang::String * getIssuerAsString(); + virtual ::java::util::Date * getCertificateValid(); + virtual ::java::util::Set * getExtendedKeyUsage(); virtual JArray< jbyte > * getIssuerAsBytes(); - virtual void setIssuer(::java::lang::String *); - virtual void setIssuer(JArray< jbyte > *); - virtual ::java::lang::String * getSubjectAsString(); + virtual ::java::lang::String * getIssuerAsString(); + virtual JArray< jboolean > * getKeyUsage(); + virtual jboolean getMatchAllSubjectAltNames(); + virtual JArray< jbyte > * getNameConstraints(); + virtual ::java::util::Collection * getPathToNames(); + virtual ::java::util::Set * getPolicy(); + virtual ::java::util::Date * getPrivateKeyValid(); + virtual ::java::math::BigInteger * getSerialNumber(); + virtual ::java::util::Collection * getSubjectAlternativeNames(); virtual JArray< jbyte > * getSubjectAsBytes(); - virtual void setSubject(::java::lang::String *); - virtual void setSubject(JArray< jbyte > *); + virtual ::java::lang::String * getSubjectAsString(); virtual JArray< jbyte > * getSubjectKeyIdentifier(); - virtual void setSubjectKeyIdentifier(JArray< jbyte > *); - virtual JArray< jbyte > * getAuthorityKeyIdentifier(); + virtual ::java::security::PublicKey * getSubjectPublicKey(); + virtual ::java::lang::String * getSubjectPublicKeyAlgID(); + virtual jboolean match(::java::security::cert::Certificate *); virtual void setAuthorityKeyIdentifier(JArray< jbyte > *); - virtual ::java::util::Date * getCertificateValid(); + virtual void setBasicConstraints(jint); + virtual void setCertificate(::java::security::cert::X509Certificate *); virtual void setCertificateValid(::java::util::Date *); - virtual ::java::util::Date * getPrivateKeyValid(); - virtual void setPrivateKeyValid(::java::util::Date *); - virtual ::java::lang::String * getSubjectPublicKeyAlgID(); - virtual void setSubjectPublicKeyAlgID(::java::lang::String *); - virtual ::java::security::PublicKey * getSubjectPublicKey(); - virtual void setSubjectPublicKey(::java::security::PublicKey *); - virtual void setSubjectPublicKey(JArray< jbyte > *); - virtual JArray< jboolean > * getKeyUsage(); - virtual void setKeyUsage(JArray< jboolean > *); - virtual ::java::util::Set * getExtendedKeyUsage(); virtual void setExtendedKeyUsage(::java::util::Set *); - virtual jboolean getMatchAllSubjectAltNames(); + virtual void setIssuer(JArray< jbyte > *); + virtual void setIssuer(::java::lang::String *); + virtual void setKeyUsage(JArray< jboolean > *); virtual void setMatchAllSubjectAltNames(jboolean); - virtual void setSubjectAlternativeNames(::java::util::Collection *); - virtual void addSubjectAlternativeName(jint, ::java::lang::String *); - virtual void addSubjectAlternativeName(jint, JArray< jbyte > *); - virtual JArray< jbyte > * getNameConstraints(); virtual void setNameConstraints(JArray< jbyte > *); - virtual jint getBasicConstraints(); - virtual void setBasicConstraints(jint); - virtual jboolean match(::java::security::cert::Certificate *); + virtual void setPathToNames(::java::util::Collection *); + virtual void setPolicy(::java::util::Set *); + virtual void setPrivateKeyValid(::java::util::Date *); + virtual void setSerialNumber(::java::math::BigInteger *); + virtual void setSubject(JArray< jbyte > *); + virtual void setSubject(::java::lang::String *); + virtual void setSubjectAlternativeNames(::java::util::Collection *); + virtual void setSubjectKeyIdentifier(JArray< jbyte > *); + virtual void setSubjectPublicKey(JArray< jbyte > *); + virtual void setSubjectPublicKey(::java::security::PublicKey *); + virtual void setSubjectPublicKeyAlgID(::java::lang::String *); virtual ::java::lang::String * toString(); - virtual ::java::lang::Object * clone(); +public: // actually package-private + static JArray< jint > * $SWITCH_TABLE$gnu$java$security$x509$ext$GeneralName$Kind(); private: - static jboolean checkOid(JArray< jint > *); static ::java::lang::String * AUTH_KEY_ID; static ::java::lang::String * SUBJECT_KEY_ID; static ::java::lang::String * NAME_CONSTRAINTS_ID; @@ -125,6 +142,8 @@ private: jboolean matchAllNames; JArray< jbyte > * nameConstraints; ::java::util::Set * policy; + ::java::util::List * pathToNames; + static JArray< jint > * $SWITCH_TABLE$gnu$java$security$x509$ext$GeneralName$Kind__; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/text/Collator.java b/libjava/java/text/Collator.java index aa643163943..3e64172632d 100644 --- a/libjava/java/text/Collator.java +++ b/libjava/java/text/Collator.java @@ -38,10 +38,13 @@ exception statement from your version. */ package java.text; +import java.text.spi.CollatorProvider; + import java.util.Comparator; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; +import java.util.ServiceLoader; /** * This class is the abstract superclass of classes which perform @@ -286,7 +289,8 @@ public abstract class Collator implements Comparator<Object>, Cloneable /** * This method returns an instance of <code>Collator</code> for the * specified locale. If no <code>Collator</code> exists for the desired - * locale, a <code>Collator</code> for the default locale will be returned. + * locale, the fallback procedure described in + * {@link java.util.spi.LocaleServiceProvider} is invoked. * * @param loc The desired locale to load a <code>Collator</code> for. * @@ -294,27 +298,52 @@ public abstract class Collator implements Comparator<Object>, Cloneable */ public static Collator getInstance (Locale loc) { - ResourceBundle res; String pattern; try { - res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", - loc, ClassLoader.getSystemClassLoader()); - pattern = res.getString("collation_rules"); + ResourceBundle res = + ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", + loc, ClassLoader.getSystemClassLoader()); + return new RuleBasedCollator(res.getString("collation_rules")); } catch (MissingResourceException x) { - pattern = "<0<1<2<3<4<5<6<7<8<9<A,a<b,B<c,C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K" + - "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,T<u,U<v,V<w,W<x,X<y,Y<z,Z"; - } - try - { - return new RuleBasedCollator (pattern); + /* This means runtime support for the locale + * is not available, so we check providers. */ } catch (ParseException x) { throw (InternalError)new InternalError().initCause(x); } + for (CollatorProvider p : ServiceLoader.load(CollatorProvider.class)) + { + for (Locale l : p.getAvailableLocales()) + { + if (l.equals(loc)) + { + Collator c = p.getInstance(loc); + if (c != null) + return c; + break; + } + } + } + if (loc.equals(Locale.ROOT)) + { + try + { + return new RuleBasedCollator("<0<1<2<3<4<5<6<7<8<9<A,a<b,B<c," + + "C<d,D<e,E<f,F<g,G<h,H<i,I<j,J<k,K" + + "<l,L<m,M<n,N<o,O<p,P<q,Q<r,R<s,S<t,"+ + "T<u,U<v,V<w,W<x,X<y,Y<z,Z"); + } + catch (ParseException x) + { + throw (InternalError)new InternalError().initCause(x); + } + } + // FIXME + return getInstance(Locale.US); } /** diff --git a/libjava/java/text/DateFormat.h b/libjava/java/text/DateFormat.h index 447fef3b3ce..7f82499eea6 100644 --- a/libjava/java/text/DateFormat.h +++ b/libjava/java/text/DateFormat.h @@ -39,6 +39,7 @@ public: private: static ::java::text::DateFormat * computeInstance(jint, ::java::util::Locale *, jboolean, jboolean); static ::java::text::DateFormat * computeInstance(jint, jint, ::java::util::Locale *, jboolean, jboolean); + static ::java::text::DateFormat * computeDefault(jint, jint, jboolean, jboolean); public: static ::java::text::DateFormat * getDateInstance(); static ::java::text::DateFormat * getDateInstance(jint); diff --git a/libjava/java/text/DateFormatSymbols.h b/libjava/java/text/DateFormatSymbols.h index 1ef65b7cabd..9836ea51273 100644 --- a/libjava/java/text/DateFormatSymbols.h +++ b/libjava/java/text/DateFormatSymbols.h @@ -50,6 +50,8 @@ public: virtual jboolean equals(::java::lang::Object *); virtual ::java::lang::Object * clone(); virtual jint hashCode(); + static ::java::text::DateFormatSymbols * getInstance(); + static ::java::text::DateFormatSymbols * getInstance(::java::util::Locale *); public: // actually package-private JArray< ::java::lang::String * > * __attribute__((aligned(__alignof__( ::java::lang::Object)))) ampms; JArray< ::java::lang::String * > * eras; @@ -61,6 +63,7 @@ public: // actually package-private JArray< ::java::lang::String * > * shortWeekdays; JArray< ::java::lang::String * > * weekdays; private: + JArray< JArray< ::java::lang::String * > * > * runtimeZoneStrings; JArray< JArray< ::java::lang::String * > * > * zoneStrings; static const jlong serialVersionUID = -5987973545549424702LL; static JArray< ::java::lang::String * > * formatPrefixes; diff --git a/libjava/java/text/DateFormatSymbols.java b/libjava/java/text/DateFormatSymbols.java index 27a806df1b6..2ca513e6d0a 100644 --- a/libjava/java/text/DateFormatSymbols.java +++ b/libjava/java/text/DateFormatSymbols.java @@ -1,5 +1,5 @@ /* DateFormatSymbols.java -- Format over a range of numbers - Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,14 +38,25 @@ exception statement from your version. */ package java.text; +import gnu.java.locale.LocaleHelper; + +import java.text.spi.DateFormatSymbolsProvider; + +import java.util.ArrayList; +import java.util.List; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; +import java.util.ServiceLoader; +import java.util.TimeZone; + +import java.util.spi.TimeZoneNameProvider; /** * This class acts as container for locale specific date/time formatting * information such as the days of the week and the months of the year. * @author Per Bothner (bothner@cygnus.com) + * * @date October 24, 1998. */ /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3. @@ -60,6 +71,15 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable String[] shortMonths; String[] shortWeekdays; String[] weekdays; + + /** + * The timezone strings supplied by the runtime. + */ + private String[][] runtimeZoneStrings; + + /** + * Custom timezone strings supplied by {@link #setZoneStrings()}. + */ private String[][] zoneStrings; private static final long serialVersionUID = -5987973545549424702L; @@ -91,11 +111,18 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable /** * This method initializes a new instance of <code>DateFormatSymbols</code> * by loading the date format information for the specified locale. + * This constructor only obtains instances using the runtime's resources; + * to also include {@link java.text.spi.DateFormatSymbolsProvider} instances, + * call {@link #getInstance(java.util.Locale)} instead. * * @param locale The locale for which date formatting symbols should * be loaded. + * @throws MissingResourceException if the resources for the specified + * locale could not be found or loaded. + * @see #getInstance(java.util.Locale) */ - public DateFormatSymbols (Locale locale) throws MissingResourceException + public DateFormatSymbols (Locale locale) + throws MissingResourceException { ResourceBundle res = ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", locale, @@ -116,9 +143,16 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable /** * This method loads the format symbol information for the default - * locale. + * locale. This constructor only obtains instances using the runtime's resources; + * to also include {@link java.text.spi.DateFormatSymbolsProvider} instances, + * call {@link #getInstance()} instead. + * + * @throws MissingResourceException if the resources for the default + * locale could not be found or loaded. + * @see #getInstance() */ - public DateFormatSymbols () throws MissingResourceException + public DateFormatSymbols() + throws MissingResourceException { this (Locale.getDefault()); } @@ -499,4 +533,65 @@ public class DateFormatSymbols implements java.io.Serializable, Cloneable ^ hashCode(weekdays) ^ hashCode(zoneStrings)); } + + /** + * Returns a {@link DateFormatSymbols} instance for the + * default locale obtained from either the runtime itself + * or one of the installed + * {@link java.text.spi.DateFormatSymbolsProvider} instances. + * This is equivalent to calling + * <code>getInstance(Locale.getDefault())</code>. + * + * @return a {@link DateFormatSymbols} instance for the default + * locale. + * @since 1.6 + */ + public static final DateFormatSymbols getInstance() + { + return getInstance(Locale.getDefault()); + } + + /** + * Returns a {@link DateFormatSymbols} instance for the + * specified locale obtained from either the runtime itself + * or one of the installed + * {@link java.text.spi.DateFormatSymbolsProvider} instances. + * + * @param locale the locale for which an instance should be + * returned. + * @return a {@link DateFormatSymbols} instance for the specified + * locale. + * @throws NullPointerException if <code>locale</code> is + * <code>null</code>. + * @since 1.6 + */ + public static final DateFormatSymbols getInstance(Locale locale) + { + try + { + DateFormatSymbols syms = new DateFormatSymbols(locale); + return syms; + } + catch (MissingResourceException e) + { + /* This means runtime support for the locale + * is not available, so we check providers. */ + } + for (DateFormatSymbolsProvider p : + ServiceLoader.load(DateFormatSymbolsProvider.class)) + { + for (Locale loc : p.getAvailableLocales()) + { + if (loc.equals(locale)) + { + DateFormatSymbols syms = p.getInstance(locale); + if (syms != null) + return syms; + break; + } + } + } + return getInstance(LocaleHelper.getFallbackLocale(locale)); + } + } diff --git a/libjava/java/text/DecimalFormatSymbols.h b/libjava/java/text/DecimalFormatSymbols.h index b38140c0620..8967572f19a 100644 --- a/libjava/java/text/DecimalFormatSymbols.h +++ b/libjava/java/text/DecimalFormatSymbols.h @@ -67,6 +67,10 @@ public: void setZeroDigit(jchar); private: void readObject(::java::io::ObjectInputStream *); +public: + static ::java::text::DecimalFormatSymbols * getInstance(); + static ::java::text::DecimalFormatSymbols * getInstance(::java::util::Locale *); +private: ::java::lang::String * __attribute__((aligned(__alignof__( ::java::lang::Object)))) currencySymbol; jchar decimalSeparator; jchar digit; diff --git a/libjava/java/text/DecimalFormatSymbols.java b/libjava/java/text/DecimalFormatSymbols.java index 110e45f1200..b72f144546b 100644 --- a/libjava/java/text/DecimalFormatSymbols.java +++ b/libjava/java/text/DecimalFormatSymbols.java @@ -38,13 +38,19 @@ exception statement from your version. */ package java.text; +import gnu.java.locale.LocaleHelper; + import java.io.IOException; import java.io.ObjectInputStream; import java.io.Serializable; + +import java.text.spi.DecimalFormatSymbolsProvider; + import java.util.Currency; import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; +import java.util.ServiceLoader; /** * This class is a container for the symbols used by @@ -77,6 +83,11 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable /** * This method initializes a new instance of * <code>DecimalFormatSymbols</code> for the default locale. + * This constructor only obtains instances using the runtime's resources; + * to also include {@link java.text.spi.DateFormatSymbolsProvider} instances, + * call {@link #getInstance()} instead. + * + * @see #getInstance() */ public DecimalFormatSymbols () { @@ -664,4 +675,68 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable serialVersionOnStream = 2; } + + /** + * Returns a {@link DecimalFormatSymbols} instance for the + * default locale obtained from either the runtime itself + * or one of the installed + * {@link java.text.spi.DecimalFormatSymbolsProvider} instances. + * This is equivalent to calling + * <code>getInstance(Locale.getDefault())</code>. + * + * @return a {@link DecimalFormatSymbols} instance for the default + * locale. + * @since 1.6 + */ + public static final DecimalFormatSymbols getInstance() + { + return getInstance(Locale.getDefault()); + } + + /** + * Returns a {@link DecimalFormatSymbols} instance for the + * specified locale obtained from either the runtime itself + * or one of the installed + * {@link java.text.spi.DecimalFormatSymbolsProvider} instances. + * + * @param locale the locale for which an instance should be + * returned. + * @return a {@link DecimalFormatSymbols} instance for the specified + * locale. + * @throws NullPointerException if <code>locale</code> is + * <code>null</code>. + * @since 1.6 + */ + public static final DecimalFormatSymbols getInstance(Locale locale) + { + try + { + if (!locale.equals(Locale.ROOT)) + ResourceBundle.getBundle("gnu.java.locale.LocaleInformation", + locale, + ClassLoader.getSystemClassLoader()); + return new DecimalFormatSymbols(locale); + } + catch (MissingResourceException x) + { + /* This means runtime support for the locale + * is not available, so we check providers. */ + } + for (DecimalFormatSymbolsProvider p : + ServiceLoader.load(DecimalFormatSymbolsProvider.class)) + { + for (Locale loc : p.getAvailableLocales()) + { + if (loc.equals(locale)) + { + DecimalFormatSymbols syms = p.getInstance(locale); + if (syms != null) + return syms; + break; + } + } + } + return getInstance(LocaleHelper.getFallbackLocale(locale)); + } + } diff --git a/libjava/java/text/spi/BreakIteratorProvider.h b/libjava/java/text/spi/BreakIteratorProvider.h new file mode 100644 index 00000000000..663dff22f9a --- /dev/null +++ b/libjava/java/text/spi/BreakIteratorProvider.h @@ -0,0 +1,38 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_text_spi_BreakIteratorProvider__ +#define __java_text_spi_BreakIteratorProvider__ + +#pragma interface + +#include <java/util/spi/LocaleServiceProvider.h> +extern "Java" +{ + namespace java + { + namespace text + { + class BreakIterator; + namespace spi + { + class BreakIteratorProvider; + } + } + } +} + +class java::text::spi::BreakIteratorProvider : public ::java::util::spi::LocaleServiceProvider +{ + +public: // actually protected + BreakIteratorProvider(); +public: + virtual ::java::text::BreakIterator * getCharacterInstance(::java::util::Locale *) = 0; + virtual ::java::text::BreakIterator * getLineInstance(::java::util::Locale *) = 0; + virtual ::java::text::BreakIterator * getSentenceInstance(::java::util::Locale *) = 0; + virtual ::java::text::BreakIterator * getWordInstance(::java::util::Locale *) = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_text_spi_BreakIteratorProvider__ diff --git a/libjava/java/text/spi/CollatorProvider.h b/libjava/java/text/spi/CollatorProvider.h new file mode 100644 index 00000000000..bf072711ba8 --- /dev/null +++ b/libjava/java/text/spi/CollatorProvider.h @@ -0,0 +1,35 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_text_spi_CollatorProvider__ +#define __java_text_spi_CollatorProvider__ + +#pragma interface + +#include <java/util/spi/LocaleServiceProvider.h> +extern "Java" +{ + namespace java + { + namespace text + { + class Collator; + namespace spi + { + class CollatorProvider; + } + } + } +} + +class java::text::spi::CollatorProvider : public ::java::util::spi::LocaleServiceProvider +{ + +public: // actually protected + CollatorProvider(); +public: + virtual ::java::text::Collator * getInstance(::java::util::Locale *) = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_text_spi_CollatorProvider__ diff --git a/libjava/java/text/spi/DateFormatProvider.h b/libjava/java/text/spi/DateFormatProvider.h new file mode 100644 index 00000000000..15f6e36e26f --- /dev/null +++ b/libjava/java/text/spi/DateFormatProvider.h @@ -0,0 +1,37 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_text_spi_DateFormatProvider__ +#define __java_text_spi_DateFormatProvider__ + +#pragma interface + +#include <java/util/spi/LocaleServiceProvider.h> +extern "Java" +{ + namespace java + { + namespace text + { + class DateFormat; + namespace spi + { + class DateFormatProvider; + } + } + } +} + +class java::text::spi::DateFormatProvider : public ::java::util::spi::LocaleServiceProvider +{ + +public: // actually protected + DateFormatProvider(); +public: + virtual ::java::text::DateFormat * getDateInstance(jint, ::java::util::Locale *) = 0; + virtual ::java::text::DateFormat * getDateTimeInstance(jint, jint, ::java::util::Locale *) = 0; + virtual ::java::text::DateFormat * getTimeInstance(jint, ::java::util::Locale *) = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_text_spi_DateFormatProvider__ diff --git a/libjava/java/text/spi/DateFormatSymbolsProvider.h b/libjava/java/text/spi/DateFormatSymbolsProvider.h new file mode 100644 index 00000000000..4a701292004 --- /dev/null +++ b/libjava/java/text/spi/DateFormatSymbolsProvider.h @@ -0,0 +1,35 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_text_spi_DateFormatSymbolsProvider__ +#define __java_text_spi_DateFormatSymbolsProvider__ + +#pragma interface + +#include <java/util/spi/LocaleServiceProvider.h> +extern "Java" +{ + namespace java + { + namespace text + { + class DateFormatSymbols; + namespace spi + { + class DateFormatSymbolsProvider; + } + } + } +} + +class java::text::spi::DateFormatSymbolsProvider : public ::java::util::spi::LocaleServiceProvider +{ + +public: // actually protected + DateFormatSymbolsProvider(); +public: + virtual ::java::text::DateFormatSymbols * getInstance(::java::util::Locale *) = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_text_spi_DateFormatSymbolsProvider__ diff --git a/libjava/java/text/spi/DecimalFormatSymbolsProvider.h b/libjava/java/text/spi/DecimalFormatSymbolsProvider.h new file mode 100644 index 00000000000..ceead0294f8 --- /dev/null +++ b/libjava/java/text/spi/DecimalFormatSymbolsProvider.h @@ -0,0 +1,35 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_text_spi_DecimalFormatSymbolsProvider__ +#define __java_text_spi_DecimalFormatSymbolsProvider__ + +#pragma interface + +#include <java/util/spi/LocaleServiceProvider.h> +extern "Java" +{ + namespace java + { + namespace text + { + class DecimalFormatSymbols; + namespace spi + { + class DecimalFormatSymbolsProvider; + } + } + } +} + +class java::text::spi::DecimalFormatSymbolsProvider : public ::java::util::spi::LocaleServiceProvider +{ + +public: // actually protected + DecimalFormatSymbolsProvider(); +public: + virtual ::java::text::DecimalFormatSymbols * getInstance(::java::util::Locale *) = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_text_spi_DecimalFormatSymbolsProvider__ diff --git a/libjava/java/text/spi/NumberFormatProvider.h b/libjava/java/text/spi/NumberFormatProvider.h new file mode 100644 index 00000000000..4224aeaa42a --- /dev/null +++ b/libjava/java/text/spi/NumberFormatProvider.h @@ -0,0 +1,38 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_text_spi_NumberFormatProvider__ +#define __java_text_spi_NumberFormatProvider__ + +#pragma interface + +#include <java/util/spi/LocaleServiceProvider.h> +extern "Java" +{ + namespace java + { + namespace text + { + class NumberFormat; + namespace spi + { + class NumberFormatProvider; + } + } + } +} + +class java::text::spi::NumberFormatProvider : public ::java::util::spi::LocaleServiceProvider +{ + +public: // actually protected + NumberFormatProvider(); +public: + virtual ::java::text::NumberFormat * getCurrencyInstance(::java::util::Locale *) = 0; + virtual ::java::text::NumberFormat * getIntegerInstance(::java::util::Locale *) = 0; + virtual ::java::text::NumberFormat * getNumberInstance(::java::util::Locale *) = 0; + virtual ::java::text::NumberFormat * getPercentInstance(::java::util::Locale *) = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_text_spi_NumberFormatProvider__ diff --git a/libjava/java/util/AbstractMap$SimpleEntry.h b/libjava/java/util/AbstractMap$SimpleEntry.h index 0cc266dfe0a..581205048b5 100644 --- a/libjava/java/util/AbstractMap$SimpleEntry.h +++ b/libjava/java/util/AbstractMap$SimpleEntry.h @@ -20,6 +20,8 @@ public: virtual jint hashCode(); virtual ::java::lang::Object * setValue(::java::lang::Object *); virtual ::java::lang::String * toString(); +private: + static const jlong serialVersionUID = -8499721149061103585LL; public: // actually package-private ::java::lang::Object * __attribute__((aligned(__alignof__( ::java::lang::Object)))) key; ::java::lang::Object * value; diff --git a/libjava/java/util/AbstractMap$SimpleImmutableEntry.h b/libjava/java/util/AbstractMap$SimpleImmutableEntry.h index 540d5f49f4a..f979f8a0c9b 100644 --- a/libjava/java/util/AbstractMap$SimpleImmutableEntry.h +++ b/libjava/java/util/AbstractMap$SimpleImmutableEntry.h @@ -17,6 +17,8 @@ public: virtual ::java::lang::Object * getKey(); virtual ::java::lang::Object * getValue(); virtual ::java::lang::Object * setValue(::java::lang::Object *); +private: + static const jlong serialVersionUID = 7138329143949025153LL; public: // actually package-private ::java::lang::Object * __attribute__((aligned(__alignof__( ::java::lang::Object)))) key; ::java::lang::Object * value; diff --git a/libjava/java/util/Arrays.h b/libjava/java/util/Arrays.h index 6b4941db0ea..4010f602cd1 100644 --- a/libjava/java/util/Arrays.h +++ b/libjava/java/util/Arrays.h @@ -16,14 +16,23 @@ class java::util::Arrays : public ::java::lang::Object Arrays(); public: static jint binarySearch(JArray< jbyte > *, jbyte); + static jint binarySearch(JArray< jbyte > *, jint, jint, jbyte); static jint binarySearch(JArray< jchar > *, jchar); + static jint binarySearch(JArray< jchar > *, jint, jint, jchar); static jint binarySearch(JArray< jshort > *, jshort); + static jint binarySearch(JArray< jshort > *, jint, jint, jshort); static jint binarySearch(JArray< jint > *, jint); + static jint binarySearch(JArray< jint > *, jint, jint, jint); static jint binarySearch(JArray< jlong > *, jlong); + static jint binarySearch(JArray< jlong > *, jint, jint, jlong); static jint binarySearch(JArray< jfloat > *, jfloat); + static jint binarySearch(JArray< jfloat > *, jint, jint, jfloat); static jint binarySearch(JArray< jdouble > *, jdouble); + static jint binarySearch(JArray< jdouble > *, jint, jint, jdouble); static jint binarySearch(JArray< ::java::lang::Object * > *, ::java::lang::Object *); + static jint binarySearch(JArray< ::java::lang::Object * > *, jint, jint, ::java::lang::Object *); static jint binarySearch(JArray< ::java::lang::Object * > *, ::java::lang::Object *, ::java::util::Comparator *); + static jint binarySearch(JArray< ::java::lang::Object * > *, jint, jint, ::java::lang::Object *, ::java::util::Comparator *); static jboolean equals(JArray< jboolean > *, JArray< jboolean > *); static jboolean equals(JArray< jbyte > *, JArray< jbyte > *); static jboolean equals(JArray< jchar > *, JArray< jchar > *); @@ -138,6 +147,26 @@ private: static void deepToString(JArray< ::java::lang::Object * > *, ::java::lang::StringBuilder *, ::java::util::HashSet *); public: static ::java::lang::String * deepToString(JArray< ::java::lang::Object * > *); + static JArray< jboolean > * copyOf(JArray< jboolean > *, jint); + static JArray< jboolean > * copyOfRange(JArray< jboolean > *, jint, jint); + static JArray< jbyte > * copyOf(JArray< jbyte > *, jint); + static JArray< jbyte > * copyOfRange(JArray< jbyte > *, jint, jint); + static JArray< jchar > * copyOf(JArray< jchar > *, jint); + static JArray< jchar > * copyOfRange(JArray< jchar > *, jint, jint); + static JArray< jdouble > * copyOf(JArray< jdouble > *, jint); + static JArray< jdouble > * copyOfRange(JArray< jdouble > *, jint, jint); + static JArray< jfloat > * copyOf(JArray< jfloat > *, jint); + static JArray< jfloat > * copyOfRange(JArray< jfloat > *, jint, jint); + static JArray< jint > * copyOf(JArray< jint > *, jint); + static JArray< jint > * copyOfRange(JArray< jint > *, jint, jint); + static JArray< jlong > * copyOf(JArray< jlong > *, jint); + static JArray< jlong > * copyOfRange(JArray< jlong > *, jint, jint); + static JArray< jshort > * copyOf(JArray< jshort > *, jint); + static JArray< jshort > * copyOfRange(JArray< jshort > *, jint, jint); + static JArray< ::java::lang::Object * > * copyOf(JArray< ::java::lang::Object * > *, jint); + static JArray< ::java::lang::Object * > * copyOfRange(JArray< ::java::lang::Object * > *, jint, jint); + static JArray< ::java::lang::Object * > * copyOf(JArray< ::java::lang::Object * > *, jint, ::java::lang::Class *); + static JArray< ::java::lang::Object * > * copyOfRange(JArray< ::java::lang::Object * > *, jint, jint, ::java::lang::Class *); static ::java::lang::Class class$; }; diff --git a/libjava/java/util/Calendar.h b/libjava/java/util/Calendar.h index 3a46dc03793..5d9fb75e938 100644 --- a/libjava/java/util/Calendar.h +++ b/libjava/java/util/Calendar.h @@ -73,6 +73,8 @@ private: void writeObject(::java::io::ObjectOutputStream *); void readObject(::java::io::ObjectInputStream *); public: + virtual ::java::lang::String * getDisplayName(jint, jint, ::java::util::Locale *); + virtual ::java::util::Map * getDisplayNames(jint, jint, ::java::util::Locale *); virtual jint compareTo(::java::lang::Object *); static const jint ERA = 0; static const jint YEAR = 1; @@ -115,6 +117,9 @@ public: static const jint UNDECIMBER = 12; static const jint AM = 0; static const jint PM = 1; + static const jint ALL_STYLES = 0; + static const jint SHORT = 1; + static const jint LONG = 2; public: // actually protected JArray< jint > * __attribute__((aligned(__alignof__( ::java::lang::Object)))) fields; JArray< jboolean > * isSet__; diff --git a/libjava/java/util/Calendar.java b/libjava/java/util/Calendar.java index 6c0d7213dea..7eab6122a39 100644 --- a/libjava/java/util/Calendar.java +++ b/libjava/java/util/Calendar.java @@ -43,9 +43,12 @@ import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; + import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import java.text.DateFormatSymbols; + /** * This class is an abstract base class for Calendars, which can be * used to convert between <code>Date</code> objects and a set of @@ -99,6 +102,20 @@ day_of_week + week_of_year</pre> * specific field by one, propagating overflows), or * <code>add</code>ing/substracting a fixed amount to a field. * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Jochen Hoenicke (Jochen.Hoenicke@Informatik.Uni-Oldenburg.de) + * @author Warren Levy (warrenl@cygnus.com) + * @author Jeff Sturm (jsturm@one-point.com) + * @author Tom Tromey (tromey@redhat.com) + * @author Bryce McKinlay (mckinlay@redhat.com) + * @author Ingo Proetel (proetel@aicas.com) + * @author Jerry Quinn (jlquinn@optonline.net) + * @author Jeroen Frijters (jeroen@frijters.net) + * @author Noa Resare (noa@resare.com) + * @author Sven de Marothy (sven@physto.se) + * @author David Gilbert (david.gilbert@object-refinery.com) + * @author Olivier Jolly (olivier.jolly@pcedev.com) + * @author Andrew John Hughes (gnu_andrew@member.fsf.org) * @see Date * @see GregorianCalendar * @see TimeZone @@ -326,6 +343,34 @@ public abstract class Calendar public static final int PM = 1; /** + * A style specifier for {@link #getDisplayNames(int,int,Locale)} + * stating that names should be returned in both long and short variants. + * + * @since 1.6 + * @see #SHORT + * @see #LONG + */ + public static final int ALL_STYLES = 0; + + /** + * A style specifier for {@link #getDisplayName(int,int,Locale)} + * and {@link #getDisplayNames(int,int,Locale)} stating that names + * should be returned in their short variant if applicable. + * + * @since 1.6 + */ + public static final int SHORT = 1; + + /** + * A style specifier for {@link #getDisplayName(int,int,Locale)} + * and {@link #getDisplayNames(int,int,Locale)} stating that names + * should be returned in their long variant if applicable. + * + * @since 1.6 + */ + public static final int LONG = 2; + + /** * The time fields. The array is indexed by the constants YEAR to * DST_OFFSET. * @serial @@ -504,7 +549,7 @@ public abstract class Calendar * Cache of locale->calendar-class mappings. This avoids having to do a ResourceBundle * lookup for every getInstance call. */ - private static HashMap cache = new HashMap(); + private static HashMap<Locale,Class> cache = new HashMap<Locale,Class>(); /** Preset argument types for calendar-class constructor lookup. */ private static Class[] ctorArgTypes = new Class[] @@ -526,7 +571,7 @@ public abstract class Calendar */ public static synchronized Calendar getInstance(TimeZone zone, Locale locale) { - Class calendarClass = (Class) cache.get(locale); + Class calendarClass = cache.get(locale); Throwable exception = null; try @@ -1326,4 +1371,205 @@ public abstract class Calendar areFieldsSet = false; } } + + /** + * Returns a localised textual representation of the current value + * of the given field using the specified style. If there is no + * applicable textual representation (e.g. the field has a numeric + * value), then <code>null</code> is returned. If one does exist, + * then the value is obtained from {@link #get(int)} and converted + * appropriately. For example, if the <code>MONTH</code> field is + * requested, then <code>get(MONTH)</code> is called. This is then + * converted to a textual representation based on its value and + * the style requested; if the <code>LONG</code> style is requested + * and the returned value is <code>11</code> from a + * {@link GregorianCalendar} implementation, then <code>"December"</code> + * is returned. By default, a textual representation is available + * for all fields which have an applicable value obtainable from + * {@link java.text.DateFormatSymbols}. + * + * @param field the calendar field whose textual representation should + * be obtained. + * @param style the style to use; either {@link #LONG} or {@link #SHORT}. + * @param locale the locale to use for translation. + * @return the textual representation of the given field in the specified + * style, or <code>null</code> if none is applicable. + * @throws IllegalArgumentException if <code>field</code> or <code>style</code> + * or invalid, or the calendar is non-lenient + * and has invalid values. + * @throws NullPointerException if <code>locale</code> is <code>null</code>. + * @since 1.6 + */ + public String getDisplayName(int field, int style, Locale locale) + { + if (field < 0 || field >= FIELD_COUNT) + throw new IllegalArgumentException("The field value, " + field + + ", is invalid."); + if (style != SHORT && style != LONG) + throw new IllegalArgumentException("The style must be either " + + "short or long."); + if (field == YEAR || field == WEEK_OF_YEAR || + field == WEEK_OF_MONTH || field == DAY_OF_MONTH || + field == DAY_OF_YEAR || field == DAY_OF_WEEK_IN_MONTH || + field == HOUR || field == HOUR_OF_DAY || field == MINUTE || + field == SECOND || field == MILLISECOND) + return null; + + int value = get(field); + DateFormatSymbols syms = DateFormatSymbols.getInstance(locale); + if (field == ERA) + return syms.getEras()[value]; + if (field == MONTH) + if (style == LONG) + return syms.getMonths()[value]; + else + return syms.getShortMonths()[value]; + if (field == DAY_OF_WEEK) + if (style == LONG) + return syms.getWeekdays()[value]; + else + return syms.getShortWeekdays()[value]; + if (field == AM_PM) + return syms.getAmPmStrings()[value]; + if (field == ZONE_OFFSET) + if (style == LONG) + return syms.getZoneStrings()[value][1]; + else + return syms.getZoneStrings()[value][2]; + if (field == DST_OFFSET) + if (style == LONG) + return syms.getZoneStrings()[value][3]; + else + return syms.getZoneStrings()[value][4]; + + throw new InternalError("Failed to resolve field " + field + + " with style " + style + " for locale " + + locale); + } + + /** + * Returns a map linking all specified textual representations + * of the given field to their numerical values. The textual + * representations included are determined by the specified + * style and locale. For example, if the style <code>LONG</code> + * is specified and the German locale, then the map will + * contain "Montag" to {@link #MONDAY}, "Dienstag" to + * {@link #TUESDAY}, "Mittwoch" to {@link #WEDNESDAY} and + * so on. The default implementation uses the values returned + * by {@link DateFormatSymbols} so, for example, the style + * {@link #ALL_STYLES} and the field {@link #MONTH} will return + * a map filled with the values returned from + * {@link DateFormatSymbols#getMonths()} and + * {@link DateFormatSymbols#getShortMonths()}. If there are + * no textual representations for a given field (usually because + * it is purely numeric, such as the year in the + * {@link GregorianCalendar}), <code>null</code> is returned. + * + * @param field the calendar field whose textual representation should + * be obtained. + * @param style the style to use; either {@link #LONG}, {@link #SHORT} + * or {@link ALL_STYLES}. + * @param locale the locale to use for translation. + * @return a map of the textual representations of the given field in the + * specified style to their numeric values, or <code>null</code> + * if none is applicable. + * @throws IllegalArgumentException if <code>field</code> or <code>style</code> + * or invalid, or the calendar is non-lenient + * and has invalid values. + * @throws NullPointerException if <code>locale</code> is <code>null</code>. + * @since 1.6 + */ + public Map<String,Integer> getDisplayNames(int field, int style, Locale locale) + { + if (field < 0 || field >= FIELD_COUNT) + throw new IllegalArgumentException("The field value, " + field + + ", is invalid."); + if (style != SHORT && style != LONG && style != ALL_STYLES) + throw new IllegalArgumentException("The style must be either " + + "short, long or all styles."); + if (field == YEAR || field == WEEK_OF_YEAR || + field == WEEK_OF_MONTH || field == DAY_OF_MONTH || + field == DAY_OF_YEAR || field == DAY_OF_WEEK_IN_MONTH || + field == HOUR || field == HOUR_OF_DAY || field == MINUTE || + field == SECOND || field == MILLISECOND) + return null; + + DateFormatSymbols syms = DateFormatSymbols.getInstance(locale); + Map<String,Integer> map = new HashMap<String,Integer>(); + if (field == ERA) + { + String[] eras = syms.getEras(); + for (int a = 0; a < eras.length; ++a) + map.put(eras[a], a); + return map; + } + if (field == MONTH) + { + if (style == LONG || style == ALL_STYLES) + { + String[] months = syms.getMonths(); + for (int a = 0; a < months.length; ++a) + map.put(months[a], a); + } + if (style == SHORT || style == ALL_STYLES) + { + String[] months = syms.getShortMonths(); + for (int a = 0; a < months.length; ++a) + map.put(months[a], a); + } + return map; + } + if (field == DAY_OF_WEEK) + { + if (style == LONG || style == ALL_STYLES) + { + String[] weekdays = syms.getWeekdays(); + for (int a = SUNDAY; a < weekdays.length; ++a) + map.put(weekdays[a], a); + } + if (style == SHORT || style == ALL_STYLES) + { + String[] weekdays = syms.getShortWeekdays(); + for (int a = SUNDAY; a < weekdays.length; ++a) + map.put(weekdays[a], a); + } + return map; + } + if (field == AM_PM) + { + String[] ampms = syms.getAmPmStrings(); + for (int a = 0; a < ampms.length; ++a) + map.put(ampms[a], a); + return map; + } + if (field == ZONE_OFFSET) + { + String[][] zones = syms.getZoneStrings(); + for (int a = 0; a < zones.length; ++a) + { + if (style == LONG || style == ALL_STYLES) + map.put(zones[a][1], a); + if (style == SHORT || style == ALL_STYLES) + map.put(zones[a][2], a); + } + return map; + } + if (field == DST_OFFSET) + { + String[][] zones = syms.getZoneStrings(); + for (int a = 0; a < zones.length; ++a) + { + if (style == LONG || style == ALL_STYLES) + map.put(zones[a][3], a); + if (style == SHORT || style == ALL_STYLES) + map.put(zones[a][4], a); + } + return map; + } + + throw new InternalError("Failed to resolve field " + field + + " with style " + style + " for locale " + + locale); + } + } diff --git a/libjava/java/util/Collections$LIFOQueue.h b/libjava/java/util/Collections$LIFOQueue.h new file mode 100644 index 00000000000..c053a493271 --- /dev/null +++ b/libjava/java/util/Collections$LIFOQueue.h @@ -0,0 +1,31 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_Collections$LIFOQueue__ +#define __java_util_Collections$LIFOQueue__ + +#pragma interface + +#include <java/util/AbstractQueue.h> + +class java::util::Collections$LIFOQueue : public ::java::util::AbstractQueue +{ + +public: + Collections$LIFOQueue(::java::util::Deque *); + virtual jboolean add(::java::lang::Object *); + virtual jboolean addAll(::java::util::Collection *); + virtual void clear(); + virtual jboolean isEmpty(); + virtual ::java::util::Iterator * iterator(); + virtual jboolean offer(::java::lang::Object *); + virtual ::java::lang::Object * peek(); + virtual ::java::lang::Object * poll(); + virtual jint size(); +private: + ::java::util::Deque * __attribute__((aligned(__alignof__( ::java::util::AbstractQueue)))) deque; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_Collections$LIFOQueue__ diff --git a/libjava/java/util/Collections$MapSet.h b/libjava/java/util/Collections$MapSet.h new file mode 100644 index 00000000000..70caba7822c --- /dev/null +++ b/libjava/java/util/Collections$MapSet.h @@ -0,0 +1,30 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_Collections$MapSet__ +#define __java_util_Collections$MapSet__ + +#pragma interface + +#include <java/util/AbstractSet.h> + +class java::util::Collections$MapSet : public ::java::util::AbstractSet +{ + +public: + Collections$MapSet(::java::util::Map *); + virtual jboolean add(::java::lang::Object *); + virtual jboolean addAll(::java::util::Collection *); + virtual void clear(); + virtual jboolean contains(::java::lang::Object *); + virtual jboolean isEmpty(); + virtual ::java::util::Iterator * iterator(); + virtual jboolean remove(::java::lang::Object *); + virtual jint size(); +private: + ::java::util::Map * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) map; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_Collections$MapSet__ diff --git a/libjava/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet.h b/libjava/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet.h index 1128060de45..8299dc468f1 100644 --- a/libjava/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet.h +++ b/libjava/java/util/Collections$UnmodifiableMap$UnmodifiableEntrySet.h @@ -17,9 +17,8 @@ public: // actually package-private Collections$UnmodifiableMap$UnmodifiableEntrySet(::java::util::Set *); public: ::java::util::Iterator * iterator(); - JArray< ::java::util::Map$Entry * > * Collections$UnmodifiableMap$UnmodifiableEntrySet$toArray(); - JArray< ::java::lang::Object * > * toArray(JArray< ::java::lang::Object * > *); JArray< ::java::lang::Object * > * toArray(); + JArray< ::java::lang::Object * > * toArray(JArray< ::java::lang::Object * > *); private: static const jlong serialVersionUID = 7854390611657943733LL; public: diff --git a/libjava/java/util/Collections.h b/libjava/java/util/Collections.h index 6e11724394a..2ca25f89895 100644 --- a/libjava/java/util/Collections.h +++ b/libjava/java/util/Collections.h @@ -69,6 +69,8 @@ public: static ::java::util::Set * checkedSet(::java::util::Set *, ::java::lang::Class *); static ::java::util::SortedMap * checkedSortedMap(::java::util::SortedMap *, ::java::lang::Class *, ::java::lang::Class *); static ::java::util::SortedSet * checkedSortedSet(::java::util::SortedSet *, ::java::lang::Class *); + static ::java::util::Queue * asLifoQueue(::java::util::Deque *); + static ::java::util::Set * newSetFromMap(::java::util::Map *); private: static const jint LARGE_LIST_SIZE = 16; public: diff --git a/libjava/java/util/LinkedList$1.h b/libjava/java/util/LinkedList$1.h new file mode 100644 index 00000000000..63c402d7de5 --- /dev/null +++ b/libjava/java/util/LinkedList$1.h @@ -0,0 +1,33 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_LinkedList$1__ +#define __java_util_LinkedList$1__ + +#pragma interface + +#include <java/lang/Object.h> + +class java::util::LinkedList$1 : public ::java::lang::Object +{ + +public: // actually package-private + LinkedList$1(::java::util::LinkedList *); +private: + void checkMod(); +public: + jboolean hasNext(); + ::java::lang::Object * next(); + void remove(); +private: + jint __attribute__((aligned(__alignof__( ::java::lang::Object)))) knownMod; + ::java::util::LinkedList$Entry * next__; + ::java::util::LinkedList$Entry * lastReturned; + jint position; +public: // actually package-private + ::java::util::LinkedList * this$0; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_LinkedList$1__ diff --git a/libjava/java/util/LinkedList.h b/libjava/java/util/LinkedList.h index aee4f09d2d3..0c5e681d1aa 100644 --- a/libjava/java/util/LinkedList.h +++ b/libjava/java/util/LinkedList.h @@ -56,6 +56,19 @@ public: private: void writeObject(::java::io::ObjectOutputStream *); void readObject(::java::io::ObjectInputStream *); +public: + virtual ::java::util::Iterator * descendingIterator(); + virtual jboolean offerFirst(::java::lang::Object *); + virtual jboolean offerLast(::java::lang::Object *); + virtual ::java::lang::Object * peekFirst(); + virtual ::java::lang::Object * peekLast(); + virtual ::java::lang::Object * pollFirst(); + virtual ::java::lang::Object * pollLast(); + virtual ::java::lang::Object * pop(); + virtual void push(::java::lang::Object *); + virtual jboolean removeFirstOccurrence(::java::lang::Object *); + virtual jboolean removeLastOccurrence(::java::lang::Object *); +private: static const jlong serialVersionUID = 876323262645176354LL; public: // actually package-private ::java::util::LinkedList$Entry * __attribute__((aligned(__alignof__( ::java::util::AbstractSequentialList)))) first; diff --git a/libjava/java/util/Locale.h b/libjava/java/util/Locale.h index 6868aa1712f..041dab342c4 100644 --- a/libjava/java/util/Locale.h +++ b/libjava/java/util/Locale.h @@ -26,6 +26,9 @@ public: static JArray< ::java::util::Locale * > * getAvailableLocales(); static JArray< ::java::lang::String * > * getISOCountries(); static JArray< ::java::lang::String * > * getISOLanguages(); +private: + static JArray< ::java::lang::String * > * getISOStrings(::java::lang::String *); +public: ::java::lang::String * getLanguage(); ::java::lang::String * getCountry(); ::java::lang::String * getVariant(); @@ -68,13 +71,18 @@ public: static ::java::util::Locale * US; static ::java::util::Locale * CANADA; static ::java::util::Locale * CANADA_FRENCH; + static ::java::util::Locale * ROOT; private: static const jlong serialVersionUID = 9149081749638150636LL; ::java::lang::String * __attribute__((aligned(__alignof__( ::java::lang::Object)))) language; ::java::lang::String * country; ::java::lang::String * variant; jint hashcode; + static JArray< ::java::util::Locale * > * availableLocales; + static ::java::util::HashMap * localeMap; static ::java::util::Locale * defaultLocale; + static JArray< ::java::lang::String * > * languageCache; + static JArray< ::java::lang::String * > * countryCache; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/util/Locale.java b/libjava/java/util/Locale.java deleted file mode 100644 index 03689aa7a8a..00000000000 --- a/libjava/java/util/Locale.java +++ /dev/null @@ -1,864 +0,0 @@ -/* Locale.java -- i18n locales - Copyright (C) 1998, 1999, 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.util; - -import gnu.classpath.SystemProperties; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; - -/** - * Locales represent a specific country and culture. Classes which can be - * passed a Locale object tailor their information for a given locale. For - * instance, currency number formatting is handled differently for the USA - * and France. - * - * <p>Locales are made up of a language code, a country code, and an optional - * set of variant strings. Language codes are represented by - * <a href="http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt"> - * ISO 639:1988</a> w/ additions from ISO 639/RA Newsletter No. 1/1989 - * and a decision of the Advisory Committee of ISO/TC39 on August 8, 1997. - * - * <p>Country codes are represented by - * <a href="http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html"> - * ISO 3166</a>. Variant strings are vendor and browser specific. Standard - * variant strings include "POSIX" for POSIX, "WIN" for MS-Windows, and - * "MAC" for Macintosh. When there is more than one variant string, they must - * be separated by an underscore (U+005F). - * - * <p>The default locale is determined by the values of the system properties - * user.language, user.region, and user.variant, defaulting to "en". Note that - * the locale does NOT contain the conversion and formatting capabilities (for - * that, use ResourceBundle and java.text). Rather, it is an immutable tag - * object for identifying a given locale, which is referenced by these other - * classes when they must make locale-dependent decisions. - * - * @see ResourceBundle - * @see java.text.Format - * @see java.text.NumberFormat - * @see java.text.Collator - * @author Jochen Hoenicke - * @author Paul Fisher - * @author Eric Blake (ebb9@email.byu.edu) - * @author Andrew John Hughes (gnu_andrew@member.fsf.org) - * @since 1.1 - * @status updated to 1.4 - */ -public final class Locale implements Serializable, Cloneable -{ - /** Locale which represents the English language. */ - public static final Locale ENGLISH = getLocale("en"); - - /** Locale which represents the French language. */ - public static final Locale FRENCH = getLocale("fr"); - - /** Locale which represents the German language. */ - public static final Locale GERMAN = getLocale("de"); - - /** Locale which represents the Italian language. */ - public static final Locale ITALIAN = getLocale("it"); - - /** Locale which represents the Japanese language. */ - public static final Locale JAPANESE = getLocale("ja"); - - /** Locale which represents the Korean language. */ - public static final Locale KOREAN = getLocale("ko"); - - /** Locale which represents the Chinese language. */ - public static final Locale CHINESE = getLocale("zh"); - - /** Locale which represents the Chinese language as used in China. */ - public static final Locale SIMPLIFIED_CHINESE = getLocale("zh", "CN"); - - /** - * Locale which represents the Chinese language as used in Taiwan. - * Same as TAIWAN Locale. - */ - public static final Locale TRADITIONAL_CHINESE = getLocale("zh", "TW"); - - /** Locale which represents France. */ - public static final Locale FRANCE = getLocale("fr", "FR"); - - /** Locale which represents Germany. */ - public static final Locale GERMANY = getLocale("de", "DE"); - - /** Locale which represents Italy. */ - public static final Locale ITALY = getLocale("it", "IT"); - - /** Locale which represents Japan. */ - public static final Locale JAPAN = getLocale("ja", "JP"); - - /** Locale which represents Korea. */ - public static final Locale KOREA = getLocale("ko", "KR"); - - /** - * Locale which represents China. - * Same as SIMPLIFIED_CHINESE Locale. - */ - public static final Locale CHINA = SIMPLIFIED_CHINESE; - - /** - * Locale which represents the People's Republic of China. - * Same as CHINA Locale. - */ - public static final Locale PRC = CHINA; - - /** - * Locale which represents Taiwan. - * Same as TRADITIONAL_CHINESE Locale. - */ - public static final Locale TAIWAN = TRADITIONAL_CHINESE; - - /** Locale which represents the United Kingdom. */ - public static final Locale UK = getLocale("en", "GB"); - - /** Locale which represents the United States. */ - public static final Locale US = getLocale("en", "US"); - - /** Locale which represents the English speaking portion of Canada. */ - public static final Locale CANADA = getLocale("en", "CA"); - - /** Locale which represents the French speaking portion of Canada. */ - public static final Locale CANADA_FRENCH = getLocale("fr", "CA"); - - /** - * Compatible with JDK 1.1+. - */ - private static final long serialVersionUID = 9149081749638150636L; - - /** - * The language code, as returned by getLanguage(). - * - * @serial the languange, possibly "" - */ - private String language; - - /** - * The country code, as returned by getCountry(). - * - * @serial the country, possibly "" - */ - private String country; - - /** - * The variant code, as returned by getVariant(). - * - * @serial the variant, possibly "" - */ - private String variant; - - /** - * This is the cached hashcode. When writing to stream, we write -1. - * - * @serial should be -1 in serial streams - */ - private int hashcode; - - /** - * The default locale. Except for during bootstrapping, this should never be - * null. Note the logic in the main constructor, to detect when - * bootstrapping has completed. - */ - private static Locale defaultLocale = - getLocale(SystemProperties.getProperty("user.language", "en"), - SystemProperties.getProperty("user.region", ""), - SystemProperties.getProperty("user.variant", "")); - - /** - * Retrieves the locale with the specified language from the cache. - * - * @param language the language of the locale to retrieve. - * @return the locale. - */ - private static Locale getLocale(String language) - { - return getLocale(language, "", ""); - } - - /** - * Retrieves the locale with the specified language and region - * from the cache. - * - * @param language the language of the locale to retrieve. - * @param region the region of the locale to retrieve. - * @return the locale. - */ - private static Locale getLocale(String language, String region) - { - return getLocale(language, region, ""); - } - - /** - * Retrieves the locale with the specified language, region - * and variant from the cache. - * - * @param language the language of the locale to retrieve. - * @param region the region of the locale to retrieve. - * @param variant the variant of the locale to retrieve. - * @return the locale. - */ - private static Locale getLocale(String language, String region, String variant) - { - return new Locale(language, region, variant); - } - - /** - * Convert new iso639 codes to the old ones. - * - * @param language the language to check - * @return the appropriate code - */ - private String convertLanguage(String language) - { - if (language.equals("")) - return language; - language = language.toLowerCase(); - int index = "he,id,yi".indexOf(language); - if (index != -1) - return "iw,in,ji".substring(index, index + 2); - return language; - } - - /** - * Creates a new locale for the given language and country. - * - * @param language lowercase two-letter ISO-639 A2 language code - * @param country uppercase two-letter ISO-3166 A2 contry code - * @param variant vendor and browser specific - * @throws NullPointerException if any argument is null - */ - public Locale(String language, String country, String variant) - { - // During bootstrap, we already know the strings being passed in are - // the correct capitalization, and not null. We can't call - // String.toUpperCase during this time, since that depends on the - // default locale. - if (defaultLocale != null) - { - language = convertLanguage(language).intern(); - country = country.toUpperCase().intern(); - variant = variant.intern(); - } - this.language = language; - this.country = country; - this.variant = variant; - hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode(); - } - - /** - * Creates a new locale for the given language and country. - * - * @param language lowercase two-letter ISO-639 A2 language code - * @param country uppercase two-letter ISO-3166 A2 country code - * @throws NullPointerException if either argument is null - */ - public Locale(String language, String country) - { - this(language, country, ""); - } - - /** - * Creates a new locale for a language. - * - * @param language lowercase two-letter ISO-639 A2 language code - * @throws NullPointerException if either argument is null - * @since 1.4 - */ - public Locale(String language) - { - this(language, "", ""); - } - - /** - * Returns the default Locale. The default locale is generally once set - * on start up and then never changed. Normally you should use this locale - * for everywhere you need a locale. The initial setting matches the - * default locale, the user has chosen. - * - * @return the default locale for this virtual machine - */ - public static Locale getDefault() - { - return defaultLocale; - } - - /** - * Changes the default locale. Normally only called on program start up. - * Note that this doesn't change the locale for other programs. This has - * a security check, - * <code>PropertyPermission("user.language", "write")</code>, because of - * its potential impact to running code. - * - * @param newLocale the new default locale - * @throws NullPointerException if newLocale is null - * @throws SecurityException if permission is denied - */ - public static void setDefault(Locale newLocale) - { - if (newLocale == null) - throw new NullPointerException(); - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkPermission(new PropertyPermission("user.language", "write")); - defaultLocale = newLocale; - } - - /** - * Returns the list of available locales. - * - * @return the installed locales - */ - public static Locale[] getAvailableLocales() - { - /* I only return those for which localized language - * or country information exists. - * XXX - remove hard coded list, and implement more locales (Sun's JDK 1.4 - * has 148 installed locales!). - */ - return new Locale[] - { - ENGLISH, FRENCH, GERMAN, new Locale("ga", "") - }; - } - - /** - * Returns a list of all 2-letter uppercase country codes as defined - * in ISO 3166. - * - * @return a list of acceptable country codes - */ - public static String[] getISOCountries() - { - return new String[] - { - "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AN", "AO", "AQ", "AR", "AS", - "AT", "AU", "AW", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", - "BJ", "BM", "BN", "BO", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", - "CC", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", - "CV", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", - "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "FX", - "GA", "GB", "GD", "GE", "GF", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", - "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", - "ID", "IE", "IL", "IN", "IO", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", - "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", - "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", - "MD", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", - "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", - "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", - "PH", "PK", "PL", "PM", "PN", "PR", "PT", "PW", "PY", "QA", "RE", "RO", - "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", - "SL", "SM", "SN", "SO", "SR", "ST", "SV", "SY", "SZ", "TC", "TD", "TF", - "TG", "TH", "TJ", "TK", "TM", "TN", "TO", "TP", "TR", "TT", "TV", "TW", - "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", - "VN", "VU", "WF", "WS", "YE", "YT", "YU", "ZA", "ZM", "ZR", "ZW" - }; - } - - /** - * Returns a list of all 2-letter lowercase language codes as defined - * in ISO 639 (both old and new variant). - * - * @return a list of acceptable language codes - */ - public static String[] getISOLanguages() - { - return new String[] - { - "aa", "ab", "af", "am", "ar", "as", "ay", "az", "ba", "be", "bg", "bh", - "bi", "bn", "bo", "br", "ca", "co", "cs", "cy", "da", "de", "dz", "el", - "en", "eo", "es", "et", "eu", "fa", "fi", "fj", "fo", "fr", "fy", "ga", - "gd", "gl", "gn", "gu", "ha", "he", "hi", "hr", "hu", "hy", "ia", "id", - "ie", "ik", "in", "is", "it", "iu", "iw", "ja", "ji", "jw", "ka", "kk", - "kl", "km", "kn", "ko", "ks", "ku", "ky", "la", "ln", "lo", "lt", "lv", - "mg", "mi", "mk", "ml", "mn", "mo", "mr", "ms", "mt", "my", "na", "ne", - "nl", "no", "oc", "om", "or", "pa", "pl", "ps", "pt", "qu", "rm", "rn", - "ro", "ru", "rw", "sa", "sd", "sg", "sh", "si", "sk", "sl", "sm", "sn", - "so", "sq", "sr", "ss", "st", "su", "sv", "sw", "ta", "te", "tg", "th", - "ti", "tk", "tl", "tn", "to", "tr", "ts", "tt", "tw", "ug", "uk", "ur", - "uz", "vi", "vo", "wo", "xh", "yi", "yo", "za", "zh", "zu" - }; - } - - /** - * Returns the language code of this locale. Some language codes have changed - * as ISO 639 has evolved; this returns the old name, even if you built - * the locale with the new one. - * - * @return language code portion of this locale, or an empty String - */ - public String getLanguage() - { - return language; - } - - /** - * Returns the country code of this locale. - * - * @return country code portion of this locale, or an empty String - */ - public String getCountry() - { - return country; - } - - /** - * Returns the variant code of this locale. - * - * @return the variant code portion of this locale, or an empty String - */ - public String getVariant() - { - return variant; - } - - /** - * Gets the string representation of the current locale. This consists of - * the language, the country, and the variant, separated by an underscore. - * The variant is listed only if there is a language or country. Examples: - * "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr__MAC". - * - * @return the string representation of this Locale - * @see #getDisplayName() - */ - public String toString() - { - if (language.length() == 0 && country.length() == 0) - return ""; - else if (country.length() == 0 && variant.length() == 0) - return language; - StringBuffer result = new StringBuffer(language); - result.append('_').append(country); - if (variant.length() != 0) - result.append('_').append(variant); - return result.toString(); - } - - /** - * Returns the three-letter ISO language abbrevation of this locale. - * - * @throws MissingResourceException if the three-letter code is not known - */ - public String getISO3Language() - { - // We know all strings are interned so we can use '==' for better performance. - if (language == "") - return ""; - int index - = ("aa,ab,af,am,ar,as,ay,az,ba,be,bg,bh,bi,bn,bo,br,ca,co,cs,cy,da," - + "de,dz,el,en,eo,es,et,eu,fa,fi,fj,fo,fr,fy,ga,gd,gl,gn,gu,ha,iw," - + "hi,hr,hu,hy,ia,in,ie,ik,in,is,it,iu,iw,ja,ji,jw,ka,kk,kl,km,kn," - + "ko,ks,ku,ky,la,ln,lo,lt,lv,mg,mi,mk,ml,mn,mo,mr,ms,mt,my,na,ne," - + "nl,no,oc,om,or,pa,pl,ps,pt,qu,rm,rn,ro,ru,rw,sa,sd,sg,sh,si,sk," - + "sl,sm,sn,so,sq,sr,ss,st,su,sv,sw,ta,te,tg,th,ti,tk,tl,tn,to,tr," - + "ts,tt,tw,ug,uk,ur,uz,vi,vo,wo,xh,ji,yo,za,zh,zu") - .indexOf(language); - - if (index % 3 != 0 || language.length() != 2) - throw new MissingResourceException - ("Can't find ISO3 language for " + language, - "java.util.Locale", language); - - // Don't read this aloud. These are the three letter language codes. - return - ("aarabkaframharaasmaymazebakbelbulbihbisbenbodbrecatcoscescymdandeu" - + "dzoellengepospaesteusfasfinfijfaofrafrygaigdhglggrngujhauhebhinhrv" - + "hunhyeinaindileipkindislitaikuhebjpnyidjawkatkazkalkhmkankorkaskur" - + "kirlatlinlaolitlavmlgmrimkdmalmonmolmarmsamltmyanaunepnldnorociorm" - + "oripanpolpusporquerohrunronruskinsansndsagsrpsinslkslvsmosnasomsqi" - + "srpsswsotsunsweswatamteltgkthatirtuktgltsntonturtsotattwiuigukrurd" - + "uzbvievolwolxhoyidyorzhazhozul") - .substring(index, index + 3); - } - - /** - * Returns the three-letter ISO country abbrevation of the locale. - * - * @throws MissingResourceException if the three-letter code is not known - */ - public String getISO3Country() - { - // We know all strings are interned so we can use '==' for better performance. - if (country == "") - return ""; - int index - = ("AD,AE,AF,AG,AI,AL,AM,AN,AO,AQ,AR,AS,AT,AU,AW,AZ,BA,BB,BD,BE,BF," - + "BG,BH,BI,BJ,BM,BN,BO,BR,BS,BT,BV,BW,BY,BZ,CA,CC,CF,CG,CH,CI,CK," - + "CL,CM,CN,CO,CR,CU,CV,CX,CY,CZ,DE,DJ,DK,DM,DO,DZ,EC,EE,EG,EH,ER," - + "ES,ET,FI,FJ,FK,FM,FO,FR,FX,GA,GB,GD,GE,GF,GH,GI,GL,GM,GN,GP,GQ," - + "GR,GS,GT,GU,GW,GY,HK,HM,HN,HR,HT,HU,ID,IE,IL,IN,IO,IQ,IR,IS,IT," - + "JM,JO,JP,KE,KG,KH,KI,KM,KN,KP,KR,KW,KY,KZ,LA,LB,LC,LI,LK,LR,LS," - + "LT,LU,LV,LY,MA,MC,MD,MG,MH,MK,ML,MM,MN,MO,MP,MQ,MR,MS,MT,MU,MV," - + "MW,MX,MY,MZ,NA,NC,NE,NF,NG,NI,NL,NO,NP,NR,NU,NZ,OM,PA,PE,PF,PG," - + "PH,PK,PL,PM,PN,PR,PT,PW,PY,QA,RE,RO,RU,RW,SA,SB,SC,SD,SE,SG,SH," - + "SI,SJ,SK,SL,SM,SN,SO,SR,ST,SV,SY,SZ,TC,TD,TF,TG,TH,TJ,TK,TM,TN," - + "TO,TP,TR,TT,TV,TW,TZ,UA,UG,UM,US,UY,UZ,VA,VC,VE,VG,VI,VN,VU,WF," - + "WS,YE,YT,YU,ZA,ZM,ZR,ZW") - .indexOf(country); - - if (index % 3 != 0 || country.length() != 2) - throw new MissingResourceException - ("Can't find ISO3 country for " + country, - "java.util.Locale", country); - - // Don't read this aloud. These are the three letter country codes. - return - ("ANDAREAFGATGAIAALBARMANTAGOATAARGASMAUTAUSABWAZEBIHBRBBGDBELBFABGR" - + "BHRBDIBENBMUBRNBOLBRABHSBTNBVTBWABLRBLZCANCCKCAFCOGCHECIVCOKCHLCMR" - + "CHNCOLCRICUBCPVCXRCYPCZEDEUDJIDNKDMADOMDZAECUESTEGYESHERIESPETHFIN" - + "FJIFLKFSMFROFRAFXXGABGBRGRDGEOGUFGHAGIBGRLGMBGINGLPGNQGRCSGSGTMGUM" - + "GNBGUYHKGHMDHNDHRVHTIHUNIDNIRLISRINDIOTIRQIRNISLITAJAMJORJPNKENKGZ" - + "KHMKIRCOMKNAPRKKORKWTCYMKAZLAOLBNLCALIELKALBRLSOLTULUXLVALBYMARMCO" - + "MDAMDGMHLMKDMLIMMRMNGMACMNPMTQMRTMSRMLTMUSMDVMWIMEXMYSMOZNAMNCLNER" - + "NFKNGANICNLDNORNPLNRUNIUNZLOMNPANPERPYFPNGPHLPAKPOLSPMPCNPRIPRTPLW" - + "PRYQATREUROMRUSRWASAUSLBSYCSDNSWESGPSHNSVNSJMSVKSLESMRSENSOMSURSTP" - + "SLVSYRSWZTCATCDATFTGOTHATJKTKLTKMTUNTONTMPTURTTOTUVTWNTZAUKRUGAUMI" - + "USAURYUZBVATVCTVENVGBVIRVNMVUTWLFWSMYEMMYTYUGZAFZMBZARZWE") - .substring(index, index + 3); - } - - /** - * Gets the country name suitable for display to the user, formatted - * for the default locale. This has the same effect as - * <pre> - * getDisplayLanguage(Locale.getDefault()); - * </pre> - * - * @return the language name of this locale localized to the default locale, - * with the ISO code as backup - */ - public String getDisplayLanguage() - { - return getDisplayLanguage(defaultLocale); - } - - /** - * <p> - * Gets the name of the language specified by this locale, in a form suitable - * for display to the user. If possible, the display name will be localized - * to the specified locale. For example, if the locale instance is - * <code>Locale.GERMANY</code>, and the specified locale is <code>Locale.UK</code>, - * the result would be 'German'. Using the German locale would instead give - * 'Deutsch'. If the display name can not be localized to the supplied - * locale, it will fall back on other output in the following order: - * </p> - * <ul> - * <li>the display name in the default locale</li> - * <li>the display name in English</li> - * <li>the ISO code</li> - * </ul> - * <p> - * If the language is unspecified by this locale, then the empty string is - * returned. - * </p> - * - * @param inLocale the locale to use for formatting the display string. - * @return the language name of this locale localized to the given locale, - * with the default locale, English and the ISO code as backups. - * @throws NullPointerException if the supplied locale is null. - */ - public String getDisplayLanguage(Locale inLocale) - { - try - { - ResourceBundle bundle - = ResourceBundle.getBundle("gnu.java.locale.iso639", inLocale); - return bundle.getString(language); - } - catch (MissingResourceException ex) - { - return language; - } - } - - /** - * Returns the country name of this locale localized to the - * default locale. If the localized is not found, the ISO code - * is returned. This has the same effect as - * <pre> - * getDisplayCountry(Locale.getDefault()); - * </pre> - * - * @return the country name of this locale localized to the given locale, - * with the ISO code as backup - */ - public String getDisplayCountry() - { - return getDisplayCountry(defaultLocale); - } - - /** - * <p> - * Gets the name of the country specified by this locale, in a form suitable - * for display to the user. If possible, the display name will be localized - * to the specified locale. For example, if the locale instance is - * <code>Locale.GERMANY</code>, and the specified locale is <code>Locale.UK</code>, - * the result would be 'Germany'. Using the German locale would instead give - * 'Deutschland'. If the display name can not be localized to the supplied - * locale, it will fall back on other output in the following order: - * </p> - * <ul> - * <li>the display name in the default locale</li> - * <li>the display name in English</li> - * <li>the ISO code</li> - * </ul> - * <p> - * If the country is unspecified by this locale, then the empty string is - * returned. - * </p> - * - * @param inLocale the locale to use for formatting the display string. - * @return the country name of this locale localized to the given locale, - * with the default locale, English and the ISO code as backups. - * @throws NullPointerException if the supplied locale is null. - */ - public String getDisplayCountry(Locale inLocale) - { - try - { - ResourceBundle bundle = - ResourceBundle.getBundle("gnu.java.locale.iso3166", inLocale); - return bundle.getString(country); - } - catch (MissingResourceException ex) - { - return country; - } - } - - /** - * Returns the variant name of this locale localized to the - * default locale. If the localized is not found, the variant code - * itself is returned. This has the same effect as - * <pre> - * getDisplayVariant(Locale.getDefault()); - * </pre> - * - * @return the variant code of this locale localized to the given locale, - * with the ISO code as backup - */ - public String getDisplayVariant() - { - return getDisplayVariant(defaultLocale); - } - - /** - * <p> - * Gets the name of the variant specified by this locale, in a form suitable - * for display to the user. If possible, the display name will be localized - * to the specified locale. For example, if the locale instance is a revised - * variant, and the specified locale is <code>Locale.UK</code>, the result - * would be 'REVISED'. Using the German locale would instead give - * 'Revidiert'. If the display name can not be localized to the supplied - * locale, it will fall back on other output in the following order: - * </p> - * <ul> - * <li>the display name in the default locale</li> - * <li>the display name in English</li> - * <li>the ISO code</li> - * </ul> - * <p> - * If the variant is unspecified by this locale, then the empty string is - * returned. - * </p> - * - * @param inLocale the locale to use for formatting the display string. - * @return the variant name of this locale localized to the given locale, - * with the default locale, English and the ISO code as backups. - * @throws NullPointerException if the supplied locale is null. - */ - public String getDisplayVariant(Locale inLocale) - { - // XXX - load a bundle? - return variant; - } - - /** - * Gets all local components suitable for display to the user, formatted - * for the default locale. For the language component, getDisplayLanguage - * is called. For the country component, getDisplayCountry is called. - * For the variant set component, getDisplayVariant is called. - * - * <p>The returned String will be one of the following forms:<br> - * <pre> - * language (country, variant) - * language (country) - * language (variant) - * country (variant) - * language - * country - * variant - * </pre> - * - * @return String version of this locale, suitable for display to the user - */ - public String getDisplayName() - { - return getDisplayName(defaultLocale); - } - - /** - * Gets all local components suitable for display to the user, formatted - * for a specified locale. For the language component, - * getDisplayLanguage(Locale) is called. For the country component, - * getDisplayCountry(Locale) is called. For the variant set component, - * getDisplayVariant(Locale) is called. - * - * <p>The returned String will be one of the following forms:<br> - * <pre> - * language (country, variant) - * language (country) - * language (variant) - * country (variant) - * language - * country - * variant - * </pre> - * - * @param locale locale to use for formatting - * @return String version of this locale, suitable for display to the user - */ - public String getDisplayName(Locale locale) - { - StringBuffer result = new StringBuffer(); - int count = 0; - String[] delimiters = {"", " (", ","}; - if (language.length() != 0) - { - result.append(delimiters[count++]); - result.append(getDisplayLanguage(locale)); - } - if (country.length() != 0) - { - result.append(delimiters[count++]); - result.append(getDisplayCountry(locale)); - } - if (variant.length() != 0) - { - result.append(delimiters[count++]); - result.append(getDisplayVariant(locale)); - } - if (count > 1) - result.append(")"); - return result.toString(); - } - - /** - * Does the same as <code>Object.clone()</code> but does not throw - * a <code>CloneNotSupportedException</code>. Why anyone would - * use this method is a secret to me, since this class is immutable. - * - * @return the clone - */ - public Object clone() - { - // This class is final, so no need to use native super.clone(). - return new Locale(language, country, variant); - } - - /** - * Return the hash code for this locale. The hashcode is the logical - * xor of the hash codes of the language, the country and the variant. - * The hash code is precomputed, since <code>Locale</code>s are often - * used in hash tables. - * - * @return the hashcode - */ - public int hashCode() - { - return hashcode; - } - - /** - * Compares two locales. To be equal, obj must be a Locale with the same - * language, country, and variant code. - * - * @param obj the other locale - * @return true if obj is equal to this - */ - public boolean equals(Object obj) - { - if (this == obj) - return true; - if (! (obj instanceof Locale)) - return false; - Locale l = (Locale) obj; - - return (language == l.language - && country == l.country - && variant == l.variant); - } - - /** - * Write the locale to an object stream. - * - * @param output the stream to write to - * @throws IOException if the write fails - * @serialData The first three fields are Strings representing language, - * country, and variant. The fourth field is a placeholder for - * the cached hashcode, but this is always written as -1, and - * recomputed when reading it back. - */ - private void writeObject(ObjectOutputStream s) - throws IOException - { - ObjectOutputStream.PutField fields = s.putFields(); - fields.put("hashcode", -1); - s.defaultWriteObject(); - } - - /** - * Reads a locale from the input stream. - * - * @param input the stream to read from - * @throws IOException if reading fails - * @throws ClassNotFoundException if reading fails - * @serialData the hashCode is always invalid and must be recomputed - */ - private void readObject(ObjectInputStream s) - throws IOException, ClassNotFoundException - { - s.defaultReadObject(); - language = language.intern(); - country = country.intern(); - variant = variant.intern(); - hashcode = language.hashCode() ^ country.hashCode() ^ variant.hashCode(); - } -} // class Locale diff --git a/libjava/java/util/ServiceConfigurationError.h b/libjava/java/util/ServiceConfigurationError.h new file mode 100644 index 00000000000..7a2a905adfa --- /dev/null +++ b/libjava/java/util/ServiceConfigurationError.h @@ -0,0 +1,23 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_ServiceConfigurationError__ +#define __java_util_ServiceConfigurationError__ + +#pragma interface + +#include <java/lang/Error.h> + +class java::util::ServiceConfigurationError : public ::java::lang::Error +{ + +public: + ServiceConfigurationError(::java::lang::String *); + ServiceConfigurationError(::java::lang::String *, ::java::lang::Throwable *); +private: + static const jlong serialVersionUID = 74132770414881LL; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_ServiceConfigurationError__ diff --git a/libjava/java/util/ServiceLoader$1.h b/libjava/java/util/ServiceLoader$1.h new file mode 100644 index 00000000000..ad210a2f9c4 --- /dev/null +++ b/libjava/java/util/ServiceLoader$1.h @@ -0,0 +1,28 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_ServiceLoader$1__ +#define __java_util_ServiceLoader$1__ + +#pragma interface + +#include <java/lang/Object.h> + +class java::util::ServiceLoader$1 : public ::java::lang::Object +{ + +public: // actually package-private + ServiceLoader$1(::java::util::ServiceLoader *); +public: + jboolean hasNext(); + ::java::lang::Object * next(); + void remove(); +private: + ::java::util::Iterator * __attribute__((aligned(__alignof__( ::java::lang::Object)))) cacheIt; +public: // actually package-private + ::java::util::ServiceLoader * this$0; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_ServiceLoader$1__ diff --git a/libjava/java/util/ServiceLoader.h b/libjava/java/util/ServiceLoader.h new file mode 100644 index 00000000000..f3a91601fd9 --- /dev/null +++ b/libjava/java/util/ServiceLoader.h @@ -0,0 +1,37 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_ServiceLoader__ +#define __java_util_ServiceLoader__ + +#pragma interface + +#include <java/lang/Object.h> + +class java::util::ServiceLoader : public ::java::lang::Object +{ + + ServiceLoader(::java::lang::Class *, ::java::lang::ClassLoader *); +public: + ::java::util::Iterator * iterator(); + static ::java::util::ServiceLoader * load(::java::lang::Class *); + static ::java::util::ServiceLoader * load(::java::lang::Class *, ::java::lang::ClassLoader *); + static ::java::util::ServiceLoader * loadInstalled(::java::lang::Class *); + void reload(); + ::java::lang::String * toString(); +public: // actually package-private + static ::java::util::List * access$0(::java::util::ServiceLoader *); + static ::java::util::Iterator * access$1(::java::util::ServiceLoader *); + static ::java::lang::Class * access$2(::java::util::ServiceLoader *); + static ::java::lang::ClassLoader * access$3(::java::util::ServiceLoader *); + static void access$4(::java::util::ServiceLoader *, ::java::util::Iterator *); +private: + ::java::lang::Class * __attribute__((aligned(__alignof__( ::java::lang::Object)))) spi; + ::java::lang::ClassLoader * loader; + ::java::util::List * cache; + ::java::util::Iterator * serviceIt; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_ServiceLoader__ diff --git a/libjava/java/util/TreeMap$1.h b/libjava/java/util/TreeMap$1.h index d181072f09a..59653e35082 100644 --- a/libjava/java/util/TreeMap$1.h +++ b/libjava/java/util/TreeMap$1.h @@ -6,21 +6,18 @@ #pragma interface -#include <java/util/AbstractSet.h> +#include <java/lang/Object.h> -class java::util::TreeMap$1 : public ::java::util::AbstractSet +class java::util::TreeMap$1 : public ::java::lang::Object { public: // actually package-private - TreeMap$1(::java::util::TreeMap$SubMap *); + TreeMap$1(::java::util::TreeMap$SubMap$NavigableEntrySet *); public: - jint size(); - ::java::util::Iterator * iterator(); - void clear(); - jboolean contains(::java::lang::Object *); - jboolean remove(::java::lang::Object *); + jint TreeMap$1$compare(::java::util::Map$Entry *, ::java::util::Map$Entry *); + jint compare(::java::lang::Object *, ::java::lang::Object *); public: // actually package-private - ::java::util::TreeMap$SubMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) this$1; + ::java::util::TreeMap$SubMap$NavigableEntrySet * __attribute__((aligned(__alignof__( ::java::lang::Object)))) this$2; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/util/TreeMap$2.h b/libjava/java/util/TreeMap$2.h index 0ea21a8863d..92b9f404e66 100644 --- a/libjava/java/util/TreeMap$2.h +++ b/libjava/java/util/TreeMap$2.h @@ -6,9 +6,9 @@ #pragma interface -#include <java/util/AbstractSet.h> +#include <java/util/AbstractCollection.h> -class java::util::TreeMap$2 : public ::java::util::AbstractSet +class java::util::TreeMap$2 : public ::java::util::AbstractCollection { public: // actually package-private @@ -17,10 +17,8 @@ public: jint size(); ::java::util::Iterator * iterator(); void clear(); - jboolean contains(::java::lang::Object *); - jboolean remove(::java::lang::Object *); public: // actually package-private - ::java::util::TreeMap$SubMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) this$1; + ::java::util::TreeMap$SubMap * __attribute__((aligned(__alignof__( ::java::util::AbstractCollection)))) this$1; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/util/TreeMap$3.h b/libjava/java/util/TreeMap$3.h index 47ece2a0334..3ab5a98eb98 100644 --- a/libjava/java/util/TreeMap$3.h +++ b/libjava/java/util/TreeMap$3.h @@ -12,13 +12,14 @@ class java::util::TreeMap$3 : public ::java::util::AbstractCollection { public: // actually package-private - TreeMap$3(::java::util::TreeMap$SubMap *); + TreeMap$3(::java::util::TreeMap$DescendingMap *); public: jint size(); ::java::util::Iterator * iterator(); void clear(); public: // actually package-private - ::java::util::TreeMap$SubMap * __attribute__((aligned(__alignof__( ::java::util::AbstractCollection)))) this$1; + static ::java::util::TreeMap$DescendingMap * access$0(::java::util::TreeMap$3 *); + ::java::util::TreeMap$DescendingMap * __attribute__((aligned(__alignof__( ::java::util::AbstractCollection)))) this$1; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/util/TreeMap$4.h b/libjava/java/util/TreeMap$4.h index 5665ffd20ad..b8e5ba7dda3 100644 --- a/libjava/java/util/TreeMap$4.h +++ b/libjava/java/util/TreeMap$4.h @@ -6,21 +6,22 @@ #pragma interface -#include <java/util/AbstractSet.h> +#include <java/lang/Object.h> -class java::util::TreeMap$4 : public ::java::util::AbstractSet +class java::util::TreeMap$4 : public ::java::lang::Object { public: // actually package-private - TreeMap$4(::java::util::TreeMap *); + TreeMap$4(::java::util::TreeMap$3 *); public: - jint size(); - ::java::util::Iterator * iterator(); - void clear(); - jboolean contains(::java::lang::Object *); - jboolean remove(::java::lang::Object *); + jboolean hasNext(); + ::java::lang::Object * next(); + void remove(); +private: + ::java::util::Map$Entry * __attribute__((aligned(__alignof__( ::java::lang::Object)))) last; + ::java::util::Map$Entry * next__; public: // actually package-private - ::java::util::TreeMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) this$0; + ::java::util::TreeMap$3 * this$2; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/util/TreeMap$5.h b/libjava/java/util/TreeMap$5.h index b615001e52a..585fe2cd220 100644 --- a/libjava/java/util/TreeMap$5.h +++ b/libjava/java/util/TreeMap$5.h @@ -6,21 +6,22 @@ #pragma interface -#include <java/util/AbstractSet.h> +#include <java/lang/Object.h> -class java::util::TreeMap$5 : public ::java::util::AbstractSet +class java::util::TreeMap$5 : public ::java::lang::Object { public: // actually package-private - TreeMap$5(::java::util::TreeMap *); + TreeMap$5(::java::util::TreeMap$DescendingSet *); public: - jint size(); - ::java::util::Iterator * iterator(); - void clear(); - jboolean contains(::java::lang::Object *); - jboolean remove(::java::lang::Object *); + jboolean hasNext(); + ::java::lang::Object * next(); + void remove(); +private: + ::java::lang::Object * __attribute__((aligned(__alignof__( ::java::lang::Object)))) last; + ::java::lang::Object * next__; public: // actually package-private - ::java::util::TreeMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) this$0; + ::java::util::TreeMap$DescendingSet * this$1; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/util/TreeMap$6.h b/libjava/java/util/TreeMap$6.h index 45e7802ffac..0e8af452848 100644 --- a/libjava/java/util/TreeMap$6.h +++ b/libjava/java/util/TreeMap$6.h @@ -6,19 +6,18 @@ #pragma interface -#include <java/util/AbstractCollection.h> +#include <java/lang/Object.h> -class java::util::TreeMap$6 : public ::java::util::AbstractCollection +class java::util::TreeMap$6 : public ::java::lang::Object { public: // actually package-private - TreeMap$6(::java::util::TreeMap *); + TreeMap$6(::java::util::TreeMap$NavigableEntrySet *); public: - jint size(); - ::java::util::Iterator * iterator(); - void clear(); + jint TreeMap$6$compare(::java::util::Map$Entry *, ::java::util::Map$Entry *); + jint compare(::java::lang::Object *, ::java::lang::Object *); public: // actually package-private - ::java::util::TreeMap * __attribute__((aligned(__alignof__( ::java::util::AbstractCollection)))) this$0; + ::java::util::TreeMap$NavigableEntrySet * __attribute__((aligned(__alignof__( ::java::lang::Object)))) this$1; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/util/TreeMap$7.h b/libjava/java/util/TreeMap$7.h new file mode 100644 index 00000000000..7fd6109bcd8 --- /dev/null +++ b/libjava/java/util/TreeMap$7.h @@ -0,0 +1,26 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$7__ +#define __java_util_TreeMap$7__ + +#pragma interface + +#include <java/util/AbstractCollection.h> + +class java::util::TreeMap$7 : public ::java::util::AbstractCollection +{ + +public: // actually package-private + TreeMap$7(::java::util::TreeMap *); +public: + jint size(); + ::java::util::Iterator * iterator(); + void clear(); +public: // actually package-private + ::java::util::TreeMap * __attribute__((aligned(__alignof__( ::java::util::AbstractCollection)))) this$0; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$7__ diff --git a/libjava/java/util/TreeMap$DescendingMap.h b/libjava/java/util/TreeMap$DescendingMap.h new file mode 100644 index 00000000000..70d6e6c7671 --- /dev/null +++ b/libjava/java/util/TreeMap$DescendingMap.h @@ -0,0 +1,65 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$DescendingMap__ +#define __java_util_TreeMap$DescendingMap__ + +#pragma interface + +#include <java/lang/Object.h> + +class java::util::TreeMap$DescendingMap : public ::java::lang::Object +{ + +public: + TreeMap$DescendingMap(::java::util::NavigableMap *); + ::java::util::Map$Entry * ceilingEntry(::java::lang::Object *); + ::java::lang::Object * ceilingKey(::java::lang::Object *); + void clear(); + ::java::util::Comparator * comparator(); + jboolean containsKey(::java::lang::Object *); + jboolean containsValue(::java::lang::Object *); + ::java::util::NavigableSet * descendingKeySet(); + ::java::util::NavigableMap * descendingMap(); + ::java::util::Set * entrySet(); + jboolean equals(::java::lang::Object *); + ::java::util::Map$Entry * firstEntry(); + ::java::lang::Object * firstKey(); + ::java::util::Map$Entry * floorEntry(::java::lang::Object *); + ::java::lang::Object * floorKey(::java::lang::Object *); + ::java::lang::Object * get(::java::lang::Object *); + jint hashCode(); + ::java::util::SortedMap * headMap(::java::lang::Object *); + ::java::util::NavigableMap * headMap(::java::lang::Object *, jboolean); + ::java::util::Map$Entry * higherEntry(::java::lang::Object *); + ::java::lang::Object * higherKey(::java::lang::Object *); + ::java::util::Set * keySet(); + jboolean isEmpty(); + ::java::util::Map$Entry * lastEntry(); + ::java::lang::Object * lastKey(); + ::java::util::Map$Entry * lowerEntry(::java::lang::Object *); + ::java::lang::Object * lowerKey(::java::lang::Object *); + ::java::util::NavigableSet * navigableKeySet(); + ::java::util::Map$Entry * pollFirstEntry(); + ::java::util::Map$Entry * pollLastEntry(); + ::java::lang::Object * put(::java::lang::Object *, ::java::lang::Object *); + void putAll(::java::util::Map *); + ::java::lang::Object * remove(::java::lang::Object *); + jint size(); + ::java::util::SortedMap * subMap(::java::lang::Object *, ::java::lang::Object *); + ::java::util::NavigableMap * subMap(::java::lang::Object *, jboolean, ::java::lang::Object *, jboolean); + ::java::util::SortedMap * tailMap(::java::lang::Object *); + ::java::util::NavigableMap * tailMap(::java::lang::Object *, jboolean); + ::java::lang::String * toString(); + ::java::util::Collection * values(); +private: + ::java::util::Set * __attribute__((aligned(__alignof__( ::java::lang::Object)))) entries; + ::java::util::Set * keys; + ::java::util::NavigableSet * nKeys; + ::java::util::Collection * values__; + ::java::util::NavigableMap * map; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$DescendingMap__ diff --git a/libjava/java/util/TreeMap$DescendingSet.h b/libjava/java/util/TreeMap$DescendingSet.h new file mode 100644 index 00000000000..4824a2747eb --- /dev/null +++ b/libjava/java/util/TreeMap$DescendingSet.h @@ -0,0 +1,57 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$DescendingSet__ +#define __java_util_TreeMap$DescendingSet__ + +#pragma interface + +#include <java/lang/Object.h> +#include <gcj/array.h> + + +class java::util::TreeMap$DescendingSet : public ::java::lang::Object +{ + +public: + TreeMap$DescendingSet(::java::util::NavigableSet *); + jboolean add(::java::lang::Object *); + jboolean addAll(::java::util::Collection *); + ::java::lang::Object * ceiling(::java::lang::Object *); + void clear(); + ::java::util::Comparator * comparator(); + jboolean contains(::java::lang::Object *); + jboolean containsAll(::java::util::Collection *); + ::java::util::Iterator * descendingIterator(); + ::java::util::NavigableSet * descendingSet(); + jboolean equals(::java::lang::Object *); + ::java::lang::Object * first(); + ::java::lang::Object * floor(::java::lang::Object *); + jint hashCode(); + ::java::util::SortedSet * headSet(::java::lang::Object *); + ::java::util::NavigableSet * headSet(::java::lang::Object *, jboolean); + ::java::lang::Object * higher(::java::lang::Object *); + jboolean isEmpty(); + ::java::util::Iterator * iterator(); + ::java::lang::Object * last(); + ::java::lang::Object * lower(::java::lang::Object *); + ::java::lang::Object * pollFirst(); + ::java::lang::Object * pollLast(); + jboolean remove(::java::lang::Object *); + jboolean removeAll(::java::util::Collection *); + jboolean retainAll(::java::util::Collection *); + jint size(); + ::java::util::SortedSet * subSet(::java::lang::Object *, ::java::lang::Object *); + ::java::util::NavigableSet * subSet(::java::lang::Object *, jboolean, ::java::lang::Object *, jboolean); + ::java::util::SortedSet * tailSet(::java::lang::Object *); + ::java::util::NavigableSet * tailSet(::java::lang::Object *, jboolean); + JArray< ::java::lang::Object * > * toArray(); + JArray< ::java::lang::Object * > * toArray(JArray< ::java::lang::Object * > *); + ::java::lang::String * toString(); +private: + ::java::util::NavigableSet * __attribute__((aligned(__alignof__( ::java::lang::Object)))) set; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$DescendingSet__ diff --git a/libjava/java/util/TreeMap$EntrySet.h b/libjava/java/util/TreeMap$EntrySet.h new file mode 100644 index 00000000000..ed03318b813 --- /dev/null +++ b/libjava/java/util/TreeMap$EntrySet.h @@ -0,0 +1,28 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$EntrySet__ +#define __java_util_TreeMap$EntrySet__ + +#pragma interface + +#include <java/util/AbstractSet.h> + +class java::util::TreeMap$EntrySet : public ::java::util::AbstractSet +{ + + TreeMap$EntrySet(::java::util::TreeMap *); +public: + virtual jint size(); + virtual ::java::util::Iterator * iterator(); + virtual void clear(); + virtual jboolean contains(::java::lang::Object *); + virtual jboolean remove(::java::lang::Object *); +public: // actually package-private + TreeMap$EntrySet(::java::util::TreeMap *, ::java::util::TreeMap$EntrySet *); + ::java::util::TreeMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) this$0; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$EntrySet__ diff --git a/libjava/java/util/TreeMap$KeySet.h b/libjava/java/util/TreeMap$KeySet.h new file mode 100644 index 00000000000..0559a4dd797 --- /dev/null +++ b/libjava/java/util/TreeMap$KeySet.h @@ -0,0 +1,29 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$KeySet__ +#define __java_util_TreeMap$KeySet__ + +#pragma interface + +#include <java/util/AbstractSet.h> + +class java::util::TreeMap$KeySet : public ::java::util::AbstractSet +{ + + TreeMap$KeySet(::java::util::TreeMap *); +public: + virtual jint size(); + virtual ::java::util::Iterator * iterator(); + virtual void clear(); + virtual jboolean contains(::java::lang::Object *); + virtual jboolean remove(::java::lang::Object *); +public: // actually package-private + TreeMap$KeySet(::java::util::TreeMap *, ::java::util::TreeMap$KeySet *); + TreeMap$KeySet(::java::util::TreeMap *, ::java::util::TreeMap$KeySet *, ::java::util::TreeMap$KeySet *); + ::java::util::TreeMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) this$0; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$KeySet__ diff --git a/libjava/java/util/TreeMap$NavigableEntrySet.h b/libjava/java/util/TreeMap$NavigableEntrySet.h new file mode 100644 index 00000000000..cdbed6ee369 --- /dev/null +++ b/libjava/java/util/TreeMap$NavigableEntrySet.h @@ -0,0 +1,55 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$NavigableEntrySet__ +#define __java_util_TreeMap$NavigableEntrySet__ + +#pragma interface + +#include <java/util/TreeMap$EntrySet.h> + +class java::util::TreeMap$NavigableEntrySet : public ::java::util::TreeMap$EntrySet +{ + + TreeMap$NavigableEntrySet(::java::util::TreeMap *); +public: + ::java::util::Map$Entry * TreeMap$NavigableEntrySet$ceiling(::java::util::Map$Entry *); + ::java::util::Comparator * comparator(); + ::java::util::Iterator * descendingIterator(); + ::java::util::NavigableSet * descendingSet(); + ::java::util::Map$Entry * TreeMap$NavigableEntrySet$first(); + ::java::util::Map$Entry * TreeMap$NavigableEntrySet$floor(::java::util::Map$Entry *); + ::java::util::SortedSet * TreeMap$NavigableEntrySet$headSet(::java::util::Map$Entry *); + ::java::util::NavigableSet * TreeMap$NavigableEntrySet$headSet(::java::util::Map$Entry *, jboolean); + ::java::util::Map$Entry * TreeMap$NavigableEntrySet$higher(::java::util::Map$Entry *); + ::java::util::Map$Entry * TreeMap$NavigableEntrySet$last(); + ::java::util::Map$Entry * TreeMap$NavigableEntrySet$lower(::java::util::Map$Entry *); + ::java::util::Map$Entry * TreeMap$NavigableEntrySet$pollFirst(); + ::java::util::Map$Entry * TreeMap$NavigableEntrySet$pollLast(); + ::java::util::SortedSet * TreeMap$NavigableEntrySet$subSet(::java::util::Map$Entry *, ::java::util::Map$Entry *); + ::java::util::NavigableSet * TreeMap$NavigableEntrySet$subSet(::java::util::Map$Entry *, jboolean, ::java::util::Map$Entry *, jboolean); + ::java::util::SortedSet * TreeMap$NavigableEntrySet$tailSet(::java::util::Map$Entry *); + ::java::util::NavigableSet * TreeMap$NavigableEntrySet$tailSet(::java::util::Map$Entry *, jboolean); + ::java::lang::Object * pollFirst(); + ::java::lang::Object * higher(::java::lang::Object *); + ::java::lang::Object * lower(::java::lang::Object *); + ::java::lang::Object * pollLast(); + ::java::lang::Object * first(); + ::java::lang::Object * last(); + ::java::util::NavigableSet * subSet(::java::lang::Object *, jboolean, ::java::lang::Object *, jboolean); + ::java::util::SortedSet * subSet(::java::lang::Object *, ::java::lang::Object *); + ::java::lang::Object * ceiling(::java::lang::Object *); + ::java::lang::Object * floor(::java::lang::Object *); + ::java::util::NavigableSet * tailSet(::java::lang::Object *, jboolean); + ::java::util::SortedSet * tailSet(::java::lang::Object *); + ::java::util::NavigableSet * headSet(::java::lang::Object *, jboolean); + ::java::util::SortedSet * headSet(::java::lang::Object *); +public: // actually package-private + TreeMap$NavigableEntrySet(::java::util::TreeMap *, ::java::util::TreeMap$NavigableEntrySet *); + static ::java::util::TreeMap * access$15(::java::util::TreeMap$NavigableEntrySet *); + ::java::util::TreeMap * __attribute__((aligned(__alignof__( ::java::util::TreeMap$EntrySet)))) this$0; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$NavigableEntrySet__ diff --git a/libjava/java/util/TreeMap$NavigableKeySet.h b/libjava/java/util/TreeMap$NavigableKeySet.h new file mode 100644 index 00000000000..247ac276bff --- /dev/null +++ b/libjava/java/util/TreeMap$NavigableKeySet.h @@ -0,0 +1,40 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$NavigableKeySet__ +#define __java_util_TreeMap$NavigableKeySet__ + +#pragma interface + +#include <java/util/TreeMap$KeySet.h> + +class java::util::TreeMap$NavigableKeySet : public ::java::util::TreeMap$KeySet +{ + + TreeMap$NavigableKeySet(::java::util::TreeMap *); +public: + ::java::lang::Object * ceiling(::java::lang::Object *); + ::java::util::Comparator * comparator(); + ::java::util::Iterator * descendingIterator(); + ::java::util::NavigableSet * descendingSet(); + ::java::lang::Object * first(); + ::java::lang::Object * floor(::java::lang::Object *); + ::java::util::SortedSet * headSet(::java::lang::Object *); + ::java::util::NavigableSet * headSet(::java::lang::Object *, jboolean); + ::java::lang::Object * higher(::java::lang::Object *); + ::java::lang::Object * last(); + ::java::lang::Object * lower(::java::lang::Object *); + ::java::lang::Object * pollFirst(); + ::java::lang::Object * pollLast(); + ::java::util::SortedSet * subSet(::java::lang::Object *, ::java::lang::Object *); + ::java::util::NavigableSet * subSet(::java::lang::Object *, jboolean, ::java::lang::Object *, jboolean); + ::java::util::SortedSet * tailSet(::java::lang::Object *); + ::java::util::NavigableSet * tailSet(::java::lang::Object *, jboolean); +public: // actually package-private + TreeMap$NavigableKeySet(::java::util::TreeMap *, ::java::util::TreeMap$NavigableKeySet *); + ::java::util::TreeMap * __attribute__((aligned(__alignof__( ::java::util::TreeMap$KeySet)))) this$0; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$NavigableKeySet__ diff --git a/libjava/java/util/TreeMap$SubMap$EntrySet.h b/libjava/java/util/TreeMap$SubMap$EntrySet.h new file mode 100644 index 00000000000..70a2ffc5150 --- /dev/null +++ b/libjava/java/util/TreeMap$SubMap$EntrySet.h @@ -0,0 +1,28 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$SubMap$EntrySet__ +#define __java_util_TreeMap$SubMap$EntrySet__ + +#pragma interface + +#include <java/util/AbstractSet.h> + +class java::util::TreeMap$SubMap$EntrySet : public ::java::util::AbstractSet +{ + + TreeMap$SubMap$EntrySet(::java::util::TreeMap$SubMap *); +public: + virtual jint size(); + virtual ::java::util::Iterator * iterator(); + virtual void clear(); + virtual jboolean contains(::java::lang::Object *); + virtual jboolean remove(::java::lang::Object *); +public: // actually package-private + TreeMap$SubMap$EntrySet(::java::util::TreeMap$SubMap *, ::java::util::TreeMap$SubMap$EntrySet *); + ::java::util::TreeMap$SubMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) this$1; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$SubMap$EntrySet__ diff --git a/libjava/java/util/TreeMap$SubMap$KeySet.h b/libjava/java/util/TreeMap$SubMap$KeySet.h new file mode 100644 index 00000000000..812d7cd5844 --- /dev/null +++ b/libjava/java/util/TreeMap$SubMap$KeySet.h @@ -0,0 +1,29 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$SubMap$KeySet__ +#define __java_util_TreeMap$SubMap$KeySet__ + +#pragma interface + +#include <java/util/AbstractSet.h> + +class java::util::TreeMap$SubMap$KeySet : public ::java::util::AbstractSet +{ + + TreeMap$SubMap$KeySet(::java::util::TreeMap$SubMap *); +public: + virtual jint size(); + virtual ::java::util::Iterator * iterator(); + virtual void clear(); + virtual jboolean contains(::java::lang::Object *); + virtual jboolean remove(::java::lang::Object *); +public: // actually package-private + TreeMap$SubMap$KeySet(::java::util::TreeMap$SubMap *, ::java::util::TreeMap$SubMap$KeySet *); + TreeMap$SubMap$KeySet(::java::util::TreeMap$SubMap *, ::java::util::TreeMap$SubMap$KeySet *, ::java::util::TreeMap$SubMap$KeySet *); + ::java::util::TreeMap$SubMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) this$1; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$SubMap$KeySet__ diff --git a/libjava/java/util/TreeMap$SubMap$NavigableEntrySet.h b/libjava/java/util/TreeMap$SubMap$NavigableEntrySet.h new file mode 100644 index 00000000000..34c99770200 --- /dev/null +++ b/libjava/java/util/TreeMap$SubMap$NavigableEntrySet.h @@ -0,0 +1,55 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$SubMap$NavigableEntrySet__ +#define __java_util_TreeMap$SubMap$NavigableEntrySet__ + +#pragma interface + +#include <java/util/TreeMap$SubMap$EntrySet.h> + +class java::util::TreeMap$SubMap$NavigableEntrySet : public ::java::util::TreeMap$SubMap$EntrySet +{ + + TreeMap$SubMap$NavigableEntrySet(::java::util::TreeMap$SubMap *); +public: + ::java::util::Map$Entry * TreeMap$SubMap$NavigableEntrySet$ceiling(::java::util::Map$Entry *); + ::java::util::Comparator * comparator(); + ::java::util::Iterator * descendingIterator(); + ::java::util::NavigableSet * descendingSet(); + ::java::util::Map$Entry * TreeMap$SubMap$NavigableEntrySet$first(); + ::java::util::Map$Entry * TreeMap$SubMap$NavigableEntrySet$floor(::java::util::Map$Entry *); + ::java::util::SortedSet * TreeMap$SubMap$NavigableEntrySet$headSet(::java::util::Map$Entry *); + ::java::util::NavigableSet * TreeMap$SubMap$NavigableEntrySet$headSet(::java::util::Map$Entry *, jboolean); + ::java::util::Map$Entry * TreeMap$SubMap$NavigableEntrySet$higher(::java::util::Map$Entry *); + ::java::util::Map$Entry * TreeMap$SubMap$NavigableEntrySet$last(); + ::java::util::Map$Entry * TreeMap$SubMap$NavigableEntrySet$lower(::java::util::Map$Entry *); + ::java::util::Map$Entry * TreeMap$SubMap$NavigableEntrySet$pollFirst(); + ::java::util::Map$Entry * TreeMap$SubMap$NavigableEntrySet$pollLast(); + ::java::util::SortedSet * TreeMap$SubMap$NavigableEntrySet$subSet(::java::util::Map$Entry *, ::java::util::Map$Entry *); + ::java::util::NavigableSet * TreeMap$SubMap$NavigableEntrySet$subSet(::java::util::Map$Entry *, jboolean, ::java::util::Map$Entry *, jboolean); + ::java::util::SortedSet * TreeMap$SubMap$NavigableEntrySet$tailSet(::java::util::Map$Entry *); + ::java::util::NavigableSet * TreeMap$SubMap$NavigableEntrySet$tailSet(::java::util::Map$Entry *, jboolean); + ::java::lang::Object * pollFirst(); + ::java::lang::Object * higher(::java::lang::Object *); + ::java::lang::Object * lower(::java::lang::Object *); + ::java::lang::Object * pollLast(); + ::java::lang::Object * first(); + ::java::lang::Object * last(); + ::java::util::NavigableSet * subSet(::java::lang::Object *, jboolean, ::java::lang::Object *, jboolean); + ::java::util::SortedSet * subSet(::java::lang::Object *, ::java::lang::Object *); + ::java::lang::Object * ceiling(::java::lang::Object *); + ::java::lang::Object * floor(::java::lang::Object *); + ::java::util::NavigableSet * tailSet(::java::lang::Object *, jboolean); + ::java::util::SortedSet * tailSet(::java::lang::Object *); + ::java::util::NavigableSet * headSet(::java::lang::Object *, jboolean); + ::java::util::SortedSet * headSet(::java::lang::Object *); +public: // actually package-private + TreeMap$SubMap$NavigableEntrySet(::java::util::TreeMap$SubMap *, ::java::util::TreeMap$SubMap$NavigableEntrySet *); + static ::java::util::TreeMap$SubMap * access$15(::java::util::TreeMap$SubMap$NavigableEntrySet *); + ::java::util::TreeMap$SubMap * __attribute__((aligned(__alignof__( ::java::util::TreeMap$SubMap$EntrySet)))) this$1; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$SubMap$NavigableEntrySet__ diff --git a/libjava/java/util/TreeMap$SubMap$NavigableKeySet.h b/libjava/java/util/TreeMap$SubMap$NavigableKeySet.h new file mode 100644 index 00000000000..66509d11f9e --- /dev/null +++ b/libjava/java/util/TreeMap$SubMap$NavigableKeySet.h @@ -0,0 +1,40 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_TreeMap$SubMap$NavigableKeySet__ +#define __java_util_TreeMap$SubMap$NavigableKeySet__ + +#pragma interface + +#include <java/util/TreeMap$SubMap$KeySet.h> + +class java::util::TreeMap$SubMap$NavigableKeySet : public ::java::util::TreeMap$SubMap$KeySet +{ + + TreeMap$SubMap$NavigableKeySet(::java::util::TreeMap$SubMap *); +public: + ::java::lang::Object * ceiling(::java::lang::Object *); + ::java::util::Comparator * comparator(); + ::java::util::Iterator * descendingIterator(); + ::java::util::NavigableSet * descendingSet(); + ::java::lang::Object * first(); + ::java::lang::Object * floor(::java::lang::Object *); + ::java::util::SortedSet * headSet(::java::lang::Object *); + ::java::util::NavigableSet * headSet(::java::lang::Object *, jboolean); + ::java::lang::Object * higher(::java::lang::Object *); + ::java::lang::Object * last(); + ::java::lang::Object * lower(::java::lang::Object *); + ::java::lang::Object * pollFirst(); + ::java::lang::Object * pollLast(); + ::java::util::SortedSet * subSet(::java::lang::Object *, ::java::lang::Object *); + ::java::util::NavigableSet * subSet(::java::lang::Object *, jboolean, ::java::lang::Object *, jboolean); + ::java::util::SortedSet * tailSet(::java::lang::Object *); + ::java::util::NavigableSet * tailSet(::java::lang::Object *, jboolean); +public: // actually package-private + TreeMap$SubMap$NavigableKeySet(::java::util::TreeMap$SubMap *, ::java::util::TreeMap$SubMap$NavigableKeySet *); + ::java::util::TreeMap$SubMap * __attribute__((aligned(__alignof__( ::java::util::TreeMap$SubMap$KeySet)))) this$1; +public: + static ::java::lang::Class class$; +}; + +#endif // __java_util_TreeMap$SubMap$NavigableKeySet__ diff --git a/libjava/java/util/TreeMap$SubMap.h b/libjava/java/util/TreeMap$SubMap.h index ef206c8a8b8..accd468bfab 100644 --- a/libjava/java/util/TreeMap$SubMap.h +++ b/libjava/java/util/TreeMap$SubMap.h @@ -15,21 +15,39 @@ public: // actually package-private TreeMap$SubMap(::java::util::TreeMap *, ::java::lang::Object *, ::java::lang::Object *); jboolean keyInRange(::java::lang::Object *); public: + ::java::util::Map$Entry * ceilingEntry(::java::lang::Object *); + ::java::lang::Object * ceilingKey(::java::lang::Object *); + ::java::util::NavigableSet * descendingKeySet(); + ::java::util::NavigableMap * descendingMap(); void clear(); ::java::util::Comparator * comparator(); jboolean containsKey(::java::lang::Object *); jboolean containsValue(::java::lang::Object *); ::java::util::Set * entrySet(); + ::java::util::Map$Entry * firstEntry(); ::java::lang::Object * firstKey(); + ::java::util::Map$Entry * floorEntry(::java::lang::Object *); + ::java::lang::Object * floorKey(::java::lang::Object *); ::java::lang::Object * get(::java::lang::Object *); ::java::util::SortedMap * headMap(::java::lang::Object *); + ::java::util::NavigableMap * headMap(::java::lang::Object *, jboolean); ::java::util::Set * keySet(); + ::java::util::Map$Entry * higherEntry(::java::lang::Object *); + ::java::lang::Object * higherKey(::java::lang::Object *); + ::java::util::Map$Entry * lastEntry(); ::java::lang::Object * lastKey(); + ::java::util::Map$Entry * lowerEntry(::java::lang::Object *); + ::java::lang::Object * lowerKey(::java::lang::Object *); + ::java::util::NavigableSet * navigableKeySet(); + ::java::util::Map$Entry * pollFirstEntry(); + ::java::util::Map$Entry * pollLastEntry(); ::java::lang::Object * put(::java::lang::Object *, ::java::lang::Object *); ::java::lang::Object * remove(::java::lang::Object *); jint size(); ::java::util::SortedMap * subMap(::java::lang::Object *, ::java::lang::Object *); + ::java::util::NavigableMap * subMap(::java::lang::Object *, jboolean, ::java::lang::Object *, jboolean); ::java::util::SortedMap * tailMap(::java::lang::Object *); + ::java::util::NavigableMap * tailMap(::java::lang::Object *, jboolean); ::java::util::Collection * values(); public: // actually package-private static ::java::util::TreeMap * access$0(::java::util::TreeMap$SubMap *); @@ -37,6 +55,8 @@ public: // actually package-private ::java::lang::Object * maxKey; private: ::java::util::Set * entries; + ::java::util::NavigableMap * descendingMap__; + ::java::util::NavigableSet * nKeys; public: // actually package-private ::java::util::TreeMap * this$0; public: diff --git a/libjava/java/util/TreeMap.h b/libjava/java/util/TreeMap.h index a68bcf6252c..b87c8926262 100644 --- a/libjava/java/util/TreeMap.h +++ b/libjava/java/util/TreeMap.h @@ -25,6 +25,7 @@ public: virtual ::java::lang::Object * firstKey(); virtual ::java::lang::Object * get(::java::lang::Object *); virtual ::java::util::SortedMap * headMap(::java::lang::Object *); + virtual ::java::util::NavigableMap * headMap(::java::lang::Object *, jboolean); virtual ::java::util::Set * keySet(); virtual ::java::lang::Object * lastKey(); virtual ::java::lang::Object * put(::java::lang::Object *, ::java::lang::Object *); @@ -32,7 +33,9 @@ public: virtual ::java::lang::Object * remove(::java::lang::Object *); virtual jint size(); virtual ::java::util::SortedMap * subMap(::java::lang::Object *, ::java::lang::Object *); + virtual ::java::util::NavigableMap * subMap(::java::lang::Object *, jboolean, ::java::lang::Object *, jboolean); virtual ::java::util::SortedMap * tailMap(::java::lang::Object *); + virtual ::java::util::NavigableMap * tailMap(::java::lang::Object *, jboolean); virtual ::java::util::Collection * values(); public: // actually package-private virtual jint compare(::java::lang::Object *, ::java::lang::Object *); @@ -43,11 +46,13 @@ public: // actually package-private virtual ::java::util::TreeMap$Node * firstNode(); virtual ::java::util::TreeMap$Node * getNode(::java::lang::Object *); virtual ::java::util::TreeMap$Node * highestLessThan(::java::lang::Object *); + virtual ::java::util::TreeMap$Node * highestLessThan(::java::lang::Object *, jboolean); private: void insertFixup(::java::util::TreeMap$Node *); ::java::util::TreeMap$Node * lastNode(); public: // actually package-private virtual ::java::util::TreeMap$Node * lowestGreaterThan(::java::lang::Object *, jboolean); + virtual ::java::util::TreeMap$Node * lowestGreaterThan(::java::lang::Object *, jboolean, jboolean); private: ::java::util::TreeMap$Node * predecessor(::java::util::TreeMap$Node *); public: // actually package-private @@ -64,6 +69,23 @@ public: // actually package-private virtual ::java::util::TreeMap$Node * successor(::java::util::TreeMap$Node *); private: void writeObject(::java::io::ObjectOutputStream *); +public: + virtual ::java::util::Map$Entry * ceilingEntry(::java::lang::Object *); + virtual ::java::lang::Object * ceilingKey(::java::lang::Object *); + virtual ::java::util::NavigableSet * descendingKeySet(); + virtual ::java::util::NavigableMap * descendingMap(); + virtual ::java::util::Map$Entry * firstEntry(); + virtual ::java::util::Map$Entry * floorEntry(::java::lang::Object *); + virtual ::java::lang::Object * floorKey(::java::lang::Object *); + virtual ::java::util::Map$Entry * higherEntry(::java::lang::Object *); + virtual ::java::lang::Object * higherKey(::java::lang::Object *); + virtual ::java::util::Map$Entry * lastEntry(); + virtual ::java::util::Map$Entry * lowerEntry(::java::lang::Object *); + virtual ::java::lang::Object * lowerKey(::java::lang::Object *); + virtual ::java::util::NavigableSet * navigableKeySet(); + virtual ::java::util::Map$Entry * pollFirstEntry(); + virtual ::java::util::Map$Entry * pollLastEntry(); +private: static const jlong serialVersionUID = 919286545866124006LL; public: // actually package-private static const jint RED = -1; @@ -75,6 +97,8 @@ public: // actually package-private jint size__; private: ::java::util::Set * entries; + ::java::util::NavigableMap * descendingMap__; + ::java::util::NavigableSet * nKeys; public: // actually package-private jint modCount; ::java::util::Comparator * comparator__; diff --git a/libjava/java/util/TreeSet.h b/libjava/java/util/TreeSet.h index 565d828c4ad..1e19c1933bc 100644 --- a/libjava/java/util/TreeSet.h +++ b/libjava/java/util/TreeSet.h @@ -17,7 +17,7 @@ public: TreeSet(::java::util::Collection *); TreeSet(::java::util::SortedSet *); private: - TreeSet(::java::util::SortedMap *); + TreeSet(::java::util::NavigableMap *); public: virtual jboolean add(::java::lang::Object *); virtual jboolean addAll(::java::util::Collection *); @@ -27,18 +27,31 @@ public: virtual jboolean contains(::java::lang::Object *); virtual ::java::lang::Object * first(); virtual ::java::util::SortedSet * headSet(::java::lang::Object *); + virtual ::java::util::NavigableSet * headSet(::java::lang::Object *, jboolean); virtual jboolean isEmpty(); virtual ::java::util::Iterator * iterator(); virtual ::java::lang::Object * last(); virtual jboolean remove(::java::lang::Object *); virtual jint size(); virtual ::java::util::SortedSet * subSet(::java::lang::Object *, ::java::lang::Object *); + virtual ::java::util::NavigableSet * subSet(::java::lang::Object *, jboolean, ::java::lang::Object *, jboolean); virtual ::java::util::SortedSet * tailSet(::java::lang::Object *); + virtual ::java::util::NavigableSet * tailSet(::java::lang::Object *, jboolean); private: void writeObject(::java::io::ObjectOutputStream *); void readObject(::java::io::ObjectInputStream *); +public: + virtual ::java::lang::Object * ceiling(::java::lang::Object *); + virtual ::java::util::Iterator * descendingIterator(); + virtual ::java::util::NavigableSet * descendingSet(); + virtual ::java::lang::Object * floor(::java::lang::Object *); + virtual ::java::lang::Object * higher(::java::lang::Object *); + virtual ::java::lang::Object * lower(::java::lang::Object *); + virtual ::java::lang::Object * pollFirst(); + virtual ::java::lang::Object * pollLast(); +private: static const jlong serialVersionUID = -2479143000061671589LL; - ::java::util::SortedMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) map; + ::java::util::NavigableMap * __attribute__((aligned(__alignof__( ::java::util::AbstractSet)))) map; public: static ::java::lang::Class class$; }; diff --git a/libjava/java/util/logging/Logger.java b/libjava/java/util/logging/Logger.java index adb07ecf665..04f24d35499 100644 --- a/libjava/java/util/logging/Logger.java +++ b/libjava/java/util/logging/Logger.java @@ -1,5 +1,5 @@ /* Logger.java -- a class for logging messages - Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -276,8 +276,8 @@ public class Logger LogManager lm = LogManager.getLogManager(); Logger result; - /* Throw NullPointerException if name is null. */ - name.getClass(); + if (name == null) + throw new NullPointerException(); /* Without synchronized(lm), it could happen that another thread * would create a logger between our calls to getLogger and @@ -1013,8 +1013,8 @@ public class Logger public synchronized void addHandler(Handler handler) throws SecurityException { - /* Throw a new NullPointerException if handler is null. */ - handler.getClass(); + if (handler == null) + throw new NullPointerException(); /* An application is allowed to control an anonymous logger * without having the permission to control the logging @@ -1057,8 +1057,8 @@ public class Logger if (!anonymous) LogManager.getLogManager().checkAccess(); - /* Throw a new NullPointerException if handler is null. */ - handler.getClass(); + if (handler == null) + throw new NullPointerException(); handlerList.remove(handler); handlers = getHandlers(); @@ -1166,8 +1166,8 @@ public class Logger */ public synchronized void setParent(Logger parent) { - /* Throw a new NullPointerException if parent is null. */ - parent.getClass(); + if (parent == null) + throw new NullPointerException(); if (this == root) throw new IllegalArgumentException( diff --git a/libjava/java/util/prefs/Preferences$1.h b/libjava/java/util/prefs/Preferences$1.h index 09a3f1c9f2c..3dd9a0c3ee8 100644 --- a/libjava/java/util/prefs/Preferences$1.h +++ b/libjava/java/util/prefs/Preferences$1.h @@ -14,6 +14,7 @@ class java::util::prefs::Preferences$1 : public ::java::lang::Object public: // actually package-private Preferences$1(); public: + ::java::util::prefs::PreferencesFactory * Preferences$1$run(); ::java::lang::Object * run(); static ::java::lang::Class class$; }; diff --git a/libjava/java/util/regex/Pattern.h b/libjava/java/util/regex/Pattern.h index 7bfc275e55f..267cafdc041 100644 --- a/libjava/java/util/regex/Pattern.h +++ b/libjava/java/util/regex/Pattern.h @@ -41,6 +41,7 @@ public: JArray< ::java::lang::String * > * split(::java::lang::CharSequence *); JArray< ::java::lang::String * > * split(::java::lang::CharSequence *, jint); ::java::lang::String * pattern(); + ::java::lang::String * toString(); private: static const jlong serialVersionUID = 5073258162644648461LL; public: diff --git a/libjava/java/util/spi/CurrencyNameProvider.h b/libjava/java/util/spi/CurrencyNameProvider.h new file mode 100644 index 00000000000..1375c15746b --- /dev/null +++ b/libjava/java/util/spi/CurrencyNameProvider.h @@ -0,0 +1,21 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_spi_CurrencyNameProvider__ +#define __java_util_spi_CurrencyNameProvider__ + +#pragma interface + +#include <java/util/spi/LocaleServiceProvider.h> + +class java::util::spi::CurrencyNameProvider : public ::java::util::spi::LocaleServiceProvider +{ + +public: // actually protected + CurrencyNameProvider(); +public: + virtual ::java::lang::String * getSymbol(::java::lang::String *, ::java::util::Locale *) = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_util_spi_CurrencyNameProvider__ diff --git a/libjava/java/util/spi/LocaleNameProvider.h b/libjava/java/util/spi/LocaleNameProvider.h new file mode 100644 index 00000000000..d4194c52992 --- /dev/null +++ b/libjava/java/util/spi/LocaleNameProvider.h @@ -0,0 +1,23 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_spi_LocaleNameProvider__ +#define __java_util_spi_LocaleNameProvider__ + +#pragma interface + +#include <java/util/spi/LocaleServiceProvider.h> + +class java::util::spi::LocaleNameProvider : public ::java::util::spi::LocaleServiceProvider +{ + +public: // actually protected + LocaleNameProvider(); +public: + virtual ::java::lang::String * getDisplayCountry(::java::lang::String *, ::java::util::Locale *) = 0; + virtual ::java::lang::String * getDisplayLanguage(::java::lang::String *, ::java::util::Locale *) = 0; + virtual ::java::lang::String * getDisplayVariant(::java::lang::String *, ::java::util::Locale *) = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_util_spi_LocaleNameProvider__ diff --git a/libjava/java/util/spi/LocaleServiceProvider.h b/libjava/java/util/spi/LocaleServiceProvider.h new file mode 100644 index 00000000000..69cc23170f6 --- /dev/null +++ b/libjava/java/util/spi/LocaleServiceProvider.h @@ -0,0 +1,23 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_spi_LocaleServiceProvider__ +#define __java_util_spi_LocaleServiceProvider__ + +#pragma interface + +#include <java/lang/Object.h> +#include <gcj/array.h> + + +class java::util::spi::LocaleServiceProvider : public ::java::lang::Object +{ + +public: // actually protected + LocaleServiceProvider(); +public: + virtual JArray< ::java::util::Locale * > * getAvailableLocales() = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_util_spi_LocaleServiceProvider__ diff --git a/libjava/java/util/spi/TimeZoneNameProvider.h b/libjava/java/util/spi/TimeZoneNameProvider.h new file mode 100644 index 00000000000..8e430931273 --- /dev/null +++ b/libjava/java/util/spi/TimeZoneNameProvider.h @@ -0,0 +1,21 @@ + +// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- + +#ifndef __java_util_spi_TimeZoneNameProvider__ +#define __java_util_spi_TimeZoneNameProvider__ + +#pragma interface + +#include <java/util/spi/LocaleServiceProvider.h> + +class java::util::spi::TimeZoneNameProvider : public ::java::util::spi::LocaleServiceProvider +{ + +public: // actually protected + TimeZoneNameProvider(); +public: + virtual ::java::lang::String * getDisplayName(::java::lang::String *, jboolean, jint, ::java::util::Locale *) = 0; + static ::java::lang::Class class$; +}; + +#endif // __java_util_spi_TimeZoneNameProvider__ |