Changeset 7776


Ignore:
Timestamp:
Feb 18, 2020, 9:50:54 AM (22 months ago)
Author:
Nicklas Nordborg
Message:

References #2202: Include information from parent items in list pages

Fixes an issue with incorrect caching in the transition from Physical Bioassay to Extract. We need to keep the extract chain that was collected from Raw/Derived? bioassay until we reach a known extract.

If we don't do this the Pool aliquot and Pool will be cached without context and the next time we have a Library from the same Pool, we will get the Library item we will get the cached Library item instead of the Library in the context.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/util/AnnotationUtil.java

    r7767 r7776  
    222222    private Set<Integer> loadExtracts()
    223223    {
    224       Set<Integer> extractsInChain;
     224      Set<Integer> extractsInChain = Collections.emptySet();
    225225      switch (item.getType())
    226226      {
     
    229229        case RAWBIOASSAY:
    230230        {
    231           extractsInChain = new HashSet<Integer>();
     231          extractsInChain = new HashSet<>();
    232232          if (chain != null) extractsInChain.addAll(chain.extractsInChain);
    233233          if (extract != null) extractsInChain.add(extract.getId());
    234234          break;
    235235        }
     236        case EXTRACT:
     237        {
     238          if (chain != null && !chain.extractsInChain.contains(item.getId()))
     239          {
     240            extractsInChain = new HashSet<>(chain.extractsInChain);
     241          }
     242          break;
     243        }
    236244        default:
    237         {
    238           extractsInChain = Collections.emptySet();
    239         }
     245        {}
    240246      }
    241247      return extractsInChain;
     
    356362      cmap.put(wrapper, parents);
    357363    }
     364
     365    @Override
     366    public String toString()
     367    {
     368      return cmap.toString();
     369    }
     370   
    358371   
    359372  }
Note: See TracChangeset for help on using the changeset viewer.