Changeset 4210


Ignore:
Timestamp:
Apr 7, 2008, 1:48:07 PM (15 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #977: ClassCastException? in Experiment overview when clicking on an experimental factor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6-stable/www/views/experiments/overview/info.jsp

    r4209 r4210  
    147147
    148148    <base:body>
     149      <!-- Debug: Node name=<%=node.getName() %>; Node ID=<%=node.getId()%> -->
    149150      <table class="form">
    150151      <tr>
     
    303304      else if (item instanceof AnnotationType)
    304305      {
    305         if (node.getName().startsWith("parameter"))
    306         {
    307           annotatable = (Annotatable)node.getParent().getParent().getParent().getItem();
    308         }
    309         else
    310         {
    311           annotatable = (Annotatable)node.getParent().getParent().getItem();
    312         }
    313         dc.reattachItem((BasicItem)annotatable);
    314         if (annotatable.isAnnotated())
    315         {
    316           annotations = annotatable.getAnnotationSet().findAnnotations(dc, (AnnotationType)item, true);
    317         }
    318         annotationsTitle = "Annotation values";
     306        // Find the annotatable parent
     307        Node parentNode = node;
     308        while (parentNode != null)
     309        {
     310          BasicItem parentItem = parentNode.getItem();
     311          if (parentItem instanceof Annotatable)
     312          {
     313            annotatable = (Annotatable)parentItem;
     314            dc.reattachItem((BasicItem)annotatable);
     315            if (annotatable.isAnnotated())
     316            {
     317              annotations = annotatable.getAnnotationSet().findAnnotations(dc, (AnnotationType)item, true);
     318            }
     319            annotationsTitle = "Annotation values";
     320            break;
     321          }
     322          parentNode = parentNode.getParent();
     323        }
    319324      }
    320325      else if (item instanceof Annotatable)
Note: See TracChangeset for help on using the changeset viewer.