{"id":74,"date":"2012-03-28T16:10:42","date_gmt":"2012-03-28T15:10:42","guid":{"rendered":"http:\/\/www.flamingpenguin.co.uk\/blog\/?p=74"},"modified":"2012-03-28T16:10:42","modified_gmt":"2012-03-28T15:10:42","slug":"refactoring-ideas-inline-method-with-flag-parameter","status":"publish","type":"post","link":"https:\/\/www.flamingpenguin.co.uk\/blog\/2012\/03\/28\/refactoring-ideas-inline-method-with-flag-parameter\/","title":{"rendered":"Refactoring Ideas: inline method with flag parameter"},"content":{"rendered":"<p>Check all calls to see if the value of the flag can be analysed, if so inline everywhere (otherwise tell the developer where it is ambiguous):<\/p>\n<pre lang=\"java\">\r\n   public static String pad(final String string, final int length, final char character, final boolean before)\r\n   {\r\n      if(before)\r\n      {\r\n         return leftPad(string, length, character);\r\n      }\r\n      else\r\n      {\r\n         return rightPad(string, length, character);\r\n      }\r\n   }\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Check all calls to see if the value of the flag can be analysed, if so inline everywhere (otherwise tell the developer where it is ambiguous): public static String pad(final String string, final int length, final char character, final boolean &hellip; <a href=\"https:\/\/www.flamingpenguin.co.uk\/blog\/2012\/03\/28\/refactoring-ideas-inline-method-with-flag-parameter\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,31],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-java","category-refactoring"],"_links":{"self":[{"href":"https:\/\/www.flamingpenguin.co.uk\/blog\/wp-json\/wp\/v2\/posts\/74","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingpenguin.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingpenguin.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingpenguin.co.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingpenguin.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":0,"href":"https:\/\/www.flamingpenguin.co.uk\/blog\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.flamingpenguin.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingpenguin.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingpenguin.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}