* java/net/NetPermission.java
(NetPermission): Make doucmentation match the method declaration.
* java/net/NetworkInterface.java
(equals): Reformated for GNU coding style.
* java/net/ServerSocket.java: Merged with classpath.
* java/net/Socket.java: Partly merged with classpath (Added some @since).
* java/net/SocketImpl.java
(localPort): Merged with classpath (initialize with -1).
* java/net/SocketPermission.java: Merged with classpath (reindented).
* java/net/URLDecoder.java: Merged with classpath (reindented).
From-SVN: r62824
2003-02-12 Ranjit Mathew <rmathew@hotmail.com>
* include/win32.h: Include ws2tcpip.h instead of
winsock.h to obtain definition of the socklen_t type.
Remove IP_TOS definition - not needed with ws2tcpip.h
(_Jv_connect): Correct slight formatting error.
From-SVN: r62801
2003-02-12 Ranjit Mathew <rmathew@hotmail.com>
* jni.cc (_Jv_LookupJNIMethod): Modify to accept the
size of the arguments for a JNI function. For Win32,
modify to search for all forms of possible exported
names of an stdcall JNI function.
(_Jv_JNIMethod::call): Modify to calculate the size
of the arguments passed to a JNI function and pass
it to _Jv_LookupJNIMethod.
From-SVN: r62796
* java/nio/Buffer.java
(cap, lim, pos, mark): Made private
(Buffer): Added package private constructor.
* java/nio/ByteBuffer.java
(ByteBuffer): Implements Cloneable.
(offset): New member variable.
(readOnly): New member variable.
(backing_buffer): New member variable.
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet, documentation added.
(allocate): Documentation added.
(wrap): Documentation added.
(ByteBuffer): New constructor.
(hasArray): New method.
(array): New method.
(arrayOffset): New method.
(get): Documentation added.
(put): Documentation added.
* java/nio/CharBuffer.java
(CharBuffer): New constructor.
(compareTo): Don't access member variables of Buffer directly.
* java/nio/DoubleBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
* java/nio/FloatBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
* java/nio/IntBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
* java/nio/LongBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
* java/nio/MappedByteBuffer.java
(MappedByteBuffer): New method.
(force): New method.
(isLoaded): New method.
(load): New method.
* java/nio/ShortBuffer.java
(allocateDirect): Throw exception and tell that direct buffers are
not supported yet.
From-SVN: r62685
* java/nio/DoubleBuffer.java
(DoubleBuffer): Implements Comparable.
(endian): Removed.
(array_offset): New member variable.
(DoubleBuffer): New constuctor.
(get): May not be final.
(put): May not be final.
(arrayOffset): Implemented.
(order): Made abstract.
(order): Removed.
(as*Buffer): Removed.
(get*): Removed.
(put*): Removed.
* java/nio/FloatBuffer.java
(FloatBuffer): Implements Comparable.
(endian): Removed.
(array_offset): New member variable.
(FloatBuffer): New constuctor.
(get): May not be final.
(put): May not be final.
(arrayOffset): Implemented.
(order): Made abstract.
(order): Removed.
(as*Buffer): Removed.
(get*): Removed.
(put*): Removed.
* java/nio/IntBuffer.java
(IntBuffer): Implements Comparable.
(endian): Removed.
(array_offset): New member variable.
(IntBuffer): New constuctor.
(get): May not be final.
(put): May not be final.
(arrayOffset): Implemented.
(order): Made abstract.
(order): Removed.
(as*Buffer): Removed.
(get*): Removed.
(put*): Removed.
* java/nio/LongBuffer.java
(LongBuffer): Implements Comparable.
(endian): Removed.
(array_offset): New member variable.
(LongBuffer): New constuctor.
(get): May not be final.
(put): May not be final.
(arrayOffset): Implemented.
(order): Made abstract.
(order): Removed.
(as*Buffer): Removed.
(get*): Removed.
(put*): Removed.
* java/nio/ShortBuffer.java
(ShortBuffer): Implements Comparable.
(endian): Removed.
(array_offset): New member variable.
(ShortBuffer): New constuctor.
(get): May not be final.
(put): May not be final.
(arrayOffset): Implemented.
(order): Made abstract.
(order): Removed.
(as*Buffer): Removed.
(get*): Removed.
(put*): Removed.
From-SVN: r62684
* java/nio/charset/IllegalCharsetNameException.java
(serialVersionUID): New member variable.
(charsetName): New member variable.
(IllegalCharsetException): New implementation.
(getCharsetName): New implementation.
* java/nio/charset/UnsupportedCharsetException.java
(serialVersionUID): New member variable.
(charsetName): New member variable.
(UnsupportedCharsetException): New implementation.
(getCharsetName): New implementation.
From-SVN: r62680
2003-02-10 Raif S. Naffah <raif@fl.net.au>
* gnu/java/security/provider/SHA1PRNG.java (ensureIsSeeded): new
method used to ensure seeding has occurred and that a specific
seed can be set and used.
From-SVN: r62660
2003-02-10 Raif S. Naffah <raif@fl.net.au>
* java/math/BigInteger.java:
Updated notice to include years 2002 and 3.
Added 2 private (int) arrays with values from the HAC (Handbook of
Applied Cryptography -A. Menezes & al): k[] that contains bit lengths
and t[] that contains nbr. of tests --used in isProbablePrime().
* java/math/BigInteger.java (make(long)): Merged into valueOf(long).
* java/math/BigInteger.java (make(int[],int), add(int,int),
add(BI,BI,int), times(BI,int), divide(long,long,BI,BI,int), gcd(BI),
isProbablePrime(int), shift(BI,int), valueOf(String,int), neg(BI),
bitOp(int,BI,BI), and(BI,int)): Use valueOf(long) instead of
make(long).
* java/math/BigInteger.java (euclidInv): Reduce number of work vars
(euclidInv(int,int,int)): Now returns an array of 2 ints instead of 3.
(euclidInv(BI,BI,BI)): Used to return an array of 2 BIs; now accepts 6
BIs and returns void.
(modInverse(BI)): Use new signatures of euclidInv().
* java/math/BigInteger.java (isProbablePrime(int)): Use divide() with
static small primes instead of remainder().
Use pre-computed max nbr of trials based on bitlength of BI to test.
Use pre-computed small primes for the trial tests instead of random
numbers.
* java/math/BigInteger.java (isOdd, isMinusOne, pow): Removed.
not used.
* java/math/BigInteger.java (format(int,StringBuffer)): Removed
invoacation of MPN.chars_per_word(). not used.
* java/math/BigInteger.java (gcd(int,int)): Declared 'tmp' once as
local var and used where needed.
* java/math/BigInteger.java (modPow(BI,BI)): Fixed spelling.
Combined declaration with initialisation of locals.
Removed unused var.
* java/math/BigInteger.java: Style changes
(pow(int)): Removed 'else' keyword.
(toString(int)): idem.
(doubleValue()): idem.
(bitLength()): idem.
(equals(Object)): Use static methods name in same class w/o prepending
class name.
(doubleValue()): idem.
(setNegative(BI)): idem.
(negate()): idem.
(and(BI,int)): idem.
(and(BI)): idem.
(gcd(BI)): idem.
(byteArrayToIntArray()): Removed casting to (int). this is
std. behaviour.
(canonicalize()): idem.
(alloc(int)): Always instantiate a new BI.
From-SVN: r62656
* java/util/jar/JarFile.java (JarFile(String, boolean)): Read manifest
when verify is true.
(JarFile(File, boolean)): Likewise.
(manifestRead): Set manifestRead field correctly.
From-SVN: r62545
2003-02-07 Stephen Crawley <crawley@dstc.edu.au>
* java/math/BigDecimal(valueOf): fix DiagBigDecimal val008, val013
tests; see patch #1016 on Savannah.
2003-02-07 Stephen Crawley <crawley@dstc.edu.au>
* java/math/BigDecimal.java (BigDecimal): enhance parsing of exponents
(toString): do not return Strings starting with . and - erroneously.
Improves Mauve results to 12 of 600 instead of 16 of 338 on
DiagBigDecimal.
From-SVN: r62540
2003-02-03 Ranjit Mathew <rmathew@hotmail.com>
* java/lang/natRuntime.cc (java::lang::Runtime::_load)): Take care
of the fact that on Win32, JNI_OnLoad is an "stdcall" function and
could also have been exported as "JNI_OnLoad@8" (MinGW) or
"_JNI_OnLoad@8" (MSVC).
From-SVN: r62348
* jni.cc (_Jv_JNI_NewObjectArray): Check that initializer can be
cast to element type.
(_Jv_JNI_SetObjectArrayElement): Check array bounds.
(_Jv_JNI_GetObjectArrayElement): Likewise.
From-SVN: r62210
* aclocal.m4, configure, include/config.h.in: Rebuilt.
* acinclude.m4 (CHECK_FOR_BROKEN_MINGW_LD): Resurrected; was in
aclocal.m4 and lost in some merge.
From-SVN: r62188
2003-01-28 Oscar Pearce <oscar@pearceenterprises.com>
* java/awt/Component.java (processPaintEvent): Dispose of Graphics
object when finished.
From-SVN: r62052
2003-01-28 Ranjit Mathew <rmathew@hotmail.com>
Fixes PR java/9254:
* include/win32-threads.h (_Jv_Mutex_t): Convert to a struct
additionally containing id of the owner thread as well as
the number of nested times the thread has acquired the mutex.
(_Jv_MutexInit): Initialise owner thread id and refcount to 0.
(_Jv_MutexDestroy): Reset owner thread id and refcount to 0.
(_Jv_MutexUnlock): Check if really the owner thread, reset
owner thread id to 0 before leaving, if leaving for the last
time.
(_Jv_MutexLock): Set owner thread id in the mutex and increment
refcount.
(_Jv_ThreadYield): Yield using a call to Sleep(0).
* win32-threads.cc (_Jv_CondWait): Check if really owner of
the passed mutex.
Pass handle of the broadcast event, instead of a pointer to it
in Win32 ResetEvent( ) call.
Remove incorrect return values.
(_Jv_CondDestroy): Close both event handles and delete
critical section.
(_Jv_CondNotify): Check if really the owner thread.
(_Jv_CondNotifyAll): Check if really the owner thread.
(_Jv_InitThreads): Change daemon_cond to a manual-reset event.
(really_start): Use SetEvent( ) to signal daemon_cond.
(_Jv_ThreadWait): Remove SignalObjectAndWait( ) and use
WaitForSingleObject( ) instead to wait for daemon_cond to be
signalled.
From-SVN: r62033
2003-01-24 Ranjit Mathew <rmathew@hotmail.com>
Fixes PR java/9253:
* java/io/natFileWin32.cc (performList): Append only "*.*"
if the canonical file path already has a "\" at the end.
From-SVN: r61736
2003-01-21 Vladimir Puskas <vpuskas@eunet.yu>
* java/io/natFileWin32.cc (isAbsolute): Check path length before
looking at any characters.
* java/io/natFilePosix.cc (_stat): Only compute `buf' if it will
be used.
(isAbsolute): Check path's length as well.
From-SVN: r61566
2003-01-15 Scott Gilbertson <scottg@mantatest.com>
* Makefile.in: Rebuilt.
* Makefile.am (xlib_includes): New macro.
(INCLUDES): Use it.
From-SVN: r61366
2003-01-15 Scott Gilbertson <scottg@mantatest.com>
* java/awt/CardLayout.java (show): Rewrote.
(gotoComponent): Removed `target' argument. Simplified code.
Don't pre-compute `choice' unless `what' is FIRST or LAST.
Changed all callers.
(NONE): Removed.
From-SVN: r61357
Fix for PR libgcj/9139:
* lib/libjava.exp (find_javac): Put value of libgcj_jar into
return value when gcj is used.
* libjava.mauve/mauve.exp (test_mauve): Use libgcj_jar global.
From-SVN: r61237
* java/net/DatagramSocket.java
(ch): Description added.
(remotePort): Initialize with -1.
(connect): Doesnt throws SocketException.
* java/net/MulticastSocket.java
(setInterface): Merge with Classpath.
* java/net/ServerSocket.java
(closed): New member variable.
(bind): Check if socket is closed.
(close): Close an associated channel too, set new value to closed.
(isBound): Reindented.
(isClosed): Implemented.
* java/net/Socket.java
(closed): New member variable.
(bind): Check if socket is closed.
(connect): Check if socket is closed.
(close): Close an associated channel too, set new value to closed.
(isClosed): Implemented.
From-SVN: r61185
* java/io/FileDescriptor.java (position): New private field.
* java/io/natFileDescriptorPosix.cc (write): Up position.
(setLength): Use and set position.
(seek): Set position.
(getFilePointer): Return position.
(read): Up position.
From-SVN: r60869
* java/io/ObjectStreamClass.java (lookup): Split method and call
lookupForClassObject().
(lookupForClassObject): New method.
(isProxyClass): New field.
(setClass): Set isProxyClass, add object to classLookupTable, set
superClass and calculateOffsets.
(ObjectStreamClass): Set isProxyClass. Only set uid when Serializable
and not a proxy class.
(setFields): Set accessible true for serialPersistentFields.
(getClassUID): Same for suid. And check if suid is of type long.
(hasClassInitializer): Don't throw NoSuchMethodError.
From-SVN: r60867
2003-01-03 Eric Blake <ebb9@email.byu.edu>
* java/util/TreeMap.java (fabricateTree): Fix off-by-one error.
(TreeIterator.remove): Prefer IllegalStateException over
ConcurrentModificationException, to match Sun.
From-SVN: r60837
* java/net/HttpURLConnection.java (HTTP_NOT_IMPLEMENTED): Must be
public.
(HTTP_USE_PROXY): Add field.
(getResponseVals): Only set responseCode when not yet explicitly
set by subclass.
From-SVN: r60809
* java/util/zip/ZipFile.java (entries): Now HashMap.
(readLeShort(DataInput, byte[])): Read from given byte array.
(readLeInt(DataInput, byte[]): Likewise.
(readLeShort(byte[] b, int off)): New method.
(readLeInt(byte[] b, int off)): Likewise.
(readEntries): Use byte arrays to read info in bigger chunks.
(getEntries): Return HashMap.
(getEntry): Use HashMap.
(locBuf): New private field.
(checkLocalHeader): Use locBuf to read info in one chunk.
(getInputStream): Use entries HashMap, wrap PartialInputStream
in BufferedInputStream.
(ZipEntryEnumeration): Use HashMap and Interator.
Co-Authored-By: Mark Wielaard <mark@klomp.org>
From-SVN: r60803
Fix for PR libgcj/7416:
* javax/naming/InitialContext.java (init): Use
gnu.classpath.home.url.
* java/security/Security.java: Use new properties.
(loadProviders): Accept base url; use it.
* java/lang/System.java: Document gnu.classpath.vm.shortname, and
gnu.classpath.home.url.
(gnu.classpath.home.url): Define.
(gnu.classpath.vm.shortname): Likewise.
From-SVN: r60722