Commit Graph

68 Commits

Author SHA1 Message Date
9b7d0d1624 update copyright years 2014-04-23 15:33:41 -06:00
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
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
25d69f38ee match Java's schizophrenic concept of inner class access modifiers
An inner class has two sets of modifier flags: one is declared in the
usual place in the class file and the other is part of the
InnerClasses attribute.  Not only is that redundant, but they can
contradict, and the VM can't just pick one and roll with it.  Instead,
Class.getModifiers must return the InnerClasses version, whereas
reflection must check the top-level version.  So even if
Class.getModifiers says the class is protected, it might still be
public for the purpose of reflection depending on what the
InnerClasses attribute says.  Crazy?  Yes.
2014-03-06 16:17:43 -07:00
0c298eb513 move OpenJDK.getProtectionDomain into Classes.java
This way, apps can access the CodeSource of a class whether they're
using the OpenJDK class library or the Avian one.
2014-02-26 14:09:42 -07:00
d1bdf2f8ef fix dumb mistake leading to AIOOBEs in Class.getMethod 2014-01-03 13:58:37 -07:00
0eb2d55da2 Class#getDeclaredClasses(): exclude inner classes of inner classes
Inner classes can have inner classes, but getDeclaredClasses() is
supposed to list *only* the immediate inner classes.

Example: if class Reflection contains a class Hello that contains
a class World, Reflection.class.getDeclaredClasses() must not
include World in its result.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-12-03 16:48:40 -06:00
dba8d39e63 Implement Class#getDeclaredClasses
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-11-06 09:07:58 -06:00
87b02eb949 update copyright years
Previously, I used a shell script to extract modification date ranges
from the Git history, but that was complicated and unreliable, so now
every file just gets the same year range in its copyright header.  If
someone needs to know when a specific file was modified and by whom,
they can look at the Git history themselves; no need to include it
redundantly in the header.
2013-07-02 20:52:38 -06:00
4e12847858 code rearrangment to improve state of Android libcore tests
This mainly moves several sun.misc.Unsafe method implementations from
classpath-openjdk.cpp to builtin.cpp so that the Avian and Android
builds can use them.

It also replaces FinalizerReference.finalizeAllEnqueued with a no-op,
since the real implementations assumes too much about how the VM
handles (or delegates) finalization.
2013-04-23 13:47:15 -06:00
8546ca5670 fix Avian classpath build 2013-02-22 11:55:01 -07:00
42d39b1af1 more Android class library work 2013-02-21 15:37:17 -07:00
1db67e463f Add Class#isEnum and improve error handling in Enum.valueOf 2013-02-03 16:03:15 +01:00
0addd8c814 update copyright years 2012-05-11 17:43:27 -06:00
794a45cb79 fix various ObjectOutputStream/ObjectInputStream bugs 2011-07-01 08:43:43 -06:00
a5742f5985 update copyright years 2010-12-05 20:21:09 -07:00
459f4d5194 fix openjdk-src bootimage build
The main change here is to use a lazily-populated vector to associate
runtime data with classes instead of referencing them directly from
the class which requires updating immutable references in the heap
image.  The other changes employ other strategies to avoid trying to
update immutable references.
2010-11-26 12:41:31 -07:00
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
d819a75f36 more work towards OpenJDK classpath support
The biggest change in this commit is to split the system classloader
into two: one for boot classes (e.g. java.lang.*) and another for
application classes.  This is necessary to make OpenJDK's security
checks happy.

The rest of the changes include bugfixes and additional JVM method
implementations in classpath-openjdk.cpp.
2010-09-14 10:49:41 -06:00
cddea7187d preliminary support for using OpenJDK's class library
Whereas the GNU Classpath port used the strategy of patching Classpath
with core classes from Avian so as to minimize changes to the VM, this
port uses the opposite strategy: abstract and isolate
classpath-specific features in the VM similar to how we abstract away
platform-specific features in system.h.  This allows us to use an
unmodified copy of OpenJDK's class library, including its core classes
and augmented by a few VM-specific classes in the "avian" package.
2010-09-10 15:05:29 -06:00
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
6118792ffd update copyright years 2009-12-02 19:08:29 -07:00
953cb69e5e move proxy and annotation code from C++ to Java
This allows code shrinkers to remove it if it's not used by the application.
2009-09-19 16:21:15 -06:00
7aa906d97b support runtime-visible annotations and java.lang.reflect.Proxy 2009-09-18 18:01:54 -06:00
987330fed5 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-08-28 16:18:36 -06:00
cd41751912 ensure primitive names are zero-terminated in Class.getName 2009-08-28 16:17:23 -06:00
73dc058c14 implement StackTraceElement.getFileName properly 2009-08-27 16:28:44 -06:00
c4edabdc02 implement ClassLoader.resolveClass and ensure class is linked in e.g. Class.getMethods; minor bugfixes 2009-08-18 14:26:28 -06:00
fb37f48237 add various methods to Class and fix getComponentType for primitive arrays 2009-08-13 08:57:06 -06:00
0544ab381f fix Class.isArray for case this == Class.class 2009-08-12 19:40:52 -06:00
97ea23e3bb optionally specify classloader to Class.forCanonicalName 2009-08-10 07:46:05 -06:00
1a2deff97d Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2009-08-09 14:43:53 -06:00
6d27274aea update Class.PrimitiveFlag value to reflect change in machine.h; make Class.getName work for primitive types 2009-08-05 15:57:51 +00:00
7050448ec5 implement Class.{get|set}Signers 2009-08-04 18:31:14 -06:00
54ceb80116 implement stub versions of java.security classes 2009-08-03 08:56:19 -06:00
27d863790c Merge branch 'win64' into gnu
Conflicts:

	makefile
	src/compile-x86.S
	src/x86.S
	src/x86.cpp
2009-07-25 20:48:36 -06:00
a201d28e5c handle null loader parameter properly in Class.forName 2009-06-06 20:29:15 -06:00
bcad89dc17 handle null parameter types in various class methods 2009-06-05 14:28:55 -06:00
0615b8a09f add classes and methods needed for GNU Classpath compatibility
Most of these methods are stubs which throw
UnsupportedOperationExceptions for now.
2009-06-02 17:14:38 -06:00
c80eb51c17 Merge branch 'master' into powerpc
Conflicts:

	makefile
	src/assembler.h
	src/compile.cpp
	src/compiler.cpp
	src/compiler.h
	src/finder.cpp
2008-11-11 08:21:48 -07:00
bba4f75c2f Tweaked code indentation and formatting to match existing style 2008-07-03 10:49:08 -06:00
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
e9eacd900d add Class.isInterface 2008-04-01 16:48:58 -06:00
2edaa82801 prepend copyright notice and license to all source files; add license.txt and readme.txt 2008-02-19 11:06:52 -07:00
6fe0c4636f various bugfixes and tweaks in reflection 2007-11-20 13:40:07 -07:00
80f23a5040 implement Class.getEnumConstants 2007-11-17 11:39:29 -07:00
e820b6a8a4 sketch of singleton support 2007-11-02 15:08:14 -06:00
bb520e4ef9 bugfixes 2007-09-13 21:59:39 -06:00
7cb3a30a91 sketch of Runtime.exec() and Calendar; misc bugfixes 2007-09-12 18:21:37 -06:00
cb03240c64 quick sketches of various SWT 3.3 dependencies 2007-09-11 19:13:05 -06:00