Program: 74822
Project: 74822
Buggy source:
/** 
 * React to a change in an attribute.  This method is called by a contained attribute when its value changes.  This initally responds to changes in the <i>ptalonCode</i> parameter.  Later it responds to changes in parameters specified in the Ptalon code itself.
 * @exception IllegalActionException If the change is not acceptableto this container (not thrown in this base class).
 */
public void attributeChanged(Attribute att) throws IllegalActionException {
  super.attributeChanged(att);
  if (att == ptalonCodeLocation) {
    _initializePtalonCodeLocation();
  }
 else   if (att instanceof PtalonParameter) {
    PtalonParameter p=(PtalonParameter)att;
    if ((p.hasValue()) && (!p.getVisibility().equals(Settable.NOT_EDITABLE))) {
      try {
        if (p.getVisibility().equals(Settable.FULL)) {
          p.setVisibility(Settable.NOT_EDITABLE);
        }
        _assignedPtalonParameters.add(p);
        if ((_ast == null) || (_codeManager == null)) {
          return;
        }
        boolean ready=true;
        for (        PtalonParameter param : _ptalonParameters) {
          if (!param.hasValue()) {
            ready=false;
            break;
          }
        }
        if (ready) {
          PtalonPopulator populator=new PtalonPopulator();
          populator.setASTNodeClass("String_Node_Str");
          populator.actor_definition(_ast,_codeManager);
          _ast=(PtalonAST)populator.getAST();
          _codeManager.assignInternalParameters();
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * React to a change in an attribute.  This method is called by a contained attribute when its value changes.  This initally responds to changes in the <i>ptalonCode</i> parameter.  Later it responds to changes in parameters specified in the Ptalon code itself.
 * @exception IllegalActionException If the change is not acceptableto this container (not thrown in this base class).
 */
public void attributeChanged(Attribute att) throws IllegalActionException {
  super.attributeChanged(att);
  if (att == ptalonCodeLocation) {
    _initializePtalonCodeLocation();
  }
 else   if (att instanceof PtalonParameter) {
    PtalonParameter p=(PtalonParameter)att;
    if ((p.hasValue()) && (!p.getVisibility().equals(Settable.NOT_EDITABLE))) {
      try {
        if (p.getVisibility().equals(Settable.FULL)) {
          p.setVisibility(Settable.NOT_EDITABLE);
        }
 else         if (p.getVisibility().equals(Settable.NONE)) {
          if (_unsettablePtalonParameters.contains(p)) {
            return;
          }
 else {
            _unsettablePtalonParameters.add(p);
          }
        }
        _assignedPtalonParameters.add(p);
        if ((_ast == null) || (_codeManager == null)) {
          return;
        }
        boolean ready=true;
        for (        PtalonParameter param : _ptalonParameters) {
          if (!param.hasValue()) {
            ready=false;
            break;
          }
        }
        if (ready) {
          PtalonPopulator populator=new PtalonPopulator();
          populator.setASTNodeClass("String_Node_Str");
          populator.actor_definition(_ast,_codeManager);
          _ast=(PtalonAST)populator.getAST();
          _codeManager.assignInternalParameters();
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}