{"id":313963,"date":"2020-11-28T15:01:10","date_gmt":"2020-11-28T15:01:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=313963"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=313963","title":{"rendered":"\u0420\u0430\u0437\u0434\u0435\u043b \u00abRefactor\u00bb \u0432 IDEA"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u042d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 c gif-\u043a\u0430\u043c\u0438 \u043f\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430\u043c Java-\u0444\u0430\u0439\u043b\u043e\u0432 \u0432 IDEA \u0434\u043b\u044f <em>\u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445<\/em>.<\/p>\n<p><em>\u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e<\/em>, \u043c\u043d\u043e\u0433\u043e \u0442\u044f\u0436\u0435\u043b\u044b\u0445 gif-\u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xj\/a_\/rj\/xja_rjy8r4xuuattcjwrnrv6etc.jpeg\" width=\"521\" height=\"369\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<p><em>&#171;Any fool can write code that a computer can understand. Good programmers write code that humans can understand.\u201d \u2014M. Fowler (1999)<\/em> <\/p>\n<h2>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h2>\n<p><a href=\"#introduction\" rel=\"noopener noreferrer nofollow\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/a> <\/p>\n<p><a href=\"#Refa\u0441tor\" rel=\"noopener noreferrer nofollow\">\u0420\u0430\u0437\u0434\u0435\u043b \u00abRefa\u0441tor\u00bb<\/a> <a href=\"#Refactor-This\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#Refactor-This\" rel=\"noopener noreferrer nofollow\">&#8212;  Refactor This<\/a> <a href=\"#Rename\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Rename\" rel=\"noopener noreferrer nofollow\">&#8212;  Rename<\/a> <a href=\"#RenameFile\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#RenameFile\" rel=\"noopener noreferrer nofollow\">&#8212;  Rename File<\/a> <a href=\"#ChangeSignature\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ChangeSignature\" rel=\"noopener noreferrer nofollow\">&#8212;  Change Signature<\/a> <a href=\"#EditPropertyValue\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#EditPropertyValue\" rel=\"noopener noreferrer nofollow\">&#8212;  Edit Property Value (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#TypeMigration\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#TypeMigration\" rel=\"noopener noreferrer nofollow\">&#8212; Type Migration<\/a> <a href=\"#MakeStatic\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#MakeStatic\" rel=\"noopener noreferrer nofollow\">&#8212; Make Static<\/a> <a href=\"#ConvertToInstanceMethod\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ConvertToInstanceMethod\" rel=\"noopener noreferrer nofollow\">&#8212; Convert To Instance Method<\/a> <a href=\"#MoveClasses\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#MoveClasses\" rel=\"noopener noreferrer nofollow\">&#8212; Move Classes<\/a> <a href=\"#CopyClasses\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#CopyClasses\" rel=\"noopener noreferrer nofollow\">&#8212; Copy Classes<\/a> <a href=\"#Safedelete\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Safedelete\" rel=\"noopener noreferrer nofollow\">&#8212; Safe Delete<\/a> <a href=\"#ExtractIntroduce\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#ExtractIntroduce\" rel=\"noopener noreferrer nofollow\">&#8212; Extract\/Introduce<\/a> <a href=\"#Variable\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#Variable\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Variable<\/a> <a href=\"#Constant\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Constant\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Constant<\/a> <a href=\"#Field\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Field\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Field<\/a> <a href=\"#Parameter\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Parameter\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Parameter<\/a> <a href=\"#FunctionalParameter\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#FunctionalParameter\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Functional Parameter<\/a> <a href=\"#FunctionalVariable\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#FunctionalVariable\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Functional Variable<\/a> <a href=\"#ParameterObject\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ParameterObject\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Parameter Object<\/a> <a href=\"#Method\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Method\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Method<\/a> <a href=\"#TypeParameter\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#TypeParameter\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Type Parameter (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#Interface\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Interface\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Interface<\/a> <a href=\"#Superclass\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Superclass\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Superclass<\/a> <a href=\"#SubqueryasCTE\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#SubqueryasCTE\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Subquery as CTE  (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#RSpeclet\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#RSpeclet\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; RSpec &#8216;let&#8217;  (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#Inline\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Inline\" rel=\"noopener noreferrer nofollow\">&#8212; Inline<\/a> <a href=\"#FindandReplacecodeduplicate\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#FindandReplacecodeduplicate\" rel=\"noopener noreferrer nofollow\">&#8212; Find and Replace Code Duplicate<\/a> <a href=\"#PullMemberUp\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#PullMemberUp\" rel=\"noopener noreferrer nofollow\">&#8212; Pull Member Up<\/a> <a href=\"#PullMemberDown\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#PullMemberDown\" rel=\"noopener noreferrer nofollow\">&#8212; Pull Member Down<\/a> <a href=\"#PushITdsIn\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#PushITdsIn\" rel=\"noopener noreferrer nofollow\">&#8212; Push ITds In<\/a> <a href=\"#UseInterfaceWherePossible\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#UseInterfaceWherePossible\" rel=\"noopener noreferrer nofollow\">&#8212; Use Interface Where Possible<\/a> <a href=\"#ReplaceInheritancewithdelegation\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ReplaceInheritancewithdelegation\" rel=\"noopener noreferrer nofollow\">&#8212; Replace Inheritance with Delegation<\/a> <a href=\"#RemoveMiddleman\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#RemoveMiddleman\" rel=\"noopener noreferrer nofollow\">&#8212; Remove Middleman<\/a> <a href=\"#WrapMethodReturnValue\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#WrapMethodReturnValue\" rel=\"noopener noreferrer nofollow\">&#8212; Wrap Method Return Value<\/a> <a href=\"#EncapsulateField\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#EncapsulateField\" rel=\"noopener noreferrer nofollow\">&#8212; Encapsulate Field<\/a> <a href=\"#ReplacetempwithQuery\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ReplacetempwithQuery\" rel=\"noopener noreferrer nofollow\">&#8212; Replace Temp with Query<\/a> <a href=\"#ReplaceConstructorwithFactoryMethod\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ReplaceConstructorwithFactoryMethod\" rel=\"noopener noreferrer nofollow\">&#8212; Replace Constructor with Factory Method<\/a> <a href=\"#ReplaceConstructorwithBuilder\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ReplaceConstructorwithBuilder\" rel=\"noopener noreferrer nofollow\">&#8212; Replace Constructor with Builder<\/a> <a href=\"#Generify\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Generify\" rel=\"noopener noreferrer nofollow\">&#8212; Generify<\/a> <a href=\"#Migrate\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Migrate\" rel=\"noopener noreferrer nofollow\">&#8212; Migrate<\/a> <a href=\"#Lombok\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#Lombok\" rel=\"noopener noreferrer nofollow\">&#8212; Lombok \u0438 Delombok (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#Internationalize\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Internationalize\" rel=\"noopener noreferrer nofollow\">&#8212; Internationalize<\/a> <a href=\"#NOTES\" rel=\"noopener noreferrer nofollow\">\u0421\u043f\u0438\u0441\u043e\u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/a><\/p>\n<p><a class=\"anchor\" name=\"introduction\" id=\"introduction\"><\/a><\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0426\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0434\u043b\u044f Java-\u0444\u0430\u0439\u043b\u043e\u0432 (\u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432). \u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u0438\u0435\u043c\u044b \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0432\u0438\u0434\u0435\u043e \u0422\u0430\u0433\u0438\u0440\u0430 \u0412\u0430\u043b\u0435\u0435\u0432\u0430 (\u0441\u0441\u044b\u043b\u043a\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <a href=\"#NOTES\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/a>). <\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 IDEA, \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u043d\u0435\u0439 \u043a\u0443\u0447\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u0434\u0430. \u0418 \u043f\u043e\u0447\u0442\u0438 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0430\u043d\u043e\u043d\u0441\u044b \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0433\u0434\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u043e\u0432\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438 \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u043b \u0432 \u0440\u0430\u0437\u0434\u0435\u043b Refa\u0441tor:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jz\/2t\/g3\/jz2tg386w7rapjoo7_mc9gvnq_c.png\" alt=\" \u0420\u0438\u0441. 1. \u0420\u0430\u0437\u0434\u0435\u043b Refactoring IDEA\" title=\" \u0420\u0438\u0441. 1. \u0420\u0430\u0437\u0434\u0435\u043b Refactoring IDEA\" width=\"282\" height=\"701\"><figcaption> \u0420\u0438\u0441. 1. \u0420\u0430\u0437\u0434\u0435\u043b Refactoring IDEA<\/figcaption><\/figure>\n<p>\u041d\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0432\u0441\u0435 \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u044e\u0442 \u0447\u0442\u043e \u0438 \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u044e\u0442 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u0445\u043e\u0442\u044f \u043e\u043d\u0438 \u0432\u0441\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432  <a href=\"https:\/\/www.jetbrains.com\/help\/idea\/refactoring-source-code.html\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u043a idea<\/a><\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0433\u0434\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u043d\u0438\u0433\u0443  <a href=\"https:\/\/martinfowler.com\/books\/refactoring.html\" rel=\"noopener noreferrer nofollow\">Refactoring: Improving the Design of Existing Code (Martin Fowler)<\/a>. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e  \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e gif-\u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c. \u0413\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0434\u043b\u044f  Windows\/LInux \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p><a class=\"anchor\" name=\"Refa\u0441tor\" id=\"Refa\u0441tor\"><\/a><\/p>\n<h2>\u0420\u0430\u0437\u0434\u0435\u043b \u00abRefa\u0441tor\u00bb<\/h2>\n<p>\u041f\u043e\u0439\u0434\u0435\u043c \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<p><a class=\"anchor\" name=\"Refactor-This\" id=\"Refactor-This\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abRefactor This\u00bb (Ctrl+Alt+Shift+T)<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043f\u0438\u0441\u043a\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432  \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u0432\u044b \u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435. \u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u0434\u0435  \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u043a\u0430\u0440\u0435\u0442\u043a\u0438 \u0432 \u043a\u043e\u0434\u0435, \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rb\/gs\/lt\/rbgsltgg4vv5wfa8nwqvzzv2ydg.png\" alt=\"\u0420\u0438\u0441. 2. \u00abRefactor This\u00bb \u0434\u043b\u044f \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\" title=\"\u0420\u0438\u0441. 2. \u00abRefactor This\u00bb \u0434\u043b\u044f \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\" width=\"582\" height=\"563\"><figcaption>\u0420\u0438\u0441. 2. \u00abRefactor This\u00bb \u0434\u043b\u044f \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/figcaption><\/figure>\n<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ms\/dl\/ya\/msdlyalvtetei2fozhslfqkcnoa.png\" alt=\"\u0420\u0438\u0441. 3. \u00abRefactor This\u00bb \u0434\u043b\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\" title=\"\u0420\u0438\u0441. 3. \u00abRefactor This\u00bb \u0434\u043b\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\" width=\"530\" height=\"609\"><figcaption>\u0420\u0438\u0441. 3. \u00abRefactor This\u00bb \u0434\u043b\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/figcaption><\/figure>\n<p><a class=\"anchor\" name=\"Rename\" id=\"Rename\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abRename\u00bb (Shift+F6)<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432 \u043a\u043e\u0434\u0435, \u0431\u0443\u0434\u044c \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. (\u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043e 2 \u0433\u043b\u0430\u0432\u044b &#8212; \u201cRename Field\u201d  \u0438 \u201cRename Variable\u201d)<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/47c\/d2a\/6f4\/47cd2a6f4fa743a81d584f78cf0a9ce5.gif\" alt=\"\u0420\u0438\u0441. 4. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430\" title=\"\u0420\u0438\u0441. 4. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430\" width=\"573\" height=\"338\"><figcaption>\u0420\u0438\u0441. 4. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invo&lt;caret\/&gt;ke(\", World\");    }     private static void invoke(String text) {        \/\/text        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        newFunctionName(\", World\");    }     private static void newFunctionName(String text) {        \/\/text        System.out.println(text);    } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ly\/nd\/7n\/lynd7nevzgg6y5f4utedc0yvlvc.gif\" alt=\" \u0420\u0438\u0441. 5. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439\" title=\" \u0420\u0438\u0441. 5. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439\" width=\"573\" height=\"338\"><figcaption> \u0420\u0438\u0441. 5. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invoke(\", World\");    }     private static void invoke(String te&lt;caret&gt;xt) {        \/\/text        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invoke(\", World\");    }     private static void invoke(String newText) {        \/\/newText        System.out.println(newText);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/uh\/qa\/0v\/uhqa0vouxyysocrpmzn-ycdcpcm.gif\" alt=\" \u0420\u0438\u0441. 6. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430\" title=\" \u0420\u0438\u0441. 6. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430\" width=\"586\" height=\"367\"><figcaption> \u0420\u0438\u0441. 6. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invoke(\", World\");    }     private static void invoke(String text) {        \/\/text        System.out.println(text);        throw new MyExc&lt;caret&gt;eption();    }     public static class MyException extends RuntimeException {    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invoke(\", World\");    }     private static void invoke(String text) {        \/\/text        System.out.println(text);        throw new NewMyException ();    }     public static class NewMyException extends RuntimeException {    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/si\/ol\/bj\/siolbj-ayixfpbtw7n_gy-n1nbw.gif\" alt=\" \u0420\u0438\u0441. 7. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430\" title=\" \u0420\u0438\u0441. 7. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430\" width=\"974\" height=\"437\"><figcaption> \u0420\u0438\u0441. 7. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        MyS&lt;caret&gt;ervice service = new MyService();        service.service();    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        NewMyService myService = new NewMyService ();        myService.service();    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/520\/670\/6c3\/5206706c30ac79e678108bfacea5a05a.gif\" alt=\" \u0420\u0438\u0441. 8. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430\" title=\" \u0420\u0438\u0441. 8. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430\" width=\"974\" height=\"437\"><figcaption> \u0420\u0438\u0441. 8. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">package gen&lt;caret&gt;eral;  public class Main {    public static void main(String[] args) {        NewMyService service = new NewMyService();        service.service();    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">package org.test.java.src;  public class Main {    public static void main(String[] args) {        NewMyService service = new NewMyService();        service.service();    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"RenameFile\" id=\"RenameFile\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abRename File\u00bb<\/h3>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b.  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Shift+F6 \u0435\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u0444\u0430\u0439\u043b. \u0412 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0439 (Scope), \u0438\u0441\u043a\u0430\u0442\u044c \u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0438  \u0438\u043b\u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u0445<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/67b\/dda\/3a6\/67bdda3a6a08c226d7cb18f42bfb0233.gif\" alt=\" \u0420\u0438\u0441. 9. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abRename File\u00bb\" title=\" \u0420\u0438\u0441. 9. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abRename File\u00bb\" width=\"1010\" height=\"471\"><figcaption> \u0420\u0438\u0441. 9. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abRename File\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) throws IOException {        Path path = Paths.get(\"src\/general\/TestFile.txt\");         String read = Files.readAllLines(path).get(0);        System.out.println(read);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) throws IOException {        Path path = Paths.get(\"src\/general\/TestFile2.txt\");         String read = Files.readAllLines(path).get(0);        System.out.println(read);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"ChangeSignature\" id=\"ChangeSignature\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abChange Signature\u00bb (Ctrl+F6)<\/h3>\n<p>\u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0433\u043b\u0430\u0432\u0430 \u201cChange Function Declaration\u201d. \u0412 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 IDEA \u00abChange Signature\u00bb \u0431\u044b\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d. \u042f \u0437\u043d\u0430\u044e \u0434\u0432\u0430 \u043f\u0443\u0442\u0438: <\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0443\u0442\u044c &#8212; \u043f\u0440\u044f\u043c\u043e\u0439 &#8212; \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435,<\/p>\n<\/li>\n<li>\n<p>\u0432\u0442\u043e\u0440\u043e\u0439 &#8212; \u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 (\u0447\u0435\u0440\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u0430)<\/em><\/strong><\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u043c\u0435\u0442\u043e\u0434\u0430. \u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043b\u0435\u0432\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>&#171;R&#187;<\/em> \u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u043c \u043c\u0435\u043d\u044e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u043d\u043a\u0442 <em>&#171;Update usages to reflect signature change&#187;<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/905\/1d4\/fca\/9051d4fcaedb5172eeede352b484a9bc.gif\" alt=\"\u0420\u0438\u0441. 10. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abUpdate usages to reflect signature change\u00bb\" title=\"\u0420\u0438\u0441. 10. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abUpdate usages to reflect signature change\u00bb\" width=\"945\" height=\"501\"><figcaption>\u0420\u0438\u0441. 10. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abUpdate usages to reflect signature change\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {    public static void main(String[] args) {        invokeMethod(\"Hello\");        invokeMethod(\"World\");    }     private static void invokeMethod(String text) {        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {    public static void main(String[] args) {        invokeMethod(\"Hello\", null);        invokeMethod(\"World\", null);    }     private static void invokeMethod(String text, String newType) {        System.out.println(text);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 (\u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e)<\/em><\/strong><\/p>\n<p>\u0412 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, exception, \u0438 \u0434\u0430\u0436\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a0\/63e\/430\/4a063e430f4dd9a3123eff9d66b0fca8.gif\" alt=\"\u0420\u0438\u0441. 11. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abChange Signature\u00bb\" title=\"\u0420\u0438\u0441. 11. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abChange Signature\u00bb\" width=\"1130\" height=\"643\"><figcaption>\u0420\u0438\u0441. 11. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abChange Signature\u00bb<\/figcaption><\/figure>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {    public static void main(String[] args) {        invokeMethod(\"Hello\");        invokeMethod(\"World\");    }     private static void invokeMethod(String&lt;caret&gt; text) {        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {    public static void main(String[] args) {        invokeMethod(\"Hello\");        invokeMethod(\"World\");    }     private static void invokeMethod(String text) {        invokeMethod(text, null);    }     private static void invokeMethod(String text, String newName) {        System.out.println(text);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"EditPropertyValue\" id=\"EditPropertyValue\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abEdit Property Value\u00bb  (Alt + F6)<\/h3>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 (Idea 2020.2) \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430. \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c property.value.inplace.editing=true \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443.<\/p>\n<p><a class=\"anchor\" name=\"TypeMigration\" id=\"TypeMigration\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abType Migration\u00bb  (Ctrl + Shift + F6)<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7d3\/a6d\/8f3\/7d3a6d8f37ae343b7932a27c13c7abf3.gif\" alt=\"\u0420\u0438\u0441. 12. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abType Migration\u00bb\" title=\"\u0420\u0438\u0441. 12. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abType Migration\u00bb\" width=\"906\" height=\"378\"><figcaption>\u0420\u0438\u0441. 12. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abType Migration\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {     public static void main(String[] args) {        Inte&lt;caret&gt;ger hello = 1;        print(hello);    }     private static void print(Integer text) {        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {     public static void main(String[] args) {        Number hello = 1;        print(hello);    }     private static void print(Number text) {        System.out.println(text);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"MakeStatic\" id=\"MakeStatic\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abMake Static\u00bb  (Ctrl + Shift + F6)<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0438\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439. (\u041f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <a href=\"#ConvertToInstanceMethod\" rel=\"noopener noreferrer nofollow\">Convert To Instance Method<\/a>) <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d45\/fb7\/ecb\/d45fb7ecb83393173c73c88d049da7cd.gif\" alt=\"\u0420\u0438\u0441. 13. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abMake Static\u00bb\" title=\"\u0420\u0438\u0441. 13. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abMake Static\u00bb\" width=\"906\" height=\"451\"><figcaption>\u0420\u0438\u0441. 13. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abMake Static\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class MakeStatic {    public static void main(String[] args) {        MakeStatic makeStatic = new MakeStatic();        makeStatic.sayHello();    }     public void say&lt;caret&gt;Hello() {        System.out.println(\"Hello, World\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class MakeStatic {    public static void main(String[] args) {        MakeStatic makeStatic = new MakeStatic();        MakeStatic.sayHello();    }     public static void sayHello() {        System.out.println(\"Hello, World\");    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"ConvertToInstanceMethod\" id=\"ConvertToInstanceMethod\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abConvert To Instance Method\u00bb<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432 \u043d\u0435\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 (\u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <a href=\"#MakeStatic\" rel=\"noopener noreferrer nofollow\">\u201dMake Static\u201d<\/a>). \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5ac\/e9e\/c89\/5ace9ec89f9a3f2306b97cd029fa8464.gif\" alt=\"\u0420\u0438\u0441. 14. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abConvert To Instance Method\u00bb\" title=\"\u0420\u0438\u0441. 14. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abConvert To Instance Method\u00bb\" width=\"906\" height=\"374\"><figcaption>\u0420\u0438\u0441. 14. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abConvert To Instance Method\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class MakeStatic {    public static void main(String[] args) {        sayHello();    }     public static void sa&lt;caret&gt;yHello() {        System.out.println(\"Hello, World\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class MakeStatic {    public static void main(String[] args) {        new MakeStatic().sayHello();    }     public void sayHello() {        System.out.println(\"Hello, World\");    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"MoveClasses\" id=\"MoveClasses\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abMove Classes\u00bb (F6) <\/h3>\n<p>\u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0434\u0435\u043b\u0430\u0435\u0442, \u0447\u0442\u043e \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/01b\/30d\/3d4\/01b30d3d47ff65ddeab836c34618de39.gif\" alt=\"\u0420\u0438\u0441. 15. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abMove Classes\u00bb\" title=\"\u0420\u0438\u0441. 15. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abMove Classes\u00bb\" width=\"945\" height=\"543\"><figcaption>\u0420\u0438\u0441. 15. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abMove Classes\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">package org.example.test.service;  public class TestService { &lt;caret&gt; } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">package org.example.test;  public class TestService { } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"CopyClasses\" id=\"CopyClasses\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abCopy Classes\u00bb (F5) <\/h3>\n<p>\u041c\u043d\u043e\u0433\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043b\u044e\u0431\u044f\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b,  \u0430 \u043d\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441 \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u043b\u0438\u0441\u0442\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 F5. \u041c\u0435\u043d\u044f\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043d\u0443\u0436\u043d\u043ee, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442 \u0438 \u0433\u043e\u0442\u043e\u0432\u043e. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/l4\/cx\/l9\/l4cxl9ikka4ykme-zgvl6qv6j-k.gif\" alt=\" \u0420\u0438\u0441. 16. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abCopy Classes\u00bb\" title=\" \u0420\u0438\u0441. 16. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abCopy Classes\u00bb\" width=\"945\" height=\"543\"><figcaption> \u0420\u0438\u0441. 16. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abCopy Classes\u00bb<\/figcaption><\/figure>\n<p><a class=\"anchor\" name=\"Safedelete\" id=\"Safedelete\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abSafe Delete\u00bb (Alt+Delete) <\/h3>\n<p>\u041f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e (Alt + Enter), \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435.  \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0443 \u043c\u043d\u043e\u0433\u0438\u0445 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 &#8212; <em>F2<\/em>(\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430) \u0438 <em>Alt + Enter<\/em> \u0438\u043b\u0438 <em>Alt + Delete<\/em>. \u041c\u043e\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u044b, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043c\u0435\u0442\u043e\u0434\u044b.  \u041f\u0435\u0440\u0435\u0434 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435\u043c IDEA \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u043f\u043e\u0438\u0441\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0434\u0430\u043b\u044f\u0435\u043c\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0438 \u0435\u0441\u043b\u0438 IDEA \u043d\u0430\u0439\u0434\u0435\u0442, \u0447\u0442\u043e \u043e\u043d\u0438 \u0433\u0434\u0435-\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e Usages Detected. \u041f\u0440\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0443 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u0430\u044f \u0433\u043b\u0430\u0432\u0430 &#8212; \u201cRemove Dead Code\u201d <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7e\/ab0\/60d\/b7eab060dd3b09ac4d1bc65500d8c303.gif\" alt=\" \u0420\u0438\u0441. 17. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abSafe Delete\u00bb\" title=\" \u0420\u0438\u0441. 17. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abSafe Delete\u00bb\" width=\"1028\" height=\"627\"><figcaption> \u0420\u0438\u0441. 17. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abSafe Delete\u00bb<\/figcaption><\/figure>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">package org.example.test;  public class MainClass {    public static void main(String[] args) {        start();    }     private static void start() {        String unUsedVariable;        System.out.println(\"Hello, World!\");    }     private static void unUsedMethod() {     } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">&lt;empty&gt; <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"ExtractIntroduce\" id=\"ExtractIntroduce\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abExtract\/Introduce\u00bb<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0431\u043b\u043e\u043a  &#8212; Extract\/Introduce. \u0414\u0443\u043c\u0430\u044e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0v\/ue\/9c\/0vue9ckyalh4pr6anvtxpaf_a8y.png\" alt=\" \u0420\u0438\u0441. 18. \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u00abExtract\/Introduce\u00bb\" title=\" \u0420\u0438\u0441. 18. \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u00abExtract\/Introduce\u00bb\" width=\"605\" height=\"350\"><figcaption> \u0420\u0438\u0441. 18. \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u00abExtract\/Introduce\u00bb<\/figcaption><\/figure>\n<p><a class=\"anchor\" name=\"Variable\" id=\"Variable\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abVariable\u00bb (Ctrl+Alt+V)<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0438\u0437 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430. (\u042d\u0442\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u0443 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0433\u043b\u0430\u0432\u0430 \u201cExtract Variable\u201d).<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/229\/bbe\/e36\/229bbee36d800fff7af6f54f54669962.gif\" alt=\" \u0420\u0438\u0441. 19. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Variable\u00bb&#187; title=&#187; \u0420\u0438\u0441. 19. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Variable\u00bb&#187; width=&#187;770&#8243; height=&#187;395&#8243;><figcaption> \u0420\u0438\u0441. 19. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Variable\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractVariable {    public static void main(String[] args) {        sayHello();    }     private static void sayHello() {        System.out.println(\"He&lt;caret&gt;llo, World!\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractVariable {    public static void main(String[] args) {        sayHello();    }     private static void sayHello() {        String text = \"Hello, World!\";        System.out.println(text);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"Constant\" id=\"Constant\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abConstant\u00bb (Ctrl+Alt+C)<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u0438\u0437 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ad5\/c0d\/613\/ad5c0d6136d7be1e264f6a5a762fa838.gif\" alt=\" \u0420\u0438\u0441. 20. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Constant\u00bb&#187; title=&#187; \u0420\u0438\u0441. 20. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Constant\u00bb&#187; width=&#187;770&#8243; height=&#187;395&#8243;><figcaption> \u0420\u0438\u0441. 20. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Constant\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractVariable {    public static void main(String[] args) {        sayHello();    }     private static void sayHello() {        System.out.println(\"He&lt;caret&gt;llo, World!\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractVariable {     public static final String HELLO_WORLD = \"Hello, World!\";     public static void main(String[] args) {        sayHello();    }     private static void sayHello() {        System.out.println(HELLO_WORLD);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"Field\" id=\"Field\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abField\u00bb (Ctrl+Alt+F)<\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/21b\/98d\/5bc\/21b98d5bcf89d9dae9c57d7fe07bea4a.gif\" alt=\" \u0420\u0438\u0441. 21. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Field\u00bb&#187; title=&#187; \u0420\u0438\u0441. 21. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Field\u00bb&#187; width=&#187;770&#8243; height=&#187;395&#8243;><figcaption> \u0420\u0438\u0441. 21. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Field\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractVariable {    public static void main(String[] args) {        sayHello();    }     private static void sayHello() {        System.out.println(\"He&lt;caret&gt;llo, World!\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractVariable {     private static String x;     public static void main(String[] args) {        sayHello();    }     private static void sayHello() {        x = \"Hello, World!\";        System.out.println(x);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"Parameter\" id=\"Parameter\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abParameter\u00bb (Ctrl+Alt+P) <\/h4>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 (\u0444\u0443\u043d\u043a\u0446\u0438\u0438) \u0438\u0437 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7a4\/ecd\/354\/7a4ecd354f89c7a6af76f79dd4e2157c.gif\" alt=\"\u0420\u0438\u0441. 22. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Parameter\u00bb&#187; title=&#187;\u0420\u0438\u0441. 22. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Parameter\u00bb&#187; width=&#187;770&#8243; height=&#187;395&#8243;><figcaption>\u0420\u0438\u0441. 22. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Parameter\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractVariable {    public static void main(String[] args) {        sayHello();    }     private static void sayHello() {        System.out.println(\"He&lt;caret&gt;llo, World!\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractVariable {    public static void main(String[] args) {        sayHello(\"Hello, World!\");    }     private static void sayHello(String x) {        System.out.println(x);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"FunctionalParameter\" id=\"FunctionalParameter\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abFunctional Parameter\u00bb <\/h4>\n<p>\u041e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 <a href=\"#Parameter\" rel=\"noopener noreferrer nofollow\">\u043f\u0443\u043d\u043a\u0442 \u00abParameter\u00bb<\/a>, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0438\u043b\u0438 java.util.function.Supplier, \u0438\u043b\u0438 javafx.util.Builder. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a <a href=\"https:\/\/www.jetbrains.com\/help\/idea\/extract-parameter.html#side_effects\" rel=\"noopener noreferrer nofollow\">\u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0430\u043c<\/a>. <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8da\/c89\/c80\/8dac89c8095cf4a3d9a0eb2a42eaa165.gif\" alt=\"\u0420\u0438\u0441. 23. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Functional Parameter\u00bb&#187; title=&#187;\u0420\u0438\u0441. 23. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Functional Parameter\u00bb&#187; width=&#187;890&#8243; height=&#187;395&#8243;><figcaption>\u0420\u0438\u0441. 23. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Functional Parameter\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractParameter {    public static void main(String[] args) {        System.out.println(generateText());    }    private static String generateText() {        return \"Hello, Wor&lt;caret&gt;ld!\".toUpperCase();    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractParameter {    public static void main(String[] args) {        System.out.println(generateText(() -&gt; \"Hello, World!\"));    }    private static String generateText(final Supplier&lt;string&gt; getText) {        return getText.get().toUpperCase();    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"FunctionalVariable\" id=\"FunctionalVariable\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abFunctional Variable\u00bb <\/h4>\n<p>\u041e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 <a href=\"#Parameter\" rel=\"noopener noreferrer nofollow\">\u043f\u0443\u043d\u043a\u0442 \u00abVariable\u00bb<\/a>, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u043b\u0438 java.util.function.Supplier \u0438\u043b\u0438 javafx.util.Builder. <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/07c\/733\/b78\/07c733b783b867048e6bb6eaab7def51.gif\" alt=\" \u0420\u0438\u0441. 24. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Functional Variable\u00bb &#187; title=&#187; \u0420\u0438\u0441. 24. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Functional Variable\u00bb &#187; width=&#187;890&#8243; height=&#187;496&#8243;><figcaption> \u0420\u0438\u0441. 24. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Functional Variable\u00bb <\/figcaption><\/figure>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractParameter {    public static void main(String[] args) {        System.out.println(generateText());    }    private static String generateText() {        return \"Hello, W&lt;caret&gt;orld!\".toUpperCase();    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractParameter {    public static void main(String[] args) {        System.out.println(generateText());    }    private static String generateText() {        Supplier&lt;string&gt; getText = () -&gt; \"Hello, World!\";        return getText.get().toUpperCase();    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"ParameterObject\" id=\"ParameterObject\">ParameterObject<\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abParameter Object\u00bb <\/h4>\n<p>\u0423\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043a\u043e\u0433\u0434\u0430 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u0432\u0430\u043c \u043d\u0430\u0434\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0438\u0445 \u0432 \u043a\u043b\u0430\u0441\u0441. (\u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u044d\u0442\u043e \u0433\u043b\u0430\u0432\u0430 \u201cIntroduce Parameter Object\u201d).<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/15d\/300\/524\/15d300524ee01e430bbc3d959fc0bab5.gif\" alt=\"\u0420\u0438\u0441. 25. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Parameter Object\u00bb &#187; title=&#187;\u0420\u0438\u0441. 25. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Parameter Object\u00bb &#187; width=&#187;890&#8243; height=&#187;948&#8243;><figcaption>\u0420\u0438\u0441. 25. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Parameter Object\u00bb <\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractParameter {    public static void main(String[] args) {        System.out.println(generateText(\"Hello\", \"World!\"));    }    private static String generateText(Str&lt;caret&gt;ing hello, String world) {        return hello.toUpperCase() + world.toUpperCase();    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractParameter {    public static void main(String[] args) {        System.out.println(generateText(new HelloWorld(\"Hello\", \"World!\")));    }    private static String generateText(HelloWorld helloWorld) {        return helloWorld.getHello().toUpperCase() + helloWorld.getWorld().toUpperCase();    }     private static class HelloWorld {        private final String hello;        private final String world;         private HelloWorld(String hello, String world) {            this.hello = hello;            this.world = world;        }         public String getHello() {            return hello;        }         public String getWorld() {            return world;        }    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"Method\" id=\"Method\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abMethod\u00bb (Ctrl+Alt+M) <\/h4>\n<p>\u0418\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430. (\u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u0435\u0441\u0442\u044c \u0433\u043b\u0430\u0432\u0430 \u043f\u0440\u043e \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 &#8212; \u201cExtract Function\u201d).<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/831\/2ec\/cc4\/8312eccc4a4b1545b556781bcfd11a58.gif\" alt=\" \u0420\u0438\u0441. 26. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Method\u00bb &#187; title=&#187; \u0420\u0438\u0441. 26. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Method\u00bb &#187; width=&#187;890&#8243; height=&#187;508&#8243;><figcaption> \u0420\u0438\u0441. 26. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Method\u00bb <\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractMethod {    public static void main(String[] args) {        String text = \"Hello, World!\";        System.out.prin&lt;caret&gt;tln(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractMethod {    public static void main(String[] args) {        String text = \"Hello, World!\";        print(text);    }     private static void print(String text) {        System.out.println(text);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"TypeParameter\" id=\"TypeParameter\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abType Parameter\u00bb<\/h4>\n<p>\u0420\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u0438\u0437 \u043c\u0438\u0440\u0430 Kotlin, \u0438 \u0434\u043b\u044f Java \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c (\u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440). <\/p>\n<\/p>\n<p><a class=\"anchor\" name=\"ReplaceMethodWithMethodObject\" id=\"ReplaceMethodWithMethodObject\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abReplace Method With Method Object\u00bb<\/h4>\n<p> \u041e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442. \u041c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430 (\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442-\u043e\u0431\u0435\u0440\u0442\u043a\u0443).<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fu\/ae\/ty\/fuaetyf0d9wkdf_eeq0w0lpctma.gif\" alt=\"\u0420\u0438\u0441. 27. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Replace Method With Method Object\u00bb &#187; title=&#187;\u0420\u0438\u0441. 27. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Replace Method With Method Object\u00bb &#187; width=&#187;953&#8243; height=&#187;751&#8243;><figcaption>\u0420\u0438\u0441. 27. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Replace Method With Method Object\u00bb <\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractMethod {    public static void main(String[] args) {        String text = \"Hello, World!\";        print(text);    }     private static void print(String text) {        System.out.p&lt;caret&gt;rintln(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractMethod {    public static void main(String[] args) {        String text = \"Hello, World!\";        print(text);    }     private static void print(String text) {        new Printer(text).invoke();    }     private static class Printer {        private String text;         public Printer(String text) {            this.text = text;        }         public void invoke() {            System.out.println(text);        }    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"Delegate\" id=\"Delegate\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abDelegate\u00bb<\/h4>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u043e\u043b\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e3\/caf\/a42\/3e3cafa42da66c70bdbde562e46a1457.gif\" alt=\" \u0420\u0438\u0441. 28. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Delegate\u00bb &#187; title=&#187; \u0420\u0438\u0441. 28. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Delegate\u00bb &#187; width=&#187;745&#8243; height=&#187;578&#8243;><figcaption> \u0420\u0438\u0441. 28. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Delegate\u00bb <\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Delegate {    public static void main(String[] args) {        new Delegate().print();    }     private void print() {        System.ou&lt;caret&gt;t.println(\"Hello, World!\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Delegate {    private final Printer printer = new Printer();     public static void main(String[] args) {        new Delegate().print();    }     private void print() {        printer.print();    }     public static class Printer {        public Printer() {        }         private void print() {            System.out.println(\"Hello, World!\");        }    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"Interface\" id=\"Interface\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abInterface\u00bb<\/h4>\n<p>\u0414\u043b\u044f \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0438 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. (\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441\u043e Spring, \u043a\u043e\u0433\u0434\u0430 \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u0431\u044b\u043b \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441) <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f64\/52a\/1f7\/f6452a1f74ae6ef704fe74f3a255eedd.gif\" alt=\" \u0420\u0438\u0441. 29. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Interface\u00bb &#187; title=&#187; \u0420\u0438\u0441. 29. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Interface\u00bb &#187; width=&#187;745&#8243; height=&#187;578&#8243;><figcaption> \u0420\u0438\u0441. 29. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Interface\u00bb <\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractImpl {    public static void main(String[] args) {        new ExtractImpl().print();    }     public void print() {        System.out.println(\"Hello, World!\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractImpl implements ExtractInterface {    public static void main(String[] args) {        new ExtractImpl().print();    }     @Override    public void print() {        System.out.println(\"Hello, World!\");    } }  public interface ExtractInterface {    void print(); } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"Superclass\" id=\"Superclass\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abSuperclass\u00bb<\/h4>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e <a href=\"#Interface\" rel=\"noopener noreferrer nofollow\">\u043f\u0443\u043d\u043a\u0442\u0443 \u00abInterface\u00bb<\/a>, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441-\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c (Superclass). \u0424\u0430\u0443\u043b\u0435\u0440 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432 \u0433\u043b\u0430\u0432\u0435 \u201cExtract Superclass\u201d. <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f2c\/e8b\/5e7\/f2ce8b5e70c1ac7cfdcf57f1702b0102.gif\" alt=\"\u0420\u0438\u0441. 30. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Superclass\u00bb &#187; title=&#187;\u0420\u0438\u0441. 30. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce->Superclass\u00bb &#187; width=&#187;745&#8243; height=&#187;578&#8243;><figcaption>\u0420\u0438\u0441. 30. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u00abExtract\/Introduce-&gt;Superclass\u00bb <\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractImpl {    public static void main(String[] args) {        new ExtractImpl().print();    }     public void print() {        System.out.println(\"Hello, World!\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractImpl extends ExtractAbstr {    public static void main(String[] args) {        new ExtractImpl().print();    }  }  public class ExtractAbstr {    public void print() {        System.out.println(\"Hello, World!\");    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"SubqueryasCTE\" id=\"SubqueryasCTE\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abSubquery as CTE\u00bb<\/h4>\n<p>\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a Sql, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044e.  \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u0445\u043e\u0442\u044f \u0431\u044b \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u0434\u0430 &#8212; \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u044e.<\/p>\n<p><a class=\"anchor\" name=\"RSpeclet\" id=\"RSpeclet\"><\/a><\/p>\n<h4>\u041f\u0443\u043d\u043a\u0442 \u00abRSpec &#8216;let&#8217;\u00bb<\/h4>\n<p>\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a Ruby, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u044e \u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u043f\u0440\u0438\u0448\u043b\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u0445\u043e\u0442\u044f \u0431\u044b \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u0434\u0430 &#8212; \u0441 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u044e.<\/p>\n<p><a class=\"anchor\" name=\"Inline\" id=\"Inline\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abInline\u00bb<\/h3>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043a\u0440\u0443\u0442\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430, \u0418\u043d\u043b\u0430\u0439\u043d\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435. \u0424\u0430\u0443\u043b\u0435\u0440 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432 \u0433\u043b\u0430\u0432\u0430\u0445 \u201cInline Class\u201d, \u201cInline Function\u201d, \u201cInline Variable\u201d. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/l4\/p-\/hi\/l4p-hi4ufx0jki8uqcwefkh-vze.gif\" alt=\" \u0420\u0438\u0441. 31. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abInline\u00bb\" title=\" \u0420\u0438\u0441. 31. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abInline\u00bb\" width=\"732\" height=\"578\"><figcaption> \u0420\u0438\u0441. 31. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abInline\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Inline {    public static void main(String[] args) {        print();    }     private static void print() {        new Printer().print();    }     private static class Printer {        public void print() {            String text = \"Hello, World!\";            System.out.println(t&lt;caret&gt;ext);        }    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Inline {    public static void main(String[] args) {            System.out.println(\"Hello, World!\");    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"FindandReplacecodeduplicate\" id=\"FindandReplacecodeduplicate\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abFind and Replace code duplicate\u00bb<\/h3>\n<p>\u0418\u0449\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u043b\u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lz\/yw\/u8\/lzywu8lhjrse3ifucz52539jorw.gif\" alt=\" \u0420\u0438\u0441. 32. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abFind and Replace code duplicate\u00bb\" title=\" \u0420\u0438\u0441. 32. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abFind and Replace code duplicate\u00bb\" width=\"753\" height=\"471\"><figcaption> \u0420\u0438\u0441. 32. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abFind and Replace code duplicate\u00bb<\/figcaption><\/figure>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Replace {    public static void main(String[] args) {        System.out.println(\"Hello, World!\");    }     public void print() {        System.out.println(\"Hello, World!\");    }     public void print2() {        System.out.prin&lt;caret&gt;tln(\"Hello, World!\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Replace {    public static void main(String[] args) {        print2();    }     public void print() {        print2();    }     public static void print2() {        System.out.println(\"Hello, World!\");    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"InvertBoolean\" id=\"InvertBoolean\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abInvert Boolean\u00bb<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u043b\u0435\u0432\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/82b\/ba0\/09e\/82bba009eb34fae0942293a12b1cac21.gif\" alt=\"\u0420\u0438\u0441. 33. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abInvert Boolean\u00bb\" title=\"\u0420\u0438\u0441. 33. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abInvert Boolean\u00bb\" width=\"753\" height=\"352\"><figcaption>\u0420\u0438\u0441. 33. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abInvert Boolean\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Invert {    public static void main(String[] args) {        boolean co&lt;caret&gt;ndition = true;        if (condition) {            System.out.println(\"Hello, World!\");        }    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Invert {    public static void main(String[] args) {        boolean condition = false;        if (!condition) {            System.out.println(\"Hello, World!\");        }    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"PullMemberUp\" id=\"PullMemberUp\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abPull Member Up\u00bb<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043b\u0438 \u043f\u043e\u043b\u044f \u043f\u043e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0432\u0432\u0435\u0440\u0445. \u0417\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0443 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u0432 \u0433\u043b\u0430\u0432\u0430\u0445 \u201cPull Up Field\u201d \u0438 \u201cPull Up Method\u201d. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u0443\u043d\u043a\u0442\u0430 <a href=\"#PullMemberDown\" rel=\"noopener noreferrer nofollow\">\u00abPull Member Down\u00bb<\/a>.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/m1\/jh\/9h\/m1jh9hwt7hh_gzi8fphzishwgns.gif\" alt=\"\u0420\u0438\u0441. 34. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abPull Member Up\u00bb\" title=\"\u0420\u0438\u0441. 34. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abPull Member Up\u00bb\" width=\"753\" height=\"464\"><figcaption>\u0420\u0438\u0441. 34. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abPull Member Up\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class PullMethod {    public static void main(String[] args) {        new InnerClass().print();    }     private static class InnerClass extends AbstClass {        public void print() {            System.out.pri&lt;caret&gt;ntln(\"Hello, World\");        }    }     private static abstract class AbstClass {    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class PullMethod {     public static void main(String[] args) {         new InnerClass().print();     }      private static class InnerClass extends AbstClass {     }      private static abstract class AbstClass {         public void print() {             System.out.println(\"Hello, World\");         }     } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"PullMemberDown\" id=\"PullMemberDown\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abPull Member Down\u00bb<\/h3>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u0443\u043d\u043a\u0442\u0430 <a href=\"#PullMemberUp\" rel=\"noopener noreferrer nofollow\">\u00abPull Member Up\u00bb<\/a>. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043b\u0438 \u043f\u043e\u043b\u044f \u043f\u043e \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0432\u043d\u0438\u0437. (\u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 &#8212; \u0433\u043b\u0430\u0432\u0430 \u201cPush Down Method\u201d) <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/1x\/01\/hj\/1x01hjdj0kqhjimajynadtuznyk.gif\" alt=\"\u0420\u0438\u0441. 35. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abPull Member Down\u00bb\" title=\"\u0420\u0438\u0441. 35. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abPull Member Down\u00bb\" width=\"753\" height=\"464\"><figcaption>\u0420\u0438\u0441. 35. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abPull Member Down\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class PullMethod {    public static void main(String[] args) {        new InnerClass().print();    }     private static class InnerClass extends AbstClass {    }     private static abstract class AbstClass {        public void print() {            System.out.prin&lt;caret&gt;tln(\"Hello, World\");        }    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class PullMethod {    public static void main(String[] args) {        new InnerClass().print();    }     private static class InnerClass extends AbstClass {        @Override        public void print() {            System.out.println(\"Hello, World\");        }    }     private static abstract class AbstClass {        public abstract void print();    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"PushITdsIn\" id=\"PushITdsIn\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abPush ITds In\u00bb<\/h3>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 AsperctJ. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/n9\/-_\/qo\/n9-_qolbszw8hijhiounchkbkqa.gif\" alt=\" \u0420\u0438\u0441. 36. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abPush ITds In\u00bb\" title=\" \u0420\u0438\u0441. 36. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abPush ITds In\u00bb\" width=\"671\" height=\"444\"><figcaption> \u0420\u0438\u0441. 36. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abPush ITds In\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">aspect myAspect {    boolean Account.closed = &lt;caret&gt;false;    void Account.close() {        closed = true;    } } class Account {  } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">aspect myAspect {    boolean Account.closed = false; } class Account {     void close() {        closed = true;    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"UseInterfaceWherePossible\" id=\"UseInterfaceWherePossible\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abUse Interface Where Possible\u00bb<\/h3>\n<p>IDEA \u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c, \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/si\/w_\/ht\/siw_htfkjsevopv3vdc_sgbaofw.gif\" alt=\"\u0420\u0438\u0441. 37. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abUse Interface Where Possible\u00bb\" title=\"\u0420\u0438\u0441. 37. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abUse Interface Where Possible\u00bb\" width=\"671\" height=\"665\"><figcaption>\u0420\u0438\u0441. 37. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abUse Interface Where Possible\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ExtractInterface {     public static void main(String[] args) {        InnerClass innerClass = new InnerClass();        print(innerClass);    }     private static void print(InnerClass innerClass) {        innerClass.print();    }     private static class InnerClass implements InnerInterface{        @Override        public void print() {            System.out.println(\"Hello, World!\");        }    }     private static interface InnerInterface{        void print();    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ExtractInterface {     public static void main(String[] args) {        InnerInterface innerClass = new InnerClass();        print(innerClass);    }     private static void print(InnerInterface innerClass) {        innerClass.print();    }     private static class InnerClass implements InnerInterface{        @Override        public void print() {            System.out.println(\"Hello, World!\");        }    }     private static interface InnerInterface{        void print();    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"ReplaceInheritancewithdelegation\" id=\"ReplaceInheritancewithdelegation\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abReplace Inheritance with Delegation\u00bb<\/h3>\n<p>\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c. \u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u043f\u0440\u043e \u044d\u0442\u043e \u0433\u043b\u0430\u0432\u044b \u201cReplace Subclass with Delegate\u201d \u0438 \u201cReplace Superclass with Delegate\u201d.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eb\/sy\/gb\/ebsygbipiuh0llqmcd5lcc7aosy.gif\" alt=\"\u0420\u0438\u0441. 38. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace Inheritance with Delegation\u00bb\" title=\"\u0420\u0438\u0441. 38. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace Inheritance with Delegation\u00bb\" width=\"671\" height=\"755\"><figcaption>\u0420\u0438\u0441. 38. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace Inheritance with Delegation\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class InheritanceDelegation {     public static void main(String[] args) {        InnerClass innerClass = new InnerClass();        print(innerClass);    }     private static void print(InnerClass innerClass) {        innerClass.print();    }     private static class In&lt;caret&gt;nerClass extends AbstractClass {    }     private static class AbstractClass {        public void print() {            System.out.println(\"Hello, World!\");        }    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class InheritanceDelegation {      public static void main(String[] args) {         InnerClass innerClass = new InnerClass();         print(innerClass);     }      private static void print(InnerClass innerClass) {         innerClass.print();     }      private static class InnerClass {         private final AbstractClass abstractClass = new AbstractClass();          public void print() {             abstractClass.print();         }     }      private static class AbstractClass {         public void print() {             System.out.println(\"Hello, World!\");         }     } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"RemoveMiddleman\" id=\"RemoveMiddleman\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abRemove Middleman\u00bb<\/h3>\n<p>\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043d\u0430 \u043f\u0440\u044f\u043c\u044b\u0435. (\u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 &#8212; \u0433\u043b\u0430\u0432\u0430 \u201cRemove Middle Man\u201d).<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qx\/gl\/wy\/qxglwykrz5uon2bqzlp8r4vpani.gif\" alt=\" \u0420\u0438\u0441. 39. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abRemove Middleman\u00bb\" title=\" \u0420\u0438\u0441. 39. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abRemove Middleman\u00bb\" width=\"671\" height=\"755\"><figcaption> \u0420\u0438\u0441. 39. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abRemove Middleman\u00bb<\/figcaption><\/figure>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Middleman {     public static void main(String[] args) {        InnerClass innerClass = new InnerClass();        innerClass.print();    }     private static class InnerClass {        private final NextClass next&lt;caret&gt;Class = new NextClass();         public void print() {            nextClass.print();        }    }     private static class NextClass {        public void print() {            System.out.println(\"Hello, World!\");        }    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Middleman {     public static void main(String[] args) {        InnerClass innerClass = new InnerClass();        innerClass.getNextClass().print();    }     private static class InnerClass {        private final NextClass nextClass = new NextClass();         public NextClass getNextClass() {            return nextClass;        }    }     private static class NextClass {        public void print() {            System.out.println(\"Hello, World!\");        }    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"WrapMethodReturnValue\" id=\"WrapMethodReturnValue\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abWrap Method Return Value\u00bb<\/h3>\n<p>\u041e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442-\u043e\u0431\u0435\u0440\u0442\u043a\u0443. \u0423\u0434\u043e\u0431\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ay\/wb\/mi\/aywbmip1agjfyqp5gegckmpjdoq.gif\" alt=\" \u0420\u0438\u0441. 40. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abWrap Method Return Value\u00bb\" title=\" \u0420\u0438\u0441. 40. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abWrap Method Return Value\u00bb\" width=\"671\" height=\"755\"><figcaption> \u0420\u0438\u0441. 40. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abWrap Method Return Value\u00bb<\/figcaption><\/figure>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class WrapMethodReturnValue {    public static void main(String[] args) {        System.out.println(new MessageFolder().get());    }     private static class MessageFolder {        public String get() {            ret&lt;caret&gt;urn \"Hello, World!\";        }    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class WrapMethodReturnValue {    public static void main(String[] args) {        System.out.println(new MessageFolder().get().getValue());    }     private static class MessageFolder {        public Message get() {            return new Message(\"Hello, World!\");        }         public class Message {            private final String value;             public Message(String value) {                this.value = value;            }             public String getValue() {                return value;            }        }    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"EncapsulateField\" id=\"EncapsulateField\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abEncapsulate Field\u00bb<\/h3>\n<p>\u0421\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435 \u0437\u0430 getter, setter. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kv\/mk\/kn\/kvmkknsqqr2f4mo1uuau8o-hpjk.gif\" alt=\" \u0420\u0438\u0441. 41. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abEncapsulate Field\u00bb\" title=\" \u0420\u0438\u0441. 41. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abEncapsulate Field\u00bb\" width=\"563\" height=\"755\"><figcaption> \u0420\u0438\u0441. 41. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abEncapsulate Field\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class EncapsulateField {    public static void main(String[] args) {        System.out.println(new InnerClass().message);    }     private static class InnerClass {        public String m&lt;caret&gt;essage = \"Hello, World!\";    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class EncapsulateField {    public static void main(String[] args) {        System.out.println(new InnerClass().getMessage());    }     private static class InnerClass {        private String message = \"Hello, World!\";         public String getMessage() {            return message;        }         public void setMessage(String message) {            this.message = message;        }    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"ReplacetempwithQuery\" id=\"ReplacetempwithQuery\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abReplace Temp with Query\u00bb<\/h3>\n<p>\u041f\u0443\u0441\u0442\u044c \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c <\/p>\n<pre><code>int size = getActualSize()<\/code><\/pre>\n<p> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430  \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435  <em>size<\/em> \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>getActualSize()<\/em>. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u044e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043d\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c. \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0435\u0433\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c.  <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kn\/q4\/cj\/knq4cje_ifk35he7qh6bened3mi.gif\" alt=\" \u0420\u0438\u0441. 42. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace Temp with Query\u00bb\" title=\" \u0420\u0438\u0441. 42. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace Temp with Query\u00bb\" width=\"563\" height=\"627\"><figcaption> \u0420\u0438\u0441. 42. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace Temp with Query\u00bb<\/figcaption><\/figure>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ReplaceTemp {    public static void main(String[] args) {        String hello = \"Hello\";        String mes&lt;caret&gt;sage = hello + \", World!\";        System.out.println(message);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ReplaceTemp {    public static void main(String[] args) {        String hello = \"Hello\";        System.out.println(message(hello));    }     private static String message(String hello) {        return hello + \", World!\";    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"ReplaceConstructorwithFactoryMethod\" id=\"ReplaceConstructorwithFactoryMethod\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abReplace Constructor with Factory Method\u00bb<\/h3>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0444\u0430\u0431\u0440\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430. \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 Lombok. (\u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0433\u043b\u0430\u0432\u0430 \u201cReplace Constructor with Factory Function\u201d).<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mt\/gs\/sc\/mtgsscgiy1tulxpf5obwc4ahgw4.gif\" alt=\"\u0420\u0438\u0441. 43. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace constructor with factory method\u00bb\" title=\"\u0420\u0438\u0441. 43. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace constructor with factory method\u00bb\" width=\"710\" height=\"627\"><figcaption>\u0420\u0438\u0441. 43. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace constructor with factory method\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ReplaceConstructor {    public static void main(String[] args) {        new InnerClass(\"Hello\", \"World\").print();    }     private static class InnerClass {        private String message;         public Inner&lt;caret&gt;Class(String hello, String world) {            message = hello + \", \" + world;        }         public void print() {            System.out.println(message);        }    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ReplaceConstructor {    public static void main(String[] args) {        InnerClass.createInnerClass(\"Hello\", \"World\").print();    }     private static class InnerClass {        private String message;         private InnerClass(String hello, String world) {            message = hello + \", \" + world;        }         public static InnerClass createInnerClass(String hello, String world) {            return new InnerClass(hello, world);        }         public void print() {            System.out.println(message);        }    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"ReplaceConstructorwithBuilder\" id=\"ReplaceConstructorwithBuilder\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abReplace Constructor with Builder\u00bb<\/h3>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 builder \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430. \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 Lombok.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c9a\/986\/14f\/c9a98614f7539a8dd0d3182e246127cb.gif\" alt=\"\u0420\u0438\u0441. 44. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace Constructor with Builder\u00bb\" title=\"\u0420\u0438\u0441. 44. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace Constructor with Builder\u00bb\" width=\"798\" height=\"627\"><figcaption>\u0420\u0438\u0441. 44. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abReplace Constructor with Builder\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ReplaceConstructor {    public static void main(String[] args) {        new InnerClass(\"Hello\", \"World\").print();    }     private static class InnerClass {        private String message;         public InnerC&lt;caret&gt;lass(String hello, String world) {            message = hello + \", \" + world;        }         public void print() {            System.out.println(message);        }    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ReplaceConstructor {    public static void main(String[] args) {        new InnerClassBuilder().setHello(\"Hello\").setWorld(\"World\").createInnerClass().print();    }     static class InnerClass {        private String message;         public InnerClass(String hello, String world) {            message = hello + \", \" + world;        }         public void print() {            System.out.println(message);        }    } }  public class InnerClassBuilder {    private String hello;    private String world;     public InnerClassBuilder setHello(String hello) {        this.hello = hello;        return this;    }     public InnerClassBuilder setWorld(String world) {        this.world = world;        return this;    }     public ReplaceConstructor.InnerClass createInnerClass() {        return new ReplaceConstructor.InnerClass(hello, world);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"Generify\" id=\"Generify\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abGenerify\u00bb<\/h3>\n<p>\u041f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0441 raw-\u0442\u0438\u043f\u0430\u043c\u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0434 \u0441 Generic-\u0442\u0438\u043f\u0430\u043c\u0438. \u0410\u043a\u0442\u0443\u0430\u043b\u0435\u043d \u043f\u0440\u0438 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 java \u0432\u0435\u0440\u0441\u0438\u0439 \u0440\u0430\u043d\u0435\u0435 1.5 \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438. <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fc8\/535\/37b\/fc853537bdb09330290b41a2f6a3c59f.gif\" alt=\"\u0420\u0438\u0441. 45. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abGenerify\u00bb\" title=\"\u0420\u0438\u0441. 45. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abGenerify\u00bb\" width=\"798\" height=\"627\"><figcaption>\u0420\u0438\u0441. 45. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abGenerify\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Generify {    public static void main(String[] args) {        List list = getList();        Object message = list.get(0);        System.out.println(message);    }     private static List getList() {        ArrayList arrayList = new ArrayList();        arrayList.add(\"Hello, World!\");        return arrayList;    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Generify {    public static void main(String[] args) {        List&lt;string&gt; list = getList();        String message = list.get(0);        System.out.println(message);    }     private static List&lt;string&gt; getList() {        ArrayList&lt;string&gt; arrayList = new ArrayList&amp;lt;&gt;();        arrayList.add(\"Hello, World!\");        return arrayList;    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"Migrate\" id=\"Migrate\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abMigrate\u00bb<\/h3>\n<p>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430: <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hq\/ve\/jx\/hqvejxgiyteumpmnz0xllqzwdp0.png\" alt=\"\u0420\u0438\u0441. 46. \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abMigrate\u00bb\" title=\"\u0420\u0438\u0441. 46. \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abMigrate\u00bb\" width=\"706\" height=\"158\"><figcaption>\u0420\u0438\u0441. 46. \u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439  \u043f\u0443\u043d\u043a\u0442\u0430 \u00abMigrate\u00bb<\/figcaption><\/figure>\n<p> \u0410 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0438. \u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f JUnit(4.x -&gt; 5.0): <\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wu\/2_\/mp\/wu2_mptgn7-6giblyclus1fesru.png\" alt=\"\u0420\u0438\u0441. 47. \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f JUnit(4.x -> 5.0)&#187; title=&#187;\u0420\u0438\u0441. 47. \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f JUnit(4.x -> 5.0)&#187; width=&#187;694&#8243; height=&#187;416&#8243;><figcaption>\u0420\u0438\u0441. 47. \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f JUnit(4.x -&gt; 5.0)<\/figcaption><\/figure>\n<p>  \u0412\u043e\u0442 <a href=\"https:\/\/www.youtube.com\/watch?v=F8UTTTDtbH0\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e \u043f\u0440\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f JUnit(4.x -&gt; 5.0).<\/p>\n<p><a class=\"anchor\" name=\"Lombok\" id=\"Lombok\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abLombok\u00bb \u0438 \u00abDelombok\u00bb<\/h3>\n<p>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u201cLombok\u201d. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e, \u0447\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043f\u043e\u0441\u0442\u0430\u0432\u043a\u0443 IDEA. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u201cLombok\u201d.<\/p>\n<p><a class=\"anchor\" name=\"Internationalize\" id=\"Internationalize\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abInternationalize\u00bb<\/h3>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0432 \u0441\u043f\u0440\u0430\u0432\u043a\u0435 \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. IDEA \u0441\u0435\u0439\u0447\u0430\u0441 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u044f\u0437\u044b\u043a\u0438, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u044b\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434.<\/p>\n<p><a class=\"anchor\" name=\"NOTES\" id=\"NOTES\"><\/a><\/p>\n<h3>\u0421\u043f\u0438\u0441\u043e\u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/h3>\n<ul>\n<li>\n<p><a href=\"https:\/\/2019.jpoint.ru\/talks\/4ltyzdxqzmpeofbgkld7ns\/\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u043e\u043a\u043b\u0430\u0434<\/a> \u043f\u0440\u043e \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u0439 \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433 \u043e\u0442 \u0422\u0430\u0433\u0438\u0440\u0430 \u0412\u0430\u043b\u0435\u0435\u0432\u0430<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.jetbrains.com\/help\/idea\/refactoring-source-code.html\" rel=\"noopener noreferrer nofollow\">\u0421\u043f\u0440\u0430\u0432\u043a\u0430 IDEA<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/martinfowler.com\/books\/refactoring.html\" rel=\"noopener noreferrer nofollow\">Refactoring: Improving the Design of Existing Code (Martin Fowler)<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/530360\/\"> https:\/\/habr.com\/ru\/post\/530360\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u042d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 c gif-\u043a\u0430\u043c\u0438 \u043f\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430\u043c Java-\u0444\u0430\u0439\u043b\u043e\u0432 \u0432 IDEA \u0434\u043b\u044f <em>\u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445<\/em>.<\/p>\n<p><em>\u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e<\/em>, \u043c\u043d\u043e\u0433\u043e \u0442\u044f\u0436\u0435\u043b\u044b\u0445 gif-\u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<\/p>\n<p><em>&#171;Any fool can write code that a computer can understand. Good programmers write code that humans can understand.\u201d \u2014M. Fowler (1999)<\/em> <\/p>\n<h2>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h2>\n<p><a href=\"#introduction\" rel=\"noopener noreferrer nofollow\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/a> <\/p>\n<p><a href=\"#Refa\u0441tor\" rel=\"noopener noreferrer nofollow\">>\u0420\u0430\u0437\u0434\u0435\u043b \u00abRefa\u0441tor\u00bb<\/a> <a href=\"#Refactor-This\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#Refactor-This\" rel=\"noopener noreferrer nofollow\">&#8212;  Refactor This<\/a> <a href=\"#Rename\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Rename\" rel=\"noopener noreferrer nofollow\">&#8212;  Rename<\/a> <a href=\"#RenameFile\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#RenameFile\" rel=\"noopener noreferrer nofollow\">&#8212;  Rename File<\/a> <a href=\"#ChangeSignature\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ChangeSignature\" rel=\"noopener noreferrer nofollow\">&#8212;  Change Signature<\/a> <a href=\"#EditPropertyValue\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#EditPropertyValue\" rel=\"noopener noreferrer nofollow\">&#8212;  Edit Property Value (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#TypeMigration\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#TypeMigration\" rel=\"noopener noreferrer nofollow\">&#8212; Type Migration<\/a> <a href=\"#MakeStatic\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#MakeStatic\" rel=\"noopener noreferrer nofollow\">&#8212; Make Static<\/a> <a href=\"#ConvertToInstanceMethod\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ConvertToInstanceMethod\" rel=\"noopener noreferrer nofollow\">&#8212; Convert To Instance Method<\/a> <a href=\"#MoveClasses\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#MoveClasses\" rel=\"noopener noreferrer nofollow\">&#8212; Move Classes<\/a> <a href=\"#CopyClasses\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#CopyClasses\" rel=\"noopener noreferrer nofollow\">&#8212; Copy Classes<\/a> <a href=\"#Safedelete\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Safedelete\" rel=\"noopener noreferrer nofollow\">&#8212; Safe Delete<\/a> <a href=\"#ExtractIntroduce\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#ExtractIntroduce\" rel=\"noopener noreferrer nofollow\">&#8212; Extract\/Introduce<\/a> <a href=\"#Variable\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#Variable\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Variable<\/a> <a href=\"#Constant\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Constant\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Constant<\/a> <a href=\"#Field\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Field\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Field<\/a> <a href=\"#Parameter\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Parameter\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Parameter<\/a> <a href=\"#FunctionalParameter\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#FunctionalParameter\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Functional Parameter<\/a> <a href=\"#FunctionalVariable\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#FunctionalVariable\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Functional Variable<\/a> <a href=\"#ParameterObject\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ParameterObject\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Parameter Object<\/a> <a href=\"#Method\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Method\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Method<\/a> <a href=\"#TypeParameter\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#TypeParameter\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Type Parameter (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#Interface\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Interface\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Interface<\/a> <a href=\"#Superclass\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Superclass\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Superclass<\/a> <a href=\"#SubqueryasCTE\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#SubqueryasCTE\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; Subquery as CTE  (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#RSpeclet\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#RSpeclet\" rel=\"noopener noreferrer nofollow\">&#8212; &#8212; RSpec &#8216;let&#8217;  (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#Inline\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Inline\" rel=\"noopener noreferrer nofollow\">&#8212; Inline<\/a> <a href=\"#FindandReplacecodeduplicate\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#FindandReplacecodeduplicate\" rel=\"noopener noreferrer nofollow\">&#8212; Find and Replace Code Duplicate<\/a> <a href=\"#PullMemberUp\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#PullMemberUp\" rel=\"noopener noreferrer nofollow\">&#8212; Pull Member Up<\/a> <a href=\"#PullMemberDown\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#PullMemberDown\" rel=\"noopener noreferrer nofollow\">&#8212; Pull Member Down<\/a> <a href=\"#PushITdsIn\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#PushITdsIn\" rel=\"noopener noreferrer nofollow\">&#8212; Push ITds In<\/a> <a href=\"#UseInterfaceWherePossible\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#UseInterfaceWherePossible\" rel=\"noopener noreferrer nofollow\">&#8212; Use Interface Where Possible<\/a> <a href=\"#ReplaceInheritancewithdelegation\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ReplaceInheritancewithdelegation\" rel=\"noopener noreferrer nofollow\">&#8212; Replace Inheritance with Delegation<\/a> <a href=\"#RemoveMiddleman\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#RemoveMiddleman\" rel=\"noopener noreferrer nofollow\">&#8212; Remove Middleman<\/a> <a href=\"#WrapMethodReturnValue\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#WrapMethodReturnValue\" rel=\"noopener noreferrer nofollow\">&#8212; Wrap Method Return Value<\/a> <a href=\"#EncapsulateField\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#EncapsulateField\" rel=\"noopener noreferrer nofollow\">&#8212; Encapsulate Field<\/a> <a href=\"#ReplacetempwithQuery\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ReplacetempwithQuery\" rel=\"noopener noreferrer nofollow\">&#8212; Replace Temp with Query<\/a> <a href=\"#ReplaceConstructorwithFactoryMethod\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ReplaceConstructorwithFactoryMethod\" rel=\"noopener noreferrer nofollow\">&#8212; Replace Constructor with Factory Method<\/a> <a href=\"#ReplaceConstructorwithBuilder\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#ReplaceConstructorwithBuilder\" rel=\"noopener noreferrer nofollow\">&#8212; Replace Constructor with Builder<\/a> <a href=\"#Generify\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Generify\" rel=\"noopener noreferrer nofollow\">&#8212; Generify<\/a> <a href=\"#Migrate\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Migrate\" rel=\"noopener noreferrer nofollow\">&#8212; Migrate<\/a> <a href=\"#Lombok\" rel=\"noopener noreferrer nofollow\"> <\/a><\/p>\n<p><a href=\"#Lombok\" rel=\"noopener noreferrer nofollow\">&#8212; Lombok \u0438 Delombok (\u0431\u0435\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430)<\/a> <a href=\"#Internationalize\" rel=\"noopener noreferrer nofollow\">  <\/a><\/p>\n<p><a href=\"#Internationalize\" rel=\"noopener noreferrer nofollow\">&#8212; Internationalize<\/a> <a href=\"#NOTES\" rel=\"noopener noreferrer nofollow\">\u0421\u043f\u0438\u0441\u043e\u043a \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/a><\/p>\n<p><a class=\"anchor\" name=\"introduction\" id=\"introduction\"><\/a><\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0426\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 &#8212; \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0434\u043b\u044f Java-\u0444\u0430\u0439\u043b\u043e\u0432 (\u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432). \u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u043f\u0440\u0438\u0435\u043c\u044b \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0432\u0438\u0434\u0435\u043e \u0422\u0430\u0433\u0438\u0440\u0430 \u0412\u0430\u043b\u0435\u0435\u0432\u0430 (\u0441\u0441\u044b\u043b\u043a\u0430 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 <a href=\"#NOTES\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432<\/a>). <\/p>\n<p>\u0414\u0443\u043c\u0430\u044e, \u043a\u0430\u0436\u0434\u044b\u0439, \u043a\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 IDEA, \u0437\u043d\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u043d\u0435\u0439 \u043a\u0443\u0447\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u0434\u0430. \u0418 \u043f\u043e\u0447\u0442\u0438 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0430\u043d\u043e\u043d\u0441\u044b \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0433\u0434\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u043d\u043e\u0432\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438 \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u043b \u0432 \u0440\u0430\u0437\u0434\u0435\u043b Refa\u0441tor:<\/p>\n<figure class=\"\"><figcaption> \u0420\u0438\u0441. 1. \u0420\u0430\u0437\u0434\u0435\u043b Refactoring IDEA<\/figcaption><\/figure>\n<p>\u041d\u043e \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e \u0432\u0441\u0435 \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u044e\u0442 \u0447\u0442\u043e \u0438 \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u044e\u0442 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u0445\u043e\u0442\u044f \u043e\u043d\u0438 \u0432\u0441\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432  <a href=\"https:\/\/www.jetbrains.com\/help\/idea\/refactoring-source-code.html\" rel=\"noopener noreferrer nofollow\">\u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u043a idea<\/a><\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u0434\u0430, \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438 \u043f\u043e\u0447\u0442\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430. \u0422\u0430\u043a\u0436\u0435 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0433\u0434\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u043d\u0438\u0433\u0443  <a href=\"https:\/\/martinfowler.com\/books\/refactoring.html\" rel=\"noopener noreferrer nofollow\">Refactoring: Improving the Design of Existing Code (Martin Fowler)<\/a>. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u0444\u0438\u043a \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e  \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e gif-\u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c. \u0413\u043e\u0440\u044f\u0447\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0434\u043b\u044f  Windows\/LInux \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p><a class=\"anchor\" name=\"Refa\u0441tor\" id=\"Refa\u0441tor\">&#171;><\/a><\/p>\n<h2>\u0420\u0430\u0437\u0434\u0435\u043b \u00abRefa\u0441tor\u00bb<\/h2>\n<p>\u041f\u043e\u0439\u0434\u0435\u043c \u0441\u0432\u0435\u0440\u0445\u0443 \u0432\u043d\u0438\u0437 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<p><a class=\"anchor\" name=\"Refactor-This\" id=\"Refactor-This\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abRefactor This\u00bb (Ctrl+Alt+Shift+T)<\/h3>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u043f\u0438\u0441\u043a\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432  \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u0432\u044b \u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435. \u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043a\u043e\u0434\u0435  \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u043a\u0430\u0440\u0435\u0442\u043a\u0438 \u0432 \u043a\u043e\u0434\u0435, \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435.<\/p>\n<figure class=\"\"><figcaption>\u0420\u0438\u0441. 2. \u00abRefactor This\u00bb \u0434\u043b\u044f \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/figcaption><\/figure>\n<\/p>\n<figure class=\"\"><figcaption>\u0420\u0438\u0441. 3. \u00abRefactor This\u00bb \u0434\u043b\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/figcaption><\/figure>\n<p><a class=\"anchor\" name=\"Rename\" id=\"Rename\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abRename\u00bb (Shift+F6)<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432 \u043a\u043e\u0434\u0435, \u0431\u0443\u0434\u044c \u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443, \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438. (\u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043e 2 \u0433\u043b\u0430\u0432\u044b &#8212; \u201cRename Field\u201d  \u0438 \u201cRename Variable\u201d)<\/p>\n<figure class=\"full-width\"><figcaption>\u0420\u0438\u0441. 4. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invo&lt;caret\/&gt;ke(\", World\");    }     private static void invoke(String text) {        \/\/text        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        newFunctionName(\", World\");    }     private static void newFunctionName(String text) {        \/\/text        System.out.println(text);    } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><figcaption> \u0420\u0438\u0441. 5. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invoke(\", World\");    }     private static void invoke(String te&lt;caret&gt;xt) {        \/\/text        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invoke(\", World\");    }     private static void invoke(String newText) {        \/\/newText        System.out.println(newText);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><figcaption> \u0420\u0438\u0441. 6. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invoke(\", World\");    }     private static void invoke(String text) {        \/\/text        System.out.println(text);        throw new MyExc&lt;caret&gt;eption();    }     public static class MyException extends RuntimeException {    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        System.out.print(\"Hello\");        invoke(\", World\");    }     private static void invoke(String text) {        \/\/text        System.out.println(text);        throw new NewMyException ();    }     public static class NewMyException extends RuntimeException {    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><figcaption> \u0420\u0438\u0441. 7. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        MyS&lt;caret&gt;ervice service = new MyService();        service.service();    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) {        NewMyService myService = new NewMyService ();        myService.service();    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption> \u0420\u0438\u0441. 8. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"java\">package gen&lt;caret&gt;eral;  public class Main {    public static void main(String[] args) {        NewMyService service = new NewMyService();        service.service();    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">package org.test.java.src;  public class Main {    public static void main(String[] args) {        NewMyService service = new NewMyService();        service.service();    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"RenameFile\" id=\"RenameFile\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abRename File\u00bb<\/h3>\n<p>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b.  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Shift+F6 \u0435\u0441\u043b\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d \u0444\u0430\u0439\u043b. \u0412 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0439 (Scope), \u0438\u0441\u043a\u0430\u0442\u044c \u043b\u0438 \u0441\u0441\u044b\u043b\u043a\u0438  \u0438\u043b\u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u0445<\/p>\n<figure class=\"full-width\"><figcaption> \u0420\u0438\u0441. 9. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abRename File\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) throws IOException {        Path path = Paths.get(\"src\/general\/TestFile.txt\");         String read = Files.readAllLines(path).get(0);        System.out.println(read);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class Main {    public static void main(String[] args) throws IOException {        Path path = Paths.get(\"src\/general\/TestFile2.txt\");         String read = Files.readAllLines(path).get(0);        System.out.println(read);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"ChangeSignature\" id=\"ChangeSignature\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abChange Signature\u00bb (Ctrl+F6)<\/h3>\n<p>\u0423 \u0424\u0430\u0443\u043b\u0435\u0440\u0430 \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0433\u043b\u0430\u0432\u0430 \u201cChange Function Declaration\u201d. \u0412 \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 IDEA \u00abChange Signature\u00bb \u0431\u044b\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u043d. \u042f \u0437\u043d\u0430\u044e \u0434\u0432\u0430 \u043f\u0443\u0442\u0438: <\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0443\u0442\u044c &#8212; \u043f\u0440\u044f\u043c\u043e\u0439 &#8212; \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435,<\/p>\n<\/li>\n<li>\n<p>\u0432\u0442\u043e\u0440\u043e\u0439 &#8212; \u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 (\u0447\u0435\u0440\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u0430)<\/em><\/strong><\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 \u043c\u0435\u0442\u043e\u0434\u0430. \u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043b\u0435\u0432\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>&#171;R&#187;<\/em> \u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u043c \u043c\u0435\u043d\u044e \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u043d\u043a\u0442 <em>&#171;Update usages to reflect signature change&#187;<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<figure class=\"full-width\"><figcaption>\u0420\u0438\u0441. 10. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abUpdate usages to reflect signature change\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {    public static void main(String[] args) {        invokeMethod(\"Hello\");        invokeMethod(\"World\");    }     private static void invokeMethod(String text) {        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {    public static void main(String[] args) {        invokeMethod(\"Hello\", null);        invokeMethod(\"World\", null);    }     private static void invokeMethod(String text, String newType) {        System.out.println(text);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><strong><em>\u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 (\u0447\u0435\u0440\u0435\u0437 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e)<\/em><\/strong><\/p>\n<p>\u0412 \u0434\u0438\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, exception, \u0438 \u0434\u0430\u0436\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. <\/p>\n<figure class=\"full-width\"><figcaption>\u0420\u0438\u0441. 11. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abChange Signature\u00bb<\/figcaption><\/figure>\n<\/p>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {    public static void main(String[] args) {        invokeMethod(\"Hello\");        invokeMethod(\"World\");    }     private static void invokeMethod(String&lt;caret&gt; text) {        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {    public static void main(String[] args) {        invokeMethod(\"Hello\");        invokeMethod(\"World\");    }     private static void invokeMethod(String text) {        invokeMethod(text, null);    }     private static void invokeMethod(String text, String newName) {        System.out.println(text);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"EditPropertyValue\" id=\"EditPropertyValue\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abEdit Property Value\u00bb  (Alt + F6)<\/h3>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 (Idea 2020.2) \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430. \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c property.value.inplace.editing=true \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443.<\/p>\n<p><a class=\"anchor\" name=\"TypeMigration\" id=\"TypeMigration\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abType Migration\u00bb  (Ctrl + Shift + F6)<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. <\/p>\n<figure class=\"full-width\"><figcaption>\u0420\u0438\u0441. 12. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abType Migration\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {     public static void main(String[] args) {        Inte&lt;caret&gt;ger hello = 1;        print(hello);    }     private static void print(Integer text) {        System.out.println(text);    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class ChangeSignature {     public static void main(String[] args) {        Number hello = 1;        print(hello);    }     private static void print(Number text) {        System.out.println(text);    } } <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"MakeStatic\" id=\"MakeStatic\"><\/a><\/p>\n<h3>\u041f\u0443\u043d\u043a\u0442 \u00abMake Static\u00bb  (Ctrl + Shift + F6)<\/h3>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0438\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439. (\u041f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <a href=\"#ConvertToInstanceMethod\" rel=\"noopener noreferrer nofollow\">Convert To Instance Method<\/a>) <\/p>\n<figure class=\"full-width\"><figcaption>\u0420\u0438\u0441. 13. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u00abMake Static\u00bb<\/figcaption><\/figure>\n<details class=\"spoiler\">\n<summary>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0414\u043e<\/em><\/p>\n<pre><code class=\"java\">public class MakeStatic {    public static void main(String[] args) {        MakeStatic makeStatic = new MakeStatic();        makeStatic.sayHello();    }     public void say&lt;caret&gt;Hello() {        System.out.println(\"Hello, World\");    } } <\/code><\/pre>\n<p><em>\u041f\u043e\u0441\u043b\u0435<\/em><\/p>\n<pre><code class=\"java\">public class MakeStatic {    public static void main(String[] args) {        MakeStatic makeStatic = new MakeStatic();        MakeStatic.sayHello();    }     public static void sayHello() {<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-313963","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=313963"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313963\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}