Program: 75706
Project: 75706
Buggy source:
/** 
 * React to a change of the given attribute.  Generally, this is called between firings of an actor.  However, this actor contains a separate thread of which the director is not aware. Any time the model is running, calls to this method typically happen while the thread is running.  Furthermore, the thread spends most of its time blocked in the DatagramSocket.receive() method or (if <i>overwrite</i> is false) waiting for fire() to notify it that space is available to receive another packet. Thus, some of the cases below will be given special handling.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute != _evalVar) {
    if (_debugging)     _debug("String_Node_Str" + attribute.toString().substring(28));
  }
  if (attribute == encoding) {
    if (!_encoding.equals(encoding.getExpression())) {
      _encoding=encoding.getExpression();
      if (_encoding.equals("String_Node_Str")) {
        _decodeWithPtolemyParser=true;
        _decodeToIntegerArray=false;
      }
 else       if (_encoding.equals("String_Node_Str")) {
        _decodeWithPtolemyParser=false;
        _decodeToIntegerArray=true;
        _decodedBytesPerInteger=1;
      }
 else       if (_encoding.equals("String_Node_Str")) {
        _decodeWithPtolemyParser=false;
        _decodeToIntegerArray=true;
        _decodedBytesPerInteger=4;
      }
 else {
        throw new IllegalActionException(this,"String_Node_Str" + _encoding);
      }
      if (false) {
        if (_decodeWithPtolemyParser) {
          output.setTypeEquals(BaseType.GENERAL);
        }
 else         if (_decodeToIntegerArray) {
          output.setTypeEquals(new ArrayType(BaseType.INT));
        }
 else {
        }
      }
    }
  }
 else   if (attribute == defaultOutput) {
synchronized (_syncDefaultOutput) {
      _defaultOutputToken=defaultOutput.getToken();
      if (false)       System.out.println(_defaultOutputToken == null);
    }
  }
 else   if (attribute == overwrite) {
    _overwrite=((BooleanToken)(overwrite.getToken())).booleanValue();
    if (_overwrite) {
synchronized (_syncFireAndThread) {
        _syncFireAndThread.notifyAll();
      }
    }
  }
 else   if (attribute == blockAwaitingDatagram) {
    _blockAwaitingDatagram=((BooleanToken)(blockAwaitingDatagram.getToken())).booleanValue();
    if (!_blockAwaitingDatagram) {
synchronized (_syncFireAndThread) {
        _syncFireAndThread.notifyAll();
      }
    }
  }
 else   if (attribute == localSocketNumber) {
synchronized (this) {
      if (_socket != null) {
        if (_listenerThread == null) {
          throw new IllegalActionException(this,"String_Node_Str");
        }
 else         if (!_listenerThread.isAlive()) {
          throw new IllegalActionException(this,"String_Node_Str");
        }
        int newSktNum=((IntToken)(localSocketNumber.getToken())).intValue();
        if (newSktNum != _socket.getLocalPort()) {
synchronized (_syncSocket) {
            if (_inReceive) {
              try {
                _syncSocket.wait((long)444);
              }
 catch (              InterruptedException ex) {
                System.out.println("String_Node_Str");
                throw new IllegalActionException(this,"String_Node_Str");
              }
            }
            _socket.close();
            try {
              _socket=new DatagramSocket(newSktNum);
            }
 catch (            SocketException ex) {
              System.out.println("String_Node_Str");
              throw new InternalErrorException(KernelException.stackTraceToString(ex));
            }
          }
        }
      }
    }
  }
 else   if (attribute == bufferLength) {
synchronized (_syncBufferLength) {
      _bufferLength=((IntToken)(bufferLength.getToken())).intValue();
    }
  }
 else {
    super.attributeChanged(attribute);
  }
  if (attribute != _evalVar) {
    if (_debugging)     _debug(this + "String_Node_Str");
    if (_debugging)     _debug("String_Node_Str" + attribute.toString().substring(28));
  }
}

Fixed version (ground truth):
/** 
 * React to a change of the given attribute.  Generally, this is called between firings of an actor.  However, this actor contains a separate thread of which the director is not aware. Any time the model is running, calls to this method typically happen while the thread is running.  Furthermore, the thread spends most of its time blocked in the DatagramSocket.receive() method or (if <i>overwrite</i> is false) waiting for fire() to notify it that space is available to receive another packet. Thus, some of the cases below will be given special handling.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute != _evalVar) {
    System.out.println("String_Node_Str" + attribute.toString().substring(28));
  }
  if (attribute == encoding) {
    if (!_encoding.equals(encoding.getExpression())) {
      _encoding=encoding.getExpression();
      if (_encoding.equals("String_Node_Str")) {
        _decodeWithPtolemyParser=true;
        _decodeToIntegerArray=false;
      }
 else       if (_encoding.equals("String_Node_Str")) {
        _decodeWithPtolemyParser=false;
        _decodeToIntegerArray=true;
        _decodedBytesPerInteger=1;
      }
 else       if (_encoding.equals("String_Node_Str")) {
        _decodeWithPtolemyParser=false;
        _decodeToIntegerArray=true;
        _decodedBytesPerInteger=4;
      }
 else {
        throw new IllegalActionException(this,"String_Node_Str" + _encoding);
      }
      if (false) {
        if (_decodeWithPtolemyParser) {
          output.setTypeEquals(BaseType.GENERAL);
        }
 else         if (_decodeToIntegerArray) {
          output.setTypeEquals(new ArrayType(BaseType.INT));
        }
 else {
        }
      }
    }
  }
 else   if (attribute == defaultOutput) {
synchronized (_syncDefaultOutput) {
      _defaultOutputToken=defaultOutput.getToken();
      if (false)       System.out.println(_defaultOutputToken == null);
    }
  }
 else   if (attribute == overwrite) {
    _overwrite=((BooleanToken)(overwrite.getToken())).booleanValue();
    if (_overwrite) {
synchronized (_syncFireAndThread) {
        _syncFireAndThread.notifyAll();
      }
    }
  }
 else   if (attribute == blockAwaitingDatagram) {
    _blockAwaitingDatagram=((BooleanToken)(blockAwaitingDatagram.getToken())).booleanValue();
    if (!_blockAwaitingDatagram) {
synchronized (_syncFireAndThread) {
        _syncFireAndThread.notifyAll();
      }
    }
  }
 else   if (attribute == localSocketNumber) {
synchronized (this) {
      if (_socket != null) {
        if (_listenerThread == null) {
          throw new IllegalActionException(this,"String_Node_Str");
        }
 else         if (!_listenerThread.isAlive()) {
          throw new IllegalActionException(this,"String_Node_Str");
        }
        int newSktNum=((IntToken)(localSocketNumber.getToken())).intValue();
        if (newSktNum != _socket.getLocalPort()) {
synchronized (_syncSocket) {
            if (_inReceive) {
              try {
                _syncSocket.wait((long)444);
              }
 catch (              InterruptedException ex) {
                System.out.println("String_Node_Str");
                throw new IllegalActionException(this,"String_Node_Str");
              }
            }
            _socket.close();
            try {
              _socket=new DatagramSocket(newSktNum);
            }
 catch (            SocketException ex) {
              System.out.println("String_Node_Str");
              throw new InternalErrorException(KernelException.stackTraceToString(ex));
            }
          }
        }
      }
    }
  }
 else   if (attribute == actorBufferLength) {
synchronized (_syncBufferLength) {
      _actorBufferLength=((IntToken)(actorBufferLength.getToken())).intValue();
    }
  }
 else   if (attribute == platformBufferLength && _socket != null) {
    if (platformBufferLength.getToken() != null) {
      int requestedValue=((IntToken)platformBufferLength.getToken()).intValue();
      int existingValue=0;
      try {
        System.out.println("String_Node_Str");
        existingValue=_socket.getReceiveBufferSize();
        System.out.println("String_Node_Str");
      }
 catch (      SocketException sex) {
        System.out.println("String_Node_Str" + sex.toString());
      }
      if (requestedValue != existingValue) {
        try {
          System.out.println("String_Node_Str");
          _socket.setReceiveBufferSize(requestedValue);
          System.out.println("String_Node_Str");
        }
 catch (        SocketException sex) {
          System.out.println("String_Node_Str" + sex.toString());
        }
      }
    }
  }
 else {
    super.attributeChanged(attribute);
  }
  if (attribute != _evalVar) {
    if (_debugging)     _debug(this + "String_Node_Str");
    System.out.println("String_Node_Str" + attribute.toString().substring(28));
  }
}