nus-yam/ex-repair huggingface dataset:
Program: 92113
Project: 92113
Buggy source:
/** 
 * Creates an axis with the same name than the abbreviation.
 */
private CoordinateSystemAxis createAxis(final String abbreviation,final AxisDirection direction,final Unit<?> unit) throws FactoryException {
  return csFactory.createCoordinateSystemAxis(singletonMap(IdentifiedObject.NAME_KEY,abbreviation),abbreviation,direction,unit);
}

Fixed version (ground truth):
/** 
 * Creates an axis with the same name than the abbreviation.
 */
private CoordinateSystemAxis createAxis(final String name,final String abbreviation,final AxisDirection direction,final Unit<?> unit) throws FactoryException {
  return csFactory.createCoordinateSystemAxis(singletonMap(IdentifiedObject.NAME_KEY,name),abbreviation,direction,unit);
}
Program: 92114
Project: 92114
Buggy source:
/** 
 * Parses an <strong>optional</strong>   {@code "VERT_CS"} element.This element has the following pattern: {@preformat text}VERT_CS["<name>", <vert datum>, <linear unit>,  <axis>,} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "VERT_CS"} element as a {@link VerticalCRS} object.
 * @throws ParseException if the {@code "VERT_CS"} element can not be parsed.
 */
private VerticalCRS parseVertCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Vert_CS);
  final String name=element.pullString("String_Node_Str");
  final VerticalDatum datum=parseVertDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,linearUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      axis=createAxis("String_Node_Str",AxisDirection.UP,linearUnit);
    }
    return crsFactory.createVerticalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createVerticalCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses an <strong>optional</strong>   {@code "VERT_CS"} element.This element has the following pattern: {@preformat text}VERT_CS["<name>", <vert datum>, <linear unit>,  <axis>,} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "VERT_CS"} element as a {@link VerticalCRS} object.
 * @throws ParseException if the {@code "VERT_CS"} element can not be parsed.
 */
private VerticalCRS parseVertCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Vert_CS);
  final String name=element.pullString("String_Node_Str");
  final VerticalDatum datum=parseVertDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,false,linearUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      String sn="String_Node_Str", abbreviation="String_Node_Str";
      AxisDirection direction=AxisDirection.UP;
      final VerticalDatumType type=datum.getVerticalDatumType();
      if (VerticalDatumType.GEOIDAL.equals(type)) {
        sn=AxisNames.GRAVITY_RELATED_HEIGHT;
        abbreviation="String_Node_Str";
      }
 else       if (VerticalDatumType.DEPTH.equals(type)) {
        sn=AxisNames.DEPTH;
        abbreviation="String_Node_Str";
        direction=AxisDirection.DOWN;
      }
 else       if (VerticalDatumTypes.ELLIPSOIDAL.equals(type)) {
        sn=AxisNames.ELLIPSOIDAL_HEIGHT;
      }
      axis=createAxis(sn,abbreviation,direction,linearUnit);
    }
    return crsFactory.createVerticalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createVerticalCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92115
Project: 92115
Buggy source:
/** 
 * Parses the next element in the specified <cite>Well Know Text</cite> (WKT) tree.
 * @param element The element to be parsed.
 * @return The object.
 * @throws ParseException if the element can not be parsed.
 */
@Override Object parseObject(final Element element) throws ParseException {
  Object value=parseCoordinateReferenceSystem(element,false);
  if (value != null) {
    return value;
  }
  value=parseMathTransform(element,false);
  if (value != null) {
    return value;
  }
  String keyword=WKTKeywords.GeogCS;
  final Object child=element.peek();
  if (child instanceof Element) {
    keyword=((Element)child).keyword;
    if (keyword != null) {
      if (keyword.equalsIgnoreCase(WKTKeywords.Axis))       return parseAxis(element,SI.METRE,true);
      if (keyword.equalsIgnoreCase(WKTKeywords.PrimeM))       return parsePrimem(element,NonSI.DEGREE_ANGLE);
      if (keyword.equalsIgnoreCase(WKTKeywords.ToWGS84))       return parseToWGS84(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Spheroid))       return parseSpheroid(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Vert_Datum))       return parseVertDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Local_Datum))       return parseLocalDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Datum))       return parseDatum(element,referencing.getGreenwich());
    }
  }
  throw element.keywordNotFound(keyword,keyword == WKTKeywords.GeogCS);
}

Fixed version (ground truth):
/** 
 * Parses the next element in the specified <cite>Well Know Text</cite> (WKT) tree.
 * @param element The element to be parsed.
 * @return The object.
 * @throws ParseException if the element can not be parsed.
 */
@Override Object parseObject(final Element element) throws ParseException {
  Object value=parseCoordinateReferenceSystem(element,false);
  if (value != null) {
    return value;
  }
  value=parseMathTransform(element,false);
  if (value != null) {
    return value;
  }
  String keyword=WKTKeywords.GeogCS;
  final Object child=element.peek();
  if (child instanceof Element) {
    keyword=((Element)child).keyword;
    if (keyword != null) {
      if (keyword.equalsIgnoreCase(WKTKeywords.Axis))       return parseAxis(element,false,SI.METRE,true);
      if (keyword.equalsIgnoreCase(WKTKeywords.PrimeM))       return parsePrimem(element,NonSI.DEGREE_ANGLE);
      if (keyword.equalsIgnoreCase(WKTKeywords.ToWGS84))       return parseToWGS84(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Spheroid))       return parseSpheroid(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Vert_Datum))       return parseVertDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Local_Datum))       return parseLocalDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Datum))       return parseDatum(element,referencing.getGreenwich());
    }
  }
  throw element.keywordNotFound(keyword,keyword == WKTKeywords.GeogCS);
}
Program: 92116
Project: 92116
Buggy source:
/** 
 * Parses an <strong>optional</strong>   {@code "TIMECRS"} element.
 * @param parent The parent element.
 * @return The {@code "TIMECRS"} element as a {@link TemporalCRS} object.
 * @throws ParseException if the {@code "TIMECRS"} element can not be parsed.
 */
private TemporalCRS parseTimeCRS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.TimeCRS);
  final String name=element.pullString("String_Node_Str");
  final TemporalDatum datum=parseTimeDatum(element);
  final Unit<Duration> timeUnit=parseUnit(element,SI.SECOND);
  CoordinateSystemAxis axis=parseAxis(element,timeUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      axis=createAxis("String_Node_Str",AxisDirection.UP,timeUnit);
    }
    return crsFactory.createTemporalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createTimeCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses an <strong>optional</strong>   {@code "TIMECRS"} element.
 * @param parent The parent element.
 * @return The {@code "TIMECRS"} element as a {@link TemporalCRS} object.
 * @throws ParseException if the {@code "TIMECRS"} element can not be parsed.
 */
private TemporalCRS parseTimeCRS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.TimeCRS);
  final String name=element.pullString("String_Node_Str");
  final TemporalDatum datum=parseTimeDatum(element);
  final Unit<Duration> timeUnit=parseUnit(element,SI.SECOND);
  CoordinateSystemAxis axis=parseAxis(element,false,timeUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      axis=createAxis("String_Node_Str","String_Node_Str",AxisDirection.FUTURE,timeUnit);
    }
    return crsFactory.createTemporalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createTimeCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92118
Project: 92118
Buggy source:
/** 
 * Parses a   {@code "GEOCCS"} element.This element has the following pattern: {@preformat textGEOCCS["<name>", <datum>, <prime meridian>, <linear unit>}{,<axis> ,<axis> ,<axis>} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "GEOCCS"} element as a {@link GeocentricCRS} object.
 * @throws ParseException if the {@code "GEOCCS"} element can not be parsed.
 */
private GeocentricCRS parseGeoCCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.GeocCS);
  final String name=element.pullString("String_Node_Str");
  final PrimeMeridian meridian=parsePrimem(element,NonSI.DEGREE_ANGLE);
  final GeodeticDatum datum=parseDatum(element,meridian);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CartesianCS cs;
  CoordinateSystemAxis axis0, axis1=null, axis2=null;
  axis0=parseAxis(element,linearUnit,false);
  try {
    if (axis0 != null) {
      axis1=parseAxis(element,linearUnit,true);
      axis2=parseAxis(element,linearUnit,true);
    }
    final Map<String,?> properties=parseAuthorityAndClose(element,name);
    if (axis0 != null && !isAxisIgnored) {
      cs=csFactory.createCartesianCS(properties,axis0,axis1,axis2);
      cs=referencing.upgradeGeocentricCS(cs);
    }
 else {
      cs=referencing.getGeocentricCS(linearUnit);
    }
    return crsFactory.createGeocentricCRS(properties,datum,cs);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses a   {@code "GEOCCS"} element.This element has the following pattern: {@preformat textGEOCCS["<name>", <datum>, <prime meridian>, <linear unit>}{,<axis> ,<axis> ,<axis>} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "GEOCCS"} element as a {@link GeocentricCRS} object.
 * @throws ParseException if the {@code "GEOCCS"} element can not be parsed.
 */
private GeocentricCRS parseGeoCCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.GeocCS);
  final String name=element.pullString("String_Node_Str");
  final PrimeMeridian meridian=parsePrimem(element,NonSI.DEGREE_ANGLE);
  final GeodeticDatum datum=parseDatum(element,meridian);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CartesianCS cs;
  CoordinateSystemAxis axis0, axis1=null, axis2=null;
  axis0=parseAxis(element,false,linearUnit,false);
  try {
    if (axis0 != null) {
      axis1=parseAxis(element,false,linearUnit,true);
      axis2=parseAxis(element,false,linearUnit,true);
    }
    final Map<String,?> properties=parseAuthorityAndClose(element,name);
    if (axis0 != null && !isAxisIgnored) {
      cs=csFactory.createCartesianCS(properties,axis0,axis1,axis2);
      cs=referencing.upgradeGeocentricCS(cs);
    }
 else {
      cs=referencing.getGeocentricCS(linearUnit);
    }
    return crsFactory.createGeocentricCRS(properties,datum,cs);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92119
Project: 92119
Buggy source:
/** 
 * Parses a   {@code "GEOGCS"} element. This element has the following pattern:{@preformat text}GEOGCS["<name>", <datum>, <prime meridian>, <angular unit>   ,<twin axes>} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "GEOGCS"} element as a {@link GeographicCRS} object.
 * @throws ParseException if the {@code "GEOGCS"} element can not be parsed.
 */
private GeographicCRS parseGeoGCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.GeogCS);
  Object name=element.pullString("String_Node_Str");
  final Unit<Angle> angularUnit=parseUnit(element,SI.RADIAN);
  final PrimeMeridian meridian=parsePrimem(element,angularUnit);
  final GeodeticDatum datum=parseDatum(element,meridian);
  if (((String)name).isEmpty()) {
    name=datum.getName();
  }
  CoordinateSystemAxis axis0=parseAxis(element,angularUnit,false);
  CoordinateSystemAxis axis1=null;
  try {
    if (axis0 != null) {
      axis1=parseAxis(element,angularUnit,true);
    }
    if (axis0 == null || isAxisIgnored) {
      axis0=createAxis("String_Node_Str",AxisDirection.EAST,angularUnit);
      axis1=createAxis("String_Node_Str",AxisDirection.NORTH,angularUnit);
    }
    final Map<String,?> properties=parseAuthorityAndClose(element,name);
    return crsFactory.createGeographicCRS(properties,datum,csFactory.createEllipsoidalCS(properties,axis0,axis1));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses a   {@code "GEOGCS"} element. This element has the following pattern:{@preformat text}GEOGCS["<name>", <datum>, <prime meridian>, <angular unit>   ,<twin axes>} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "GEOGCS"} element as a {@link GeographicCRS} object.
 * @throws ParseException if the {@code "GEOGCS"} element can not be parsed.
 */
private GeographicCRS parseGeoGCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.GeogCS);
  Object name=element.pullString("String_Node_Str");
  final Unit<Angle> angularUnit=parseUnit(element,SI.RADIAN);
  final PrimeMeridian meridian=parsePrimem(element,angularUnit);
  final GeodeticDatum datum=parseDatum(element,meridian);
  if (((String)name).isEmpty()) {
    name=datum.getName();
  }
  CoordinateSystemAxis axis0=parseAxis(element,true,angularUnit,false);
  CoordinateSystemAxis axis1=null;
  try {
    if (axis0 != null) {
      axis1=parseAxis(element,true,angularUnit,true);
    }
    if (axis0 == null || isAxisIgnored) {
      axis0=createAxis(AxisNames.GEODETIC_LONGITUDE,"String_Node_Str",AxisDirection.EAST,angularUnit);
      axis1=createAxis(AxisNames.GEODETIC_LATITUDE,"String_Node_Str",AxisDirection.NORTH,angularUnit);
    }
    final Map<String,?> properties=parseAuthorityAndClose(element,name);
    return crsFactory.createGeographicCRS(properties,datum,csFactory.createEllipsoidalCS(properties,axis0,axis1));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92120
Project: 92120
Buggy source:
/** 
 * Tests   {@link CharEncoding#getAbbreviation(CoordinateSystem,CoordinateSystemAxis)}.
 */
@Test public void testGetAbbreviation(){
  assertAbbreviationEquals("String_Node_Str",new Geographic("String_Node_Str","String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geocentric("String_Node_Str","String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geographic("String_Node_Str","String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geocentric("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Tests   {@link CharEncoding#getAbbreviation(CoordinateSystem,CoordinateSystemAxis)}.
 */
@Test public void testGetAbbreviation(){
  assertAbbreviationEquals("String_Node_Str",new Geographic(AxisNames.GEODETIC_LATITUDE,"String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geocentric(AxisNames.SPHERICAL_LATITUDE,"String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geographic(AxisNames.GEODETIC_LONGITUDE,"String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geocentric(AxisNames.SPHERICAL_LONGITUDE,"String_Node_Str"));
}
Program: 92122
Project: 92122
Buggy source:
/** 
 * Parses a   {@code "LOCAL_CS"} element.This element has the following pattern: {@preformat text}LOCAL_CS["<name>", <local datum>, <unit>, <axis>,  ,<axis>}* {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "LOCAL_CS"} element as an {@link EngineeringCRS} object.
 * @throws ParseException if the {@code "LOCAL_CS"} element can not be parsed.
 * @todo The coordinate system used is always a SIS implementation, since we don'tknow which method to invokes in the  {@link CSFactory} (is it a Cartesiancoordinate system? a spherical one? etc.).
 */
private EngineeringCRS parseLocalCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Local_CS);
  final String name=element.pullString("String_Node_Str");
  final EngineeringDatum datum=parseLocalDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,linearUnit,true);
  final List<CoordinateSystemAxis> list=new ArrayList<CoordinateSystemAxis>();
  do {
    list.add(axis);
    axis=parseAxis(element,linearUnit,false);
  }
 while (axis != null);
  final CoordinateSystem cs=referencing.createAbstractCS(list.toArray(new CoordinateSystemAxis[list.size()]));
  try {
    return crsFactory.createEngineeringCRS(parseAuthorityAndClose(element,name),datum,cs);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses a   {@code "LOCAL_CS"} element.This element has the following pattern: {@preformat text}LOCAL_CS["<name>", <local datum>, <unit>, <axis>,  ,<axis>}* {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "LOCAL_CS"} element as an {@link EngineeringCRS} object.
 * @throws ParseException if the {@code "LOCAL_CS"} element can not be parsed.
 * @todo The coordinate system used is always a SIS implementation, since we don'tknow which method to invokes in the  {@link CSFactory} (is it a Cartesiancoordinate system? a spherical one? etc.).
 */
private EngineeringCRS parseLocalCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Local_CS);
  final String name=element.pullString("String_Node_Str");
  final EngineeringDatum datum=parseLocalDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,false,linearUnit,true);
  final List<CoordinateSystemAxis> list=new ArrayList<CoordinateSystemAxis>();
  do {
    list.add(axis);
    axis=parseAxis(element,false,linearUnit,false);
  }
 while (axis != null);
  final CoordinateSystem cs=referencing.createAbstractCS(list.toArray(new CoordinateSystemAxis[list.size()]));
  try {
    return crsFactory.createEngineeringCRS(parseAuthorityAndClose(element,name),datum,cs);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92123
Project: 92123
Buggy source:
/** 
 * Creates an axis with the same name than the abbreviation.
 */
private CoordinateSystemAxis createAxis(final String abbreviation,final AxisDirection direction,final Unit<?> unit) throws FactoryException {
  return csFactory.createCoordinateSystemAxis(singletonMap(IdentifiedObject.NAME_KEY,abbreviation),abbreviation,direction,unit);
}

Fixed version (ground truth):
/** 
 * Creates an axis with the same name than the abbreviation.
 */
private CoordinateSystemAxis createAxis(final String name,final String abbreviation,final AxisDirection direction,final Unit<?> unit) throws FactoryException {
  return csFactory.createCoordinateSystemAxis(singletonMap(IdentifiedObject.NAME_KEY,name),abbreviation,direction,unit);
}
Program: 92124
Project: 92124
Buggy source:
/** 
 * Parses an <strong>optional</strong>   {@code "VERT_CS"} element.This element has the following pattern: {@preformat text}VERT_CS["<name>", <vert datum>, <linear unit>,  <axis>,} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "VERT_CS"} element as a {@link VerticalCRS} object.
 * @throws ParseException if the {@code "VERT_CS"} element can not be parsed.
 */
private VerticalCRS parseVertCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Vert_CS);
  final String name=element.pullString("String_Node_Str");
  final VerticalDatum datum=parseVertDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,linearUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      axis=createAxis("String_Node_Str",AxisDirection.UP,linearUnit);
    }
    return crsFactory.createVerticalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createVerticalCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses an <strong>optional</strong>   {@code "VERT_CS"} element.This element has the following pattern: {@preformat text}VERT_CS["<name>", <vert datum>, <linear unit>,  <axis>,} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "VERT_CS"} element as a {@link VerticalCRS} object.
 * @throws ParseException if the {@code "VERT_CS"} element can not be parsed.
 */
private VerticalCRS parseVertCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Vert_CS);
  final String name=element.pullString("String_Node_Str");
  final VerticalDatum datum=parseVertDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,false,linearUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      String sn="String_Node_Str", abbreviation="String_Node_Str";
      AxisDirection direction=AxisDirection.UP;
      final VerticalDatumType type=datum.getVerticalDatumType();
      if (VerticalDatumType.GEOIDAL.equals(type)) {
        sn=AxisNames.GRAVITY_RELATED_HEIGHT;
        abbreviation="String_Node_Str";
      }
 else       if (VerticalDatumType.DEPTH.equals(type)) {
        sn=AxisNames.DEPTH;
        abbreviation="String_Node_Str";
        direction=AxisDirection.DOWN;
      }
 else       if (VerticalDatumTypes.ELLIPSOIDAL.equals(type)) {
        sn=AxisNames.ELLIPSOIDAL_HEIGHT;
      }
      axis=createAxis(sn,abbreviation,direction,linearUnit);
    }
    return crsFactory.createVerticalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createVerticalCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92125
Project: 92125
Buggy source:
/** 
 * Parses the next element in the specified <cite>Well Know Text</cite> (WKT) tree.
 * @param element The element to be parsed.
 * @return The object.
 * @throws ParseException if the element can not be parsed.
 */
@Override Object parseObject(final Element element) throws ParseException {
  Object value=parseCoordinateReferenceSystem(element,false);
  if (value != null) {
    return value;
  }
  value=parseMathTransform(element,false);
  if (value != null) {
    return value;
  }
  String keyword=WKTKeywords.GeogCS;
  final Object child=element.peek();
  if (child instanceof Element) {
    keyword=((Element)child).keyword;
    if (keyword != null) {
      if (keyword.equalsIgnoreCase(WKTKeywords.Axis))       return parseAxis(element,SI.METRE,true);
      if (keyword.equalsIgnoreCase(WKTKeywords.PrimeM))       return parsePrimem(element,NonSI.DEGREE_ANGLE);
      if (keyword.equalsIgnoreCase(WKTKeywords.ToWGS84))       return parseToWGS84(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Spheroid))       return parseSpheroid(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Vert_Datum))       return parseVertDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Local_Datum))       return parseLocalDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Datum))       return parseDatum(element,referencing.getGreenwich());
    }
  }
  throw element.keywordNotFound(keyword,keyword == WKTKeywords.GeogCS);
}

Fixed version (ground truth):
/** 
 * Parses the next element in the specified <cite>Well Know Text</cite> (WKT) tree.
 * @param element The element to be parsed.
 * @return The object.
 * @throws ParseException if the element can not be parsed.
 */
@Override Object parseObject(final Element element) throws ParseException {
  Object value=parseCoordinateReferenceSystem(element,false);
  if (value != null) {
    return value;
  }
  value=parseMathTransform(element,false);
  if (value != null) {
    return value;
  }
  String keyword=WKTKeywords.GeogCS;
  final Object child=element.peek();
  if (child instanceof Element) {
    keyword=((Element)child).keyword;
    if (keyword != null) {
      if (keyword.equalsIgnoreCase(WKTKeywords.Axis))       return parseAxis(element,false,SI.METRE,true);
      if (keyword.equalsIgnoreCase(WKTKeywords.PrimeM))       return parsePrimem(element,NonSI.DEGREE_ANGLE);
      if (keyword.equalsIgnoreCase(WKTKeywords.ToWGS84))       return parseToWGS84(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Spheroid))       return parseSpheroid(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Vert_Datum))       return parseVertDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Local_Datum))       return parseLocalDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Datum))       return parseDatum(element,referencing.getGreenwich());
    }
  }
  throw element.keywordNotFound(keyword,keyword == WKTKeywords.GeogCS);
}
Program: 92126
Project: 92126
Buggy source:
/** 
 * Parses an <strong>optional</strong>   {@code "TIMECRS"} element.
 * @param parent The parent element.
 * @return The {@code "TIMECRS"} element as a {@link TemporalCRS} object.
 * @throws ParseException if the {@code "TIMECRS"} element can not be parsed.
 */
private TemporalCRS parseTimeCRS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.TimeCRS);
  final String name=element.pullString("String_Node_Str");
  final TemporalDatum datum=parseTimeDatum(element);
  final Unit<Duration> timeUnit=parseUnit(element,SI.SECOND);
  CoordinateSystemAxis axis=parseAxis(element,timeUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      axis=createAxis("String_Node_Str",AxisDirection.UP,timeUnit);
    }
    return crsFactory.createTemporalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createTimeCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses an <strong>optional</strong>   {@code "TIMECRS"} element.
 * @param parent The parent element.
 * @return The {@code "TIMECRS"} element as a {@link TemporalCRS} object.
 * @throws ParseException if the {@code "TIMECRS"} element can not be parsed.
 */
private TemporalCRS parseTimeCRS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.TimeCRS);
  final String name=element.pullString("String_Node_Str");
  final TemporalDatum datum=parseTimeDatum(element);
  final Unit<Duration> timeUnit=parseUnit(element,SI.SECOND);
  CoordinateSystemAxis axis=parseAxis(element,false,timeUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      axis=createAxis("String_Node_Str","String_Node_Str",AxisDirection.FUTURE,timeUnit);
    }
    return crsFactory.createTemporalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createTimeCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92128
Project: 92128
Buggy source:
/** 
 * Parses a   {@code "GEOCCS"} element.This element has the following pattern: {@preformat textGEOCCS["<name>", <datum>, <prime meridian>, <linear unit>}{,<axis> ,<axis> ,<axis>} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "GEOCCS"} element as a {@link GeocentricCRS} object.
 * @throws ParseException if the {@code "GEOCCS"} element can not be parsed.
 */
private GeocentricCRS parseGeoCCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.GeocCS);
  final String name=element.pullString("String_Node_Str");
  final PrimeMeridian meridian=parsePrimem(element,NonSI.DEGREE_ANGLE);
  final GeodeticDatum datum=parseDatum(element,meridian);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CartesianCS cs;
  CoordinateSystemAxis axis0, axis1=null, axis2=null;
  axis0=parseAxis(element,linearUnit,false);
  try {
    if (axis0 != null) {
      axis1=parseAxis(element,linearUnit,true);
      axis2=parseAxis(element,linearUnit,true);
    }
    final Map<String,?> properties=parseAuthorityAndClose(element,name);
    if (axis0 != null && !isAxisIgnored) {
      cs=csFactory.createCartesianCS(properties,axis0,axis1,axis2);
      cs=referencing.upgradeGeocentricCS(cs);
    }
 else {
      cs=referencing.getGeocentricCS(linearUnit);
    }
    return crsFactory.createGeocentricCRS(properties,datum,cs);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses a   {@code "GEOCCS"} element.This element has the following pattern: {@preformat textGEOCCS["<name>", <datum>, <prime meridian>, <linear unit>}{,<axis> ,<axis> ,<axis>} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "GEOCCS"} element as a {@link GeocentricCRS} object.
 * @throws ParseException if the {@code "GEOCCS"} element can not be parsed.
 */
private GeocentricCRS parseGeoCCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.GeocCS);
  final String name=element.pullString("String_Node_Str");
  final PrimeMeridian meridian=parsePrimem(element,NonSI.DEGREE_ANGLE);
  final GeodeticDatum datum=parseDatum(element,meridian);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CartesianCS cs;
  CoordinateSystemAxis axis0, axis1=null, axis2=null;
  axis0=parseAxis(element,false,linearUnit,false);
  try {
    if (axis0 != null) {
      axis1=parseAxis(element,false,linearUnit,true);
      axis2=parseAxis(element,false,linearUnit,true);
    }
    final Map<String,?> properties=parseAuthorityAndClose(element,name);
    if (axis0 != null && !isAxisIgnored) {
      cs=csFactory.createCartesianCS(properties,axis0,axis1,axis2);
      cs=referencing.upgradeGeocentricCS(cs);
    }
 else {
      cs=referencing.getGeocentricCS(linearUnit);
    }
    return crsFactory.createGeocentricCRS(properties,datum,cs);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92129
Project: 92129
Buggy source:
/** 
 * Parses a   {@code "GEOGCS"} element. This element has the following pattern:{@preformat text}GEOGCS["<name>", <datum>, <prime meridian>, <angular unit>   ,<twin axes>} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "GEOGCS"} element as a {@link GeographicCRS} object.
 * @throws ParseException if the {@code "GEOGCS"} element can not be parsed.
 */
private GeographicCRS parseGeoGCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.GeogCS);
  Object name=element.pullString("String_Node_Str");
  final Unit<Angle> angularUnit=parseUnit(element,SI.RADIAN);
  final PrimeMeridian meridian=parsePrimem(element,angularUnit);
  final GeodeticDatum datum=parseDatum(element,meridian);
  if (((String)name).isEmpty()) {
    name=datum.getName();
  }
  CoordinateSystemAxis axis0=parseAxis(element,angularUnit,false);
  CoordinateSystemAxis axis1=null;
  try {
    if (axis0 != null) {
      axis1=parseAxis(element,angularUnit,true);
    }
    if (axis0 == null || isAxisIgnored) {
      axis0=createAxis("String_Node_Str",AxisDirection.EAST,angularUnit);
      axis1=createAxis("String_Node_Str",AxisDirection.NORTH,angularUnit);
    }
    final Map<String,?> properties=parseAuthorityAndClose(element,name);
    return crsFactory.createGeographicCRS(properties,datum,csFactory.createEllipsoidalCS(properties,axis0,axis1));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses a   {@code "GEOGCS"} element. This element has the following pattern:{@preformat text}GEOGCS["<name>", <datum>, <prime meridian>, <angular unit>   ,<twin axes>} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "GEOGCS"} element as a {@link GeographicCRS} object.
 * @throws ParseException if the {@code "GEOGCS"} element can not be parsed.
 */
private GeographicCRS parseGeoGCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.GeogCS);
  Object name=element.pullString("String_Node_Str");
  final Unit<Angle> angularUnit=parseUnit(element,SI.RADIAN);
  final PrimeMeridian meridian=parsePrimem(element,angularUnit);
  final GeodeticDatum datum=parseDatum(element,meridian);
  if (((String)name).isEmpty()) {
    name=datum.getName();
  }
  CoordinateSystemAxis axis0=parseAxis(element,true,angularUnit,false);
  CoordinateSystemAxis axis1=null;
  try {
    if (axis0 != null) {
      axis1=parseAxis(element,true,angularUnit,true);
    }
    if (axis0 == null || isAxisIgnored) {
      axis0=createAxis(AxisNames.GEODETIC_LONGITUDE,"String_Node_Str",AxisDirection.EAST,angularUnit);
      axis1=createAxis(AxisNames.GEODETIC_LATITUDE,"String_Node_Str",AxisDirection.NORTH,angularUnit);
    }
    final Map<String,?> properties=parseAuthorityAndClose(element,name);
    return crsFactory.createGeographicCRS(properties,datum,csFactory.createEllipsoidalCS(properties,axis0,axis1));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92130
Project: 92130
Buggy source:
/** 
 * Tests   {@link CharEncoding#getAbbreviation(CoordinateSystem,CoordinateSystemAxis)}.
 */
@Test public void testGetAbbreviation(){
  assertAbbreviationEquals("String_Node_Str",new Geographic("String_Node_Str","String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geocentric("String_Node_Str","String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geographic("String_Node_Str","String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geocentric("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Tests   {@link CharEncoding#getAbbreviation(CoordinateSystem,CoordinateSystemAxis)}.
 */
@Test public void testGetAbbreviation(){
  assertAbbreviationEquals("String_Node_Str",new Geographic(AxisNames.GEODETIC_LATITUDE,"String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geocentric(AxisNames.SPHERICAL_LATITUDE,"String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geographic(AxisNames.GEODETIC_LONGITUDE,"String_Node_Str"));
  assertAbbreviationEquals("String_Node_Str",new Geocentric(AxisNames.SPHERICAL_LONGITUDE,"String_Node_Str"));
}
Program: 92132
Project: 92132
Buggy source:
/** 
 * Parses a   {@code "LOCAL_CS"} element.This element has the following pattern: {@preformat text}LOCAL_CS["<name>", <local datum>, <unit>, <axis>,  ,<axis>}* {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "LOCAL_CS"} element as an {@link EngineeringCRS} object.
 * @throws ParseException if the {@code "LOCAL_CS"} element can not be parsed.
 * @todo The coordinate system used is always a SIS implementation, since we don'tknow which method to invokes in the  {@link CSFactory} (is it a Cartesiancoordinate system? a spherical one? etc.).
 */
private EngineeringCRS parseLocalCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Local_CS);
  final String name=element.pullString("String_Node_Str");
  final EngineeringDatum datum=parseLocalDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,linearUnit,true);
  final List<CoordinateSystemAxis> list=new ArrayList<>();
  do {
    list.add(axis);
    axis=parseAxis(element,linearUnit,false);
  }
 while (axis != null);
  final CoordinateSystem cs=referencing.createAbstractCS(list.toArray(new CoordinateSystemAxis[list.size()]));
  try {
    return crsFactory.createEngineeringCRS(parseAuthorityAndClose(element,name),datum,cs);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses a   {@code "LOCAL_CS"} element.This element has the following pattern: {@preformat text}LOCAL_CS["<name>", <local datum>, <unit>, <axis>,  ,<axis>}* {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "LOCAL_CS"} element as an {@link EngineeringCRS} object.
 * @throws ParseException if the {@code "LOCAL_CS"} element can not be parsed.
 * @todo The coordinate system used is always a SIS implementation, since we don'tknow which method to invokes in the  {@link CSFactory} (is it a Cartesiancoordinate system? a spherical one? etc.).
 */
private EngineeringCRS parseLocalCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Local_CS);
  final String name=element.pullString("String_Node_Str");
  final EngineeringDatum datum=parseLocalDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,false,linearUnit,true);
  final List<CoordinateSystemAxis> list=new ArrayList<>();
  do {
    list.add(axis);
    axis=parseAxis(element,false,linearUnit,false);
  }
 while (axis != null);
  final CoordinateSystem cs=referencing.createAbstractCS(list.toArray(new CoordinateSystemAxis[list.size()]));
  try {
    return crsFactory.createEngineeringCRS(parseAuthorityAndClose(element,name),datum,cs);
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92133
Project: 92133
Buggy source:
/** 
 * Creates an axis with the same name than the abbreviation.
 */
private CoordinateSystemAxis createAxis(final String abbreviation,final AxisDirection direction,final Unit<?> unit) throws FactoryException {
  return csFactory.createCoordinateSystemAxis(singletonMap(IdentifiedObject.NAME_KEY,abbreviation),abbreviation,direction,unit);
}

Fixed version (ground truth):
/** 
 * Creates an axis with the same name than the abbreviation.
 */
private CoordinateSystemAxis createAxis(final String name,final String abbreviation,final AxisDirection direction,final Unit<?> unit) throws FactoryException {
  return csFactory.createCoordinateSystemAxis(singletonMap(IdentifiedObject.NAME_KEY,name),abbreviation,direction,unit);
}
Program: 92134
Project: 92134
Buggy source:
/** 
 * Parses an <strong>optional</strong>   {@code "VERT_CS"} element.This element has the following pattern: {@preformat text}VERT_CS["<name>", <vert datum>, <linear unit>,  <axis>,} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "VERT_CS"} element as a {@link VerticalCRS} object.
 * @throws ParseException if the {@code "VERT_CS"} element can not be parsed.
 */
private VerticalCRS parseVertCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Vert_CS);
  final String name=element.pullString("String_Node_Str");
  final VerticalDatum datum=parseVertDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,linearUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      axis=createAxis("String_Node_Str",AxisDirection.UP,linearUnit);
    }
    return crsFactory.createVerticalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createVerticalCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses an <strong>optional</strong>   {@code "VERT_CS"} element.This element has the following pattern: {@preformat text}VERT_CS["<name>", <vert datum>, <linear unit>,  <axis>,} {,<authority>}] }
 * @param parent The parent element.
 * @return The {@code "VERT_CS"} element as a {@link VerticalCRS} object.
 * @throws ParseException if the {@code "VERT_CS"} element can not be parsed.
 */
private VerticalCRS parseVertCS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.Vert_CS);
  final String name=element.pullString("String_Node_Str");
  final VerticalDatum datum=parseVertDatum(element);
  final Unit<Length> linearUnit=parseUnit(element,SI.METRE);
  CoordinateSystemAxis axis=parseAxis(element,false,linearUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      String sn="String_Node_Str", abbreviation="String_Node_Str";
      AxisDirection direction=AxisDirection.UP;
      final VerticalDatumType type=datum.getVerticalDatumType();
      if (VerticalDatumType.GEOIDAL.equals(type)) {
        sn=AxisNames.GRAVITY_RELATED_HEIGHT;
        abbreviation="String_Node_Str";
      }
 else       if (VerticalDatumType.DEPTH.equals(type)) {
        sn=AxisNames.DEPTH;
        abbreviation="String_Node_Str";
        direction=AxisDirection.DOWN;
      }
 else       if (VerticalDatumTypes.ELLIPSOIDAL.equals(type)) {
        sn=AxisNames.ELLIPSOIDAL_HEIGHT;
      }
      axis=createAxis(sn,abbreviation,direction,linearUnit);
    }
    return crsFactory.createVerticalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createVerticalCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}
Program: 92135
Project: 92135
Buggy source:
/** 
 * Parses the next element in the specified <cite>Well Know Text</cite> (WKT) tree.
 * @param element The element to be parsed.
 * @return The object.
 * @throws ParseException if the element can not be parsed.
 */
@Override Object parseObject(final Element element) throws ParseException {
  Object value=parseCoordinateReferenceSystem(element,false);
  if (value != null) {
    return value;
  }
  value=parseMathTransform(element,false);
  if (value != null) {
    return value;
  }
  String keyword=WKTKeywords.GeogCS;
  final Object child=element.peek();
  if (child instanceof Element) {
    keyword=((Element)child).keyword;
    if (keyword != null) {
      if (keyword.equalsIgnoreCase(WKTKeywords.Axis))       return parseAxis(element,SI.METRE,true);
      if (keyword.equalsIgnoreCase(WKTKeywords.PrimeM))       return parsePrimem(element,NonSI.DEGREE_ANGLE);
      if (keyword.equalsIgnoreCase(WKTKeywords.ToWGS84))       return parseToWGS84(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Spheroid))       return parseSpheroid(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Vert_Datum))       return parseVertDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Local_Datum))       return parseLocalDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Datum))       return parseDatum(element,referencing.getGreenwich());
    }
  }
  throw element.keywordNotFound(keyword,keyword == WKTKeywords.GeogCS);
}

Fixed version (ground truth):
/** 
 * Parses the next element in the specified <cite>Well Know Text</cite> (WKT) tree.
 * @param element The element to be parsed.
 * @return The object.
 * @throws ParseException if the element can not be parsed.
 */
@Override Object parseObject(final Element element) throws ParseException {
  Object value=parseCoordinateReferenceSystem(element,false);
  if (value != null) {
    return value;
  }
  value=parseMathTransform(element,false);
  if (value != null) {
    return value;
  }
  String keyword=WKTKeywords.GeogCS;
  final Object child=element.peek();
  if (child instanceof Element) {
    keyword=((Element)child).keyword;
    if (keyword != null) {
      if (keyword.equalsIgnoreCase(WKTKeywords.Axis))       return parseAxis(element,false,SI.METRE,true);
      if (keyword.equalsIgnoreCase(WKTKeywords.PrimeM))       return parsePrimem(element,NonSI.DEGREE_ANGLE);
      if (keyword.equalsIgnoreCase(WKTKeywords.ToWGS84))       return parseToWGS84(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Spheroid))       return parseSpheroid(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Vert_Datum))       return parseVertDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Local_Datum))       return parseLocalDatum(element);
      if (keyword.equalsIgnoreCase(WKTKeywords.Datum))       return parseDatum(element,referencing.getGreenwich());
    }
  }
  throw element.keywordNotFound(keyword,keyword == WKTKeywords.GeogCS);
}
Program: 92136
Project: 92136
Buggy source:
/** 
 * Parses an <strong>optional</strong>   {@code "TIMECRS"} element.
 * @param parent The parent element.
 * @return The {@code "TIMECRS"} element as a {@link TemporalCRS} object.
 * @throws ParseException if the {@code "TIMECRS"} element can not be parsed.
 */
private TemporalCRS parseTimeCRS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.TimeCRS);
  final String name=element.pullString("String_Node_Str");
  final TemporalDatum datum=parseTimeDatum(element);
  final Unit<Duration> timeUnit=parseUnit(element,SI.SECOND);
  CoordinateSystemAxis axis=parseAxis(element,timeUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      axis=createAxis("String_Node_Str",AxisDirection.UP,timeUnit);
    }
    return crsFactory.createTemporalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createTimeCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}

Fixed version (ground truth):
/** 
 * Parses an <strong>optional</strong>   {@code "TIMECRS"} element.
 * @param parent The parent element.
 * @return The {@code "TIMECRS"} element as a {@link TemporalCRS} object.
 * @throws ParseException if the {@code "TIMECRS"} element can not be parsed.
 */
private TemporalCRS parseTimeCRS(final Element parent) throws ParseException {
  final Element element=parent.pullElement(WKTKeywords.TimeCRS);
  final String name=element.pullString("String_Node_Str");
  final TemporalDatum datum=parseTimeDatum(element);
  final Unit<Duration> timeUnit=parseUnit(element,SI.SECOND);
  CoordinateSystemAxis axis=parseAxis(element,false,timeUnit,false);
  try {
    if (axis == null || isAxisIgnored) {
      axis=createAxis("String_Node_Str","String_Node_Str",AxisDirection.FUTURE,timeUnit);
    }
    return crsFactory.createTemporalCRS(parseAuthorityAndClose(element,name),datum,csFactory.createTimeCS(singletonMap("String_Node_Str",name),axis));
  }
 catch (  FactoryException exception) {
    throw element.parseFailed(exception);
  }
}