[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Annotation hash check with security enabled

alesj do-not-reply at jboss.com
Tue Apr 1 11:11:10 EDT 2008


"alesj" wrote : "alesj" wrote : which I think is somehow too strict to require security check, since is a simple equals/hash call made by HashSet to remove annotation metadata.
  | Doing direct '==' would probably do the trick, but that's too impl specific.
  | Not to mention the horrible code that would come out of it. ;-)
Like Adrian said yesterday on the jboss-dev list, think before you shoot. :-)
This does the trick, and it doesn't require any hash/equals:

  |          Object[] allMetaData = levelMetaData.getMetaData();
  |          Annotation[] annotations = levelMetaData.getAnnotations();
  |          // all meta data is not null, since level metadata is not empty
  |          int allSize = allMetaData.length;
  |          int annotationsSize = annotations != null ? annotations.length : 0;
  | 
  |          // do we have something else than annotations
  |          if (allSize > annotationsSize)
  |          {
  |             return true;
  |          }
  | 
;-)

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140574#4140574

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140574



More information about the jboss-dev-forums mailing list