Program: 154013
Project: 154013
Buggy source:
/** 
 * Implementation of <code>PropertyChangeListener</code>. <p> When invoked with an event which is an instance of either <code>CollectionChangeEvent</code> or <code>RenderingChangeEvent</code> emitted by a <code>CollectionOp</code> or <code>RenderedOp</code> source, respectively, the node will respond by re-rendering itself while retaining any data possible.
 * @since JAI 1.1
 */
public synchronized void propertyChange(PropertyChangeEvent evt){
  if (isRenderable())   return;
  Object evtSrc=evt.getSource();
  Vector nodeSources=nodeSupport.getParameterBlock().getSources();
  String propName=evt.getPropertyName().toLowerCase();
  if (imageCollection != null && ((evt instanceof PropertyChangeEventJAI && evtSrc == this && !(evt instanceof PropertySourceChangeEvent) && nodeEventNames.contains(propName)) || ((evt instanceof CollectionChangeEvent || evt instanceof RenderingChangeEvent) && nodeSources.contains(evtSrc)))) {
    Collection theOldCollection=imageCollection;
    boolean fireEvent=false;
    if (!(imageCollection instanceof CollectionImage)) {
      fireEvent=true;
      imageCollection=null;
    }
 else     if (evtSrc == this && (propName.equals("String_Node_Str") || propName.equals("String_Node_Str"))) {
      fireEvent=true;
      imageCollection=null;
    }
 else     if (evt instanceof CollectionChangeEvent) {
      fireEvent=true;
      CollectionImageFactory oldCIF=((CollectionImage)theOldCollection).getImageFactory();
      if (oldCIF == null) {
        imageCollection=null;
      }
 else {
        CollectionChangeEvent ccEvent=(CollectionChangeEvent)evt;
        Vector parameters=nodeSupport.getParameterBlock().getParameters();
        parameters=ImageUtil.evaluateParameters(parameters);
        ParameterBlock oldPB=new ParameterBlock((Vector)nodeSources.clone(),parameters);
        ParameterBlock newPB=new ParameterBlock((Vector)nodeSources.clone(),parameters);
        int sourceIndex=nodeSources.indexOf(ccEvent.getSource());
        oldPB.setSource(ccEvent.getOldValue(),sourceIndex);
        newPB.setSource(ccEvent.getNewValue(),sourceIndex);
        imageCollection=oldCIF.update(oldPB,oldHints,newPB,oldHints,(CollectionImage)theOldCollection,this);
      }
    }
 else {
      CollectionImageFactory oldCIF=((CollectionImage)theOldCollection).getImageFactory();
      if (oldCIF == null || oldCIF != CIFRegistry.get(nodeSupport.getRegistry(),nodeSupport.getOperationName())) {
        imageCollection=null;
        fireEvent=true;
      }
 else {
        ParameterBlock oldPB=null;
        ParameterBlock newPB=null;
        boolean updateCollection=false;
        if (propName.equals("String_Node_Str")) {
          oldPB=(ParameterBlock)evt.getOldValue();
          newPB=(ParameterBlock)evt.getNewValue();
          updateCollection=true;
        }
 else         if (propName.equals("String_Node_Str")) {
          Vector params=nodeSupport.getParameterBlock().getParameters();
          oldPB=new ParameterBlock((Vector)evt.getOldValue(),params);
          newPB=new ParameterBlock((Vector)evt.getNewValue(),params);
          updateCollection=true;
        }
 else         if (propName.equals("String_Node_Str")) {
          oldPB=new ParameterBlock(nodeSources,(Vector)evt.getOldValue());
          newPB=new ParameterBlock(nodeSources,(Vector)evt.getNewValue());
          updateCollection=true;
        }
 else         if (propName.equals("String_Node_Str")) {
          oldPB=newPB=nodeSupport.getParameterBlock();
          updateCollection=true;
        }
 else         if (evt instanceof RenderingChangeEvent) {
          int renderingIndex=nodeSources.indexOf(evt.getSource());
          Vector oldSources=(Vector)nodeSources.clone();
          Vector newSources=(Vector)nodeSources.clone();
          oldSources.set(renderingIndex,evt.getOldValue());
          newSources.set(renderingIndex,evt.getNewValue());
          Vector params=nodeSupport.getParameterBlock().getParameters();
          oldPB=new ParameterBlock(oldSources,params);
          newPB=new ParameterBlock(newSources,params);
          updateCollection=true;
        }
        if (updateCollection) {
          fireEvent=true;
          oldPB=ImageUtil.evaluateParameters(oldPB);
          newPB=ImageUtil.evaluateParameters(newPB);
          RenderingHints newHints=nodeSupport.getRenderingHints();
          if ((imageCollection=oldCIF.update(oldPB,oldHints,newPB,newHints,(CollectionImage)theOldCollection,this)) != null) {
            oldHints=newHints;
          }
        }
      }
    }
    getCollection();
    if (fireEvent) {
      resetProperties(true);
      CollectionChangeEvent ccEvent=new CollectionChangeEvent(this,theOldCollection,imageCollection);
      eventManager.firePropertyChange(ccEvent);
      Set sinks=getSinks();
      if (sinks != null) {
        Iterator it=sinks.iterator();
        while (it.hasNext()) {
          Object sink=it.next();
          if (sink instanceof PropertyChangeListener) {
            ((PropertyChangeListener)sink).propertyChange(ccEvent);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Implementation of <code>PropertyChangeListener</code>. <p> When invoked with an event which is an instance of either <code>CollectionChangeEvent</code> or <code>RenderingChangeEvent</code> emitted by a <code>CollectionOp</code> or <code>RenderedOp</code> source, respectively, the node will respond by re-rendering itself while retaining any data possible.
 * @since JAI 1.1
 */
public synchronized void propertyChange(PropertyChangeEvent evt){
  if (isRenderable())   return;
  Object evtSrc=evt.getSource();
  Vector nodeSources=nodeSupport.getParameterBlock().getSources();
  String propName=evt.getPropertyName().toLowerCase(Locale.ENGLISH);
  if (imageCollection != null && ((evt instanceof PropertyChangeEventJAI && evtSrc == this && !(evt instanceof PropertySourceChangeEvent) && nodeEventNames.contains(propName)) || ((evt instanceof CollectionChangeEvent || evt instanceof RenderingChangeEvent) && nodeSources.contains(evtSrc)))) {
    Collection theOldCollection=imageCollection;
    boolean fireEvent=false;
    if (!(imageCollection instanceof CollectionImage)) {
      fireEvent=true;
      imageCollection=null;
    }
 else     if (evtSrc == this && (propName.equals("String_Node_Str") || propName.equals("String_Node_Str"))) {
      fireEvent=true;
      imageCollection=null;
    }
 else     if (evt instanceof CollectionChangeEvent) {
      fireEvent=true;
      CollectionImageFactory oldCIF=((CollectionImage)theOldCollection).getImageFactory();
      if (oldCIF == null) {
        imageCollection=null;
      }
 else {
        CollectionChangeEvent ccEvent=(CollectionChangeEvent)evt;
        Vector parameters=nodeSupport.getParameterBlock().getParameters();
        parameters=ImageUtil.evaluateParameters(parameters);
        ParameterBlock oldPB=new ParameterBlock((Vector)nodeSources.clone(),parameters);
        ParameterBlock newPB=new ParameterBlock((Vector)nodeSources.clone(),parameters);
        int sourceIndex=nodeSources.indexOf(ccEvent.getSource());
        oldPB.setSource(ccEvent.getOldValue(),sourceIndex);
        newPB.setSource(ccEvent.getNewValue(),sourceIndex);
        imageCollection=oldCIF.update(oldPB,oldHints,newPB,oldHints,(CollectionImage)theOldCollection,this);
      }
    }
 else {
      CollectionImageFactory oldCIF=((CollectionImage)theOldCollection).getImageFactory();
      if (oldCIF == null || oldCIF != CIFRegistry.get(nodeSupport.getRegistry(),nodeSupport.getOperationName())) {
        imageCollection=null;
        fireEvent=true;
      }
 else {
        ParameterBlock oldPB=null;
        ParameterBlock newPB=null;
        boolean updateCollection=false;
        if (propName.equals("String_Node_Str")) {
          oldPB=(ParameterBlock)evt.getOldValue();
          newPB=(ParameterBlock)evt.getNewValue();
          updateCollection=true;
        }
 else         if (propName.equals("String_Node_Str")) {
          Vector params=nodeSupport.getParameterBlock().getParameters();
          oldPB=new ParameterBlock((Vector)evt.getOldValue(),params);
          newPB=new ParameterBlock((Vector)evt.getNewValue(),params);
          updateCollection=true;
        }
 else         if (propName.equals("String_Node_Str")) {
          oldPB=new ParameterBlock(nodeSources,(Vector)evt.getOldValue());
          newPB=new ParameterBlock(nodeSources,(Vector)evt.getNewValue());
          updateCollection=true;
        }
 else         if (propName.equals("String_Node_Str")) {
          oldPB=newPB=nodeSupport.getParameterBlock();
          updateCollection=true;
        }
 else         if (evt instanceof RenderingChangeEvent) {
          int renderingIndex=nodeSources.indexOf(evt.getSource());
          Vector oldSources=(Vector)nodeSources.clone();
          Vector newSources=(Vector)nodeSources.clone();
          oldSources.set(renderingIndex,evt.getOldValue());
          newSources.set(renderingIndex,evt.getNewValue());
          Vector params=nodeSupport.getParameterBlock().getParameters();
          oldPB=new ParameterBlock(oldSources,params);
          newPB=new ParameterBlock(newSources,params);
          updateCollection=true;
        }
        if (updateCollection) {
          fireEvent=true;
          oldPB=ImageUtil.evaluateParameters(oldPB);
          newPB=ImageUtil.evaluateParameters(newPB);
          RenderingHints newHints=nodeSupport.getRenderingHints();
          if ((imageCollection=oldCIF.update(oldPB,oldHints,newPB,newHints,(CollectionImage)theOldCollection,this)) != null) {
            oldHints=newHints;
          }
        }
      }
    }
    getCollection();
    if (fireEvent) {
      resetProperties(true);
      CollectionChangeEvent ccEvent=new CollectionChangeEvent(this,theOldCollection,imageCollection);
      eventManager.firePropertyChange(ccEvent);
      Set sinks=getSinks();
      if (sinks != null) {
        Iterator it=sinks.iterator();
        while (it.hasNext()) {
          Object sink=it.next();
          if (sink instanceof PropertyChangeListener) {
            ((PropertyChangeListener)sink).propertyChange(ccEvent);
          }
        }
      }
    }
  }
}