Program: 73227
Project: 73227
Buggy source:
/** 
 * Update the base component units map with the set of base units from another derived units' base component units map.
 * @param baseUnitsMap The base component units map to be updated.
 * @param baseUnitsMapFromDerivedUnit The base component units map from anotherderived unit concept to be added to the baseUnitsMap.
 */
private static void _addDerivedUnit(Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> baseUnitsMap,Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> baseUnitsMapFromDerivedUnit){
  for (  Map.Entry<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> baseUnitsMapEntry : baseUnitsMapFromDerivedUnit.entrySet()) {
    BaseDimensionRepresentativeConcept baseDimension=baseUnitsMapEntry.getKey();
    List<BaseUnitConcept>[] arrayOfBaseUnitsListsFromDerivedUnit=baseUnitsMapEntry.getValue();
    List<BaseUnitConcept>[] arrayOfBaseUnitsLists=baseUnitsMap.get(baseDimension);
    if (arrayOfBaseUnitsLists == null) {
      arrayOfBaseUnitsLists=arrayOfBaseUnitsListsFromDerivedUnit;
    }
 else {
      arrayOfBaseUnitsLists[POSITIVE_EXPONENT_INDEX].addAll(arrayOfBaseUnitsListsFromDerivedUnit[POSITIVE_EXPONENT_INDEX]);
      arrayOfBaseUnitsLists[NEGATIVE_EXPONENT_INDEX].addAll(arrayOfBaseUnitsListsFromDerivedUnit[NEGATIVE_EXPONENT_INDEX]);
    }
    baseUnitsMap.put(baseDimension,arrayOfBaseUnitsLists);
  }
}

Fixed version (ground truth):
/** 
 * Update the base component units map with the set of base units from another derived units' base component units map.
 * @param baseUnitsMap The base component units map to be updated.
 * @param baseUnitsMapFromDerivedUnit The base component units map from anotherderived unit concept to be added to the baseUnitsMap.
 * @param derivedDimensionExponent The exponent of the derived dimension.
 * @exception IllegalActionException Thrown if the derivedDimensionExponentis zero, which should never be the case if this method is called.
 */
private static void _addDerivedUnit(Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> baseUnitsMap,Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> baseUnitsMapFromDerivedUnit,int derivedDimensionExponent) throws IllegalActionException {
  for (  Map.Entry<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> baseUnitsMapEntry : baseUnitsMapFromDerivedUnit.entrySet()) {
    BaseDimensionRepresentativeConcept baseDimension=baseUnitsMapEntry.getKey();
    List<BaseUnitConcept>[] arrayOfBaseUnitsListsFromDerivedUnit=baseUnitsMapEntry.getValue();
    List<BaseUnitConcept>[] arrayOfBaseUnitsLists=baseUnitsMap.get(baseDimension);
    if (derivedDimensionExponent > 0) {
      if (arrayOfBaseUnitsLists == null) {
        arrayOfBaseUnitsLists=arrayOfBaseUnitsListsFromDerivedUnit;
      }
 else {
        arrayOfBaseUnitsLists[POSITIVE_EXPONENT_INDEX].addAll(arrayOfBaseUnitsListsFromDerivedUnit[POSITIVE_EXPONENT_INDEX]);
        arrayOfBaseUnitsLists[NEGATIVE_EXPONENT_INDEX].addAll(arrayOfBaseUnitsListsFromDerivedUnit[NEGATIVE_EXPONENT_INDEX]);
      }
    }
 else     if (derivedDimensionExponent < 0) {
      if (arrayOfBaseUnitsLists == null) {
        arrayOfBaseUnitsLists=arrayOfBaseUnitsListsFromDerivedUnit;
        List<BaseUnitConcept> tempList=new ArrayList<BaseUnitConcept>(arrayOfBaseUnitsLists[NEGATIVE_EXPONENT_INDEX]);
        arrayOfBaseUnitsLists[NEGATIVE_EXPONENT_INDEX]=arrayOfBaseUnitsLists[POSITIVE_EXPONENT_INDEX];
        arrayOfBaseUnitsLists[POSITIVE_EXPONENT_INDEX]=tempList;
      }
 else {
        arrayOfBaseUnitsLists[NEGATIVE_EXPONENT_INDEX].addAll(arrayOfBaseUnitsListsFromDerivedUnit[POSITIVE_EXPONENT_INDEX]);
        arrayOfBaseUnitsLists[POSITIVE_EXPONENT_INDEX].addAll(arrayOfBaseUnitsListsFromDerivedUnit[NEGATIVE_EXPONENT_INDEX]);
      }
    }
 else {
      throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
    }
    baseUnitsMap.put(baseDimension,arrayOfBaseUnitsLists);
  }
}