jenkinsci / stapler

Stapler web framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suspected incorrect check of methods from more complex interface inheritance chains

stephenc opened this issue · comments

https://github.com/stapler/stapler/blob/a6d86809e89dc1d48084201f97e19b602ed603ed/core/src/main/java/org/kohsuke/stapler/ClassDescriptor.java#L142 does not return all interfaces only all declared interfaces, e.g. if I have

interface A {
  @WebMethod("some-method")
  void someMethod(StaplerRequest req, StaplerResponse rsp);
}

interface B extends A {
  ...
}

public class C implements B {
  public void someMethod(StaplerRequest req, StaplerResponse rsp) {
    ...
  }
}

Then C.class.getInterfaces() will include B.class but not A.class

https://github.com/stapler/stapler/blob/311dcfd92d229569e7aaaaae364f6e702188fddc/jelly/src/main/java/org/kohsuke/stapler/jelly/AnnotationProcessorImpl.java#L79 may also need checking