Commit Graph

512 Commits

Author SHA1 Message Date
Joel Dice
345c7d38a9 Merge http://github.com/gzsombor/avian into gzsombor 2010-09-12 14:33:02 -06:00
Joel Dice
522f8ca1a5 javadoc grammar correction in Continuations.java 2010-09-12 14:29:27 -06:00
Zsombor Gegesy
6752505cb8 add File.canRead()/File.canWrite() implementation 2010-09-11 21:23:46 +02:00
Zsombor Gegesy
7376425b24 dummy SecurityManager and related classes added 2010-09-11 21:23:46 +02:00
Zsombor Gegesy
6985e81503 add Properties.load(Reader) implementation 2010-09-11 21:23:46 +02:00
Zsombor Gegesy
5dadac2cb8 API additions for compatibility with harmony's java.util package 2010-09-11 21:23:46 +02:00
Zsombor Gegesy
fc2c6d5100 implement toLowerCase(Locale) in the default case 2010-09-11 21:23:46 +02:00
Joel Dice
250a77dc13 handle empty strings properly in Pattern.split
We were incorrectly returning an empty array when the input was empty,
whereas we ought to return an array containing a single empty string.
When the pattern to match was empty, we went into a loop to create an
infinite list of empty strings, only to crash once we've run out of
memory.  This commit addresses both problems.
2010-09-06 11:16:27 -06:00
Eric Scharff
a26eb1b2b9 Fix missing flush in PrintStream 2010-09-05 09:07:18 -06:00
Zsombor Gegesy
4169425307 add error classes 2010-08-16 09:23:48 -06:00
Zsombor Gegesy
a50fda1a5e add ClassLoader.getResources calls 2010-08-16 09:23:48 -06:00
Zsombor Gegesy
03b66375f4 add Collections.enumeration(Collection<T> c) 2010-08-16 09:23:48 -06:00
Zsombor Gegesy
4dc05844df add java.util.Properties.propertyNames() method 2010-08-16 09:23:48 -06:00
Zsombor Gegesy
1daa93d3c4 add ability to append to files 2010-08-16 09:23:48 -06:00
Joel Dice
f0f35a920f return a useful value from InflaterInputStream.available
Note the following excerpt from PNGFileFormat.java in SWT:

     /*
     * InflaterInputStream does not consume all bytes in the stream
     * when it is closed. This may leave unread IDAT chunks. The fix
     * is to read all available bytes before closing it.
     */
     while (stream.available() > 0) stream.read();
     stream.close();

This code relies on the documented behavior of
InflaterInputStream.available, which must return "0 after EOF has been
reached, otherwise always return 1".  This is unlike
InputStream.available, which is documented to return "the number of
bytes that can be read (or skipped over) from this input stream
without blocking by the next caller of a method for this input
stream", and says nothing about how many bytes are left until the end
of stream.

This commit modifies InflaterInputStream.available to behave according
to Sun's documentation.
2010-08-04 18:54:47 -06:00
Joel Dice
f0129665c6 fix corruption of old revisioins in PersistentSet
In PersistentSet.remove, we were modifying the child node in place
instead of making a copy to update, which would corrupt older
revisions.  This commit ensures that we always create a copy if
necessary.
2010-07-30 12:23:41 -06:00
Joel Dice
b3da635b63 add java.nio.channels.Channels implementation 2010-07-13 18:03:25 -06:00
Joel Dice
a3daeee1f6 Merge branch 'dns' 2010-07-02 12:39:41 -06:00
Joel Dice
5e7e539c2a fix non-windows java-net.cpp build 2010-07-02 09:36:55 -06:00
Joel Dice
cdc48da493 grammar tweaks to Continuations.java JavaDoc 2010-06-15 18:40:12 -06:00
Joel Dice
1b31fb67e1 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2010-06-15 18:27:51 -06:00
Joel Dice
47d9039b69 switch from gethostbyname to getaddrinfo on POSIX systems
gethostbyname may return any combination of IPv4 and IPv6 addresses,
and it's not safe to assume the first address is IPv4, which is all
our code is currently prepared to handle.  In contrast, getaddrinfo
allows us to specify whether we want IPv4, IPv6, or both.

We should eventually make this switch on Windows as well, but the
status of getaddrinfo in Windows 2000 is not clear, and MinGW's
ws2tcpip.h only declares it for XP and above.

This commit also adds InetAddress.getByName for explicit DNS lookups.
2010-06-14 16:09:56 -06:00
Joel Dice
f3a1c3253e use closesocket instead of close on Windows
MinGW's close apparently does nothing, and MSVC's headers don't even
declare it, so closesocket is the way to go.
2010-06-04 18:45:13 -06:00
Joel Dice
b908f575d5 fix several blocking SocketChannel bugs
In java-nio.cpp, we can't use GetPrimitiveArrayCritical when reading
from or writing to blocking sockets since it may block the rest of the
VM indefinitely.

In SelectableChannel.java, we can't use a null test on
SelectableChannel.key to determine whether the channel is open since
it might never be registered with a Selector.  According to the Sun
documentation, a SelectableChannel is open as soon as it's created, so
that's what we now implement.
2010-06-04 15:37:22 -06:00
Matt Klich
83c51f4801 Fix signed vs. unsigned comparison for 32bit build with mingw64 2010-05-13 16:59:08 -06:00
mjensen
a6998238d5 Additional of several interfaces which can be used in serialization 2010-05-10 10:17:06 -06:00
JET
c666ab58e3 Improved (should now be complete) Unicode support (UTF-8 for *nix and UTF-16 for Windows). 2010-04-20 10:03:07 -06:00
JET
b6936fb597 optimized InputStreamReader.read() 2010-04-14 09:43:56 -06:00
JET
b2f5e71d22 ARM and UTF-8 work 2010-04-14 09:26:50 -06:00
Joel Dice
a650f1affa provide more useful message when throwing exception from Field.set 2010-03-07 12:03:17 -07:00
Joel Dice
fdf9c5087b register socket with exceptfds when calling select on Windows
This allows us to get connection errors like WSAECONNREFUSED in
non-blocking mode.
2010-02-19 16:41:27 -07:00
Joel Dice
5d781a0584 declare Long.MAX_VALUE and Long.MIN_VALUE as longs, not Longs 2010-02-02 09:33:10 -07:00
Joel Dice
2c4e229e6e convert forward slashes to back slashes in Windows paths 2010-01-11 08:31:01 -07:00
Joel Dice
b1a1391093 skip "." and ".." in File.list{Files} to match Sun 2010-01-09 19:18:39 -07:00
Joel Dice
585dba004b ignore redundant calls to File{In|Out}putStream.close
Previously, we threw an IOException, which did not match Sun's behavior.
2010-01-09 18:22:16 -07:00
Joel Dice
9a056da2f7 increase default buffer size in BufferedInputStream
The previous value of 32 bytes did not perform well.  This increases it to 4096 bytes, which matches BufferedOutputStream.
2010-01-09 18:20:15 -07:00
Joel Dice
664cb3cd39 don't try to parse annotation tables more than once; use defining classloader when loading array classes during linking 2009-12-24 17:58:48 -07:00
Joel Dice
f588a62ae3 fix Classpath 0.98 compatibility issues 2009-12-22 21:34:04 -07:00
Joel Dice
30db38ebd6 replace calls to ExceptionOccurred with calls to ExceptionCheck
The latter is cheaper (avoids a state transition and possible memory
allocation) when we just want to know if an exception is thrown
without needing a handle to that exception.
2009-12-16 19:25:03 -07:00
Joel Dice
70da0df46b add Class.getExceptionTypes method 2009-12-15 10:04:51 -07:00
Joel Dice
875a1a45a3 pass valid pReturnValue parameter to _wgetenv_s 2009-12-12 17:55:00 -07:00
Joel Dice
f0c14fa1f1 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-12-06 13:35:07 -07:00
Joel Dice
bec3766180 fix misuse of term "recursive" in Continations JavaDoc 2009-12-06 13:34:31 -07:00
Joel Dice
ccbb4796f2 fix typo in JavaDoc comment 2009-12-05 22:49:23 -07:00
Joel Dice
0c85fc7527 throw OutOfMemoryError if malloc returns null pointer 2009-12-05 15:51:12 -07:00
Joel Dice
112e2a71d5 update copyright years 2009-12-05 15:50:23 -07:00
jent
99a1c12682 Files to add Deflater and DeflaterOutputStream to java.util.zip for
avian
2009-12-04 12:01:31 -07:00
Joel Dice
6118792ffd update copyright years 2009-12-02 19:08:29 -07:00
jent
f39469e71c Changes for better memory managment 2009-12-01 09:54:36 -07:00
Joel Dice
6475beda83 don't null out array in HashMap when size drops to zero
As in ArrayList, we want to avoid thrashing in cases where the map is frequently emptied and refilled.
2009-11-19 12:55:53 -07:00