mirror of
https://github.com/corda/corda.git
synced 2025-06-14 13:18:18 +00:00
Fixing some issues with runtime annotations within avian.
We were not properly converting dots to slashes internally for package names and we did not properly handle Method.getAnnotations and Method.getAnnotation(Class<T>) on methods without any annotations. Added some tests to cover these cases.
This commit is contained in:
@ -170,7 +170,7 @@ public class Method<T> extends AccessibleObject implements Member {
|
||||
}
|
||||
|
||||
public <T extends Annotation> T getAnnotation(Class<T> class_) {
|
||||
if (vmMethod.addendum.annotationTable != null) {
|
||||
if (vmMethod.hasAnnotations()) {
|
||||
Object[] table = (Object[]) vmMethod.addendum.annotationTable;
|
||||
for (int i = 0; i < table.length; ++i) {
|
||||
Object[] a = (Object[]) table[i];
|
||||
@ -183,7 +183,7 @@ public class Method<T> extends AccessibleObject implements Member {
|
||||
}
|
||||
|
||||
public Annotation[] getAnnotations() {
|
||||
if (vmMethod.addendum.annotationTable != null) {
|
||||
if (vmMethod.hasAnnotations()) {
|
||||
Object[] table = (Object[]) vmMethod.addendum.annotationTable;
|
||||
Annotation[] array = new Annotation[table.length];
|
||||
for (int i = 0; i < table.length; ++i) {
|
||||
|
Reference in New Issue
Block a user