* java/lang/ClassLoader.java (resolveClass0): Transform
ClassNotFoundException to NoClassDefFoundError. Transform all other
throwables to LinkageError.
From-SVN: r60097
* libjava.loader/loader.exp (gcj_loader_test_one): Use
libjava_prune_warnings.
(gcj_loader_run): Likewise.
* libjava.mauve/mauve.exp (test_mauve): Use
libjava_prune_warnings.
(test_mauve_sim): Likewise.
* libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Use
libjava_prune_warnings.
(gcj_jni_build_header): Likewise.
* lib/libjava.exp (libjava_prune_warnings): New proc.
(gcj_link): Use it.
(test_libjava_from_source): Likewise.
(test_libjava_from_javac): Likewise.
From-SVN: r60089
* java/lang/ClassLoader.java (loadedClasses): New field.
(defineClass): Fixed indentation. Put new class in
loadedClasses.
(findLoadedClass): Implement here.
* java/lang/natClassLoader.cc (findLoadedClass): Removed.
From-SVN: r60043
2002-12-10 Mark Wielaard <mark@klomp.org>
Tom Tromey <tromey@redhat.com>
* java/net/URLClassLoader.java (getCanonicalFileURL): New method.
(JarURLLoader): Use it.
(FileURLLoader): Likewise.
(JarURLResource.getURL): Use chained exception.
(FileResource.getURL): Likewise.
(FileURLLoader.getResource): Use canonical file name.
(addURL): Indentation fix.
Co-Authored-By: Tom Tromey <tromey@redhat.com>
From-SVN: r60019
* include/win32.h (_Jv_platform_solib_prefix): New define.
(_Jv_platform_solib_suffix): Likewise.
* include/posix.h (_Jv_platform_solib_prefix): New define.
(_Jv_platform_solib_suffix): Likewise.
* java/lang/natRuntime.cc: Include StackTrace.h.
(_load): Use findLibrary and new platform defines.
(nativeGetLibname): Use new platform defines.
From-SVN: r59976
* gnu/gcj/protocol/jar/Connection.java (getJarFile): download and
cache remote jar files.
* gnu/gcj/runtime/VMClassLoader.java: Don't construct jar URL, only
add File.separator to URL when it is a directory.
* java/lang/ClassLoader.java: Add Classpath javadoc.
(parent): final.
(getParent): Add (disabled) security check.
(findLibrary): New default method.
* java/net/JarURLConnection.java (getManifest): Implement.
(getInputStream): Only create InputStream when entry exists.
(getHeaders): Only use jarFileURLConnection or JarEntry to set length
when they exist.
* java/net/URLClassLoader.java: New/Rewritten version from Classpath.
From-SVN: r59949
* java/net/InetAddress.java (toString): Use hostname when not null,
don't do an explicit reverse getHostName() lookup.
* java/net/Socket.java (setSocketImplFactory): When fac == null throw
NullPointerException.
From-SVN: r59902
2002-12-05 Andrew Haley <aph@redhat.com>
* gnu/gcj/runtime/natStackTrace.cc (fillInStackTrace): Throw
#ifdef (HAVE_BACKTRACE) around the whole function body.
From-SVN: r59855
* java/lang/Class.h (_Jv_SetVTableEntries): Updated declaration.
* resolve.cc: Don't include AbstractMethodError.h.
(_Jv_abstractMethodError): Removed.
* defineclass.cc (handleMethodsBegin): Initialize method index to
-1.
* java/lang/natClass.cc (_Jv_LayoutVTableMethods): Don't set
method index for "new" final method.
(_Jv_SetVTableEntries): Compare index against -1 instead of using
isVirtualMethod. Added `flags' argument.
(_Jv_MakeVTable): Throw exception for abstract method in concrete
class.
From-SVN: r59847
* java/util/jar/JarFile.java (manifest): Not final.
(manifestRead): New field.
(JarFile): Don't read Manifest in constructor.
(getManifest): New method.
(JarEnumeration.nextElement): Use new method.
(getEntry): Likewise.
* java/util/zip/ZipFile.java (name): Final.
(raf): Likewsie.
(entries): Change type to Hashtable.
(closed): New field.
(ZipFile): Don't read enties in constructor.
(readEntries): Use Hashtable.
(close): Set new close flag and set entries to null inside
synchronized block.
(entries): Contruct enumeration using new getEntries() method and
entries Hashtable.
(getEntryIndex): Removed.
(getEntries): New method.
(getEntry): Use new getEntries() method and entries Hastable.
(getInputStream): Likewise.
(size): Return getEntries().size().
(ZipEntryEnumeration): Wrap entries Hashtable elements.
* java/util/zip/ZipEntry.java (cal): Don't initialize.
(time): Removed
(dostime): New field.
(zipFileIndex): Removed.
(ZipEntry(ZipEntry)): Copy dostime.
(setDOSTime): Now final and doesn't convert dos time.
(getDOSTime): Likewise.
(setTime): Convert dos time.
(getTime): Likewise.
(getCalendar): New method.
(setExtra): Use setTime().
* java/util/zip/ZipInputStream.java (getNextEntry): Format error msg.
From-SVN: r59785
2002-12-03 Andrew Haley <aph@redhat.com>
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call
_Jv_PushClass.
(_Jv_InitNewClassFields): Set protectionDomain and chain = NULL.
(_Jv_PopClass): New.
(_Jv_PushClass): New.
* java/lang/natClass.cc (forName (jstring)): Use a StackTrace to
discover the ClassLoader of our caller.
(_Jv_CheckArrayStore): Don't check that a class is assignment
compatible with Object.
* java/lang/natVMTHrowable.cc: Delete.
* gnu/gcj/runtime/StackTrace.java: New, partly copied from
java.lang.VMThrowable.
(StackTrace(), StackTrace(int)): New constructors.
(classAt, methodAt, update, methodAtAddress): New methods.
(map): New field.
* java/lang/VMThrowable.java: Use StackTrace instead of
natVMTHrowable.
* java/lang/Class.h (getClassLoaderInternal): New.
(class Class): Be friendly with _Jv_PopClass and _Jv_PushClass.
Be friendly with gnu::gcj::runtime::StackTrace.
(Object.chain): New field.
* include/java-interp.h (class _Jv_InterpMethod): Be friendly with
gnu::gcj::runtime::StackTrace.
* gnu/gcj/runtime/natStackTrace.cc: New file.
* gnu/gcj/runtime/MethodRef.java: New file.
* prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal()
instead of getClassLoader().
* verify.cc (class _Jv_BytecodeVerifier): Likewise.
java::lang::VMThrowable.
* Makefile.am (core_java_source_files): Add MethodRef.java,
StackTrace.java.
(nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc.
* Makefile.in: Rebuild.
From-SVN: r59771
2002-12-03 Andrew Haley <aph@redhat.com>
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call
_Jv_PushClass.
(_Jv_InitNewClassFields): Set protectionDomain and chain = NULL.
(_Jv_PopClass): New.
(_Jv_PushClass): New.
* java/lang/natClass.cc (forName (jstring)): Use a StackTrace to
discover the ClassLoader of our caller.
(_Jv_CheckArrayStore): Don't check that a class is assignment
compatible with Object.
* java/lang/natVMTHrowable.cc: Delete.
* gnu/gcj/runtime/StackTrace.java: New, partly copied from
java.lang.VMThrowable.
(StackTrace(), StackTrace(int)): New constructors.
(classAt, methodAt, update, methodAtAddress): New methods.
(map): New field.
* java/lang/VMThrowable.java: Use StackTrace instead of
natVMTHrowable.
* java/lang/Class.h (getClassLoaderInternal): New.
(class Class): Be friendly with _Jv_PopClass and _Jv_PushClass.
Be friendly with gnu::gcj::runtime::StackTrace.
(Object.chain): New field.
* include/java-interp.h (class _Jv_InterpMethod): Be friendly with
gnu::gcj::runtime::StackTrace.
* prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal()
instead of getClassLoader().
* verify.cc (class _Jv_BytecodeVerifier): Likewise.
java::lang::VMThrowable.
* Makefile.am (core_java_source_files): Add MethodRef.java,
StackTrace.java.
(nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc.
* Makefile.in: Rebuild.
From-SVN: r59770
2002-12-03 Andrew Haley <aph@redhat.com>
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call
_Jv_PushClass.
(_Jv_InitNewClassFields): Set protectionDomain and chain = NULL.
(_Jv_PopClass): New.
(_Jv_PushClass): New.
* java/lang/natClass.cc (forName (jstring)): Use a StackTrace to
discover the ClassLoader of our caller.
(_Jv_CheckArrayStore): Don't check that a class is assignment
compatible with Object.
* java/lang/natVMTHrowable.cc: Delete.
* gnu/gcj/runtime/StackTrace.java: New, partly copied from
java.lang.VMThrowable.
(StackTrace(), StackTrace(int)): New constructors.
(classAt, methodAt, update, methodAtAddress): New methods.
(map): New field.
* java/lang/VMThrowable.java: Use StackTrace instead of
natVMTHrowable.
* java/lang/Class.h (getClassLoaderInternal): New.
(class Class): Be friendly with _Jv_PopClass and _Jv_PushClass.
Be friendly with gnu::gcj::runtime::StackTrace.
(Object.chain): New field.
* include/java-interp.h (class _Jv_InterpMethod): Be friendly with
gnu::gcj::runtime::StackTrace.
* prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal()
instead of getClassLoader().
* verify.cc (class _Jv_BytecodeVerifier): Likewise.
java::lang::VMThrowable.
* Makefile.am (core_java_source_files): Add MethodRef.java,
StackTrace.java.
(nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc.
* Makefile.in: Rebuild.
2002-12-03 Andrew Haley <aph@redhat.com>
* class.c (make_class_data): New field, "chain".
* decl.c (java_init_decl_processing): Likewise.
From-SVN: r59769
* libjava.jacks/jacks.exp (gcj_jacks_setup_xfail): New function.
(gcj_jacks_parse): Use it; set up xfails.
* libjava.jacks/jacks.xfail: New file.
From-SVN: r59702
2002-11-29 Scott Gilbertson <scottg@mantatest.com>
* java/awt/image/ColorModel.java (getUnnormalizedComponents,
getNormalizedComponents): Fix calculation which was using one too
many bits in the unnormalized format.
From-SVN: r59651
* gnu/java/nio/DatagramChannelImpl:
(fd): New member variable to store file descriptor of socket.
* gnu/java/nio/SelectionKeyImpl.java:
(ops): Removed.
(readyOps): New member variable.
(interestOps): New member variable.
(readyOps): Implemented.
(readyOps): New method to set member variable readyOps.
(interestOps): Replaced ops by interestOps.
* gnu/java/nio/SelectorImpl.java:
(SelectorImpl): Initialize key sets.
(select): Call select with -1 instead of Long.MAX_VALUE).
(java_do_select): Make it a native method.
(getFDsAsArray): New helper method.
(select): Remove canceled keys, give only interested file discriptors
to java_do_select, set ready ops.
(add): No need to initialize keys set here.
(add_selected): No need to initialize selected set here.
(deregisterCanceledKeys): New helper method.
(register): Set interest ops, set attachments, added handling of datagram
channels.
* gnu/java/nio/ServerSocketChannelImpl:
(SocketAccept): Renamed from NioSocketAccept.
(implConfigureBlocking): Implemented.
(accept): Use SocketAccept instead of NioSocketAccept.
* gnu/java/nio/SocketChannelImpl:
Reactivate native methods.
From-SVN: r59632
* gnu/java/nio/ByteBufferImpl.java
(ByteBufferImpl): Moved position() after limit.
(nio_*): Use native implementation.
* gnu/java/nio/CharBufferImpl.java:
Reformated.
(endian): New member variable string endianess of buffer.
(CharBufferImpl): Moved position() after limit.
(nio_*): Use native implementation.
(subSequence): Implemented.
* gnu/java/nio/DoubleBufferImpl.java
(DoubleBufferImpl): Moved position() after limit.
(nio_*): Use native implementation.
* gnu/java/nio/FloatBufferImpl.java
Reformated.
(FloatBufferImpl): Moved position() after limit.
(nio_*): Use native implementation.
* gnu/java/nio/IntBufferImpl.java
Added needed imports, Reformated.
(IntBufferImpl): Moved position() after limit.
(nio_*): Use native implementation.
* gnu/java/nio/LongBufferImpl.java
Reformated.
(LongBufferImpl): Moved position() after limit.
(nio_*): Use native implementation.
* gnu/java/nio/ShortBufferImpl.java
Reformated.
(ShortBufferImpl): Moved position() after limit.
(nio_*): Use native implementation.
From-SVN: r59624
2002-11-27 Julian Dolby <dolby@us.ibm.com>
* java/util/Locale.java (toString): Improve efficiency if country
and variant are both empty.
From-SVN: r59590
* include/posix.h:
(_Jv_platform_on_close): Moved out of #ifndef DISBALE_JAVA_NET.
* include/win32.h:
(_Jv_platform_on_close): Moved out of #ifndef DISBALE_JAVA_NET.
(backtrace): Moved out of #ifndef DISBALE_JAVA_NET.
From-SVN: r59374