* @throws FactoryException if an error occured.
*
* @since 2.4
*/
protected Set reportDuplicatedCodes(final PrintWriter out) throws FactoryException {
final AbstractAuthorityFactory sqlFactory = getFactory(ThreadedEpsgFactory.class);
final Vocabulary resources = Vocabulary.getResources(null);
out.println(resources.getLabel(VocabularyKeys.COMPARE_WITH));
try {
final IndentedLineWriter w = new IndentedLineWriter(out);
w.setIndentation(4);
w.write(sqlFactory.getBackingStoreDescription());
w.flush();
} catch (IOException e) {
// Should never happen, since we are writting to a PrintWriter.
throw new AssertionError(e);
}
out.println();
final Set<String> wktCodes = this. getAuthorityCodes(IdentifiedObject.class);
final Set<String> sqlCodes = sqlFactory.getAuthorityCodes(IdentifiedObject.class);
final Set<String> duplicated = new TreeSet<String>();
for (String code : wktCodes) {
code = code.trim();
if (sqlCodes.contains(code)) {
duplicated.add(code);