[ 
https://issues.apache.org/jira/browse/BVAL-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859347#action_12859347
 ] 

Carlos Vara commented on BVAL-20:
---------------------------------

Well, mine is not a binding opinion, but even though I think that the change 
would very likely improve the speed, I would wait until the TCK passes and the 
project is profiled to worry about performance. Of course, once you have 
worried, there is no harm in changing it :-)

Also, probably the time-hog in that algorithm is in these two lines:

  List<Class<?>> subClasses = new 
ArrayList<Class<?>>(Arrays.asList(clazz.getInterfaces()));
  subClasses.add(0, clazz.getSuperclass());

Can be easily improved (for speed) by doing:

  Class<?>[] subClasses = clazz.getInterfaces();
  fillFullClassHierarchyAsList(allClasses, clazz.getSuperClass());

And keeping the same loop. I just left it the way it is because I find that 
easier to read.

> When building a MetaBean, the full tree of subclasses/interfaces must be 
> considered
> -----------------------------------------------------------------------------------
>
>                 Key: BVAL-20
>                 URL: https://issues.apache.org/jira/browse/BVAL-20
>             Project: BeanValidation
>          Issue Type: Bug
>          Components: jsr303
>    Affects Versions: 0.1-incubating
>            Reporter: Carlos Vara
>            Assignee: Simone Tripodi
>         Attachments: FullHierarchyTraversal.patch
>
>
> Currently, only subclasses and interfaces of the original class are 
> traversed. I attach a fix that traverses the full hierarchy tree.
> 3 more tests in the TCK pass with it applied.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to