Source:
private GerritConfig create() { final GerritConfig config = new GerritConfig(); config.setCanonicalUrl(canonicalWebUrl); config.setUseContributorAgreements(cfg.getBoolean("auth", "contributoragreements", false)); config.setGitDaemonUrl(cfg.getString("gerrit", null, "canonicalgiturl")); config.setUseRepoDownload(cfg.getBoolean("repo", null, "showdownloadcommand", false)); config.setUseContactInfo(contactStore != null && contactStore.isEnabled()); config.setAuthType(authConfig.getAuthType()); config.setWildProject(wildProject); config.setApprovalTypes(approvalTypes); final Set<Account.FieldName> fields = new HashSet<Account.FieldName>(); for (final Account.FieldName n : Account.FieldName.values()) { if (realm.allowsEdit(n)) { fields.add(n); } } if (emailSender != null && emailSender.isEnabled()) { fields.add(Account.FieldName.REGISTER_NEW_EMAIL); } config.setEditableAccountFields(fields); final String gitwebUrl = cfg.getString("gitweb", null, "url"); if (gitwebUrl != null) { config.setGitwebLink(new GitwebLink(gitwebUrl)); } config.setSshdAddress(sshInfo != null ? sshInfo.getSshdAddress() : null); ArrayList<String> commentLinkNames = new ArrayList<String>(cfg.getSubsections("CommentLink")); ArrayList<RegexFindReplace> commentLinks = new ArrayList<RegexFindReplace>(commentLinkNames.size()); for (String commentLinkName : commentLinkNames) { String match = cfg.getString("CommentLink", commentLinkName, "match"); String link = cfg.getString("CommentLink", commentLinkName, "link"); commentLinks.add(new RegexFindReplace(match, link)); } config.setCommentLinks(commentLinks); return config; }

Target:
private GerritConfig create() { final GerritConfig config = new GerritConfig(); config.setCanonicalUrl(canonicalWebUrl); config.setUseContributorAgreements(cfg.getBoolean("auth", "contributoragreements", false)); config.setGitDaemonUrl(cfg.getString("gerrit", null, "canonicalgiturl")); config.setUseRepoDownload(cfg.getBoolean("repo", null, "showdownloadcommand", false)); config.setUseContactInfo(contactStore != null && contactStore.isEnabled()); config.setAuthType(authConfig.getAuthType()); config.setWildProject(wildProject); config.setApprovalTypes(approvalTypes); final Set<Account.FieldName> fields = new HashSet<Account.FieldName>(); for (final Account.FieldName n : Account.FieldName.values()) { if (realm.allowsEdit(n)) { fields.add(n); } } if (emailSender != null && emailSender.isEnabled()) { fields.add(Account.FieldName.REGISTER_NEW_EMAIL); } config.setEditableAccountFields(fields); final String gitwebUrl = cfg.getString("gitweb", null, "url"); if (gitwebUrl != null) { config.setGitwebLink(new GitwebLink(gitwebUrl)); } config.setSshdAddress(sshInfo != null ? sshInfo.getSshdAddress() : null); ArrayList<String> commentLinkNames = new ArrayList<String>(cfg.getSubsections("CommentLink")); ArrayList<RegexFindReplace> commentLinks = new ArrayList<RegexFindReplace>(commentLinkNames.size()); for (String commentLinkName : commentLinkNames) { String match = cfg.getString("CommentLink", commentLinkName, "match"); String link = "<a href=\"" + cfg.getString("CommentLink", commentLinkName, "link") + "\">$&</a>"; commentLinks.add(new RegexFindReplace(match, link)); } config.setCommentLinks(commentLinks); return config; }