{"action":"created","issue":{"url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/issues/255","repository_url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer","labels_url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/issues/255/comments","events_url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/issues/255/events","html_url":"https://github.com/SpartanRefactoring/Spartanizer/issues/255","id":179060997,"number":255,"title":"Extract tail method","user":{"login":"yossigil","id":12775400,"avatar_url":"https://avatars.githubusercontent.com/u/12775400?v=3","gravatar_id":"","url":"https://api.github.com/users/yossigil","html_url":"https://github.com/yossigil","followers_url":"https://api.github.com/users/yossigil/followers","following_url":"https://api.github.com/users/yossigil/following{/other_user}","gists_url":"https://api.github.com/users/yossigil/gists{/gist_id}","starred_url":"https://api.github.com/users/yossigil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yossigil/subscriptions","organizations_url":"https://api.github.com/users/yossigil/orgs","repos_url":"https://api.github.com/users/yossigil/repos","events_url":"https://api.github.com/users/yossigil/events{/privacy}","received_events_url":"https://api.github.com/users/yossigil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/labels/innovation","name":"innovation","color":"fbca04"},{"url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/labels/new-tipper","name":"new-tipper","color":"55A532"},{"url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/labels/YPP","name":"YPP","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/milestones/12","html_url":"https://github.com/SpartanRefactoring/Spartanizer/milestones/YPP:%20Step%20-1","labels_url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/milestones/12/labels","id":2029022,"number":12,"title":"YPP: Step -1","description":"Initial organization of projects","creator":{"login":"yossigil","id":12775400,"avatar_url":"https://avatars.githubusercontent.com/u/12775400?v=3","gravatar_id":"","url":"https://api.github.com/users/yossigil","html_url":"https://github.com/yossigil","followers_url":"https://api.github.com/users/yossigil/followers","following_url":"https://api.github.com/users/yossigil/following{/other_user}","gists_url":"https://api.github.com/users/yossigil/gists{/gist_id}","starred_url":"https://api.github.com/users/yossigil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yossigil/subscriptions","organizations_url":"https://api.github.com/users/yossigil/orgs","repos_url":"https://api.github.com/users/yossigil/repos","events_url":"https://api.github.com/users/yossigil/events{/privacy}","received_events_url":"https://api.github.com/users/yossigil/received_events","type":"User","site_admin":false},"open_issues":40,"closed_issues":0,"state":"open","created_at":"2016-09-26T14:24:09Z","updated_at":"2016-09-26T22:04:01Z","due_on":"2016-10-20T00:00:00Z","closed_at":null},"comments":1,"created_at":"2016-09-25T00:58:15Z","updated_at":"2016-09-27T03:00:55Z","closed_at":null,"body":"When you find that the suffix of a method has a tail, extract the tail passing to it only live arguments.  Use the same method name. "},"comment":{"url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/issues/comments/249754356","html_url":"https://github.com/SpartanRefactoring/Spartanizer/issues/255#issuecomment-249754356","issue_url":"https://api.github.com/repos/SpartanRefactoring/Spartanizer/issues/255","id":249754356,"user":{"login":"yossigil","id":12775400,"avatar_url":"https://avatars.githubusercontent.com/u/12775400?v=3","gravatar_id":"","url":"https://api.github.com/users/yossigil","html_url":"https://github.com/yossigil","followers_url":"https://api.github.com/users/yossigil/followers","following_url":"https://api.github.com/users/yossigil/following{/other_user}","gists_url":"https://api.github.com/users/yossigil/gists{/gist_id}","starred_url":"https://api.github.com/users/yossigil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yossigil/subscriptions","organizations_url":"https://api.github.com/users/yossigil/orgs","repos_url":"https://api.github.com/users/yossigil/repos","events_url":"https://api.github.com/users/yossigil/events{/privacy}","received_events_url":"https://api.github.com/users/yossigil/received_events","type":"User","site_admin":false},"created_at":"2016-09-27T03:00:55Z","updated_at":"2016-09-27T03:00:55Z","body":"Another example, from \r\n```java\r\n   private static String runScript(final String pathname) throws IOException {\r\n    final ProcessBuilder builder = new ProcessBuilder(\"/bin/bash\");\r\n    builder.command(script, pathname);\r\n    builder.redirectErrorStream(true);\r\n    final Process process = builder.start();\r\n    final InputStream stdout = process.getInputStream();\r\n    try (final BufferedReader r = new BufferedReader(new InputStreamReader(stdout))) {\r\n      String ¢;\r\n      for (final StringBuffer $ = new StringBuffer();; $.append(¢))\r\n        if ((¢ = r.readLine()) == null)\r\n          return $ + \"\";\r\n    }\r\n  }\r\n```\r\nto\r\n```java\r\n  private static String runScript(final String pathname) throws IOException {\r\n    final ProcessBuilder builder = new ProcessBuilder(\"/bin/bash\");\r\n    builder.command(script, pathname);\r\n    builder.redirectErrorStream(true);\r\n    final Process process = builder.start();\r\n    return runScript(process);\r\n  }\r\n```\r\n\r\nfollowed by the automatically generated auxiliary method\r\n```java\r\n  public static String runScript(final Process p) throws IOException {\r\n    try (final InputStream s = p.getInputStream();\r\n        final BufferedReader r = new BufferedReader(new InputStreamReader(s))) {\r\n      String ¢;\r\n      for (final StringBuffer $ = new StringBuffer();; $.append(¢))\r\n        if ((¢ = r.readLine()) == null)\r\n          return $ + \"\";\r\n    }\r\n  }\r\n```\r\n\r\nNote that this auxiliary method must have  the same name, the parameter names could be just generic names, or the names of the variables. "}}
{"actor":{"display_login":"yossigil"}}