Simplify merges of the annotation code.
Change-Id: I9fd3b53032b2e6053094500571775ed2fb5edf78
diff --git a/vm/Globals.h b/vm/Globals.h
index 1c0cb8c..d4076e9 100644
--- a/vm/Globals.h
+++ b/vm/Globals.h
@@ -268,9 +268,9 @@
ClassObject* classJavaLangReflectMethodArray;
ClassObject* classJavaLangReflectProxy;
ClassObject* classJavaNioDirectByteBuffer;
- ClassObject* classOrgApacheHarmonyLangAnnotationAnnotationFactory;
- ClassObject* classOrgApacheHarmonyLangAnnotationAnnotationMember;
- ClassObject* classOrgApacheHarmonyLangAnnotationAnnotationMemberArray;
+ ClassObject* classLibcoreReflectAnnotationFactory;
+ ClassObject* classLibcoreReflectAnnotationMember;
+ ClassObject* classLibcoreReflectAnnotationMemberArray;
ClassObject* classOrgApacheHarmonyDalvikDdmcChunk;
ClassObject* classOrgApacheHarmonyDalvikDdmcDdmServer;
ClassObject* classJavaLangRefFinalizerReference;
diff --git a/vm/InitRefs.cpp b/vm/InitRefs.cpp
index 9c1e1cb..672abaa 100644
--- a/vm/InitRefs.cpp
+++ b/vm/InitRefs.cpp
@@ -128,16 +128,12 @@
{ &gDvm.classJavaLangReflectMethodArray, "[Ljava/lang/reflect/Method;"},
{ &gDvm.classJavaLangReflectProxy, "Ljava/lang/reflect/Proxy;" },
{ &gDvm.classJavaNioDirectByteBuffer, "Ljava/nio/DirectByteBuffer;" },
- { &gDvm.classOrgApacheHarmonyDalvikDdmcChunk,
- "Lorg/apache/harmony/dalvik/ddmc/Chunk;" },
+ { &gDvm.classOrgApacheHarmonyDalvikDdmcChunk, "Lorg/apache/harmony/dalvik/ddmc/Chunk;" },
{ &gDvm.classOrgApacheHarmonyDalvikDdmcDdmServer,
"Lorg/apache/harmony/dalvik/ddmc/DdmServer;" },
- { &gDvm.classOrgApacheHarmonyLangAnnotationAnnotationFactory,
- "Lorg/apache/harmony/lang/annotation/AnnotationFactory;" },
- { &gDvm.classOrgApacheHarmonyLangAnnotationAnnotationMember,
- "Lorg/apache/harmony/lang/annotation/AnnotationMember;" },
- { &gDvm.classOrgApacheHarmonyLangAnnotationAnnotationMemberArray,
- "[Lorg/apache/harmony/lang/annotation/AnnotationMember;" },
+ { &gDvm.classLibcoreReflectAnnotationFactory, "Llibcore/reflect/AnnotationFactory;" },
+ { &gDvm.classLibcoreReflectAnnotationMember, "Llibcore/reflect/AnnotationMember;" },
+ { &gDvm.classLibcoreReflectAnnotationMemberArray, "[Llibcore/reflect/AnnotationMember;" },
{ NULL, NULL }
};
@@ -334,7 +330,7 @@
{ &gDvm.methJavaNioDirectByteBuffer_init, "Ljava/nio/DirectByteBuffer;",
"(JI)V" },
{ &gDvm.methOrgApacheHarmonyLangAnnotationAnnotationMember_init,
- "Lorg/apache/harmony/lang/annotation/AnnotationMember;",
+ "Llibcore/reflect/AnnotationMember;",
"(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/reflect/Method;)V" },
{ NULL, NULL, NULL }
};
@@ -364,8 +360,8 @@
{ &gDvm.methodTraceGcMethod, "Ldalvik/system/VMDebug;", "startGC", "()V" },
{ &gDvm.methodTraceClassPrepMethod, "Ldalvik/system/VMDebug;", "startClassPrep", "()V" },
{ &gDvm.methOrgApacheHarmonyLangAnnotationAnnotationFactory_createAnnotation,
- "Lorg/apache/harmony/lang/annotation/AnnotationFactory;", "createAnnotation",
- "(Ljava/lang/Class;[Lorg/apache/harmony/lang/annotation/AnnotationMember;)"
+ "Llibcore/reflect/AnnotationFactory;", "createAnnotation",
+ "(Ljava/lang/Class;[Llibcore/reflect/AnnotationMember;)"
"Ljava/lang/annotation/Annotation;" },
{ &gDvm.methDalvikSystemNativeStart_main, "Ldalvik/system/NativeStart;", "main", "([Ljava/lang/String;)V" },
{ &gDvm.methDalvikSystemNativeStart_run, "Ldalvik/system/NativeStart;", "run", "()V" },
diff --git a/vm/reflect/Annotation.cpp b/vm/reflect/Annotation.cpp
index 7ef0bde..bb1d2f5 100644
--- a/vm/reflect/Annotation.cpp
+++ b/vm/reflect/Annotation.cpp
@@ -666,9 +666,7 @@
valueObj = (Object*)avalue.value.l;
/* new member to hold the element */
- newMember =
- dvmAllocObject(gDvm.classOrgApacheHarmonyLangAnnotationAnnotationMember,
- ALLOC_DEFAULT);
+ newMember = dvmAllocObject(gDvm.classLibcoreReflectAnnotationMember, ALLOC_DEFAULT);
name = dexStringById(pDexFile, elementNameIdx);
nameObj = dvmCreateStringFromCstr(name);
@@ -775,9 +773,8 @@
JValue result;
if (size > 0) {
- elementArray = dvmAllocArrayByClass(
- gDvm.classOrgApacheHarmonyLangAnnotationAnnotationMemberArray,
- size, ALLOC_DEFAULT);
+ elementArray = dvmAllocArrayByClass(gDvm.classLibcoreReflectAnnotationMemberArray,
+ size, ALLOC_DEFAULT);
if (elementArray == NULL) {
ALOGE("failed to allocate annotation member array (%d elements)",
size);
@@ -833,10 +830,10 @@
const DexAnnotationItem* pAnnoItem;
/* we need these later; make sure they're initialized */
- if (!dvmIsClassInitialized(gDvm.classOrgApacheHarmonyLangAnnotationAnnotationFactory))
- dvmInitClass(gDvm.classOrgApacheHarmonyLangAnnotationAnnotationFactory);
- if (!dvmIsClassInitialized(gDvm.classOrgApacheHarmonyLangAnnotationAnnotationMember))
- dvmInitClass(gDvm.classOrgApacheHarmonyLangAnnotationAnnotationMember);
+ if (!dvmIsClassInitialized(gDvm.classLibcoreReflectAnnotationFactory))
+ dvmInitClass(gDvm.classLibcoreReflectAnnotationFactory);
+ if (!dvmIsClassInitialized(gDvm.classLibcoreReflectAnnotationMember))
+ dvmInitClass(gDvm.classLibcoreReflectAnnotationMember);
/* count up the number of visible elements */
size_t count = 0;
@@ -907,10 +904,10 @@
u4 typeIdx;
/* we need these later; make sure they're initialized */
- if (!dvmIsClassInitialized(gDvm.classOrgApacheHarmonyLangAnnotationAnnotationFactory))
- dvmInitClass(gDvm.classOrgApacheHarmonyLangAnnotationAnnotationFactory);
- if (!dvmIsClassInitialized(gDvm.classOrgApacheHarmonyLangAnnotationAnnotationMember))
- dvmInitClass(gDvm.classOrgApacheHarmonyLangAnnotationAnnotationMember);
+ if (!dvmIsClassInitialized(gDvm.classLibcoreReflectAnnotationFactory))
+ dvmInitClass(gDvm.classLibcoreReflectAnnotationFactory);
+ if (!dvmIsClassInitialized(gDvm.classLibcoreReflectAnnotationMember))
+ dvmInitClass(gDvm.classLibcoreReflectAnnotationMember);
for (i = 0; i < (int) pAnnoSet->size; i++) {
pAnnoItem = dexGetAnnotationItem(pDexFile, pAnnoSet, i);