Having trouble getting the parameter annotations of a method, below is a easy to test demonstration, any directions towards the error would be welcome :
// Annotation
public @interface At {}
// Class
public class AnnoTest {
public void myTest(@At String myVar1, String myVar2){}
}
// Test
public class App {
public static void main(String[] args) {
Class myClass = AnnoTest.class;
Method method = myClass.getMethods()[0];
Annotation[][] parameterAnnotations = method.getParameterAnnotations();
// Should output 1 instead of 0
System.out.println(parameterAnnotations[0].length);
}
}