nus-yam/ex-repair huggingface dataset:
Program: 91850
Project: 91850
Buggy source:
/** 
 * Prints the name and authority code (if any) of the given object.
 */
private void printNameAndIdentifier(final IdentifiedObject object){
  outHeader.append(object.getName().getCode());
  final String identifier=IdentifiedObjects.toString(IdentifiedObjects.getIdentifier(object,null));
  if (identifier != null) {
    outHeader.append(' ');
    if (colors) {
      outHeader.append(X364.FOREGROUND_CYAN.sequence());
    }
    outHeader.append('(');
    outHeader.append(identifier);
    outHeader.append(')');
    if (colors) {
      outHeader.append(X364.FOREGROUND_DEFAULT.sequence());
    }
  }
  outHeader.nextLine();
}

Fixed version (ground truth):
/** 
 * Prints the name and authority code (if any) of the given object.
 * @param object      the object for which to print name and identifier.
 * @param idRequired  {@code true} for printing the name only if an identifier is present.
 * @return whether this method has printed something.
 */
private boolean printNameAndIdentifier(final IdentifiedObject object,final boolean idRequired){
  final String identifier=IdentifiedObjects.toString(IdentifiedObjects.getIdentifier(object,null));
  if (idRequired && identifier == null) {
    return false;
  }
  outHeader.append(object.getName().getCode());
  if (identifier != null) {
    outHeader.append(' ');
    if (colors) {
      outHeader.append(X364.FOREGROUND_CYAN.sequence());
    }
    outHeader.append('(');
    outHeader.append(identifier);
    outHeader.append(')');
    if (colors) {
      outHeader.append(X364.FOREGROUND_DEFAULT.sequence());
    }
  }
  if (!idRequired) {
    outHeader.nextLine();
  }
  return true;
}
Program: 91853
Project: 91853
Buggy source:
/** 
 * Returns the identified object for the specified value, creating it if needed.
 * @throws BackingStoreException if the object creation failed.
 * @see #createObject(String)
 */
final T get(final String code) throws BackingStoreException {
  T object;
  boolean success;
synchronized (objects) {
    object=objects.get(code);
    success=(object != null || !objects.containsKey(code));
  }
  if (!success) {
    try {
      object=createObject(code);
      success=true;
    }
 catch (    FactoryException exception) {
      if (!isRecoverableFailure(exception)) {
        throw new BackingStoreException(exception);
      }
      final LogRecord record=Messages.getResources(null).getLogRecord(Level.WARNING,Messages.Keys.CanNotInstantiateForIdentifier_3,type,code,getCause(exception));
      record.setLoggerName(Loggers.CRS_FACTORY);
      Logging.log(IdentifiedObjectSet.class,"String_Node_Str",record);
    }
synchronized (objects) {
      if (success) {
        if (objects.containsKey(code)) {
          final T c=JDK8.putIfAbsent(objects,code,object);
          if (c != null) {
            object=c;
          }
 else {
            codes=null;
          }
        }
      }
 else       if (JDK8.remove(objects,code,null)) {
        codes=null;
      }
    }
  }
  return object;
}

Fixed version (ground truth):
/** 
 * Returns the identified object for the specified value, creating it if needed.
 * @throws BackingStoreException if the object creation failed.
 * @see #createObject(String)
 */
final T get(final String code) throws BackingStoreException {
  T object;
  boolean success;
synchronized (objects) {
    object=objects.get(code);
    success=(object != null || !objects.containsKey(code));
  }
  if (!success) {
    try {
      object=createObject(code);
      success=true;
    }
 catch (    FactoryException exception) {
      if (!isRecoverableFailure(exception)) {
        throw new BackingStoreException(exception);
      }
      final LogRecord record=Messages.getResources(getLocale()).getLogRecord(Level.WARNING,Messages.Keys.CanNotInstantiateForIdentifier_3,type,code,getCause(exception));
      record.setLoggerName(Loggers.CRS_FACTORY);
      Logging.log(IdentifiedObjectSet.class,"String_Node_Str",record);
    }
synchronized (objects) {
      if (success) {
        if (objects.containsKey(code)) {
          final T c=JDK8.putIfAbsent(objects,code,object);
          if (c != null) {
            object=c;
          }
 else {
            codes=null;
          }
        }
      }
 else       if (JDK8.remove(objects,code,null)) {
        codes=null;
      }
    }
  }
  return object;
}
Program: 91856
Project: 91856
Buggy source:
/** 
 * Invoked by JAXB for setting the operations.
 */
private void setSteps(final CoordinateOperation[] steps) throws FactoryException {
  final List<CoordinateOperation> flattened=new ArrayList<>(steps.length);
  initialize(null,steps,flattened,DefaultFactories.forBuildin(MathTransformFactory.class),coordinateOperationAccuracy == null);
  operations=UnmodifiableArrayList.wrap(flattened.toArray(new CoordinateOperation[flattened.size()]));
}

Fixed version (ground truth):
/** 
 * Invoked by JAXB for setting the operations.
 */
private void setSteps(final CoordinateOperation[] steps) throws FactoryException {
  final List<CoordinateOperation> flattened=new ArrayList<>(steps.length);
  initialize(null,steps,flattened,DefaultFactories.forBuildin(MathTransformFactory.class),(coordinateOperationAccuracy == null),(domainOfValidity == null));
  operations=UnmodifiableArrayList.wrap(flattened.toArray(new CoordinateOperation[flattened.size()]));
}
Program: 91858
Project: 91858
Buggy source:
/** 
 * Prints the name and authority code (if any) of the given object.
 */
private void printNameAndIdentifier(final IdentifiedObject object){
  outHeader.append(object.getName().getCode());
  final String identifier=IdentifiedObjects.toString(IdentifiedObjects.getIdentifier(object,null));
  if (identifier != null) {
    outHeader.append(' ');
    if (colors) {
      outHeader.append(X364.FOREGROUND_CYAN.sequence());
    }
    outHeader.append('(');
    outHeader.append(identifier);
    outHeader.append(')');
    if (colors) {
      outHeader.append(X364.FOREGROUND_DEFAULT.sequence());
    }
  }
  outHeader.nextLine();
}

Fixed version (ground truth):
/** 
 * Prints the name and authority code (if any) of the given object.
 * @param object      the object for which to print name and identifier.
 * @param idRequired  {@code true} for printing the name only if an identifier is present.
 * @return whether this method has printed something.
 */
private boolean printNameAndIdentifier(final IdentifiedObject object,final boolean idRequired){
  final String identifier=IdentifiedObjects.toString(IdentifiedObjects.getIdentifier(object,null));
  if (idRequired && identifier == null) {
    return false;
  }
  outHeader.append(object.getName().getCode());
  if (identifier != null) {
    outHeader.append(' ');
    if (colors) {
      outHeader.append(X364.FOREGROUND_CYAN.sequence());
    }
    outHeader.append('(');
    outHeader.append(identifier);
    outHeader.append(')');
    if (colors) {
      outHeader.append(X364.FOREGROUND_DEFAULT.sequence());
    }
  }
  if (!idRequired) {
    outHeader.nextLine();
  }
  return true;
}
Program: 91861
Project: 91861
Buggy source:
/** 
 * Returns the identified object for the specified value, creating it if needed.
 * @throws BackingStoreException if the object creation failed.
 * @see #createObject(String)
 */
final T get(final String code) throws BackingStoreException {
  T object;
  boolean success;
synchronized (objects) {
    object=objects.get(code);
    success=(object != null || !objects.containsKey(code));
  }
  if (!success) {
    try {
      object=createObject(code);
      success=true;
    }
 catch (    FactoryException exception) {
      if (!isRecoverableFailure(exception)) {
        throw new BackingStoreException(exception);
      }
      final LogRecord record=Messages.getResources(null).getLogRecord(Level.WARNING,Messages.Keys.CanNotInstantiateForIdentifier_3,type,code,getCause(exception));
      record.setLoggerName(Loggers.CRS_FACTORY);
      Logging.log(IdentifiedObjectSet.class,"String_Node_Str",record);
    }
synchronized (objects) {
      if (success) {
        if (objects.containsKey(code)) {
          final T c=JDK8.putIfAbsent(objects,code,object);
          if (c != null) {
            object=c;
          }
 else {
            codes=null;
          }
        }
      }
 else       if (JDK8.remove(objects,code,null)) {
        codes=null;
      }
    }
  }
  return object;
}

Fixed version (ground truth):
/** 
 * Returns the identified object for the specified value, creating it if needed.
 * @throws BackingStoreException if the object creation failed.
 * @see #createObject(String)
 */
final T get(final String code) throws BackingStoreException {
  T object;
  boolean success;
synchronized (objects) {
    object=objects.get(code);
    success=(object != null || !objects.containsKey(code));
  }
  if (!success) {
    try {
      object=createObject(code);
      success=true;
    }
 catch (    FactoryException exception) {
      if (!isRecoverableFailure(exception)) {
        throw new BackingStoreException(exception);
      }
      final LogRecord record=Messages.getResources(getLocale()).getLogRecord(Level.WARNING,Messages.Keys.CanNotInstantiateForIdentifier_3,type,code,getCause(exception));
      record.setLoggerName(Loggers.CRS_FACTORY);
      Logging.log(IdentifiedObjectSet.class,"String_Node_Str",record);
    }
synchronized (objects) {
      if (success) {
        if (objects.containsKey(code)) {
          final T c=JDK8.putIfAbsent(objects,code,object);
          if (c != null) {
            object=c;
          }
 else {
            codes=null;
          }
        }
      }
 else       if (JDK8.remove(objects,code,null)) {
        codes=null;
      }
    }
  }
  return object;
}
Program: 91864
Project: 91864
Buggy source:
/** 
 * Invoked by JAXB for setting the operations.
 */
private void setSteps(final CoordinateOperation[] steps) throws FactoryException {
  final List<CoordinateOperation> flattened=new ArrayList<CoordinateOperation>(steps.length);
  initialize(null,steps,flattened,DefaultFactories.forBuildin(MathTransformFactory.class),coordinateOperationAccuracy == null);
  operations=UnmodifiableArrayList.wrap(flattened.toArray(new CoordinateOperation[flattened.size()]));
}

Fixed version (ground truth):
/** 
 * Invoked by JAXB for setting the operations.
 */
private void setSteps(final CoordinateOperation[] steps) throws FactoryException {
  final List<CoordinateOperation> flattened=new ArrayList<CoordinateOperation>(steps.length);
  initialize(null,steps,flattened,DefaultFactories.forBuildin(MathTransformFactory.class),(coordinateOperationAccuracy == null),(domainOfValidity == null));
  operations=UnmodifiableArrayList.wrap(flattened.toArray(new CoordinateOperation[flattened.size()]));
}
Program: 91866
Project: 91866
Buggy source:
/** 
 * Changes the line separator to be sent to the underlying appendable. This is the string to insert in place of every occurrences of   {@code "\r"},   {@code "\n"},  {@code "\r\n"} or other {@linkplain Characters#isLineOrParagraphSeparator(int) line separators}. If   {@code null} (the default), then the line separators given to the {@code append}methods are forwarded unchanged.
 * @param lineSeparator The new line separator, or {@code null} for forwarding EOL <i>as-is</i>.
 * @see System#lineSeparator()
 * @see Characters#isLineOrParagraphSeparator(int)
 */
public void setLineSeparator(final String lineSeparator){
  this.lineSeparator=lineSeparator;
  isEndOfLineReplaced=(lineSeparator != null);
}

Fixed version (ground truth):
/** 
 * Changes the line separator to be sent to the underlying appendable. This is the string to insert in place of every occurrences of   {@code "\r"},   {@code "\n"},  {@code "\r\n"} or other {@linkplain Characters#isLineOrParagraphSeparator(int) line separators}. If   {@code null} (the default), then the line separators given to the {@code append}methods are forwarded unchanged.
 * @param lineSeparator The new line separator, or {@code null} for forwarding EOL <i>as-is</i>.
 * @see Characters#isLineOrParagraphSeparator(int)
 */
public void setLineSeparator(final String lineSeparator){
  this.lineSeparator=lineSeparator;
  isEndOfLineReplaced=(lineSeparator != null);
}
Program: 91868
Project: 91868
Buggy source:
/** 
 * Returns the code list or enumeration value for the given title, or   {@code null} if none.The current implementation performs the following choice: <ul> <li>If the given title is a value returned by a previous call to  {@link #getCodeTitle(CodeList<?>)}, returns the code or enumeration value used for creating that title.</li> <li>Otherwise returns   {@code null}.</li> </ul>
 * @param title The title for which to get a code or enumeration value, or {@code null}.
 * @return The code or enumeration value associated with the given title, or {@code null}.
 * @since 0.7
 * @see #getCodeTitle(CodeList<?>)
 */
public static CodeList<?> forCodeTitle(final CharSequence title){
  return (title instanceof CodeTitle) ? ((CodeTitle)title).code : null;
}

Fixed version (ground truth):
/** 
 * Returns the code list or enumeration value for the given title, or   {@code null} if none.The current implementation performs the following choice: <ul> <li>If the given title is a value returned by a previous call to  {@link #getCodeTitle(CodeList)}, returns the code or enumeration value used for creating that title.</li> <li>Otherwise returns   {@code null}.</li> </ul>
 * @param title The title for which to get a code or enumeration value, or {@code null}.
 * @return The code or enumeration value associated with the given title, or {@code null}.
 * @since 0.7
 * @see #getCodeTitle(CodeList)
 */
public static CodeList<?> forCodeTitle(final CharSequence title){
  return (title instanceof CodeTitle) ? ((CodeTitle)title).code : null;
}
Program: 91870
Project: 91870
Buggy source:
/** 
 * Prints the name and authority code (if any) of the given object.
 */
private void printNameAndIdentifier(final IdentifiedObject object){
  outHeader.append(object.getName().getCode());
  final String identifier=IdentifiedObjects.toString(IdentifiedObjects.getIdentifier(object,null));
  if (identifier != null) {
    outHeader.append(' ');
    if (colors) {
      outHeader.append(X364.FOREGROUND_CYAN.sequence());
    }
    outHeader.append('(');
    outHeader.append(identifier);
    outHeader.append(')');
    if (colors) {
      outHeader.append(X364.FOREGROUND_DEFAULT.sequence());
    }
  }
  outHeader.nextLine();
}

Fixed version (ground truth):
/** 
 * Prints the name and authority code (if any) of the given object.
 * @param object      the object for which to print name and identifier.
 * @param idRequired  {@code true} for printing the name only if an identifier is present.
 * @return whether this method has printed something.
 */
private boolean printNameAndIdentifier(final IdentifiedObject object,final boolean idRequired){
  final String identifier=IdentifiedObjects.toString(IdentifiedObjects.getIdentifier(object,null));
  if (idRequired && identifier == null) {
    return false;
  }
  outHeader.append(object.getName().getCode());
  if (identifier != null) {
    outHeader.append(' ');
    if (colors) {
      outHeader.append(X364.FOREGROUND_CYAN.sequence());
    }
    outHeader.append('(');
    outHeader.append(identifier);
    outHeader.append(')');
    if (colors) {
      outHeader.append(X364.FOREGROUND_DEFAULT.sequence());
    }
  }
  if (!idRequired) {
    outHeader.nextLine();
  }
  return true;
}
Program: 91873
Project: 91873
Buggy source:
/** 
 * Returns the identified object for the specified value, creating it if needed.
 * @throws BackingStoreException if the object creation failed.
 * @see #createObject(String)
 */
final T get(final String code) throws BackingStoreException {
  T object;
  boolean success;
synchronized (objects) {
    object=objects.get(code);
    success=(object != null || !objects.containsKey(code));
  }
  if (!success) {
    try {
      object=createObject(code);
      success=true;
    }
 catch (    FactoryException exception) {
      if (!isRecoverableFailure(exception)) {
        throw new BackingStoreException(exception);
      }
      final LogRecord record=Messages.getResources(null).getLogRecord(Level.WARNING,Messages.Keys.CanNotInstantiateForIdentifier_3,type,code,getCause(exception));
      record.setLoggerName(Loggers.CRS_FACTORY);
      Logging.log(IdentifiedObjectSet.class,"String_Node_Str",record);
    }
synchronized (objects) {
      if (success) {
        if (objects.containsKey(code)) {
          final T c=JDK8.putIfAbsent(objects,code,object);
          if (c != null) {
            object=c;
          }
 else {
            codes=null;
          }
        }
      }
 else       if (JDK8.remove(objects,code,null)) {
        codes=null;
      }
    }
  }
  return object;
}

Fixed version (ground truth):
/** 
 * Returns the identified object for the specified value, creating it if needed.
 * @throws BackingStoreException if the object creation failed.
 * @see #createObject(String)
 */
final T get(final String code) throws BackingStoreException {
  T object;
  boolean success;
synchronized (objects) {
    object=objects.get(code);
    success=(object != null || !objects.containsKey(code));
  }
  if (!success) {
    try {
      object=createObject(code);
      success=true;
    }
 catch (    FactoryException exception) {
      if (!isRecoverableFailure(exception)) {
        throw new BackingStoreException(exception);
      }
      final LogRecord record=Messages.getResources(getLocale()).getLogRecord(Level.WARNING,Messages.Keys.CanNotInstantiateForIdentifier_3,type,code,getCause(exception));
      record.setLoggerName(Loggers.CRS_FACTORY);
      Logging.log(IdentifiedObjectSet.class,"String_Node_Str",record);
    }
synchronized (objects) {
      if (success) {
        if (objects.containsKey(code)) {
          final T c=JDK8.putIfAbsent(objects,code,object);
          if (c != null) {
            object=c;
          }
 else {
            codes=null;
          }
        }
      }
 else       if (JDK8.remove(objects,code,null)) {
        codes=null;
      }
    }
  }
  return object;
}
Program: 91876
Project: 91876
Buggy source:
/** 
 * Invoked by JAXB for setting the operations.
 */
private void setSteps(final CoordinateOperation[] steps) throws FactoryException {
  final List<CoordinateOperation> flattened=new ArrayList<CoordinateOperation>(steps.length);
  initialize(null,steps,flattened,DefaultFactories.forBuildin(MathTransformFactory.class),coordinateOperationAccuracy == null);
  operations=UnmodifiableArrayList.wrap(flattened.toArray(new SingleOperation[flattened.size()]));
}

Fixed version (ground truth):
/** 
 * Invoked by JAXB for setting the operations.
 */
private void setSteps(final CoordinateOperation[] steps) throws FactoryException {
  final List<CoordinateOperation> flattened=new ArrayList<CoordinateOperation>(steps.length);
  initialize(null,steps,flattened,DefaultFactories.forBuildin(MathTransformFactory.class),(coordinateOperationAccuracy == null),(domainOfValidity == null));
  operations=UnmodifiableArrayList.wrap(flattened.toArray(new SingleOperation[flattened.size()]));
}
Program: 91878
Project: 91878
Buggy source:
/** 
 * Returns the hash code value.
 */
@Override public int hashCode(){
  return sourceCRS.hashCode() * 31 + targetCRS.hashCode();
}

Fixed version (ground truth):
/** 
 * Returns the hash code value.
 */
@Override public int hashCode(){
  return Objects.hashCode(sourceCRS) * 31 + Objects.hashCode(targetCRS);
}
Program: 91879
Project: 91879
Buggy source:
/** 
 * Creates a new instance for the given factory and context.
 * @param registry  the factory to use for creating operations as defined by authority, or {@code null} if none.
 * @param factory   the factory to use for creating operations not found in the registry.
 * @param context   the area of interest and desired accuracy, or {@code null} if none.
 * @throws FactoryException if an error occurred while initializing this {@code CoordinateOperationFinder}.
 */
public CoordinateOperationFinder(final CoordinateOperationAuthorityFactory registry,final CoordinateOperationFactory factory,final CoordinateOperationContext context) throws FactoryException {
  super(registry,factory,context);
  identifierOfStepCRS=new HashMap<>(8);
  previousSearches=new HashMap<>(8);
}

Fixed version (ground truth):
/** 
 * Creates a new instance for the given factory and context.
 * @param registry  the factory to use for creating operations as defined by authority, or {@code null} if none.
 * @param factory   the factory to use for creating operations not found in the registry.
 * @param context   the area of interest and desired accuracy, or {@code null} if none.
 * @throws FactoryException if an error occurred while initializing this {@code CoordinateOperationFinder}.
 */
public CoordinateOperationFinder(final CoordinateOperationAuthorityFactory registry,final CoordinateOperationFactory factory,final CoordinateOperationContext context) throws FactoryException {
  super(registry,factory,context);
  identifierOfStepCRS=new HashMap<>(8);
  previousSearches=new HashMap<>(8);
  useCache=(context == null) && (factory == factorySIS);
}
Program: 91881
Project: 91881
Buggy source:
/** 
 * Constructs a factory with the given default properties.  {@code DefaultCoordinateOperationFactory} will fallback on the map given to this constructorfor any property not present in the map provided to a  {@code createFoo(Map<String,?>, …)} method.
 * @param properties the default properties, or {@code null} if none.
 * @param factory the factory to use for creating{@linkplain org.apache.sis.referencing.operation.transform.AbstractMathTransform math transforms}, or   {@code null} for the default factory.
 */
public DefaultCoordinateOperationFactory(Map<String,?> properties,final MathTransformFactory factory){
  if (properties == null || properties.isEmpty()) {
    properties=Collections.emptyMap();
  }
 else {
    String key=null;
    Object value=null;
    properties=new HashMap<>(properties);
    try {
      crsFactory=(CRSFactory)(value=properties.remove(key=ReferencingServices.CRS_FACTORY));
      csFactory=(CSFactory)(value=properties.remove(key=ReferencingServices.CS_FACTORY));
      mtFactory=(MathTransformFactory)(value=properties.remove(key=ReferencingServices.MT_FACTORY));
    }
 catch (    ClassCastException e) {
      throw new IllegalArgumentException(Errors.getResources(properties).getString(Errors.Keys.IllegalPropertyValueClass_2,key,Classes.getClass(value)));
    }
    properties=CollectionsExt.compact(properties);
  }
  defaultProperties=properties;
  if (factory != null) {
    mtFactory=factory;
  }
  pool=new WeakHashSet<>(IdentifiedObject.class);
}

Fixed version (ground truth):
/** 
 * Constructs a factory with the given default properties.  {@code DefaultCoordinateOperationFactory} will fallback on the map given to this constructorfor any property not present in the map provided to a  {@code createFoo(Map<String,?>, …)} method.
 * @param properties the default properties, or {@code null} if none.
 * @param factory the factory to use for creating{@linkplain org.apache.sis.referencing.operation.transform.AbstractMathTransform math transforms}, or   {@code null} for the default factory.
 */
public DefaultCoordinateOperationFactory(Map<String,?> properties,final MathTransformFactory factory){
  if (properties == null || properties.isEmpty()) {
    properties=Collections.emptyMap();
  }
 else {
    String key=null;
    Object value=null;
    properties=new HashMap<>(properties);
    try {
      crsFactory=(CRSFactory)(value=properties.remove(key=ReferencingServices.CRS_FACTORY));
      csFactory=(CSFactory)(value=properties.remove(key=ReferencingServices.CS_FACTORY));
      mtFactory=(MathTransformFactory)(value=properties.remove(key=ReferencingServices.MT_FACTORY));
    }
 catch (    ClassCastException e) {
      throw new IllegalArgumentException(Errors.getResources(properties).getString(Errors.Keys.IllegalPropertyValueClass_2,key,Classes.getClass(value)));
    }
    properties=CollectionsExt.compact(properties);
  }
  defaultProperties=properties;
  if (factory != null) {
    mtFactory=factory;
  }
  pool=new WeakHashSet<>(IdentifiedObject.class);
  cache=new Cache<>(12,50,true);
}
Program: 91884
Project: 91884
Buggy source:
/** 
 * Prints the name and authority code (if any) of the given object.
 */
private void printNameAndIdentifier(final IdentifiedObject object){
  outHeader.append(object.getName().getCode());
  final String identifier=IdentifiedObjects.toString(IdentifiedObjects.getIdentifier(object,null));
  if (identifier != null) {
    outHeader.append(' ');
    if (colors) {
      outHeader.append(X364.FOREGROUND_CYAN.sequence());
    }
    outHeader.append('(');
    outHeader.append(identifier);
    outHeader.append(')');
    if (colors) {
      outHeader.append(X364.FOREGROUND_DEFAULT.sequence());
    }
  }
  outHeader.nextLine();
}

Fixed version (ground truth):
/** 
 * Prints the name and authority code (if any) of the given object.
 * @param object      the object for which to print name and identifier.
 * @param idRequired  {@code true} for printing the name only if an identifier is present.
 * @return whether this method has printed something.
 */
private boolean printNameAndIdentifier(final IdentifiedObject object,final boolean idRequired){
  final String identifier=IdentifiedObjects.toString(IdentifiedObjects.getIdentifier(object,null));
  if (idRequired && identifier == null) {
    return false;
  }
  outHeader.append(object.getName().getCode());
  if (identifier != null) {
    outHeader.append(' ');
    if (colors) {
      outHeader.append(X364.FOREGROUND_CYAN.sequence());
    }
    outHeader.append('(');
    outHeader.append(identifier);
    outHeader.append(')');
    if (colors) {
      outHeader.append(X364.FOREGROUND_DEFAULT.sequence());
    }
  }
  if (!idRequired) {
    outHeader.nextLine();
  }
  return true;
}
Program: 91886
Project: 91886
Buggy source:
/** 
 * Returns the identified object for the specified value, creating it if needed.
 * @throws BackingStoreException if the object creation failed.
 * @see #createObject(String)
 */
final T get(final String code) throws BackingStoreException {
  T object;
  boolean success;
synchronized (objects) {
    object=objects.get(code);
    success=(object != null || !objects.containsKey(code));
  }
  if (!success) {
    try {
      object=createObject(code);
      success=true;
    }
 catch (    FactoryException exception) {
      if (!isRecoverableFailure(exception)) {
        throw new BackingStoreException(exception);
      }
      final LogRecord record=Messages.getResources(null).getLogRecord(Level.WARNING,Messages.Keys.CanNotInstantiateForIdentifier_3,type,code,getCause(exception));
      record.setLoggerName(Loggers.CRS_FACTORY);
      Logging.log(IdentifiedObjectSet.class,"String_Node_Str",record);
    }
synchronized (objects) {
      if (success) {
        if (objects.containsKey(code)) {
          final T c=objects.putIfAbsent(code,object);
          if (c != null) {
            object=c;
          }
 else {
            codes=null;
          }
        }
      }
 else       if (objects.remove(code,null)) {
        codes=null;
      }
    }
  }
  return object;
}

Fixed version (ground truth):
/** 
 * Returns the identified object for the specified value, creating it if needed.
 * @throws BackingStoreException if the object creation failed.
 * @see #createObject(String)
 */
final T get(final String code) throws BackingStoreException {
  T object;
  boolean success;
synchronized (objects) {
    object=objects.get(code);
    success=(object != null || !objects.containsKey(code));
  }
  if (!success) {
    try {
      object=createObject(code);
      success=true;
    }
 catch (    FactoryException exception) {
      if (!isRecoverableFailure(exception)) {
        throw new BackingStoreException(exception);
      }
      final LogRecord record=Messages.getResources(getLocale()).getLogRecord(Level.WARNING,Messages.Keys.CanNotInstantiateForIdentifier_3,type,code,getCause(exception));
      record.setLoggerName(Loggers.CRS_FACTORY);
      Logging.log(IdentifiedObjectSet.class,"String_Node_Str",record);
    }
synchronized (objects) {
      if (success) {
        if (objects.containsKey(code)) {
          final T c=objects.putIfAbsent(code,object);
          if (c != null) {
            object=c;
          }
 else {
            codes=null;
          }
        }
      }
 else       if (objects.remove(code,null)) {
        codes=null;
      }
    }
  }
  return object;
}
Program: 91888
Project: 91888
Buggy source:
/** 
 * Invoked by JAXB for setting the operations.
 */
private void setSteps(final CoordinateOperation[] steps) throws FactoryException {
  final List<CoordinateOperation> flattened=new ArrayList<>(steps.length);
  initialize(null,steps,flattened,DefaultFactories.forBuildin(MathTransformFactory.class),coordinateOperationAccuracy == null);
  operations=UnmodifiableArrayList.wrap(flattened.toArray(new CoordinateOperation[flattened.size()]));
}

Fixed version (ground truth):
/** 
 * Invoked by JAXB for setting the operations.
 */
private void setSteps(final CoordinateOperation[] steps) throws FactoryException {
  final List<CoordinateOperation> flattened=new ArrayList<>(steps.length);
  initialize(null,steps,flattened,DefaultFactories.forBuildin(MathTransformFactory.class),(coordinateOperationAccuracy == null),(domainOfValidity == null));
  operations=UnmodifiableArrayList.wrap(flattened.toArray(new CoordinateOperation[flattened.size()]));
}
Program: 91890
Project: 91890
Buggy source:
/** 
 * This feature type is considered to all other features except itself.
 */
@Override public boolean isAssignableFrom(final DefaultFeatureType type){
  return false;
}

Fixed version (ground truth):
/** 
 * This feature type is considered independent of all other feature types except itself.
 */
@Override public boolean isAssignableFrom(final DefaultFeatureType type){
  return false;
}
Program: 91891
Project: 91891
Buggy source:
/** 
 * Compares the specified object with this coordinate system for equality.
 * @param object The object to compare to {@code this}.
 * @param mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} for comparing only propertiesrelevant to coordinate transformations.
 * @return {@code true} if both objects are equal.
 */
@Override public boolean equals(final Object object,final ComparisonMode mode){
  if (object == this) {
    return true;
  }
  if (!super.equals(object,mode)) {
    return false;
  }
switch (mode) {
case STRICT:
{
      return Arrays.equals(axes,((AbstractCS)object).axes);
    }
default :
{
    final CoordinateSystem that=(CoordinateSystem)object;
    final int dimension=getDimension();
    if (dimension != that.getDimension()) {
      return false;
    }
    if (mode != ComparisonMode.ALLOW_VARIANT) {
      for (int i=0; i < dimension; i++) {
        if (!deepEquals(getAxis(i),that.getAxis(i),mode)) {
          return false;
        }
      }
    }
    return true;
  }
}
}

Fixed version (ground truth):
/** 
 * Compares the specified object with this coordinate system for equality.
 * @param object The object to compare to {@code this}.
 * @param mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} for comparing only propertiesrelevant to coordinate transformations.
 * @return {@code true} if both objects are equal.
 */
@Override @SuppressWarnings("String_Node_Str") public boolean equals(final Object object,final ComparisonMode mode){
  if (object == this) {
    return true;
  }
  if (!super.equals(object,mode)) {
    return false;
  }
switch (mode) {
case STRICT:
{
      return Arrays.equals(axes,((AbstractCS)object).axes);
    }
case DEBUG:
{
    final int d1=axes.length;
    final int d2=((CoordinateSystem)object).getDimension();
    if (d1 != d2) {
      throw new AssertionError(Errors.format(Errors.Keys.MismatchedDimension_2,d1,d2));
    }
  }
default :
{
  final CoordinateSystem that=(CoordinateSystem)object;
  final int dimension=getDimension();
  if (dimension != that.getDimension()) {
    return false;
  }
  if (mode != ComparisonMode.ALLOW_VARIANT) {
    for (int i=0; i < dimension; i++) {
      if (!deepEquals(getAxis(i),that.getAxis(i),mode)) {
        return false;
      }
    }
  }
  return true;
}
}
}
Program: 91892
Project: 91892
Buggy source:
/** 
 * Returns the hash code value.
 */
@Override public int hashCode(){
  return sourceCRS.hashCode() * 31 + targetCRS.hashCode();
}

Fixed version (ground truth):
/** 
 * Returns the hash code value.
 */
@Override public int hashCode(){
  return Objects.hashCode(sourceCRS) * 31 + Objects.hashCode(targetCRS);
}
Program: 91893
Project: 91893
Buggy source:
/** 
 * Returns the name of the GeoAPI interface implemented by the specified object, followed by the name between brackets.
 */
static String label(final IdentifiedObject object){
  if (object == null) {
    return null;
  }
  Class<? extends IdentifiedObject> type;
  if (object instanceof AbstractIdentifiedObject) {
    type=((AbstractIdentifiedObject)object).getInterface();
  }
 else {
    type=Classes.getLeafInterfaces(object.getClass(),IdentifiedObject.class)[0];
  }
  String label=Classes.getShortName(type);
  String name=IdentifiedObjects.getName(object,null);
  if (name != null) {
    int i=30;
    if (name.length() >= i) {
      while (i > 15) {
        final int c=name.codePointBefore(i);
        if (Character.isSpaceChar(c))         break;
        i-=Character.charCount(c);
      }
      name=CharSequences.trimWhitespaces(name,0,i).toString() + '…';
    }
    label=label + "String_Node_Str" + name+ "String_Node_Str";
  }
  return label;
}

Fixed version (ground truth):
/** 
 * Returns the name of the GeoAPI interface implemented by the specified object. In the GeographicCRS or EllipsoidalCS cases, the trailing CRS or CS suffix is replaced by the number of dimensions (e.g. "Geographic3D").
 */
static String label(final IdentifiedObject object){
  if (object == null) {
    return null;
  }
  Class<? extends IdentifiedObject> type;
  if (object instanceof AbstractIdentifiedObject) {
    type=((AbstractIdentifiedObject)object).getInterface();
  }
 else {
    type=Classes.getLeafInterfaces(object.getClass(),IdentifiedObject.class)[0];
  }
  String suffix, label=Classes.getShortName(type);
  if (label.endsWith((suffix="String_Node_Str")) || label.endsWith(suffix="String_Node_Str")) {
    Object cs=object;
    if (object instanceof CoordinateReferenceSystem) {
      cs=((CoordinateReferenceSystem)object).getCoordinateSystem();
    }
    if (cs instanceof EllipsoidalCS) {
      final StringBuilder sb=new StringBuilder(label);
      sb.setLength(label.length() - suffix.length());
      label=sb.append(((CoordinateSystem)cs).getDimension()).append('D').toString();
    }
  }
  String name=IdentifiedObjects.getName(object,null);
  if (name != null) {
    int i=30;
    if (name.length() >= i) {
      while (i > 15) {
        final int c=name.codePointBefore(i);
        if (Character.isSpaceChar(c))         break;
        i-=Character.charCount(c);
      }
      name=CharSequences.trimWhitespaces(name,0,i).toString() + '…';
    }
    label=label + "String_Node_Str" + name+ "String_Node_Str";
  }
  return label;
}
Program: 91894
Project: 91894
Buggy source:
/** 
 * Creates a new instance for the given factory and context.
 * @param registry  the factory to use for creating operations as defined by authority, or {@code null} if none.
 * @param factory   the factory to use for creating operations not found in the registry.
 * @param context   the area of interest and desired accuracy, or {@code null} if none.
 * @throws FactoryException if an error occurred while initializing this {@code CoordinateOperationFinder}.
 */
public CoordinateOperationFinder(final CoordinateOperationAuthorityFactory registry,final CoordinateOperationFactory factory,final CoordinateOperationContext context) throws FactoryException {
  super(registry,factory,context);
  identifierOfStepCRS=new HashMap<Identifier,Object>(8);
  previousSearches=new HashMap<CRSPair,Boolean>(8);
}

Fixed version (ground truth):
/** 
 * Creates a new instance for the given factory and context.
 * @param registry  the factory to use for creating operations as defined by authority, or {@code null} if none.
 * @param factory   the factory to use for creating operations not found in the registry.
 * @param context   the area of interest and desired accuracy, or {@code null} if none.
 * @throws FactoryException if an error occurred while initializing this {@code CoordinateOperationFinder}.
 */
public CoordinateOperationFinder(final CoordinateOperationAuthorityFactory registry,final CoordinateOperationFactory factory,final CoordinateOperationContext context) throws FactoryException {
  super(registry,factory,context);
  identifierOfStepCRS=new HashMap<Identifier,Object>(8);
  previousSearches=new HashMap<CRSPair,Boolean>(8);
  useCache=(context == null) && (factory == factorySIS);
}
Program: 91896
Project: 91896
Buggy source:
/** 
 * This feature type is considered to all other features except itself.
 */
@Override public boolean isAssignableFrom(final FeatureType type){
  return (type instanceof NamedFeatureType);
}

Fixed version (ground truth):
/** 
 * This feature type is considered independent of all other feature types except itself.
 */
@Override public boolean isAssignableFrom(final FeatureType type){
  return (type instanceof NamedFeatureType);
}
Program: 91897
Project: 91897
Buggy source:
/** 
 * Sets an enumeration of valid values for this attribute. <p>This is a convenience method for   {@link #addCharacteristic(Class)} with a valueof type  {@link Set} and a conventional name.</p>
 * @param values valid values.
 * @return {@code this} for allowing method calls chaining.
 * @throws UnsupportedOperationException if this property does not support characteristics.
 * @see AttributeConvention#VALID_VALUES_CHARACTERISTIC
 */
@SafeVarargs public final Property<V> setValidValues(final V... values){
  return setCharacteristic(AttributeConvention.VALID_VALUES_CHARACTERISTIC,Set.class,CollectionsExt.immutableSet(false,values));
}

Fixed version (ground truth):
/** 
 * Sets an enumeration of valid values for this attribute. <p>This is a convenience method for   {@link #addCharacteristic(Class)} with a valueof type  {@link Set} and a conventional name.</p>
 * @param values valid values.
 * @return {@code this} for allowing method calls chaining.
 * @throws UnsupportedOperationException if this property does not support characteristics.
 * @see AttributeConvention#VALID_VALUES_CHARACTERISTIC
 */
public final Property<V> setValidValues(final V... values){
  return setCharacteristic(AttributeConvention.VALID_VALUES_CHARACTERISTIC,Set.class,CollectionsExt.immutableSet(false,values));
}
Program: 91898
Project: 91898
Buggy source:
/** 
 * Compares the specified object with this coordinate system for equality.
 * @param object The object to compare to {@code this}.
 * @param mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} for comparing only propertiesrelevant to coordinate transformations.
 * @return {@code true} if both objects are equal.
 */
@Override public boolean equals(final Object object,final ComparisonMode mode){
  if (object == this) {
    return true;
  }
  if (!super.equals(object,mode)) {
    return false;
  }
switch (mode) {
case STRICT:
{
      return Arrays.equals(axes,((AbstractCS)object).axes);
    }
default :
{
    final CoordinateSystem that=(CoordinateSystem)object;
    final int dimension=getDimension();
    if (dimension != that.getDimension()) {
      return false;
    }
    if (mode != ComparisonMode.ALLOW_VARIANT) {
      for (int i=0; i < dimension; i++) {
        if (!deepEquals(getAxis(i),that.getAxis(i),mode)) {
          return false;
        }
      }
    }
    return true;
  }
}
}

Fixed version (ground truth):
/** 
 * Compares the specified object with this coordinate system for equality.
 * @param object The object to compare to {@code this}.
 * @param mode {@link ComparisonMode#STRICT STRICT} for performing a strict comparison, or{@link ComparisonMode#IGNORE_METADATA IGNORE_METADATA} for comparing only propertiesrelevant to coordinate transformations.
 * @return {@code true} if both objects are equal.
 */
@Override @SuppressWarnings("String_Node_Str") public boolean equals(final Object object,final ComparisonMode mode){
  if (object == this) {
    return true;
  }
  if (!super.equals(object,mode)) {
    return false;
  }
switch (mode) {
case STRICT:
{
      return Arrays.equals(axes,((AbstractCS)object).axes);
    }
case DEBUG:
{
    final int d1=axes.length;
    final int d2=((CoordinateSystem)object).getDimension();
    if (d1 != d2) {
      throw new AssertionError(Errors.format(Errors.Keys.MismatchedDimension_2,d1,d2));
    }
  }
default :
{
  final CoordinateSystem that=(CoordinateSystem)object;
  final int dimension=getDimension();
  if (dimension != that.getDimension()) {
    return false;
  }
  if (mode != ComparisonMode.ALLOW_VARIANT) {
    for (int i=0; i < dimension; i++) {
      if (!deepEquals(getAxis(i),that.getAxis(i),mode)) {
        return false;
      }
    }
  }
  return true;
}
}
}
Program: 91899
Project: 91899
Buggy source:
/** 
 * Returns the hash code value.
 */
@Override public int hashCode(){
  return sourceCRS.hashCode() * 31 + targetCRS.hashCode();
}

Fixed version (ground truth):
/** 
 * Returns the hash code value.
 */
@Override public int hashCode(){
  return Objects.hashCode(sourceCRS) * 31 + Objects.hashCode(targetCRS);
}
Program: 91900
Project: 91900
Buggy source:
/** 
 * Returns the name of the GeoAPI interface implemented by the specified object, followed by the name between brackets.
 */
static String label(final IdentifiedObject object){
  if (object == null) {
    return null;
  }
  Class<? extends IdentifiedObject> type;
  if (object instanceof AbstractIdentifiedObject) {
    type=((AbstractIdentifiedObject)object).getInterface();
  }
 else {
    type=Classes.getLeafInterfaces(object.getClass(),IdentifiedObject.class)[0];
  }
  String label=Classes.getShortName(type);
  String name=IdentifiedObjects.getName(object,null);
  if (name != null) {
    int i=30;
    if (name.length() >= i) {
      while (i > 15) {
        final int c=name.codePointBefore(i);
        if (Character.isSpaceChar(c))         break;
        i-=Character.charCount(c);
      }
      name=CharSequences.trimWhitespaces(name,0,i).toString() + '…';
    }
    label=label + "String_Node_Str" + name+ "String_Node_Str";
  }
  return label;
}

Fixed version (ground truth):
/** 
 * Returns the name of the GeoAPI interface implemented by the specified object. In the GeographicCRS or EllipsoidalCS cases, the trailing CRS or CS suffix is replaced by the number of dimensions (e.g. "Geographic3D").
 */
static String label(final IdentifiedObject object){
  if (object == null) {
    return null;
  }
  Class<? extends IdentifiedObject> type;
  if (object instanceof AbstractIdentifiedObject) {
    type=((AbstractIdentifiedObject)object).getInterface();
  }
 else {
    type=Classes.getLeafInterfaces(object.getClass(),IdentifiedObject.class)[0];
  }
  String suffix, label=Classes.getShortName(type);
  if (label.endsWith((suffix="String_Node_Str")) || label.endsWith(suffix="String_Node_Str")) {
    Object cs=object;
    if (object instanceof CoordinateReferenceSystem) {
      cs=((CoordinateReferenceSystem)object).getCoordinateSystem();
    }
    if (cs instanceof EllipsoidalCS) {
      final StringBuilder sb=new StringBuilder(label);
      sb.setLength(label.length() - suffix.length());
      label=sb.append(((CoordinateSystem)cs).getDimension()).append('D').toString();
    }
  }
  String name=IdentifiedObjects.getName(object,null);
  if (name != null) {
    int i=30;
    if (name.length() >= i) {
      while (i > 15) {
        final int c=name.codePointBefore(i);
        if (Character.isSpaceChar(c))         break;
        i-=Character.charCount(c);
      }
      name=CharSequences.trimWhitespaces(name,0,i).toString() + '…';
    }
    label=label + "String_Node_Str" + name+ "String_Node_Str";
  }
  return label;
}
Program: 91901
Project: 91901
Buggy source:
/** 
 * Creates a new instance for the given factory and context.
 * @param registry  the factory to use for creating operations as defined by authority, or {@code null} if none.
 * @param factory   the factory to use for creating operations not found in the registry.
 * @param context   the area of interest and desired accuracy, or {@code null} if none.
 * @throws FactoryException if an error occurred while initializing this {@code CoordinateOperationFinder}.
 */
public CoordinateOperationFinder(final CoordinateOperationAuthorityFactory registry,final CoordinateOperationFactory factory,final CoordinateOperationContext context) throws FactoryException {
  super(registry,factory,context);
  identifierOfStepCRS=new HashMap<Identifier,Object>(8);
  previousSearches=new HashMap<CRSPair,Boolean>(8);
}

Fixed version (ground truth):
/** 
 * Creates a new instance for the given factory and context.
 * @param registry  the factory to use for creating operations as defined by authority, or {@code null} if none.
 * @param factory   the factory to use for creating operations not found in the registry.
 * @param context   the area of interest and desired accuracy, or {@code null} if none.
 * @throws FactoryException if an error occurred while initializing this {@code CoordinateOperationFinder}.
 */
public CoordinateOperationFinder(final CoordinateOperationAuthorityFactory registry,final CoordinateOperationFactory factory,final CoordinateOperationContext context) throws FactoryException {
  super(registry,factory,context);
  identifierOfStepCRS=new HashMap<Identifier,Object>(8);
  previousSearches=new HashMap<CRSPair,Boolean>(8);
  useCache=(context == null) && (factory == factorySIS);
}
Program: 91904
Project: 91904
Buggy source:
/** 
 * Returns the name of this attribute as defined by its   {@linkplain #getType() type}. This convenience method delegates to   {@link AttributeType#getName()}.
 * @return The attribute name specified by its type.
 */
@Override public GenericName getName(){
  return type.getName();
}

Fixed version (ground truth):
/** 
 * Returns the name of this attribute as defined by its   {@linkplain #getType() type}. This convenience method delegates to   {@link AttributeType#getName()}.
 * @return the attribute name specified by its type.
 */
@Override public GenericName getName(){
  return type.getName();
}
Program: 91905
Project: 91905
Buggy source:
/** 
 * Returns all attribute values, or an empty collection if none. The returned collection is <cite>live</cite>: changes in the returned collection will be reflected immediately in this   {@code Attribute} instance, and conversely.<p>The default implementation returns a collection which will delegate its work to {@link #getValue()} and {@link #setValue(Object)}.</p>
 * @return The attribute values in a <cite>live</cite> collection.
 */
@Override public Collection<V> getValues(){
  return super.getValues();
}

Fixed version (ground truth):
/** 
 * Returns all attribute values, or an empty collection if none. The returned collection is <cite>live</cite>: changes in the returned collection will be reflected immediately in this   {@code Attribute} instance, and conversely.<p>The default implementation returns a collection which will delegate its work to {@link #getValue()} and {@link #setValue(Object)}.</p>
 * @return the attribute values in a <cite>live</cite> collection.
 */
@Override public Collection<V> getValues(){
  return super.getValues();
}