nus-yam/ex-repair huggingface dataset:
Program: 92174
Project: 92174
Buggy source:
/** 
 * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given type.
 * @param type One of {@link #SP1},   {@link #SP2} or {@link #BELGIUM} constants.
 * @return The roles map to give to super-class constructor.
 */
@SuppressWarnings("String_Node_Str") private static Map<ParameterRole,ParameterDescriptor<Double>> roles(final byte type){
  final EnumMap<ParameterRole,ParameterDescriptor<Double>> roles=new EnumMap<ParameterRole,ParameterDescriptor<Double>>(ParameterRole.class);
  roles.put(ParameterRole.SCALE_FACTOR,LambertConformal1SP.SCALE_FACTOR);
switch (type) {
case SP1:
{
      roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal1SP.CENTRAL_MERIDIAN);
      roles.put(ParameterRole.FALSE_EASTING,LambertConformal1SP.FALSE_EASTING);
      roles.put(ParameterRole.FALSE_NORTHING,LambertConformal1SP.FALSE_NORTHING);
      break;
    }
default :
{
    roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_EASTING,LambertConformal2SP.EASTING_AT_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_NORTHING,LambertConformal2SP.NORTHING_AT_FALSE_ORIGIN);
    break;
  }
}
return roles;
}

Fixed version (ground truth):
/** 
 * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given type.
 * @param type One of {@link #SP1},   {@link #SP2} or {@link #BELGIUM} constants.
 * @return The roles map to give to super-class constructor.
 */
private static Map<ParameterRole,ParameterDescriptor<Double>> roles(final byte type){
  final EnumMap<ParameterRole,ParameterDescriptor<Double>> roles=new EnumMap<ParameterRole,ParameterDescriptor<Double>>(ParameterRole.class);
  roles.put(ParameterRole.SCALE_FACTOR,LambertConformal1SP.SCALE_FACTOR);
switch (type) {
case SP1:
{
      roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal1SP.CENTRAL_MERIDIAN);
      roles.put(ParameterRole.FALSE_EASTING,LambertConformal1SP.FALSE_EASTING);
      roles.put(ParameterRole.FALSE_NORTHING,LambertConformal1SP.FALSE_NORTHING);
      break;
    }
default :
{
    roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_EASTING,LambertConformal2SP.EASTING_AT_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_NORTHING,LambertConformal2SP.NORTHING_AT_FALSE_ORIGIN);
    break;
  }
}
return roles;
}
Program: 92175
Project: 92175
Buggy source:
/** 
 * Returns the parameter values for this map projection.
 * @return The map projection parameters if they are an accurate description of this transform,or the generic affine parameters in case of doubt.
 */
@Override public ParameterValueGroup getParameterValues(){
  return isDefinitive ? parameters : super.getParameterValues();
}

Fixed version (ground truth):
/** 
 * Returns the parameter values for this map projection. <p><b>Hack:</b> this method normally returns the matrix parameters in case of doubt. However if  {@link Semaphores#PROJCS} is set, then this method returns the map projection parameters evenif they are not a complete description of this math transform. This internal hack shall be used only by  {@link org.apache.sis.referencing.operation.DefaultSingleOperation}.</p> <p><b>Use case of above hack:</b> consider an "Equidistant Cylindrical (Spherical)" map projection from a   {@code GeographiCRS} base using (latitude, longitude) axis order. We need to concatenate anaffine transform performing the axis swapping before the actual map projection. The concatenated transform is part of  {@code SingleOperation}, which is itself part of   {@code ProjecteCRS}. Consequently we have two conflicting needs:</p> <ul> <li>If this method is queried from a   {@code SingleOperation} instance (usually indirectly as part of a{@code ProjectedCRS}), then we want to return the "Equidistant Cylindrical (Spherical)" map projection parameters without bothering about axis swapping, because the later is described by the   {@code Axis["…"]}elements in the enclosing   {@code ProjectedCRS} instance.</li><li>But if this  {@code MathTransform} is formatted directly (not as a component of {@code ProjectedCRS}), then we want to format it as a matrix, otherwise the users would have no way to see that an axis swapping has been applied.</li> </ul> The   {@code Semaphores.PROJCS} flag is SIS internal mechanism for distinguish the two above-cited cases.
 * @return The map projection parameters if they are an accurate description of this transform,or the generic affine parameters in case of doubt.
 */
@Override public ParameterValueGroup getParameterValues(){
  return isDefinitive || Semaphores.query(Semaphores.PROJCS) ? parameters : super.getParameterValues();
}
Program: 92176
Project: 92176
Buggy source:
/** 
 * Compares this affine transform with the given object for equality. Parameters are compared only if the other object is also an instance of   {@code ParameterizedAffine}in order to preserve the   {@link AffineTransform#equals(Object)} <cite>symmetricity</cite> contract.
 * @param object The object to compare with this transform for equality.
 * @return {@code true} if the given object is of appropriate class (as explained in the{@link AffineTransform2D#equals(Object)} documentation) and the coefficients are the same.
 */
@Override public boolean equals(final Object object){
  if (super.equals(object)) {
    if (object instanceof ParameterizedAffine) {
      final ParameterizedAffine that=(ParameterizedAffine)object;
      return Objects.equals(this.parameters,that.parameters);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Compares this affine transform with the given object for equality. Parameters are compared only if the other object is also an instance of   {@code ParameterizedAffine}in order to preserve the   {@link AffineTransform#equals(Object)} <cite>symmetricity</cite> contract.
 * @param object The object to compare with this transform for equality.
 * @return {@code true} if the given object is of appropriate class (as explained in the{@link AffineTransform2D#equals(Object)} documentation) and the coefficients are the same.
 */
@Override public boolean equals(final Object object){
  if (super.equals(object)) {
    if (object instanceof ParameterizedAffine) {
      final ParameterizedAffine that=(ParameterizedAffine)object;
      return (this.isDefinitive == that.isDefinitive) && Objects.equals(this.parameters,that.parameters);
    }
    return true;
  }
  return false;
}
Program: 92177
Project: 92177
Buggy source:
/** 
 * Returns a name for a coordinate system. Examples: <ul> <li>Ellipsoidal CS: North (°), East (°).</li> <li>Cartesian CS: East (km), North (km).</li> <li>Compound CS: East (km), North (km), Up (m).</li> </ul>
 * @param buffer A buffer filled with the name header.
 * @param axes The axes.
 * @return A name for the given coordinate system type and axes.
 */
static String createName(final StringBuilder buffer,final CoordinateSystemAxis[] axes){
  String separator="String_Node_Str";
  for (  final CoordinateSystemAxis axis : axes) {
    buffer.append(separator).append(Types.getCodeLabel(axis.getDirection()));
    separator="String_Node_Str";
    final Unit<?> unit=axis.getUnit();
    if (unit != null) {
      final String symbol=unit.toString();
      if (!symbol.isEmpty()) {
        buffer.append("String_Node_Str").append(symbol).append(')');
      }
    }
  }
  return buffer.append('.').toString();
}

Fixed version (ground truth):
/** 
 * Returns a name for a coordinate system. Examples: <ul> <li>Ellipsoidal CS: North (°), East (°).</li> <li>Cartesian CS: East (km), North (km).</li> <li>Compound CS: East (km), North (km), Up (m).</li> </ul>
 * @param buffer A buffer filled with the name header.
 * @param axes The axes.
 * @return A name for the given coordinate system type and axes.
 */
static String createName(final StringBuilder buffer,final CoordinateSystemAxis[] axes){
  String separator="String_Node_Str";
  for (  final CoordinateSystemAxis axis : axes) {
    buffer.append(separator).append(Types.getCodeLabel(axis.getDirection()));
    separator="String_Node_Str";
    final String symbol=Utilities.toString(axis.getUnit());
    if (symbol != null && !symbol.isEmpty()) {
      buffer.append("String_Node_Str").append(symbol).append(')');
    }
  }
  return buffer.append('.').toString();
}
Program: 92178
Project: 92178
Buggy source:
/** 
 * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given type.
 * @param type One of {@link #SP1},   {@link #SP2} or {@link #BELGIUM} constants.
 * @return The roles map to give to super-class constructor.
 */
@SuppressWarnings("String_Node_Str") private static Map<ParameterRole,ParameterDescriptor<Double>> roles(final byte type){
  final EnumMap<ParameterRole,ParameterDescriptor<Double>> roles=new EnumMap<ParameterRole,ParameterDescriptor<Double>>(ParameterRole.class);
  roles.put(ParameterRole.SCALE_FACTOR,LambertConformal1SP.SCALE_FACTOR);
switch (type) {
case SP1:
{
      roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal1SP.CENTRAL_MERIDIAN);
      roles.put(ParameterRole.FALSE_EASTING,LambertConformal1SP.FALSE_EASTING);
      roles.put(ParameterRole.FALSE_NORTHING,LambertConformal1SP.FALSE_NORTHING);
      break;
    }
default :
{
    roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_EASTING,LambertConformal2SP.EASTING_AT_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_NORTHING,LambertConformal2SP.NORTHING_AT_FALSE_ORIGIN);
    break;
  }
}
return roles;
}

Fixed version (ground truth):
/** 
 * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given type.
 * @param type One of {@link #SP1},   {@link #SP2} or {@link #BELGIUM} constants.
 * @return The roles map to give to super-class constructor.
 */
private static Map<ParameterRole,ParameterDescriptor<Double>> roles(final byte type){
  final EnumMap<ParameterRole,ParameterDescriptor<Double>> roles=new EnumMap<ParameterRole,ParameterDescriptor<Double>>(ParameterRole.class);
  roles.put(ParameterRole.SCALE_FACTOR,LambertConformal1SP.SCALE_FACTOR);
switch (type) {
case SP1:
{
      roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal1SP.CENTRAL_MERIDIAN);
      roles.put(ParameterRole.FALSE_EASTING,LambertConformal1SP.FALSE_EASTING);
      roles.put(ParameterRole.FALSE_NORTHING,LambertConformal1SP.FALSE_NORTHING);
      break;
    }
default :
{
    roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_EASTING,LambertConformal2SP.EASTING_AT_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_NORTHING,LambertConformal2SP.NORTHING_AT_FALSE_ORIGIN);
    break;
  }
}
return roles;
}
Program: 92179
Project: 92179
Buggy source:
/** 
 * Returns the parameter values for this map projection.
 * @return The map projection parameters if they are an accurate description of this transform,or the generic affine parameters in case of doubt.
 */
@Override public ParameterValueGroup getParameterValues(){
  return isDefinitive ? parameters : super.getParameterValues();
}

Fixed version (ground truth):
/** 
 * Returns the parameter values for this map projection. <p><b>Hack:</b> this method normally returns the matrix parameters in case of doubt. However if  {@link Semaphores#PROJCS} is set, then this method returns the map projection parameters evenif they are not a complete description of this math transform. This internal hack shall be used only by  {@link org.apache.sis.referencing.operation.DefaultSingleOperation}.</p> <p><b>Use case of above hack:</b> consider an "Equidistant Cylindrical (Spherical)" map projection from a   {@code GeographiCRS} base using (latitude, longitude) axis order. We need to concatenate anaffine transform performing the axis swapping before the actual map projection. The concatenated transform is part of  {@code SingleOperation}, which is itself part of   {@code ProjecteCRS}. Consequently we have two conflicting needs:</p> <ul> <li>If this method is queried from a   {@code SingleOperation} instance (usually indirectly as part of a{@code ProjectedCRS}), then we want to return the "Equidistant Cylindrical (Spherical)" map projection parameters without bothering about axis swapping, because the later is described by the   {@code Axis["…"]}elements in the enclosing   {@code ProjectedCRS} instance.</li><li>But if this  {@code MathTransform} is formatted directly (not as a component of {@code ProjectedCRS}), then we want to format it as a matrix, otherwise the users would have no way to see that an axis swapping has been applied.</li> </ul> The   {@code Semaphores.PROJCS} flag is SIS internal mechanism for distinguish the two above-cited cases.
 * @return The map projection parameters if they are an accurate description of this transform,or the generic affine parameters in case of doubt.
 */
@Override public ParameterValueGroup getParameterValues(){
  return isDefinitive || Semaphores.query(Semaphores.PROJCS) ? parameters : super.getParameterValues();
}
Program: 92180
Project: 92180
Buggy source:
/** 
 * Compares this affine transform with the given object for equality. Parameters are compared only if the other object is also an instance of   {@code ParameterizedAffine}in order to preserve the   {@link AffineTransform#equals(Object)} <cite>symmetricity</cite> contract.
 * @param object The object to compare with this transform for equality.
 * @return {@code true} if the given object is of appropriate class (as explained in the{@link AffineTransform2D#equals(Object)} documentation) and the coefficients are the same.
 */
@Override public boolean equals(final Object object){
  if (super.equals(object)) {
    if (object instanceof ParameterizedAffine) {
      final ParameterizedAffine that=(ParameterizedAffine)object;
      return Objects.equals(this.parameters,that.parameters);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Compares this affine transform with the given object for equality. Parameters are compared only if the other object is also an instance of   {@code ParameterizedAffine}in order to preserve the   {@link AffineTransform#equals(Object)} <cite>symmetricity</cite> contract.
 * @param object The object to compare with this transform for equality.
 * @return {@code true} if the given object is of appropriate class (as explained in the{@link AffineTransform2D#equals(Object)} documentation) and the coefficients are the same.
 */
@Override public boolean equals(final Object object){
  if (super.equals(object)) {
    if (object instanceof ParameterizedAffine) {
      final ParameterizedAffine that=(ParameterizedAffine)object;
      return (this.isDefinitive == that.isDefinitive) && Objects.equals(this.parameters,that.parameters);
    }
    return true;
  }
  return false;
}
Program: 92181
Project: 92181
Buggy source:
/** 
 * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given type.
 * @param type One of {@link #SP1},   {@link #SP2} or {@link #BELGIUM} constants.
 * @return The roles map to give to super-class constructor.
 */
@SuppressWarnings("String_Node_Str") private static Map<ParameterRole,ParameterDescriptor<Double>> roles(final byte type){
  final EnumMap<ParameterRole,ParameterDescriptor<Double>> roles=new EnumMap<>(ParameterRole.class);
  roles.put(ParameterRole.SCALE_FACTOR,LambertConformal1SP.SCALE_FACTOR);
switch (type) {
case SP1:
{
      roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal1SP.CENTRAL_MERIDIAN);
      roles.put(ParameterRole.FALSE_EASTING,LambertConformal1SP.FALSE_EASTING);
      roles.put(ParameterRole.FALSE_NORTHING,LambertConformal1SP.FALSE_NORTHING);
      break;
    }
default :
{
    roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_EASTING,LambertConformal2SP.EASTING_AT_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_NORTHING,LambertConformal2SP.NORTHING_AT_FALSE_ORIGIN);
    break;
  }
}
return roles;
}

Fixed version (ground truth):
/** 
 * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given type.
 * @param type One of {@link #SP1},   {@link #SP2} or {@link #BELGIUM} constants.
 * @return The roles map to give to super-class constructor.
 */
private static Map<ParameterRole,ParameterDescriptor<Double>> roles(final byte type){
  final EnumMap<ParameterRole,ParameterDescriptor<Double>> roles=new EnumMap<>(ParameterRole.class);
  roles.put(ParameterRole.SCALE_FACTOR,LambertConformal1SP.SCALE_FACTOR);
switch (type) {
case SP1:
{
      roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal1SP.CENTRAL_MERIDIAN);
      roles.put(ParameterRole.FALSE_EASTING,LambertConformal1SP.FALSE_EASTING);
      roles.put(ParameterRole.FALSE_NORTHING,LambertConformal1SP.FALSE_NORTHING);
      break;
    }
default :
{
    roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_EASTING,LambertConformal2SP.EASTING_AT_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_NORTHING,LambertConformal2SP.NORTHING_AT_FALSE_ORIGIN);
    break;
  }
}
return roles;
}
Program: 92184
Project: 92184
Buggy source:
/** 
 * Creates the "NTF (Paris) / Lambert zone II" CRS.
 * @see HardCodedCRS#NTF
 * @todo Move this kind of code in a helper class.
 * @todo Accuracy problem in formatting of scale factor in DefaultParameterValueGroup.toString().
 */
private static DefaultProjectedCRS create() throws FactoryException {
  final MathTransformFactory mtFactory=DefaultFactories.forBuildin(MathTransformFactory.class);
  final ParameterValueGroup p=mtFactory.getDefaultParameters("String_Node_Str");
  p.parameter("String_Node_Str").setValue(52,NonSI.GRADE);
  p.parameter("String_Node_Str").setValue(0.99987742);
  p.parameter("String_Node_Str").setValue(600000,SI.METRE);
  p.parameter("String_Node_Str").setValue(2200000,SI.METRE);
  final MathTransform mt=mtFactory.createBaseToDerived(HardCodedCRS.NTF,p,HardCodedCS.PROJECTED);
  final DefaultConversion conversion=new DefaultConversion(Collections.singletonMap(DefaultConversion.NAME_KEY,"String_Node_Str"),mtFactory.getLastMethodUsed(),mt);
  return new DefaultProjectedCRS(Collections.singletonMap(DefaultConversion.NAME_KEY,"String_Node_Str"),conversion,HardCodedCRS.NTF,HardCodedCS.PROJECTED);
}

Fixed version (ground truth):
/** 
 * Creates the "NTF (Paris) / Lambert zone II" CRS.
 * @see HardCodedCRS#NTF
 * @todo Move this kind of code in a helper class.
 */
private static DefaultProjectedCRS create() throws FactoryException {
  final MathTransformFactory mtFactory=DefaultFactories.forBuildin(MathTransformFactory.class);
  final ParameterValueGroup p=mtFactory.getDefaultParameters("String_Node_Str");
  p.parameter("String_Node_Str").setValue(52,NonSI.GRADE);
  p.parameter("String_Node_Str").setValue(0.99987742);
  p.parameter("String_Node_Str").setValue(600000,SI.METRE);
  p.parameter("String_Node_Str").setValue(2200000,SI.METRE);
  final MathTransform mt=mtFactory.createBaseToDerived(HardCodedCRS.NTF,p,HardCodedCS.PROJECTED);
  final DefaultConversion conversion=new DefaultConversion(Collections.singletonMap(DefaultConversion.NAME_KEY,"String_Node_Str"),mtFactory.getLastMethodUsed(),mt);
  return new DefaultProjectedCRS(Collections.singletonMap(DefaultConversion.NAME_KEY,"String_Node_Str"),conversion,HardCodedCRS.NTF,HardCodedCS.PROJECTED);
}
Program: 92185
Project: 92185
Buggy source:
/** 
 * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given type.
 * @param type One of {@link #SP1},   {@link #SP2} or {@link #BELGIUM} constants.
 * @return The roles map to give to super-class constructor.
 */
@SuppressWarnings("String_Node_Str") private static Map<ParameterRole,ParameterDescriptor<Double>> roles(final byte type){
  final EnumMap<ParameterRole,ParameterDescriptor<Double>> roles=new EnumMap<>(ParameterRole.class);
  roles.put(ParameterRole.SCALE_FACTOR,LambertConformal1SP.SCALE_FACTOR);
switch (type) {
case SP1:
{
      roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal1SP.CENTRAL_MERIDIAN);
      roles.put(ParameterRole.FALSE_EASTING,LambertConformal1SP.FALSE_EASTING);
      roles.put(ParameterRole.FALSE_NORTHING,LambertConformal1SP.FALSE_NORTHING);
      break;
    }
default :
{
    roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_EASTING,LambertConformal2SP.EASTING_AT_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_NORTHING,LambertConformal2SP.NORTHING_AT_FALSE_ORIGIN);
    break;
  }
}
return roles;
}

Fixed version (ground truth):
/** 
 * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given type.
 * @param type One of {@link #SP1},   {@link #SP2} or {@link #BELGIUM} constants.
 * @return The roles map to give to super-class constructor.
 */
private static Map<ParameterRole,ParameterDescriptor<Double>> roles(final byte type){
  final EnumMap<ParameterRole,ParameterDescriptor<Double>> roles=new EnumMap<>(ParameterRole.class);
  roles.put(ParameterRole.SCALE_FACTOR,LambertConformal1SP.SCALE_FACTOR);
switch (type) {
case SP1:
{
      roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal1SP.CENTRAL_MERIDIAN);
      roles.put(ParameterRole.FALSE_EASTING,LambertConformal1SP.FALSE_EASTING);
      roles.put(ParameterRole.FALSE_NORTHING,LambertConformal1SP.FALSE_NORTHING);
      break;
    }
default :
{
    roles.put(ParameterRole.CENTRAL_MERIDIAN,LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_EASTING,LambertConformal2SP.EASTING_AT_FALSE_ORIGIN);
    roles.put(ParameterRole.FALSE_NORTHING,LambertConformal2SP.NORTHING_AT_FALSE_ORIGIN);
    break;
  }
}
return roles;
}
Program: 92187
Project: 92187
Buggy source:
/** 
 * Process to the WKT formatting of the inverse transform.
 */
@Override protected String formatTo(final Formatter formatter){
  formatter.append(ContextualParameters.this);
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * Formats a <cite>Well Known Text</cite> version 1 (WKT 1) element for a transform using this group of parameters. <div class="note"><b>Compatibility note:</b>  {@code Param_MT} is defined in the WKT 1 specification only.If the  {@linkplain Formatter#getConvention() formatter convention} is set to WKT 2,then this method silently uses the WKT 1 convention without raising an error.</div>
 * @return {@code "Param_MT"}.
 */
@Override protected String formatTo(final Formatter formatter){
  if (inverse) {
    formatter.append(new WKT(false));
    return "String_Node_Str";
  }
 else {
    WKTUtilities.appendParamMT(ContextualParameters.this,formatter);
    return "String_Node_Str";
  }
}
Program: 92188
Project: 92188
Buggy source:
/** 
 * Returns a modifiable clone of this parameter value group.
 * @return A clone of this parameter value group.
 */
@Override public ContextualParameters clone(){
  final ParameterValue<?>[] param=Arrays.copyOf(values,descriptor.descriptors().size());
  for (int i=0; i < param.length; i++) {
    final ParameterValue<?> p=param[i];
    if (p == null) {
      break;
    }
    param[i]=param[i].clone();
  }
  final ContextualParameters clone;
  try {
    clone=(ContextualParameters)super.clone();
  }
 catch (  CloneNotSupportedException e) {
    throw new AssertionError(e);
  }
  clone.values=param;
  clone.normalize=normalize.clone();
  clone.denormalize=denormalize.clone();
  return clone;
}

Fixed version (ground truth):
/** 
 * Returns a modifiable clone of this parameter value group.
 * @return A clone of this parameter value group.
 */
@Override public ContextualParameters clone(){
  final ParameterValue<?>[] param=Arrays.copyOf(values,descriptor.descriptors().size());
  for (int i=0; i < param.length; i++) {
    final ParameterValue<?> p=param[i];
    if (p == null) {
      break;
    }
    param[i]=param[i].clone();
  }
  final ContextualParameters clone=(ContextualParameters)super.clone();
  clone.values=param;
  clone.normalize=normalize.clone();
  clone.denormalize=denormalize.clone();
  return clone;
}
Program: 92190
Project: 92190
Buggy source:
/** 
 * Returns the parameter values for this map projection.
 * @return The map projection parameters if they are an accurate description of this transform,or the generic affine parameters in case of doubt.
 */
@Override public ParameterValueGroup getParameterValues(){
  return isDefinitive ? parameters : super.getParameterValues();
}

Fixed version (ground truth):
/** 
 * Returns the parameter values for this map projection. <p><b>Hack:</b> this method normally returns the matrix parameters in case of doubt. However if  {@link Semaphores#PROJCS} is set, then this method returns the map projection parameters evenif they are not a complete description of this math transform. This internal hack shall be used only by  {@link org.apache.sis.referencing.operation.DefaultSingleOperation}.</p> <p><b>Use case of above hack:</b> consider an "Equidistant Cylindrical (Spherical)" map projection from a   {@code GeographiCRS} base using (latitude, longitude) axis order. We need to concatenate anaffine transform performing the axis swapping before the actual map projection. The concatenated transform is part of  {@code SingleOperation}, which is itself part of   {@code ProjecteCRS}. Consequently we have two conflicting needs:</p> <ul> <li>If this method is queried from a   {@code SingleOperation} instance (usually indirectly as part of a{@code ProjectedCRS}), then we want to return the "Equidistant Cylindrical (Spherical)" map projection parameters without bothering about axis swapping, because the later is described by the   {@code Axis["…"]}elements in the enclosing   {@code ProjectedCRS} instance.</li><li>But if this  {@code MathTransform} is formatted directly (not as a component of {@code ProjectedCRS}), then we want to format it as a matrix, otherwise the users would have no way to see that an axis swapping has been applied.</li> </ul> The   {@code Semaphores.PROJCS} flag is SIS internal mechanism for distinguish the two above-cited cases.
 * @return The map projection parameters if they are an accurate description of this transform,or the generic affine parameters in case of doubt.
 */
@Override public ParameterValueGroup getParameterValues(){
  return isDefinitive || Semaphores.query(Semaphores.PROJCS) ? parameters : super.getParameterValues();
}
Program: 92191
Project: 92191
Buggy source:
/** 
 * Compares this affine transform with the given object for equality. Parameters are compared only if the other object is also an instance of   {@code ParameterizedAffine}in order to preserve the   {@link AffineTransform#equals(Object)} <cite>symmetricity</cite> contract.
 * @param object The object to compare with this transform for equality.
 * @return {@code true} if the given object is of appropriate class (as explained in the{@link AffineTransform2D#equals(Object)} documentation) and the coefficients are the same.
 */
@Override public boolean equals(final Object object){
  if (super.equals(object)) {
    if (object instanceof ParameterizedAffine) {
      final ParameterizedAffine that=(ParameterizedAffine)object;
      return Objects.equals(this.parameters,that.parameters);
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Compares this affine transform with the given object for equality. Parameters are compared only if the other object is also an instance of   {@code ParameterizedAffine}in order to preserve the   {@link AffineTransform#equals(Object)} <cite>symmetricity</cite> contract.
 * @param object The object to compare with this transform for equality.
 * @return {@code true} if the given object is of appropriate class (as explained in the{@link AffineTransform2D#equals(Object)} documentation) and the coefficients are the same.
 */
@Override public boolean equals(final Object object){
  if (super.equals(object)) {
    if (object instanceof ParameterizedAffine) {
      final ParameterizedAffine that=(ParameterizedAffine)object;
      return (this.isDefinitive == that.isDefinitive) && Objects.equals(this.parameters,that.parameters);
    }
    return true;
  }
  return false;
}
Program: 92192
Project: 92192
Buggy source:
/** 
 * Returns the parameter value of the given name. Before the call to   {@link #completeTransform completeTransform(…)}, this method can be used for setting parameter values like below:  {@preformat javaparameter("Scale factor").setValue(0.9996);   // Scale factor of Universal Transverse Mercator (UTM) projections.}After the call to   {@code completeTransform(…)}, the returned parameters are read-only.
 * @param name The name of the parameter to search.
 * @return The parameter value for the given name.
 * @throws ParameterNotFoundException if there is no parameter of the given name.
 */
@Override public ParameterValue<?> parameter(final String name) throws ParameterNotFoundException {
  final GeneralParameterDescriptor desc=descriptor.descriptor(name);
  if (!(desc instanceof ParameterDescriptor<?>)) {
    throw parameterNotFound(name);
  }
  for (int i=0; i < values.length; i++) {
    ParameterValue<?> p=values[i];
    if (p == null) {
      ensureModifiable();
      p=((ParameterDescriptor<?>)desc).createValue();
      values[i]=p;
    }
 else     if (p.getDescriptor() != desc) {
      continue;
    }
    return p;
  }
  ensureModifiable();
  throw new IllegalStateException(Errors.format(Errors.Keys.UnexpectedChange_1,descriptor.getName()));
}

Fixed version (ground truth):
/** 
 * Returns the parameter value of the given name. Before the call to   {@link #completeTransform completeTransform(…)}, this method can be used for setting parameter values like below:  {@preformat javaparameter("Scale factor").setValue(0.9996);   // Scale factor of Universal Transverse Mercator (UTM) projections.}After the call to   {@code completeTransform(…)}, the returned parameters are read-only.
 * @param name The name of the parameter to search.
 * @return The parameter value for the given name.
 * @throws ParameterNotFoundException if there is no parameter of the given name.
 */
@Override public ParameterValue<?> parameter(final String name) throws ParameterNotFoundException {
  final GeneralParameterDescriptor desc=descriptor.descriptor(name);
  if (!(desc instanceof ParameterDescriptor<?>)) {
    throw parameterNotFound(name);
  }
  for (int i=0; i < values.length; i++) {
    ParameterValue<?> p=values[i];
    if (p == null) {
      p=((ParameterDescriptor<?>)desc).createValue();
      values[i]=p;
    }
 else     if (p.getDescriptor() != desc) {
      continue;
    }
    return p;
  }
  if (isFrozen) {
    return ((ParameterDescriptor<?>)desc).createValue();
  }
  throw new IllegalStateException(Errors.format(Errors.Keys.UnexpectedChange_1,descriptor.getName()));
}
Program: 92195
Project: 92195
Buggy source:
/** 
 * Tests   {@link ContextualParameters#completeTransform(MathTransformFactory,MathTransform)}with identity normalization / denormalization transform. The complete transform should be equals to the kernel (often the same instance, but not necessarily because of caching).
 * @throws FactoryException Should never happen.
 */
@Test public void testSameTransform() throws FactoryException {
  final ContextualParameters p=create(1,1);
  final MathTransform kernel=MathTransforms.linear(3,4);
  assertEquals(kernel,p.completeTransform(DefaultMathTransformFactoryTest.factory(),kernel));
  try {
    p.parameter("String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
    final String message=e.getMessage();
    assertTrue(message,message.contains("String_Node_Str"));
  }
}

Fixed version (ground truth):
/** 
 * Tests   {@link ContextualParameters#completeTransform(MathTransformFactory,MathTransform)}with identity normalization / denormalization transform. The complete transform should be equals to the kernel (often the same instance, but not necessarily because of caching).
 * @throws FactoryException Should never happen.
 */
@Test public void testSameTransform() throws FactoryException {
  final ContextualParameters p=create(1,1);
  p.parameter("String_Node_Str").setValue(4);
  final MathTransform kernel=MathTransforms.linear(3,4);
  assertEquals(kernel,p.completeTransform(DefaultMathTransformFactoryTest.factory(),kernel));
  try {
    p.parameter("String_Node_Str").setValue(10);
    fail("String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    final String message=e.getMessage();
    assertTrue(message,message.contains("String_Node_Str"));
  }
}
Program: 92196
Project: 92196
Buggy source:
/** 
 * Compares this international string with the specified object for equality.
 * @param object The object to compare with this international string.
 * @return {@code true} if the given object is equal to this string.
 */
@Override public final boolean equals(final Object object){
  if (object == null || object.getClass() != getClass()) {
    return false;
  }
  final ResourceInternationalString that=(ResourceInternationalString)object;
  return (key == that.key) && (hasArguments == that.hasArguments) && Objects.equals(arguments,that.arguments);
}

Fixed version (ground truth):
/** 
 * Compares this international string with the specified object for equality.
 * @param object The object to compare with this international string.
 * @return {@code true} if the given object is equal to this string.
 */
@Override public final boolean equals(final Object object){
  if (object == null || object.getClass() != getClass()) {
    return false;
  }
  final ResourceInternationalString that=(ResourceInternationalString)object;
  return (key == that.key) && (hasArguments == that.hasArguments) && Objects.deepEquals(arguments,that.arguments);
}
Program: 92197
Project: 92197
Buggy source:
/** 
 * Compares this international string with the specified object for equality.
 * @param object The object to compare with this international string.
 * @return {@code true} if the given object is equal to this string.
 */
@Override public final boolean equals(final Object object){
  if (object == null || object.getClass() != getClass()) {
    return false;
  }
  final ResourceInternationalString that=(ResourceInternationalString)object;
  return (key == that.key) && (hasArguments == that.hasArguments) && Objects.equals(arguments,that.arguments);
}

Fixed version (ground truth):
/** 
 * Compares this international string with the specified object for equality.
 * @param object The object to compare with this international string.
 * @return {@code true} if the given object is equal to this string.
 */
@Override public final boolean equals(final Object object){
  if (object == null || object.getClass() != getClass()) {
    return false;
  }
  final ResourceInternationalString that=(ResourceInternationalString)object;
  return (key == that.key) && (hasArguments == that.hasArguments) && Objects.deepEquals(arguments,that.arguments);
}
Program: 92198
Project: 92198
Buggy source:
/** 
 * Compares this international string with the specified object for equality.
 * @param object The object to compare with this international string.
 * @return {@code true} if the given object is equal to this string.
 */
@Override public final boolean equals(final Object object){
  if (object == null || object.getClass() != getClass()) {
    return false;
  }
  final ResourceInternationalString that=(ResourceInternationalString)object;
  return (key == that.key) && (hasArguments == that.hasArguments) && Objects.equals(arguments,that.arguments);
}

Fixed version (ground truth):
/** 
 * Compares this international string with the specified object for equality.
 * @param object The object to compare with this international string.
 * @return {@code true} if the given object is equal to this string.
 */
@Override public final boolean equals(final Object object){
  if (object == null || object.getClass() != getClass()) {
    return false;
  }
  final ResourceInternationalString that=(ResourceInternationalString)object;
  return (key == that.key) && (hasArguments == that.hasArguments) && Objects.deepEquals(arguments,that.arguments);
}
Program: 92200
Project: 92200
Buggy source:
/** 
 * Creates the metadata objects to be used for the test.
 */
public PrunerTest(){
  metadata=new DefaultMetadata();
  identification=new DefaultDataIdentification();
  extent=new DefaultExtent();
  bbox=new DefaultGeographicBoundingBox();
  extent.setGeographicElements(singleton(bbox));
  identification.setExtents(singleton(extent));
  metadata.setIdentificationInfo(singleton(identification));
}

Fixed version (ground truth):
/** 
 * Creates the metadata objects to be used for the test.
 */
public PrunerTest(){
  metadata=new DefaultMetadata();
  identification=new DefaultDataIdentification();
  scale=new DefaultRepresentativeFraction();
  extent=new DefaultExtent();
  bbox=new DefaultGeographicBoundingBox();
  extent.setGeographicElements(singleton(bbox));
  identification.setExtents(singleton(extent));
  identification.setSpatialResolutions(singleton(new DefaultResolution(scale)));
  metadata.setIdentificationInfo(singleton(identification));
}
Program: 92202
Project: 92202
Buggy source:
/** 
 * Returns the GeoAPI interface implemented by this class. The SIS implementation returns   {@code OperationMethod.class}.  {@note Subclasses usually do not need to override this method since GeoAPI does not define<code>OperationMethod</code> sub-interface. Overriding possibility is left mostly for implementors who wish to extend GeoAPI with their own set of interfaces.}
 * @return {@code OperationMethod.class} or a user-defined sub-interface.
 */
@Override public Class<? extends OperationMethod> getInterface(){
  return OperationMethod.class;
}

Fixed version (ground truth):
/** 
 * Returns the GeoAPI interface implemented by this class. The SIS implementation returns   {@code OperationMethod.class}. <div class="note"><b>Note for implementors:</b> Subclasses usually do not need to override this method since GeoAPI does not define   {@code OperationMethod}sub-interface. Overriding possibility is left mostly for implementors who wish to extend GeoAPI with their own set of interfaces.</div>
 * @return {@code OperationMethod.class} or a user-defined sub-interface.
 */
@Override public Class<? extends OperationMethod> getInterface(){
  return OperationMethod.class;
}
Program: 92203
Project: 92203
Buggy source:
/** 
 * Concatenates in an optimized way a   {@link MathTransform} {@code other} to this{@code MathTransform}. This implementation can optimize some concatenation with  {@link LinearTransform1D} and {@link ExponentialTransform1D}.
 * @param other The math transform to apply.
 * @param applyOtherFirst {@code true} if the transformation order is {@code other}followed by   {@code this}, or   {@code false} if the transformation order is{@code this} followed by {@code other}.
 * @return The combined math transform, or {@code null} if no optimized combinedtransform is available.
 */
@Override final MathTransform concatenate(final MathTransform other,final boolean applyOtherFirst){
  if (other instanceof LinearTransform1D) {
    final LinearTransform1D linear=(LinearTransform1D)other;
    if (applyOtherFirst) {
      if (linear.offset == 0 && linear.scale > 0) {
        return create(getBase(),Math.log(linear.scale) / getLogBase() + getOffset());
      }
    }
 else {
      final double newBase=Math.pow(getBase(),1 / linear.scale);
      if (!Double.isNaN(newBase)) {
        return create(newBase,linear.scale * getOffset() + linear.offset);
      }
    }
  }
 else   if (other instanceof ExponentialTransform1D) {
    return ((ExponentialTransform1D)other).concatenateLog(this,!applyOtherFirst);
  }
  return super.concatenate(other,applyOtherFirst);
}

Fixed version (ground truth):
/** 
 * Concatenates in an optimized way a   {@link MathTransform} {@code other} to this{@code MathTransform}. This implementation can optimize some concatenation with  {@link LinearTransform1D} and {@link ExponentialTransform1D}.
 * @param other The math transform to apply.
 * @param applyOtherFirst {@code true} if the transformation order is {@code other}followed by   {@code this}, or   {@code false} if the transformation order is{@code this} followed by {@code other}.
 * @return The combined math transform, or {@code null} if no optimized combinedtransform is available.
 */
@Override final MathTransform concatenate(final MathTransform other,final boolean applyOtherFirst){
  if (other instanceof LinearTransform1D) {
    final LinearTransform1D linear=(LinearTransform1D)other;
    if (applyOtherFirst) {
      if (linear.offset == 0 && linear.scale > 0) {
        return create(getBase(),transform(linear.scale));
      }
    }
 else {
      final double newBase=pow(1 / linear.scale);
      if (!Double.isNaN(newBase)) {
        return create(newBase,linear.transform(getOffset()));
      }
    }
  }
 else   if (other instanceof ExponentialTransform1D) {
    return ((ExponentialTransform1D)other).concatenateLog(this,!applyOtherFirst);
  }
  return super.concatenate(other,applyOtherFirst);
}
Program: 92204
Project: 92204
Buggy source:
/** 
 * Tests the concatenation of a linear operation after the exponential one.
 * @throws TransformException should never happen.
 */
@Test @DependsOnMethod("String_Node_Str") public void testAffinePostConcatenation() throws TransformException {
  initialize(MathTransforms.concatenate(ExponentialTransform1D.create(BASE,SCALE),LinearTransform1D.create(C1,C0)));
  for (int i=0; i < values.length; i++) {
    expected[i]=C0 + C1 * (SCALE * pow(BASE,values[i]));
  }
  toleranceModifier=ToleranceModifiers.concatenate(toleranceModifier,ToleranceModifiers.scale(EnumSet.of(CalculationType.INVERSE_TRANSFORM),1E+8));
  run(ConcatenatedTransformDirect1D.class);
}

Fixed version (ground truth):
/** 
 * Tests the concatenation of a linear operation after the exponential one.
 * @throws TransformException should never happen.
 */
@Test @DependsOnMethod("String_Node_Str") public void testAffinePostConcatenation() throws TransformException {
  messageOnFailure="String_Node_Str";
  testAffinePostConcatenation(10);
  messageOnFailure="String_Node_Str";
  testAffinePostConcatenation(E);
  messageOnFailure="String_Node_Str";
  testAffinePostConcatenation(8.4);
}
Program: 92205
Project: 92205
Buggy source:
/** 
 * A single (non-concatenated) test case.
 * @throws TransformException should never happen.
 */
@Test public void testSingle() throws TransformException {
  initialize(ExponentialTransform1D.create(BASE,SCALE));
  for (int i=0; i < values.length; i++) {
    expected[i]=SCALE * pow(BASE,values[i]);
  }
  run(ExponentialTransform1D.class);
}

Fixed version (ground truth):
/** 
 * A single (non-concatenated) test case without scale.
 * @throws TransformException should never happen.
 */
@Test public void testSingle() throws TransformException {
  messageOnFailure="String_Node_Str";
  testSingle(10,1);
  messageOnFailure="String_Node_Str";
  testSingle(E,1);
  messageOnFailure="String_Node_Str";
  testSingle(8.4,1);
}
Program: 92206
Project: 92206
Buggy source:
/** 
 * Tests the concatenation of a linear operation before the exponential one.
 * @throws TransformException should never happen.
 */
@Test @DependsOnMethod("String_Node_Str") public void testAffinePreConcatenation() throws TransformException {
  initialize(MathTransforms.concatenate(LinearTransform1D.create(C1,C0),ExponentialTransform1D.create(BASE,SCALE)));
  for (int i=0; i < values.length; i++) {
    expected[i]=SCALE * pow(BASE,C0 + C1 * values[i]);
  }
  run(ExponentialTransform1D.class);
  final double lnBase=log(BASE);
  final double offset=-log(SCALE) / lnBase;
  final MathTransform1D log=LogarithmicTransform1D.create(BASE,offset);
  for (int i=0; i < values.length; i++) {
    expected[i]=log(expected[i]) / lnBase + offset;
  }
  transform=(LinearTransform1D)MathTransforms.concatenate(transform,log);
  run(LinearTransform1D.class);
  assertEquals(C1,((LinearTransform1D)transform).scale,1E-12);
  assertEquals(C0,((LinearTransform1D)transform).offset,1E-12);
}

Fixed version (ground truth):
/** 
 * Tests the concatenation of a linear operation before the exponential one. This test also opportunistically verifies that the technic documented in   {@link ExponentialTransform1D}javadoc for finding back the original coefficients works.
 * @throws TransformException should never happen.
 */
@Test @DependsOnMethod("String_Node_Str") public void testAffinePreConcatenation() throws TransformException {
  messageOnFailure="String_Node_Str";
  testAffinePreConcatenation(10);
  messageOnFailure="String_Node_Str";
  testAffinePreConcatenation(E);
  messageOnFailure="String_Node_Str";
  testAffinePreConcatenation(8.4);
}
Program: 92207
Project: 92207
Buggy source:
/** 
 * Tests the current transform using the   {@link #values} as input points, and comparing withthe  {@link #expected} values.
 */
private void run(final Class<? extends MathTransform1D> expectedType) throws TransformException {
  assertInstanceOf("String_Node_Str",expectedType,transform);
  assertFalse(transform.isIdentity());
  validate();
  verifyTransform(values,expected);
  verifyDerivative(2.5);
}

Fixed version (ground truth):
/** 
 * Tests the current transform using random values as input points, and comparing with the expected values computed using the given coefficients. The   {@link #transform} field must be set before to invoke this method.
 * @param expectedType The expected base type of the math transform.
 * @param base         The exponent base given to the {@link ExponentialTransform1D} constructor.
 * @param scale        The scale factor given to the {@link ExponentialTransform1D} constructor.
 * @param preAffine    {@code true} for applying an additional affine transform before the transform.
 * @param postAffine   {@code true} for applying an additional affine transform after the transform.
 */
private void run(final Class<? extends MathTransform1D> expectedType,final double base,final double scale,final boolean preAffine,final boolean postAffine) throws TransformException {
  assertInstanceOf("String_Node_Str",expectedType,transform);
  assertFalse(transform.isIdentity());
  validate();
  final double[] values=generateRandomCoordinates(CoordinateDomain.RANGE_10,0);
  final double[] expected=new double[values.length];
  for (int i=0; i < values.length; i++) {
    double value=values[i];
    if (preAffine) {
      value=C0 + C1 * value;
    }
    value=scale * pow(base,value);
    if (postAffine) {
      value=C0 + C1 * value;
    }
    expected[i]=value;
  }
  verifyTransform(values,expected);
  verifyDerivative(2.5);
}
Program: 92208
Project: 92208
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override @XmlElement(name="String_Node_Str",namespace=Namespaces.GMI) public Double getNominalSpatialResolution(){
  return super.getNominalSpatialResolution();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @ValueRange(minimum=0,isMinIncluded=false) @XmlElement(name="String_Node_Str",namespace=Namespaces.GMI) public Double getNominalSpatialResolution(){
  return super.getNominalSpatialResolution();
}
Program: 92210
Project: 92210
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override @XmlElement(name="String_Node_Str",namespace=Namespaces.GMI) public Double getNominalSpatialResolution(){
  return super.getNominalSpatialResolution();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override @ValueRange(minimum=0,isMinIncluded=false) @XmlElement(name="String_Node_Str",namespace=Namespaces.GMI) public Double getNominalSpatialResolution(){
  return super.getNominalSpatialResolution();
}