use of org.fakereplace.data.ModifiedMethod in project fakereplace by fakereplace.
the class AnnotationReflection method getAnnotations.
public static Annotation[] getAnnotations(Method clazz) {
if (AnnotationDataStore.isMethodDataRecorded(clazz)) {
Annotation[] result = AnnotationDataStore.getMethodAnnotations(clazz);
int rc = 0;
boolean found = false;
for (Annotation a : result) {
if (a instanceof ModifiedMethod) {
found = true;
break;
}
}
if (!found) {
return result;
}
Annotation[] ret = new Annotation[result.length - 1];
for (Annotation a : result) {
if (!(a instanceof ModifiedMethod)) {
ret[rc] = a;
rc++;
}
}
return ret;
}
if (clazz.isAnnotationPresent(ModifiedMethod.class)) {
Annotation[] d = clazz.getAnnotations();
Annotation[] ret = new Annotation[d.length - 1];
int rc = 0;
for (Annotation a : d) {
if (!(a instanceof ModifiedMethod)) {
ret[rc] = a;
rc++;
}
}
return ret;
}
return clazz.getAnnotations();
}
use of org.fakereplace.data.ModifiedMethod in project fakereplace by fakereplace.
the class AnnotationReflection method getDeclaredAnnotations.
public static Annotation[] getDeclaredAnnotations(Method clazz) {
if (AnnotationDataStore.isMethodDataRecorded(clazz)) {
Annotation[] result = AnnotationDataStore.getMethodAnnotations(clazz);
int rc = 0;
boolean found = false;
for (Annotation a : result) {
if (a instanceof ModifiedMethod) {
found = true;
break;
}
}
if (!found) {
return result;
}
Annotation[] ret = new Annotation[result.length - 1];
for (Annotation a : result) {
if (!(a instanceof ModifiedMethod)) {
ret[rc] = a;
rc++;
}
}
return ret;
}
if (clazz.isAnnotationPresent(ModifiedMethod.class)) {
Annotation[] d = clazz.getDeclaredAnnotations();
Annotation[] ret = new Annotation[d.length - 1];
int rc = 0;
for (Annotation a : d) {
if (!(a instanceof ModifiedMethod)) {
ret[rc] = a;
rc++;
}
}
return ret;
}
return clazz.getDeclaredAnnotations();
}
Aggregations