summaryrefslogtreecommitdiffstats
path: root/libart/src/main/java/java/lang/reflect/ArtMethod.java
diff options
context:
space:
mode:
Diffstat (limited to 'libart/src/main/java/java/lang/reflect/ArtMethod.java')
-rw-r--r--libart/src/main/java/java/lang/reflect/ArtMethod.java99
1 files changed, 0 insertions, 99 deletions
diff --git a/libart/src/main/java/java/lang/reflect/ArtMethod.java b/libart/src/main/java/java/lang/reflect/ArtMethod.java
index 3abcb60..84e6b48 100644
--- a/libart/src/main/java/java/lang/reflect/ArtMethod.java
+++ b/libart/src/main/java/java/lang/reflect/ArtMethod.java
@@ -75,103 +75,4 @@ public final class ArtMethod {
/** Only created by ART directly. */
private ArtMethod() {}
-
- public Class getDeclaringClass() {
- return declaringClass;
- }
-
- public int getAccessFlags() {
- return accessFlags;
- }
-
- int getDexMethodIndex() {
- return dexMethodIndex;
- }
-
- public static String getMethodName(ArtMethod artMethod) {
- Class<?> declClass = artMethod.getDeclaringClass();
- Dex dex = declClass.getDex();
- int nameIndex = dex.nameIndexFromMethodIndex(artMethod.getDexMethodIndex());
- // Note, in the case of a Proxy the dex cache strings are equal.
- return declClass.getDexCacheString(dex, nameIndex);
- }
-
- /**
- * Returns true if the given parameters match those of the method in the given order.
- *
- * @hide
- */
- public static boolean equalConstructorParameters(ArtMethod artMethod, Class<?>[] params) {
- Class<?> declClass = artMethod.getDeclaringClass();
- Dex dex = declClass.getDex();
- short[] types = dex.parameterTypeIndicesFromMethodIndex(artMethod.getDexMethodIndex());
- if (types.length != params.length) {
- return false;
- }
- for (int i = 0; i < types.length; i++) {
- if (declClass.getDexCacheType(dex, types[i]) != params[i]) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Returns true if the given parameters match those of this method in the given order.
- *
- * @hide
- */
- public static boolean equalMethodParameters(ArtMethod artMethod, Class<?>[] params) {
- return equalConstructorParameters(artMethod, params);
- }
-
- Class<?>[] getParameterTypes() {
- Class<?> declClass = getDeclaringClass();
- Dex dex = declClass.getDex();
- short[] types = dex.parameterTypeIndicesFromMethodIndex(dexMethodIndex);
- if (types.length == 0) {
- return EmptyArray.CLASS;
- }
- Class<?>[] parametersArray = new Class[types.length];
- for (int i = 0; i < types.length; i++) {
- // Note, in the case of a Proxy the dex cache types are equal.
- parametersArray[i] = declClass.getDexCacheType(dex, types[i]);
- }
- return parametersArray;
- }
-
- Class<?> getReturnType() {
- Class<?> declClass = getDeclaringClass();
- Dex dex = declClass.getDex();
- int returnTypeIndex = dex.returnTypeIndexFromMethodIndex(dexMethodIndex);
- // Note, in the case of a Proxy the dex cache types are equal.
- return declClass.getDexCacheType(dex, returnTypeIndex);
- }
-
- /**
- * Performs a comparison of the parameters to this method with the given parameters.
- *
- * @hide
- */
- int compareParameters(Class<?>[] params) {
- Class<?> declClass = getDeclaringClass();
- Dex dex = declClass.getDex();
- short[] types = dex.parameterTypeIndicesFromMethodIndex(dexMethodIndex);
- int length = Math.min(types.length, params.length);
- for (int i = 0; i < length; i++) {
- Class<?> aType = declClass.getDexCacheType(dex, types[i]);
- Class<?> bType = params[i];
- if (aType != bType) {
- int comparison = aType.getName().compareTo(bType.getName());
- if (comparison != 0) {
- return comparison;
- }
- }
- }
- return types.length - params.length;
- }
-
- Annotation[][] getParameterAnnotations() {
- return AnnotationAccess.getParameterAnnotations(declaringClass, dexMethodIndex);
- }
}