Commit Graph

793 Commits

Author SHA1 Message Date
Mike Jensen
ee0ad22415 Undo my collections changes, as I was wrong here 2014-12-15 17:15:00 -07:00
Mike Jensen
32a1fb21f2 Some small classpath tweaks to be compatible with openJDK's api 2014-12-15 16:26:41 -07:00
Mike Jensen
7baa5243b0 Add Collections.synchronizedList to classpath 2014-12-12 11:35:39 -07:00
Joel Dice
66f1b7cf8f Merge pull request #370 from lostdj/patch-8
Added missing MIX/MAX_VALUE for basic types.
2014-11-19 08:15:16 -07:00
lostdj
0ec230497b Added missing MIX/MAX_VALUE for basic types. 2014-11-19 14:27:11 +03:00
Timofey Lagutin
e657863656 String.equalsIgnoreCase(): fix nullptrex.
It's logical and conforms OpenJDK..
2014-11-19 14:06:31 +03:00
Joel Dice
78a0e207c0 Merge pull request #367 from lostdj/patch-6
Fix some native and managed function signatures.
2014-11-11 14:33:51 -07:00
lostdj
3cff81da8d Fix some native and managed function signatures. 2014-11-08 14:06:11 +03:00
Joel Dice
4fd8396ba3 fix WSA error 10093 when openning a ServerSocketChannel
We need to call Socket.init before trying to use the Windows Socket
library.  We were already doing this in SocketChannel.open, but not in
ServerSocketChannel.open.
2014-11-07 11:31:19 -07:00
Joel Dice
8ac58b7d77 add minimal NavigableMap interface 2014-11-05 14:27:24 -07:00
Joel Dice
f25d5921a5 implement StringWriter.getBuffer
This is used by json.org's JSON library.
2014-10-28 14:52:02 -06:00
Joshua Warner
331c635814 Merge pull request #357 from lostdj/patch-2
Added missing cp/avian/Math.atan2(double,double)
2014-10-11 20:47:17 -06:00
Ilya Mizus
75dda14691 Fixed small bug in getClassType() function. 2014-10-11 23:36:14 +04:00
Timofey Lagutin
d4d31af740 Added missing cp/avian/Math.atan2(double,double)
It was implemented as native function, but wasn't added to java.lang.Math.
2014-10-11 14:33:48 +04:00
Ilya Mizus
85fec988d5 Added Class.getGenericSuperclass() and improved Member subclasses. Fixed Makefile on OS X 2014-10-09 02:32:56 +04:00
Joel Dice
998f99af44 Merge remote-tracking branch 'bfbc/avian-pack'
Conflicts:
	makefile
2014-10-08 14:04:00 -06:00
Joel Dice
fbcdfd6dec Merge remote-tracking branch 'dicej/android-upgrade' 2014-10-08 13:41:50 -06:00
Ilya Mizus
7d4cd23837 Some improvements in the code 2014-10-08 03:46:52 +04:00
Ilya Mizus
d1d97351b9 Reflection improved 2014-10-07 16:50:02 +04:00
Joel Dice
be91d792e4 fix Class.getInterfaces to return only declared interfaces
Previously, we returned all interfaces implemented directly or
indirectly, which did not match the JDK behavior.
2014-10-05 16:28:36 -06:00
Ilya Mizus
270bbc66f9 Added getGenericInterfaces() and fixed SignatureParser to work for everything except TypeVariable-s 2014-10-04 22:17:49 +04:00
Ilya Mizus
67cafb118c Added isAnonymousClass(), isLocalClass(), isMemberClass() functions to Class class 2014-10-02 23:51:25 +04:00
Joel Dice
7f4c0b3118 fix SSL stack and Android JAR resource loading 2014-08-22 07:20:19 -06:00
Joel Dice
b96cc3c575 update to more recent version of Android class library
Lots has changed since we forked Android's libcore, so merging the
latest upstream code has required extensive changes to the
Avian/Android port.

One big change is that we now use Avian's versions of
java.lang.Object, java.lang.Class, java.lang.ClassLoader, some
java.lang.reflect.* classes, etc. instead of the Android versions.
The main reason is that the Android versions have become very
Dex/Dalvik-specific, and since Avian is based on Java class files, not
dex archives, that code doesn't make sense here.  This has the side
benefit that we can share more native code with classpath-avian.cpp
and reduce the amount of Java/C++ code duplication.
2014-08-21 13:42:49 -06:00
Joshua Warner
46f7a45f12 add hashCode and equals methods to java/util/Map
Granted, this is weird - but this is what openjdk does.  Therefore,
some code that is compiled for openjdk (say, protobufs) will treat
calls to Map.hashCode as interface calls instead of virtual calls, as
they would have previously been under avian's classpath.

Also note that this error caused avian to abort in findInterfaceMethod
rather than throw an AbstractMethodError or somesuch - but that's a
problem for another day.
2014-08-15 10:44:22 -06:00
Joel Dice
2a43e68c16 fix all the bugs
So there I was, planning to just fix one little bug: Thread.holdsLock
and Thread.yield were missing for the Android class library.  Easy
enough, right?  So, I added a test, got it passing, and figured I'd go
ahead and run ci.sh with all three class libraries.  Big mistake.

Here's the stuff I found:

 * minor inconsistency in README.md about OpenSSL version

 * untested, broken Class.getEnclosingMethod (reported by Josh)

 * JNI test failed for tails=true Android build

 * Runtime.nativeExit missing for Android build

 * obsolete assertion in CallEvent broke tails=true Android build

 * obsolete superclass field offset padding broke bootimage=true Android build

 * runtime annotation parsing broke bootimage=true Android build
   (because we couldn't modify Addendum.annotationTable for classes in
   the heap image)

 * ci.sh tried building with both android=... and openjdk=..., which
   the makefile rightfully balked at

Sorry this is all in a single commit; I didn't expect so many
unrelated issues, and I'm too lazy to break them apart.
2014-07-12 16:57:24 -06:00
Joshua Warner
194e3b2701 add VMClass changes 2014-07-11 13:25:18 -06:00
Joel Dice
5d3c612d0e fix JNIEnv::FindClass calls from JNI_OnLoad for all supported class libraries
This also fixes the some Android build rot and updates the version of
OpenSSL used.
2014-07-01 10:53:26 -06:00
Mike Jensen
809b3493e4 More defensive if getCause() changes 2014-05-30 09:46:38 -06:00
Mike Jensen
8c15c14260 Improved Throwable so that if getCause is overriden the printStackTrace will get the cause 2014-05-30 09:27:37 -06:00
Joel Dice
7a768f2c69 fix log level inheritance
A Logger which has not had a level set explicitly should inherit its
effective level from its parent, not just default to INFO.
2014-05-20 14:26:56 -06:00
Mike Jensen
a7b548f347 Change ByteArrayOutputStream's toString function to match openJDK's expectation 2014-05-14 17:09:15 -06:00
Joel Dice
c35435e450 fix portability problem in Strings test
There was a test in Strings.java that assumed the default character
encoding was UTF-8, which is an invalid assumption on some platforms
(e.g. Windows).  This modifies the test to specify the encoding
explicitly.
2014-05-09 16:38:33 -06:00
Mike Jensen
0545c07d33 Added SortedMap interface
I also changed TreeMap to implement the "SortedMap" interface, like it should.  Unfortanetly not all the code to implement the interface was there.  Where it was simple I implemented the additional functions, in the case of headMap, tailMap, subMap we are currently just throwing an UnsupportedOperationException.
2014-04-29 09:52:27 -06:00
Joshua Warner
1b17ca146b Merge pull request #242 from dicej/copyright
update copyright years
2014-04-24 18:45:18 -06:00
Joel Dice
a41efb76c5 avoid NPE in URL.set when file is null 2014-04-23 15:51:57 -06:00
Joel Dice
9b7d0d1624 update copyright years 2014-04-23 15:33:41 -06:00
Joel Dice
4c3e0f3421 Merge pull request #238 from pcarrier/PsPN
CP: Properties.stringPropertyNames()
2014-04-20 19:24:10 -06:00
Mike Jensen
1a8d557c72 Merge pull request #237 from pcarrier/sb
CP: StringBuilder.append(char[])
2014-04-20 08:04:47 -06:00
Pierre Carrier
91282a040f CP: StringBuilder.append(char[]) 2014-04-20 04:24:52 -07:00
Pierre Carrier
a36176baca CP: Properties.stringPropertyNames() 2014-04-20 04:24:14 -07:00
Joel Dice
b74f9e32e9 fix NPE in Field.getAnnotations 2014-04-17 13:16:21 -06:00
Mike Jensen
7192b0081d Small change to make these two structures implement RandomAccess (as they should) 2014-04-16 14:33:32 -06:00
Joel Dice
d00debd250 fix Java 6 build
Java 6's javac is not as smart as Java 7's when it comes to calling
overloaded methods from an inner class, so we have to be more
explicit.
2014-04-07 14:05:54 -06:00
Joel Dice
8f4c0e78ce clean up System.getProperties and related methods
The behavior of Avian's versions of these methods was egregiously
non-standard, and there were problems with the Android implementations
as well.
2014-04-04 13:43:59 -06:00
Joel Dice
6e7149061c various refinements to network implementation
The main idea is to make DatagramChannel and *SocketChannel behave in
a way that more closely matches the standard, e.g. allow binding
sockets to addresses without necessarily listening on those addresses
and accept null addresses where appropriate.  It also avoids multiple
redundant DNS lookups.

This commit also implements CharBuffer and BindException, and adds the
Readable interface.
2014-03-31 15:22:14 -06:00
Joshua Warner
c5012cda72 Merge pull request #205 from dicej/getPackage
ensure ClassLoader.getPackage works with all class libraries
2014-03-19 17:59:44 -06:00
Joel Dice
8740d76154 ensure ClassLoader.getPackage works with all class libraries
There's more work to do to derive all the properties of a given class
from its code source (e.g. JAR file), but this at least ensures that
ClassLoader.getPackage will actually return something non-null when
appropriate.
2014-03-19 11:21:26 -06:00
Mike Jensen
b5d388a718 Added an implemention of ArrayDeque, as well as unit tests
I also used this opportunity to reduce code duplication around other queue/deque implementations.
2014-03-18 19:45:00 -06:00
Joel Dice
58079887a9 fix broken Class.getDeclar{ed|ing}Classes implementations
classpath-common.h's getDeclaringClass was trying to look up
non-existing classes, which led to an abort, and I don't even know
what Class.getDeclaredClasses was trying to do, but it was ugly and
wrong.
2014-03-14 11:10:54 -06:00