Program: 91887
Project: 91887
Buggy source:
/** 
 * Creates operations from source and target coordinate reference system codes. This method only extract the information explicitely declared in the EPSG database; it does not attempt to infer by itself operations that are not explicitely recorded in the database. <p>The returned set is ordered with the most accurate operations first.</p>
 * @param sourceCRS  Coded value of source coordinate reference system.
 * @param targetCRS  Coded value of target coordinate reference system.
 * @return The operations from {@code sourceCRS} to {@code targetCRS}.
 * @throws NoSuchAuthorityCodeException if a specified code was not found.
 * @throws FactoryException if the object creation failed for some other reason.
 */
@Override public synchronized Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(final String sourceCRS,final String targetCRS) throws FactoryException {
  ArgumentChecks.ensureNonNull("String_Node_Str",sourceCRS);
  ArgumentChecks.ensureNonNull("String_Node_Str",targetCRS);
  final String label=sourceCRS + "String_Node_Str" + targetCRS;
  final CoordinateOperationSet set=new CoordinateOperationSet(owner);
  try {
    final int[] pair=toPrimaryKeys(null,null,null,sourceCRS,targetCRS);
    boolean searchTransformations=false;
    do {
      final String key, sql;
      if (searchTransformations) {
        key="String_Node_Str";
        sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      }
 else {
        key="String_Node_Str";
        sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
      }
      final Integer targetKey=searchTransformations ? null : pair[1];
      try (ResultSet result=executeQuery(key,sql,pair)){
        while (result.next()) {
          set.addAuthorityCode(getString(label,result,1),targetKey);
        }
      }
     }
 while ((searchTransformations=!searchTransformations) == true);
    final String[] codes=set.getAuthorityCodes();
    if (codes.length > 1 && sort("String_Node_Str",codes)) {
      set.setAuthorityCodes(codes);
    }
  }
 catch (  SQLException exception) {
    throw databaseFailure(CoordinateOperation.class,label,exception);
  }
  set.resolve(1);
  return set;
}

Fixed version (ground truth):
/** 
 * Creates operations from source and target coordinate reference system codes. This method only extract the information explicitely declared in the EPSG database; it does not attempt to infer by itself operations that are not explicitely recorded in the database. <p>The returned set is ordered with the most accurate operations first. Deprecated operations are not included in the set; if a deprecated operation is really wanted, it can be fetched by an explicit call to   {@link #createCoordinateOperation(String)}.</p>
 * @param sourceCRS  Coded value of source coordinate reference system.
 * @param targetCRS  Coded value of target coordinate reference system.
 * @return The operations from {@code sourceCRS} to {@code targetCRS}.
 * @throws NoSuchAuthorityCodeException if a specified code was not found.
 * @throws FactoryException if the object creation failed for some other reason.
 */
@Override public synchronized Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(final String sourceCRS,final String targetCRS) throws FactoryException {
  ArgumentChecks.ensureNonNull("String_Node_Str",sourceCRS);
  ArgumentChecks.ensureNonNull("String_Node_Str",targetCRS);
  final String label=sourceCRS + "String_Node_Str" + targetCRS;
  final CoordinateOperationSet set=new CoordinateOperationSet(owner);
  try {
    final int[] pair=toPrimaryKeys(null,null,null,sourceCRS,targetCRS);
    boolean searchTransformations=false;
    do {
      final String key, sql;
      if (searchTransformations) {
        key="String_Node_Str";
        sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      }
 else {
        key="String_Node_Str";
        sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
      }
      final Integer targetKey=searchTransformations ? null : pair[1];
      try (ResultSet result=executeQuery(key,sql,pair)){
        while (result.next()) {
          set.addAuthorityCode(getString(label,result,1),targetKey);
        }
      }
     }
 while ((searchTransformations=!searchTransformations) == true);
    final String[] codes=set.getAuthorityCodes();
    if (codes.length > 1 && sort("String_Node_Str",codes)) {
      set.setAuthorityCodes(codes);
    }
  }
 catch (  SQLException exception) {
    throw databaseFailure(CoordinateOperation.class,label,exception);
  }
  set.resolve(1);
  return set;
}