Program: 91921
Project: 91921
Buggy source:
/** 
 * Parses a   {@code "PrimeMeridian"} element. The syntax is given by<a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#53">WKT 2 specification §8.2.2</a>. The legacy WKT 1 pattern was: {@preformat text}PRIMEM["<name>", <longitude>  ,<authority>}] }
 * @param mode        {@link #FIRST},   {@link #OPTIONAL} or {@link #MANDATORY}.
 * @param parent      The parent element.
 * @param isWKT1      {@code true} if this method is invoked while parsing a WKT 1 element.
 * @param angularUnit The contextual unit.
 * @return The {@code "PrimeMeridian"} element as a {@link PrimeMeridian} object.
 * @throws ParseException if the {@code "PrimeMeridian"} element can not be parsed.
 * @see org.apache.sis.referencing.datum.DefaultPrimeMeridian#formatTo(Formatter)
 */
private PrimeMeridian parsePrimeMeridian(final int mode,final Element parent,final boolean isWKT1,Unit<Angle> angularUnit) throws ParseException {
  if (isWKT1 && usesCommonUnits) {
    angularUnit=NonSI.DEGREE_ANGLE;
  }
  final Element element=parent.pullElement(mode,WKTKeywords.PrimeMeridian,WKTKeywords.PrimeM);
  if (element == null) {
    return null;
  }
  final String name=element.pullString("String_Node_Str");
  final double longitude=element.pullDouble("String_Node_Str");
  final Unit<Angle> unit=parseScaledUnit(element,WKTKeywords.AngleUnit,SI.RADIAN);
  if (unit != null) {
    angularUnit=unit;
  }
 else   if (angularUnit == null) {
    throw parent.missingComponent(WKTKeywords.AngleUnit);
  }
  try {
    return datumFactory.createPrimeMeridian(parseMetadataAndClose(element,name,null),longitude,angularUnit);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses a   {@code "PrimeMeridian"} element. The syntax is given by<a href="http://docs.opengeospatial.org/is/12-063r5/12-063r5.html#53">WKT 2 specification §8.2.2</a>. The legacy WKT 1 pattern was: {@preformat wkt}PRIMEM["<name>", <longitude>  ,<authority>}] }
 * @param mode        {@link #FIRST},   {@link #OPTIONAL} or {@link #MANDATORY}.
 * @param parent      The parent element.
 * @param isWKT1      {@code true} if this method is invoked while parsing a WKT 1 element.
 * @param angularUnit The contextual unit.
 * @return The {@code "PrimeMeridian"} element as a {@link PrimeMeridian} object.
 * @throws ParseException if the {@code "PrimeMeridian"} element can not be parsed.
 * @see org.apache.sis.referencing.datum.DefaultPrimeMeridian#formatTo(Formatter)
 */
private PrimeMeridian parsePrimeMeridian(final int mode,final Element parent,final boolean isWKT1,Unit<Angle> angularUnit) throws ParseException {
  if (isWKT1 && usesCommonUnits) {
    angularUnit=NonSI.DEGREE_ANGLE;
  }
  final Element element=parent.pullElement(mode,WKTKeywords.PrimeMeridian,WKTKeywords.PrimeM);
  if (element == null) {
    return null;
  }
  final String name=element.pullString("String_Node_Str");
  final double longitude=element.pullDouble("String_Node_Str");
  final Unit<Angle> unit=parseScaledUnit(element,WKTKeywords.AngleUnit,SI.RADIAN);
  if (unit != null) {
    angularUnit=unit;
  }
 else   if (angularUnit == null) {
    throw parent.missingComponent(WKTKeywords.AngleUnit);
  }
  try {
    return datumFactory.createPrimeMeridian(parseMetadataAndClose(element,name,null),longitude,angularUnit);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}