java - Equals returns false between classes - proxy and bean -


i have annotation above method, on bean, proxied spring (beannameautoproxy).

@retention(retentionpolicy.runtime) @target(elementtype.method)   public @interface customannotation{      public boolean enabled() default true;  } 

customannotation.class.getclass() gives me interface mypackage.customannotation

methodinvocation.getmethod().getannotations()[0].getclass() gives me @mypackage.customannotation

so equals returns false between 2 getclass() methods of same annotation.

i have list<class> annotationclasslist, added list customannotation.getclass();

i want check if methodinvocation.getmethod().getannotations()[0].getclass() on list.

what best way check it?

customannotation.class.equals(methodinvocation.getmethod().getannotations()[0]) should trick. customannotation.class.getclass() should retun java.lang.class


Comments

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -