OSDN Git Service

リファクタリング
authorsenju <senju@users.sourceforge.jp>
Sun, 23 Aug 2009 07:20:51 +0000 (16:20 +0900)
committersenju <senju@users.sourceforge.jp>
Sun, 23 Aug 2009 07:20:51 +0000 (16:20 +0900)
src/jp/sourceforge/rabbitBTS/controllers/MembersController.java
src/jp/sourceforge/rabbitBTS/controllers/RegisterController.java
src/jp/sourceforge/rabbitBTS/services/AccountService.java

index c0e4981..09149ea 100644 (file)
@@ -53,7 +53,7 @@ public class MembersController extends BaseController implements IController {
                        return;
                }
                // TODO:他の条件が入った場合修正
-               final Account account = this.accountService.fetchAccountByNickName(form
+               final Account account = this.accountService.getAccountByNickName(form
                                .getNickName());
                final List<Account> accList = new ArrayList<Account>(1);
                map.addAttribute("accounts", accList);
@@ -69,7 +69,7 @@ public class MembersController extends BaseController implements IController {
                // TODO: 管理者チェック
                Account account = null;
                if (accountId != null) {
-                       account = this.accountService.fetchAccountById(accountId);
+                       account = this.accountService.getAccountById(accountId);
                }
 
                if (account == null) {
@@ -88,7 +88,7 @@ public class MembersController extends BaseController implements IController {
                // TODO: 管理者チェック
                if (accountId != null) {
                        final Account accForDel = this.accountService
-                                       .fetchAccountById(accountId);
+                                       .getAccountById(accountId);
                        // TODO: 取得できたかチェック
                        this.accountService.deleteAccount(accForDel);
                        // TODO: ランタイム例外の処理
index 5224375..f1e516d 100644 (file)
@@ -117,7 +117,7 @@ public final class RegisterController extends BaseController implements
 
                try {
                        // nickName重複チェック
-                       if (this.accountService.fetchAccountByNickName(account
+                       if (this.accountService.getAccountByNickName(account
                                        .getNickName()) != null) {
                                result.rejectValue("nickName", "Account.nickName[duplicate]");
                                Sht.log(this).finer("nickName重複チェックエラー");
index 5d0b8fc..e3723d8 100644 (file)
@@ -131,7 +131,7 @@ public class AccountService {
         *            検索するアカウントのニックネーム
         * @return 見つかったアカウント。無い場合null。
         */
-       public Account fetchAccountByNickName(String nickName) {
+       public Account getAccountByNickName(String nickName) {
                final Account account = this.accountDao.findAccountByNickName(nickName);
                return account;
        }
@@ -143,7 +143,7 @@ public class AccountService {
         *            検索対象のID
         * @return 見つかったアカウント。見つからない場合null。
         */
-       public Account fetchAccountById(Long id) {
+       public Account getAccountById(Long id) {
                try {
                        return this.accountDao.get(id);
                } catch (final DataRetrievalFailureException e) {
@@ -171,13 +171,6 @@ public class AccountService {
        }
 
        /**
-        * @return the firstSuperUser
-        */
-       public String getFirstSuperUser() {
-               return this.firstSuperUser;
-       }
-
-       /**
         * @param firstSuperUser
         *            the firstSuperUser to set
         */