{"action":"closed","issue":{"url":"https://api.github.com/repos/SmallButTeam/LandOfDKL_project/issues/3","labels_url":"https://api.github.com/repos/SmallButTeam/LandOfDKL_project/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/SmallButTeam/LandOfDKL_project/issues/3/comments","events_url":"https://api.github.com/repos/SmallButTeam/LandOfDKL_project/issues/3/events","html_url":"https://github.com/SmallButTeam/LandOfDKL_project/issues/3","id":63387178,"number":3,"title":"public class Router extends HttpServlet","user":{"login":"vitaly-chibrikov","id":339337,"avatar_url":"https://avatars.githubusercontent.com/u/339337?v=3","gravatar_id":"","url":"https://api.github.com/users/vitaly-chibrikov","html_url":"https://github.com/vitaly-chibrikov","followers_url":"https://api.github.com/users/vitaly-chibrikov/followers","following_url":"https://api.github.com/users/vitaly-chibrikov/following{/other_user}","gists_url":"https://api.github.com/users/vitaly-chibrikov/gists{/gist_id}","starred_url":"https://api.github.com/users/vitaly-chibrikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitaly-chibrikov/subscriptions","organizations_url":"https://api.github.com/users/vitaly-chibrikov/orgs","repos_url":"https://api.github.com/users/vitaly-chibrikov/repos","events_url":"https://api.github.com/users/vitaly-chibrikov/events{/privacy}","received_events_url":"https://api.github.com/users/vitaly-chibrikov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-21T10:27:37Z","updated_at":"2015-03-22T13:01:40Z","closed_at":"2015-03-22T13:01:40Z","body":"1. Убрать не используемые поля\r\n    private String login = \"\";\r\n\r\n    FightFinder fightFinder = new FightFinder();\r\n2. убрать закоментированный код\r\n3. не использовать return для выхода из void\r\n4. \r\nString[] urlBuf = url.split(\"/\");\r\n            String[] urlParts;\r\n            if (urlBuf.length < 4){\r\n                urlParts = new String[4];\r\n                System.arraycopy(urlBuf,0,urlParts,0,urlBuf.length);\r\n                urlParts[3] = \"main\";\r\n            } else {\r\n                urlParts = urlBuf;\r\n            }\r\n\r\nвынести в отдельный метод чтобы можно было тестировать\r\n5.\r\nObject obj = cls.newInstance();\r\n            Class[] paramTypes = new Class[] {HttpServletRequest.class,HttpServletResponse.class};\r\n            Method method = cls.getMethod(urlParts[3].toLowerCase(), paramTypes);\r\n            Object[] args = new Object[] {request, response};\r\n            method.invoke(obj, args);\r\nвынести в отдельный метод чтобы можно было тестировать\r\n\r\n6. \r\n e.printStackTrace();\r\nSystem.err.println(e.getMessage() + \" In Router\");\r\nзаменить на Logger"}}