Program: 91929
Project: 91929
Buggy source:
/** 
 * Parses a   {@code "Method"} (WKT 2) element, followed by parameter values. The syntax is given by<a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#62">WKT 2 specification §9.3</a>. The legacy WKT 1 specification was: {@preformat text}PROJECTION["<name>"  ,<authority>}] } Note that in WKT 2, this element is wrapped inside a   {@code Conversion} or {@code DerivingConversion}element which is itself inside the   {@code ProjectedCRS} element. This is different than WKT 1, whichputs this element right into the the  {@code ProjectedCRS} element without {@code Conversion} wrapper.
 * @param mode               {@link #FIRST},   {@link #OPTIONAL} or {@link #MANDATORY}.
 * @param parent             The parent element.
 * @param wrapper            "Conversion" or "DerivingConversion" wrapper name, or null if parsing a WKT 1.
 * @param defaultUnit        The unit (usually linear) of the parent element, or {@code null}.
 * @param defaultAngularUnit The angular unit of the sibling {@code GeographicCRS} element, or {@code null}.
 * @return The {@code "Method"} element and its parameters as a defining conversion.
 * @throws ParseException if the {@code "Method"} element can not be parsed.
 */
private Conversion parseDerivingConversion(final int mode,Element parent,final String wrapper,final Unit<?> defaultUnit,final Unit<Angle> defaultAngularUnit) throws ParseException {
  final String name;
  if (wrapper == null) {
    name=null;
  }
 else {
    parent=parent.pullElement(mode,wrapper);
    if (parent == null) {
      return null;
    }
    name=parent.pullString("String_Node_Str");
  }
  final OperationMethod method=parseMethod(parent,WKTKeywords.Method,WKTKeywords.Projection);
  Map<String,?> properties=this.properties;
  final ParameterValueGroup parameters=method.getParameters().createValue();
  parseParameters(parent,parameters,defaultUnit,defaultAngularUnit);
  if (wrapper != null) {
    properties=parseMetadataAndClose(parent,name,method);
  }
  try {
    return opFactory.createDefiningConversion(properties,method,parameters);
  }
 catch (  FactoryException exception) {
    throw parent.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses a   {@code "Method"} (WKT 2) element, followed by parameter values. The syntax is given by<a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#62">WKT 2 specification §9.3</a>. The legacy WKT 1 specification was: {@preformat wkt}PROJECTION["<name>"  ,<authority>}] } Note that in WKT 2, this element is wrapped inside a   {@code Conversion} or {@code DerivingConversion}element which is itself inside the   {@code ProjectedCRS} element. This is different than WKT 1, whichputs this element right into the the  {@code ProjectedCRS} element without {@code Conversion} wrapper.
 * @param mode               {@link #FIRST},   {@link #OPTIONAL} or {@link #MANDATORY}.
 * @param parent             The parent element.
 * @param wrapper            "Conversion" or "DerivingConversion" wrapper name, or null if parsing a WKT 1.
 * @param defaultUnit        The unit (usually linear) of the parent element, or {@code null}.
 * @param defaultAngularUnit The angular unit of the sibling {@code GeographicCRS} element, or {@code null}.
 * @return The {@code "Method"} element and its parameters as a defining conversion.
 * @throws ParseException if the {@code "Method"} element can not be parsed.
 */
private Conversion parseDerivingConversion(final int mode,Element parent,final String wrapper,final Unit<?> defaultUnit,final Unit<Angle> defaultAngularUnit) throws ParseException {
  final String name;
  if (wrapper == null) {
    name=null;
  }
 else {
    parent=parent.pullElement(mode,wrapper);
    if (parent == null) {
      return null;
    }
    name=parent.pullString("String_Node_Str");
  }
  final OperationMethod method=parseMethod(parent,WKTKeywords.Method,WKTKeywords.Projection);
  Map<String,?> properties=this.properties;
  final ParameterValueGroup parameters=method.getParameters().createValue();
  parseParameters(parent,parameters,defaultUnit,defaultAngularUnit);
  if (wrapper != null) {
    properties=parseMetadataAndClose(parent,name,method);
  }
  try {
    return opFactory.createDefiningConversion(properties,method,parameters);
  }
 catch (  FactoryException exception) {
    throw parent.parseFailed(exception);
  }
}