Program: 73437
Project: 73437
Buggy source:
/** 
 * Set the component units for the derived unit based on the given record token that specifies the component units for this derived unit.
 * @param derivedUnitRecord The record token that contains the specifiedunit conversion information.
 * @param unitDimensionRepresentative The dimension representative conceptfor this derived unit concept.
 * @throws IllegalActionException Thrown if the record token has invalidunit conversion specifications.
 */
private void _setComponentUnitsMap(RecordToken derivedUnitRecord,DerivedDimensionRepresentativeConcept unitDimensionRepresentative) throws IllegalActionException {
  Map<DimensionRepresentativeConcept,Integer> componentDimensions=unitDimensionRepresentative.getComponentDimensions();
  for (  DimensionRepresentativeConcept dimension : componentDimensions.keySet()) {
    String dimensionName=dimension.getName();
    Token[] unitsStringTokens=_getUnitsArray(derivedUnitRecord,dimensionName);
    int dimensionExponent=componentDimensions.get(dimension).intValue();
    int dimensionExponentAbsValue=Math.abs(dimensionExponent);
    if (unitsStringTokens.length == dimensionExponentAbsValue) {
      List<UnitConcept> unitsList=new ArrayList<UnitConcept>();
      for (      Token unitStringToken : unitsStringTokens) {
        String unitName=((StringToken)unitStringToken).stringValue();
        Concept unit=getOntology().getConceptByString(dimensionName + "String_Node_Str" + unitName);
        if (unit instanceof UnitConcept) {
          unitsList.add((UnitConcept)unit);
        }
 else {
          throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + unit);
        }
      }
      _componentUnits.put(dimension,unitsList);
    }
 else {
      throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + dimension + "String_Node_Str"+ dimensionExponent+ "String_Node_Str"+ "String_Node_Str"+ dimensionExponentAbsValue+ "String_Node_Str");
    }
  }
  _componentBaseUnits=deriveComponentBaseUnitsMap(_componentUnits,componentDimensions,unitDimensionRepresentative.getComponentBaseDimensions());
}

Fixed version (ground truth):
/** 
 * Set the component units for the derived unit based on the given record token that specifies the component units for this derived unit.
 * @param derivedUnitRecord The record token that contains the specifiedunit conversion information.
 * @param unitDimensionRepresentative The dimension representative conceptfor this derived unit concept.
 * @throws IllegalActionException Thrown if the record token has invalidunit conversion specifications.
 */
private void _setComponentUnitsMap(RecordToken derivedUnitRecord,DerivedDimensionRepresentativeConcept unitDimensionRepresentative) throws IllegalActionException {
  Map<DimensionRepresentativeConcept,Integer> componentDimensions=unitDimensionRepresentative.getComponentDimensions();
  for (  Map.Entry<DimensionRepresentativeConcept,Integer> componentDimensionsMapEntry : componentDimensions.entrySet()) {
    DimensionRepresentativeConcept dimension=componentDimensionsMapEntry.getKey();
    String dimensionName=dimension.getName();
    Token[] unitsStringTokens=_getUnitsArray(derivedUnitRecord,dimensionName);
    int dimensionExponent=componentDimensionsMapEntry.getValue().intValue();
    int dimensionExponentAbsValue=Math.abs(dimensionExponent);
    if (unitsStringTokens.length == dimensionExponentAbsValue) {
      List<UnitConcept> unitsList=new ArrayList<UnitConcept>();
      for (      Token unitStringToken : unitsStringTokens) {
        String unitName=((StringToken)unitStringToken).stringValue();
        Concept unit=getOntology().getConceptByString(dimensionName + "String_Node_Str" + unitName);
        if (unit instanceof UnitConcept) {
          unitsList.add((UnitConcept)unit);
        }
 else {
          throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + unit);
        }
      }
      _componentUnits.put(dimension,unitsList);
    }
 else {
      throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + dimension + "String_Node_Str"+ dimensionExponent+ "String_Node_Str"+ "String_Node_Str"+ dimensionExponentAbsValue+ "String_Node_Str");
    }
  }
  _componentBaseUnits=deriveComponentBaseUnitsMap(_componentUnits,componentDimensions,unitDimensionRepresentative.getComponentBaseDimensions());
}