Uploaded image for project: 'Clojure'
  1. CLJ-1022

gen-class destroys method annotations

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: Release 1.4
    • Fix versions: None
    • Labels:

      Description

      When extending a class gen-class doesn't preserve method annotations.

      If class com.bar.Foo has annotated methods then in MyClass all annotations are gone.

      (gen-class
      :name com.my.MyClass
      :extends com.bar.Foo
      :implements [com.google.common.base.Supplier]
      :prefix demo-
      :post-init post-init)

      (defn demo-post-init [this]
      (info "initialized")
      (swank.swank/start-server :port 68478))

      (defn demo-get [_]
      (get-msg))

      Class<?> aClass = Class.forName("com.my.MyClass");
      Method[] methods = aClass.getMethods();

      for (Method m : methods) {
      Annotation[] annotations = m.getAnnotations();
      System.out.println(m.getName()+" "+annotations.length);
      for (Annotation a : annotations)

      { System.out.println(a.annotationType().getClass().getName()); }

      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: