Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

isAnnotationPresent returning false

 
Jayavardhan geepi
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Test class


Why it is printing false for doesNothing method.
Can anybody trace it out please.
Thanks
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to annotate your annotation to tell the compiler to keep the annotation in the class file. If you don't, then the compiler will just throw away the annotation and you won't be able to see it at runtime.
Jayavardhan geepi wrote:
 
Jayavardhan geepi
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jasper. I got it.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic