Program: 73434
Project: 73434
Buggy source:
/** 
 * Recursively construct the base component units map for the given component units map and return it. Each value in the map is a two-element array of lists of BaseUnitConcepts that indicate the positive and negative exponent units for the base dimension.
 * @param componentUnitsMap The component units map from which to derivethe base component units map.
 * @param dimensionMap The dimension map for the component units map.
 * @param baseDimensionMap The already calculated base dimension map forthe dimension map input.
 * @return The base component units map with separate lists ofpositive and negative exponent units.
 * @throws IllegalActionException Thrown if unit concepts that areneither BaseUnitConcepts or DerivedUnitConcepts are found.
 */
private static Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> _deriveComponentBaseUnitsSeparateExponentsMap(Map<DimensionRepresentativeConcept,List<UnitConcept>> componentUnitsMap,Map<DimensionRepresentativeConcept,Integer> dimensionMap,Map<BaseDimensionRepresentativeConcept,Integer> baseDimensionMap) throws IllegalActionException {
  Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> baseComponentUnitsSeparateExponents=new HashMap<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]>();
  for (  DimensionRepresentativeConcept dimension : componentUnitsMap.keySet()) {
    List<UnitConcept> unitsList=componentUnitsMap.get(dimension);
    int exponent=dimensionMap.get(dimension).intValue();
    for (    UnitConcept unit : unitsList) {
      if (unit instanceof BaseUnitConcept) {
        Integer baseExponentInteger=baseDimensionMap.get(dimension);
        int baseDimensionMapExponent=0;
        if (baseExponentInteger != null) {
          baseDimensionMapExponent=baseExponentInteger;
        }
        _addBaseUnit(baseComponentUnitsSeparateExponents,(BaseUnitConcept)unit,exponent,baseDimensionMapExponent);
      }
 else       if (unit instanceof DerivedUnitConcept) {
        DerivedDimensionRepresentativeConcept unitDimension=(DerivedDimensionRepresentativeConcept)unit.getDimension();
        Map<DimensionRepresentativeConcept,Integer> unitDimensionMap=unitDimension.getComponentDimensions();
        Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> derivedUnitBaseComponentSeparateExponents=_deriveComponentBaseUnitsSeparateExponentsMap(((DerivedUnitConcept)unit).getComponentUnits(),unitDimensionMap,DerivedDimensionRepresentativeConcept.deriveComponentBaseDimensionsMap(unitDimensionMap));
        _addDerivedUnit(baseComponentUnitsSeparateExponents,derivedUnitBaseComponentSeparateExponents);
      }
 else {
        throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      }
    }
  }
  return baseComponentUnitsSeparateExponents;
}

Fixed version (ground truth):
/** 
 * Recursively construct the base component units map for the given component units map and return it. Each value in the map is a two-element array of lists of BaseUnitConcepts that indicate the positive and negative exponent units for the base dimension.
 * @param componentUnitsMap The component units map from which to derivethe base component units map.
 * @param dimensionMap The dimension map for the component units map.
 * @param baseDimensionMap The already calculated base dimension map forthe dimension map input.
 * @return The base component units map with separate lists ofpositive and negative exponent units.
 * @throws IllegalActionException Thrown if unit concepts that areneither BaseUnitConcepts or DerivedUnitConcepts are found.
 */
private static Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> _deriveComponentBaseUnitsSeparateExponentsMap(Map<DimensionRepresentativeConcept,List<UnitConcept>> componentUnitsMap,Map<DimensionRepresentativeConcept,Integer> dimensionMap,Map<BaseDimensionRepresentativeConcept,Integer> baseDimensionMap) throws IllegalActionException {
  Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> baseComponentUnitsSeparateExponents=new HashMap<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]>();
  for (  Map.Entry<DimensionRepresentativeConcept,List<UnitConcept>> componentUnitsMapEntry : componentUnitsMap.entrySet()) {
    DimensionRepresentativeConcept dimension=componentUnitsMapEntry.getKey();
    List<UnitConcept> unitsList=componentUnitsMapEntry.getValue();
    int exponent=dimensionMap.get(dimension).intValue();
    for (    UnitConcept unit : unitsList) {
      if (unit instanceof BaseUnitConcept) {
        Integer baseExponentInteger=baseDimensionMap.get(dimension);
        int baseDimensionMapExponent=0;
        if (baseExponentInteger != null) {
          baseDimensionMapExponent=baseExponentInteger;
        }
        _addBaseUnit(baseComponentUnitsSeparateExponents,(BaseUnitConcept)unit,exponent,baseDimensionMapExponent);
      }
 else       if (unit instanceof DerivedUnitConcept) {
        DerivedDimensionRepresentativeConcept unitDimension=(DerivedDimensionRepresentativeConcept)unit.getDimension();
        Map<DimensionRepresentativeConcept,Integer> unitDimensionMap=unitDimension.getComponentDimensions();
        Map<BaseDimensionRepresentativeConcept,List<BaseUnitConcept>[]> derivedUnitBaseComponentSeparateExponents=_deriveComponentBaseUnitsSeparateExponentsMap(((DerivedUnitConcept)unit).getComponentUnits(),unitDimensionMap,DerivedDimensionRepresentativeConcept.deriveComponentBaseDimensionsMap(unitDimensionMap));
        _addDerivedUnit(baseComponentUnitsSeparateExponents,derivedUnitBaseComponentSeparateExponents);
      }
 else {
        throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
      }
    }
  }
  return baseComponentUnitsSeparateExponents;
}