Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a ClassCastException when trying to get class annotations #562

Open
amirabiri opened this issue Jun 22, 2018 · 0 comments
Open

Getting a ClassCastException when trying to get class annotations #562

amirabiri opened this issue Jun 22, 2018 · 0 comments

Comments

@amirabiri
Copy link

I'm getting a ClassCastException on a simple attempt to get annotations of a class.

I've attached a zip with code that reproduces the problem. The trigger is simple:

public static void main(String[] args) {
    for (Object ann : MyCommand.class.getAnnotations()) {
        System.out.println(ann.getClass().getName());
    }
}

Running with java works just fine, with avian I get a ClassCastException:

# java -cp build/classes/java/main org.abiri.Main
com.sun.proxy.$Proxy1

# avian -cp build/classes/java/main org.abiri.Main
java/lang/ClassCastException: [B cannot be cast to [Ljava.lang.Object;
  at java/lang/Class.countAnnotations (line 686)
  at java/lang/Class.getAnnotations (line 693)
  at org/abiri/Main.main (line 5)

running on a macOS with avian installed via homebrew, version 1.2.0.

avian-bug.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant