summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-01-15 16:12:07 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-01-15 16:12:07 -0800
commitd94c06c605baa7814b787bab7c993775b486ffba (patch)
treea2b36c743db7cb9fd4d6ac4cc89fdfb53ed2e35e /luni
parenta0881d052ee72e3f7e773374e9b1aa75fbd6be4c (diff)
downloadlibcore-d94c06c605baa7814b787bab7c993775b486ffba.zip
libcore-d94c06c605baa7814b787bab7c993775b486ffba.tar.gz
libcore-d94c06c605baa7814b787bab7c993775b486ffba.tar.bz2
auto import from //branches/cupcake/...@126645
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/org/apache/harmony/luni/lang/reflect/GenericSignatureParser.java10
-rw-r--r--luni/src/main/java/org/apache/harmony/luni/lang/reflect/ImplForType.java13
2 files changed, 15 insertions, 8 deletions
diff --git a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/GenericSignatureParser.java b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/GenericSignatureParser.java
index 83505e1..2ea0b5a 100644
--- a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/GenericSignatureParser.java
+++ b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/GenericSignatureParser.java
@@ -73,6 +73,7 @@ public class GenericSignatureParser {
public Type fieldType;
public ListOfTypes interfaceTypes;
public Type superclassType;
+ public ClassLoader loader;
GenericDeclaration genericDecl;
@@ -93,6 +94,10 @@ public class GenericSignatureParser {
char[] buffer;
int pos;
+ public GenericSignatureParser(ClassLoader loader) {
+ this.loader = loader;
+ }
+
void setInput(GenericDeclaration genericDecl, String input) {
if (input != null) {
this.genericDecl = genericDecl;
@@ -297,7 +302,7 @@ public class GenericSignatureParser {
ListOfTypes typeArgs = parseOptTypeArguments();
ImplForType parentType =
- new ImplForType(null, qualIdent.toString(), typeArgs);
+ new ImplForType(null, qualIdent.toString(), typeArgs, loader);
ImplForType type = parentType;
while (symbol == '.') {
@@ -306,7 +311,8 @@ public class GenericSignatureParser {
scanIdentifier();
qualIdent.append("$").append(identifier); // FIXME: is "$" correct?
typeArgs = parseOptTypeArguments();
- type = new ImplForType(parentType, qualIdent.toString(), typeArgs);
+ type = new ImplForType(parentType, qualIdent.toString(), typeArgs,
+ loader);
}
expect(';');
diff --git a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ImplForType.java b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ImplForType.java
index 8553276..70f05b4 100644
--- a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ImplForType.java
+++ b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ImplForType.java
@@ -25,13 +25,15 @@ public final class ImplForType implements ParameterizedType {
private Type ownerTypeRes;
private Class rawType; // Already resolved.
private final String rawTypeName;
+ private ClassLoader loader;
public ImplForType(ImplForType ownerType, String rawTypeName,
- ListOfTypes args) {
+ ListOfTypes args, ClassLoader loader) {
this.ownerType0 = ownerType;
this.rawTypeName = rawTypeName;
this.args = args;
+ this.loader = loader;
}
@@ -53,12 +55,11 @@ public final class ImplForType implements ParameterizedType {
public Class getRawType() {
if (rawType == null) {
- // TODO which ClassLoader to use?
- // Here the actual loading of the class has to be performed and the
- // Exceptions have to be re-thrown TypeNotPresent...
- // How to deal with member (nested) classes?
+ // Here the actual loading of the class has to be performed and the
+ // Exceptions have to be re-thrown TypeNotPresent...
+ // How to deal with member (nested) classes?
try {
- rawType = Class.forName(rawTypeName);
+ rawType = Class.forName(rawTypeName, false, loader);
} catch (ClassNotFoundException e) {
throw new TypeNotPresentException(rawTypeName, e);
}