Commit Graph

256 Commits

Author SHA1 Message Date
Joel Dice
cb69ac23bd Merge remote branch 'origin/master' into openjdk
Conflicts:
	classpath/java/lang/String.java
	src/posix.cpp
2010-11-03 11:54:41 -06:00
jet
0713f8d5cb Locale system changes to better mimic Sun's VM. 2010-10-14 16:20:41 -06:00
Joel Dice
c1c9d2111b remove GNU Classpath and Apache Harmony compatibility code
Rather than try to support mixing Avian's core classes with those of
an external class library -- which necessitates adding a lot of stub
methods which throw UnsupportedOperationExceptions, among other
comprimises -- we're looking to support such external class libraries
in their unmodified forms.  The latter strategy has already proven
successful with OpenJDK's class library.  Thus, this commit removes
the stub methods, etc., which not only cleans up the code but avoids
misleading application developers as to what classes and methods
Avian's built-in class library supports.
2010-09-27 15:58:02 -06: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
Joel Dice
64100d17c7 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian into openjdk 2010-09-10 15:58:43 -06: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
Joel Dice
17c1a552d5 break each Class, Field, and Method into separate classes
In order to facilitate making the VM compatible with multiple class
libraries, it's useful to separate the VM-specific representation of
these classes from the library implementations.  This commit
introduces VMClass, VMField, and VMMethod for that purpose.
2010-09-01 10:13:52 -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
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
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
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
Joel Dice
adcac443e4 don't null out array in ArrayList when size goes to zero
This avoids thrashing in the case of a list which is frequently
emptied and refilled with a small number of elements.
2009-11-19 11:43:11 -07:00
Joel Dice
6fa25f992c Properties.setProperty should return an Object 2009-09-18 17:51:05 -06:00
Joel Dice
0a96f4c552 ensure WeakHashMap.MyCell objects are registered with the ReferenceQueue 2009-09-01 17:22:31 -06:00
Joel Dice
4c14a9ab66 implement enough of java.util.regex to ensure String methods work for trivial regular expressions 2009-08-20 11:14:05 -06:00
Joel Dice
6d54b6cec8 add classes which I meant to add in earlier commits 2009-08-14 08:51:10 -06:00
Joel Dice
590238bbfc add indexOf and lastIndexOf methods to java.util.List 2009-08-04 17:58:31 -06:00
Joel Dice
0a7f94abfe add java.util.Collection.toArray() 2009-08-04 17:36:25 -06:00
Joel Dice
7911989055 add AbstractList and AbstractSequentialList classes to java.util and listIterator methods to java.util.List 2009-08-04 17:24:29 -06:00
Joel Dice
93597a4d1d implement ArrayList.listIterator() 2009-08-04 11:34:46 -06:00
Joel Dice
08dd7d0a5a Merge branch 'gnu' 2009-08-03 09:01:16 -06:00
Joel Dice
30be3945ae update copyright year in TreeMap.java 2009-07-27 07:55:28 -06:00
Joel Dice
f869e5be21 Merge branch 'master' into gnu
Conflicts:

	classpath/java/util/TreeSet.java
2009-07-25 18:38:57 -06:00
Joel Dice
d3a249a3fa Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-07-25 18:36:27 -06:00
Joel Dice
d327f6ba5a implement java.util.TreeMap 2009-07-25 15:41:43 -06:00
Joel Dice
e72ff8db0b Merge branch 'master' into gnu
Conflicts:

	src/compile.cpp
2009-07-11 12:11:59 -06:00
Joel Dice
ab5ba9c954 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-07-10 09:57:29 -06:00
Eric Scharff
c3c06e4e0e Fix mac build
Remove a compiler error by removing an unnecessary method
2009-06-19 13:43:57 -06:00
Joel Dice
d0f11cd2e5 move non-standard classes to avian package 2009-06-04 17:59:34 -06:00
Joel Dice
98be5c509e more progress towards GNU Classpath compatibility 2009-06-03 16:17:55 -06:00
Joel Dice
9d6a3021ca make Hashtable.toString synchronized 2009-05-31 14:16:08 -06:00
Joel Dice
66c4867f18 more work on continuation support 2009-05-05 18:29:05 -06:00
Joel Dice
abc9da9b31 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-04-27 14:19:53 +00:00
Joel Dice
4091e871a7 tolerate null caller in Logger.log 2009-04-25 20:14:29 -06:00
Eric Scharff
ed4c24c7f6 Removed temp files 2009-04-22 16:27:58 -06:00
mweaver
6b89ecd0ee Like a noob, I missed some things... broke the compilation. 2009-04-22 15:24:26 -06:00
mweaver
f68f1e5888 should be fixed 2009-04-22 11:43:22 -06:00
mweaver
d6fb1e0c7c Adding changes to fix Map/Collections
Merge branch 'master' of ssh://oss.readytalk.com/var/local/git/avian

Conflicts:

	classpath/java/util/HashMap.java
	classpath/java/util/Map.java
2009-04-22 11:34:32 -06:00
mweaver
34da6da3db brought in line with Sun's SDK, should no longer break on values call 2009-04-22 10:04:38 -06:00
mweaver
c5dd57f74c Brought more in line with Sun's SDK 2009-04-22 10:04:23 -06:00
mweaver
9023899c81 Brought interface in line with Sun 2009-04-22 10:03:53 -06:00
Eric Scharff
af784f4cbc "Fix" Map.containsKey() and Map.containsValue()
java.util.Map.containsKey() and java.util.Map.containsValue() take
Object parameters, not K and V.  Changed to improve classpath
compatibility.
2009-04-17 08:57:49 -06:00
Joel Dice
d1018bf078 update copyright years 2009-03-15 12:02:36 -06:00
Joel Dice
1d04fed6de implement Collections.shuffle 2009-03-04 08:18:18 -07:00
Eric Scharff
bf8c856a3c Partially handle cascading logging levels.
We now maintain a virtual root loger, on which you can set the log
level.  When any logger logs, it finds the effective log level by going
up the parent chain, and finding a meaningful log lvel.  Thus, one can
now do Logger.getLogger("").setLevel(Level.FINER) and set the log level
for all other loggers (that do not specify their own default) to the
level specified.
2009-02-19 15:53:10 -07:00
Zsombor
8c68bc0e1b add logp methods to Logger 2009-02-16 18:11:05 -07:00
Zsombor
7c1a5fe57d add level handling to Logger 2009-02-16 18:10:31 -07:00
Zsombor
d682ccaceb add synchronized map 2009-02-16 17:52:27 -07:00
Zsombor
9ba62e25b9 fix and-ing, or-ing, etc BitSet with variant size 2009-02-16 17:51:37 -07:00
Ryan Forbes
46e19f9c80 Fixed bug where seconds were always zero because % was misspelled as / 2009-02-03 15:30:03 -07:00
Joel Dice
63c78d9d84 implement ResourceBundle.getKeys 2008-11-03 15:18:44 -07:00
Joel Dice
96d7bf571d implement a few methods to make SWT 3.4 happy 2008-10-10 11:49:28 -06:00
dain
7dbd4903f0 set default locale to en, us 2008-10-09 18:30:24 -06:00
Joel Dice
aeafb52bcb add ZipFile(File) constructor and ZipFile.close 2008-10-06 17:30:48 -06:00
Joel Dice
ae75be5683 add copyright headers 2008-10-03 14:57:40 -06:00
Joel Dice
2684b7c024 remove debug logging 2008-10-03 14:26:23 -06:00
Joel Dice
4c307ae8c6 implement minimal, read-only versions of RandomAccessFile and ZipFile 2008-10-03 14:15:47 -06:00
Joel Dice
025cf59bb6 Vector.setElementAt should return void 2008-09-26 18:16:35 -06:00
Joel Dice
066714933c implement Random.nextBytes and Random.nextLong 2008-09-26 15:30:08 -06:00
Joel Dice
93a96f3833 fix backwards logic in Stack.empty 2008-09-26 08:10:16 -06:00
Joel Dice
9017b5996a implement HashSet.toString 2008-08-22 14:02:38 -06:00
Joel Dice
a677a2da17 fix class cast exception in TreeSet ctor 2008-07-17 15:46:54 -06:00
Matt Weaver
244393430d Merge branch 'master' of git://oss.readytalk.com/avian 2008-07-16 11:26:29 -06:00
Matt Weaver
2d1ec11edc Added no arg constructor to support Comparable types. 2008-07-14 08:45:51 -06:00
Zsombor
4fed24270b add skeleton java.util.regex classes 2008-07-13 20:33:51 -06:00
Zsombor
d28a860138 add Arrays.fill 2008-07-13 18:28:27 -06:00
Zsombor
6409747f17 add Properties.getProperty(String,String) 2008-07-13 18:27:42 -06:00
Joel Dice
975c2c12a8 add license header to BitSet.java 2008-07-13 18:25:26 -06:00
Zsombor
e1d712ef71 java.util.BitSet implementation 2008-07-13 18:16:55 -06:00
Eric Scharff
bba4f75c2f Tweaked code indentation and formatting to match existing style 2008-07-03 10:49:08 -06:00
Zsombor
e3fd0d9c7d add a few classes and methods to the classpath
Add java.lang.CharSequence, java.util.AbstractSet,
java.util.AbstractCollection, Collections.unmodifiableSet,
 System.getProperty(String,String), etc.
2008-07-03 09:16:32 -06:00
Joel Dice
af794d9be0 implement Date.toString, which just defers to ctime for now (part 2) 2008-06-16 11:45:23 -06:00
Joel Dice
14e2513590 fix some API compatibility issues in the class library 2008-05-07 17:44:43 -06:00
Joel Dice
7dd9b96717 add additional methods and fields to class library 2008-03-20 18:40:18 -06:00
Joel Dice
8e1ec5794f implement java.util.Random and java.lang.Math.random in Java 2008-03-20 18:39:25 -06:00
Joel Dice
3e7acd7861 fix backwards logic in Collections.toArray 2008-03-05 14:21:53 -07:00
Joel Dice
51a731847a java.util code cleanup 2008-02-28 15:18:46 -07:00
Joel Dice
35d4d19c07 Merge branch 'master' of oss:/var/local/git/avian 2008-02-28 11:37:14 -07:00
Joel Dice
9d76d6a04e implement a few more classpath methods, including Collection.addAll and Collection.toArray 2008-02-28 11:37:10 -07:00
Eric Scharff
e23f2bafd5 Implemented trivial impolementation of java.util.Random.nextDouble() 2008-02-28 11:02:58 -07:00
Eric Scharff
73e7bfc1dc Added constructor for java.util.HashMap 2008-02-28 08:33:52 -07:00
Eric Scharff
eaa8d5c64b Trivial implementation of java.util.Random.nextInt(int n) 2008-02-26 09:37:46 -07:00
Joel Dice
2edaa82801 prepend copyright notice and license to all source files; add license.txt and readme.txt 2008-02-19 11:06:52 -07:00
Joel Dice
707359d555 remove redundant synchronization from Collections.SynchronizedCollection 2008-01-28 08:10:23 -07:00
Dain
6926ca6778 Added parsing of new line characters in properties files. 2008-01-23 16:39:45 -07:00
Eric Scharff
8b2577b77c Add method to create one hashtable from a map, useful in converting a
HashMap into a Hashtable.
2007-12-18 11:23:59 -07:00
Eric Scharff
7224c98766 Trivial implementation of java.util.Random 2007-12-17 15:43:51 -07:00
Eric Scharff
ec653fbc1e Use the default line separator when logging 2007-12-11 10:26:28 -07:00
Joel Dice
9f5c2f4122 implement Arrays.sort 2007-12-03 16:32:54 -07:00
Joel Dice
4f047ded8c make ArrayList.set() do bounds checking 2007-11-15 11:53:33 -07:00
Joel Dice
69f1024887 add missing classpath methods 2007-11-14 09:32:36 -07:00
Joel Dice
7b8fb7233e add PersistentSet.toString(), fix a bug when removing the last element, and add a couple sanity checks 2007-11-09 08:08:35 -07:00
Joel Dice
fef3cddb9e fix build breakage due to missing isEmpty() methods 2007-11-07 09:48:09 -07:00
Joel Dice
4611c89dbe add a few classpath methods 2007-11-06 17:41:53 -07:00
Eric Scharff
76d876c039 Removed custom logging code, which is factored correctly elsewhere. 2007-11-06 11:20:12 -07:00
Eric Scharff
c97b16b8bc implement a few classpath methods required by SWT for Mac OS X 2007-10-29 15:23:13 -06:00
Eric Scharff
8e95590dea Added a temporary hack for logging.
if the System property rt.log.dir is set, standard logging messages are
written both to standard out and to the file log.txt inside the directory
provided.  This allows us to get debugging information quickly.
2007-10-29 12:04:26 -06:00
Eric Scharff
25275933ce Print line numbers correctly for native and unknown source 2007-10-25 17:57:56 -06:00
Joel Dice
b12b779c7f add support for passing properties to the VM via JNI; use vm.builtins property to specify builtin libraries 2007-10-25 12:33:43 -06:00
Eric Scharff
52bc20ace2 Optimized calendar implementation. Year can now be computed with arithmetic,
not a loop to find the current year.
2007-10-22 15:53:46 -06:00
Eric Scharff
7eb08c5fc4 If a Calendar changes values, update the (cached) fields. 2007-10-22 12:23:56 -06:00
Eric Scharff
8902cf2a73 Added a working implementation of calendar that fills in the important
fields (year, month, day, hour, minute, second) for the Gregorian calendar.
Specifically, it fills in YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY, MINUTE,
and SECOND.
2007-10-22 12:03:15 -06:00
Joel Dice
f84b865f03 implement TreeSet.toString() 2007-10-16 19:17:37 -06:00
Eric Scharff
6be84b4653 Adds some missing methods to TreeSet, which really ought to be an instance of Collection 2007-10-16 12:14:03 -06:00
Eric Scharff
91ffeb6aed Signature of removeElementAt() was not correct, fixes exception in SWT 2007-10-15 14:06:06 -06:00
Joel Dice
64313aa243 fix return value of HashMap.put() 2007-10-13 15:46:20 -06:00
Eric Scharff
15d1fe8b75 Fix hashmap insertion bug (entire bucket was getting erased in some put() operations) 2007-10-11 17:03:51 -06:00
Eric Scharff
9d3027540b Add meaningful toString() methods 2007-10-11 16:41:07 -06:00
Eric Scharff
00cfa587bc Various bug fixes and optimizations 2007-10-11 15:41:23 -06:00
Eric Scharff
43a2cb7cc5 Tie up some loose ends, implementing methods that are useful but not yet implemented. 2007-09-28 11:38:58 -06:00
Eric Scharff
5691ec87f0 Added a proper implementation of TreeSet, based on a Persistent set implementation. 2007-09-28 11:01:57 -06:00
Eric Scharff
3fb90d4c3a Added minimalist TreeSet implementation, as well as Test classes for trees
and lists.
2007-09-27 16:23:05 -06:00
Eric Scharff
2ae6aa7ddf Fix System.arraycopy when the source and dest are the same 2007-09-27 15:06:56 -06:00
Eric Scharff
9621679d2a Cosmetic tweaks to the default logger 2007-09-27 12:43:20 -06:00
Eric Scharff
26de9c334d Add a default logging handler, in case the user doesn't provide any. 2007-09-27 12:42:06 -06:00
Eric Scharff
bb4a7c21c7 Implemented a simple but working implementation of the java logging API,
complete with a test class
2007-09-26 14:46:21 -06:00
Eric Scharff
c174ce34b6 Added several useful classes 2007-09-26 11:27:09 -06:00
Eric Scharff
4d3fd38d54 List now implements various forms of add() 2007-09-26 10:32:39 -06:00
Eric Scharff
0f926f8f0b Added ArrayList.set 2007-09-26 10:02:58 -06:00
Eric Scharff
7d67d09b1a Added inflate method and stub method for reset() 2007-09-26 09:53:30 -06:00
Eric Scharff
0beba6cafa ArrayList now implements ListIterator (for reverse traversals of lists) 2007-09-26 09:48:59 -06:00
Eric Scharff
8c248e382f Added methods to get and set properties, and stub method to save them 2007-09-26 09:48:21 -06:00
Eric Scharff
876b02f641 Added method addAll to interface Map 2007-09-26 09:19:21 -06:00
Eric Scharff
b02b98609e Added methods isEmpty(), putAll(), toArray() to interfaces List and Map 2007-09-26 08:57:34 -06:00
Eric Scharff
2e813cff18 Added Calendar.setTime(), even though it does not work 2007-09-26 08:43:01 -06:00
Joel Dice
86999df5f2 factor Properties and PropertieResourceBundle out of ResourceBundle 2007-09-17 16:16:57 -06:00
Joel Dice
923c4661e8 implement Inflater and InflaterInputStream 2007-09-17 16:15:16 -06:00
Joel Dice
4ade402f1b bugfixes; SWT ControlExample works on x86_32 2007-09-14 14:35:37 -06:00
Joel Dice
bb520e4ef9 bugfixes 2007-09-13 21:59:39 -06:00
Joel Dice
7cb3a30a91 sketch of Runtime.exec() and Calendar; misc bugfixes 2007-09-12 18:21:37 -06:00
Joel Dice
182414c6e0 sketch out ResourceBundle 2007-09-11 20:56:02 -06:00
Joel Dice
cb03240c64 quick sketches of various SWT 3.3 dependencies 2007-09-11 19:13:05 -06:00
Joel Dice
a4b4f36c5b various classpath updates to help SWT build 2007-08-30 17:31:32 -06:00
Joel Dice
d1dbb45d55 implement Arrays.toString() 2007-08-23 19:57:42 -06:00
Joel Dice
8377016b0f StringTokenizer bugfixes 2007-08-23 18:21:56 -06:00
Joel Dice
f907d9e08f implement StringTokenizer 2007-08-22 21:22:16 -06:00
Joel Dice
3526fbfcb7 initial sketch of java/util/StringTokenizer 2007-08-22 20:25:08 -06:00
Joel Dice
84028e7f51 fix reversed logic in LinkedList.addFirst()/addLast() 2007-08-21 22:01:37 -06:00
Joel Dice
a68505ff48 implement Hashtable.toString() (defer to HashMap) 2007-08-21 22:00:46 -06:00
Joel Dice
27c8511c5e bugfixes 2007-08-20 18:24:54 -06:00
Joel Dice
f22dda0df1 bugfixes 2007-08-14 19:14:55 -06:00
Joel Dice
d0e519d992 bugfixes 2007-08-13 19:44:47 -06:00
Joel Dice
ab3ca38580 various bugfixes 2007-08-13 18:37:00 -06:00
Joel Dice
c20219df19 flesh out serialization/deserialization code and fix build 2007-08-12 18:50:25 -06:00
Joel Dice
92ba1880d8 sketch of serialization/deserialization code (broken) 2007-08-12 15:01:47 -06:00
Joel Dice
a2bd7d0668 GC stress fixes and other bugfixes; classpath progress 2007-07-29 17:32:23 -06:00