1"use strict";(self.webpackChunkrewrite_docs=self.webpackChunkrewrite_docs||[]).push([["10989"],{39774:function(e,r,t){t.r(r),t.d(r,{frontMatter:()=>h,toc:()=>p,default:()=>j,metadata:()=>s,assets:()=>m,contentTitle:()=>d});var s=JSON.parse('{"id":"recipes/java/migrate/lombok/adoptlombokgettermethodnames","title":"Rename getter methods to fit Lombok","description":"org.openrewrite.java.migrate.lombok.AdoptLombokGetterMethodNames","source":"@site/docs/recipes/java/migrate/lombok/adoptlombokgettermethodnames.md","sourceDirName":"recipes/java/migrate/lombok","slug":"/recipes/java/migrate/lombok/adoptlombokgettermethodnames","permalink":"/recipes/java/migrate/lombok/adoptlombokgettermethodnames","draft":false,"unlisted":false,"editUrl":"https://github.com/openrewrite/rewrite-docs/edit/master/docs/recipes/java/migrate/lombok/adoptlombokgettermethodnames.md","tags":[],"version":"current","frontMatter":{"title":"Rename getter methods to fit Lombok","sidebar_label":"Rename getter methods to fit Lombok"},"sidebar":"docs","previous":{"title":"Add `config.stopBubbling` to the root `lombok.config`","permalink":"/recipes/java/migrate/lombok/addstopbubblingtolombokconfig"},"next":{"title":"Rename setter methods to fit Lombok","permalink":"/recipes/java/migrate/lombok/adoptlomboksettermethodnames"}}'),i=t(74848),a=t(84429),o=t(84109),n=t(93703),l=t(70440),c=t(48416);let h={title:"Rename getter methods to fit Lombok",sidebar_label:"Rename getter methods to fit Lombok"},d="Rename getter methods to fit Lombok",m={},p=[{value:"Recipe source",id:"recipe-source",level:2},{value:"Example",id:"example",level:2},{value:"Before",id:"before",level:6},{value:"After",id:"after",level:6},{value:"Usage",id:"usage",level:2},{value:"See how this recipe works across multiple open-source repositories",id:"see-how-this-recipe-works-across-multiple-open-source-repositories",level:2},{value:"Data Tables",id:"data-tables",level:2},{value:"Source files that had results",id:"source-files-that-had-results",level:3},{value:"Source files that had search results",id:"source-files-that-had-search-results",level:3},{value:"Source files that errored on a recipe",id:"source-files-that-errored-on-a-recipe",level:3},{value:"Recipe performance",id:"recipe-performance",level:3}];function u(e){let r={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",h6:"h6",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,a.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.header,{children:(0,i.jsx)(r.h1,{id:"rename-getter-methods-to-fit-lombok",children:"Rename getter methods to fit Lombok"})}),"\n",(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"org.openrewrite.java.migrate.lombok.AdoptLombokGetterMethodNames"})}),"\n",(0,i.jsx)(r.p,{children:"Rename methods that are effectively getter to the name Lombok would give them."}),"\n",(0,i.jsx)(r.p,{children:"Limitations:"}),"\n",(0,i.jsxs)(r.ul,{children:["\n",(0,i.jsx)(r.li,{children:"If two methods in a class are effectively the same getter then one's name will be corrected and the others name will be left as it is."}),"\n",(0,i.jsx)(r.li,{children:"If the correct name for a method is already taken by another method then the name will not be corrected."}),"\n",(0,i.jsxs)(r.li,{children:["Method name swaps or circular renaming within a class cannot be performed because the names block each other.\nE.g. ",(0,i.jsx)(r.code,{children:"int getFoo() { return ba; } int getBa() { return foo; }"})," stays as it is."]}),"\n"]}),"\n",(0,i.jsx)(r.h2,{id:"recipe-source",children:"Recipe source"}),"\n",(0,i.jsxs)(r.p,{children:[(0,i.jsx)(r.a,{href:"https://github.com/openrewrite/rewrite-migrate-java/blob/main/src/main/java/org/openrewrite/java/migrate/lombok/AdoptLombokGetterMethodNames.java",children:"GitHub: AdoptLombokGetterMethodNames.java"}),",\n",(0,i.jsx)(r.a,{href:"https://github.com/openrewrite/rewrite-migrate-java/issues",children:"Issue Tracker"}),",\n",(0,i.jsx)(r.a,{href:"https://artifacts.codegenomeproject.org/maven/org/openrewrite/recipe/rewrite-migrate-java/",children:"Code Genome Project"})]}),"\n",(0,i.jsxs)(r.p,{children:["This recipe is available under the ",(0,i.jsx)(r.a,{href:"https://docs.moderne.io
1/licensing/moderne-source-available-license",children:"Moderne Source Available License"}),". Moderne customers can download precompiled artifacts from The Code Genome Project. For non-commercial use you can build the artifact from source locally."]}),"\n",(0,i.jsx)(r.h2,{id:"example",children:"Example"}),"\n",(0,i.jsxs)(o.A,{groupId:"beforeAfter",children:[(0,i.jsxs)(n.A,{value:"java",label:"java",children:[(0,i.jsx)(r.h6,{id:"before",children:"Before"}),(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-java",children:"class A {\n int foo = 9;\n int giveFoo() { return foo; }\n}\n"})}),(0,i.jsx)(r.h6,{id:"after",children:"After"}),(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-java",children:"class A {\n int foo = 9;\n int getFoo() { return foo; }\n}\n"})})]}),(0,i.jsx)(n.A,{value:"diff",label:"Diff",children:(0,i.jsx)(r.pre,{children:(0,i.jsx)(r.code,{className:"language-diff",children:"@@ -3,1 +3,1 @@\nclass A {\n int foo = 9;\n- int giveFoo() { return foo; }\n+ int getFoo() { return foo; }\n}\n"})})})]}),"\n",(0,i.jsx)(r.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(l.A,{recipeName:"org.openrewrite.java.migrate.lombok.AdoptLombokGetterMethodNames",displayName:"Rename getter methods to fit Lombok",groupId:"org.openrewrite.recipe",artifactId:"rewrite-migrate-java",versionKey:"VERSION_ORG_OPENREWRITE_RECIPE_REWRITE_MIGRATE_JAVA",hasDataTables:!0}),"\n",(0,i.jsx)(r.h2,{id:"see-how-this-recipe-works-across-multiple-open-source-repositories",children:"See how this recipe works across multiple open-source repositories"}),"\n","\n",(0,i.jsx)(c.A,{link:"https://app.moderne.io/recipes/org.openrewrite.java.migrate.lombok.AdoptLombokGetterMethodNames"}),"\n",(0,i.jsx)(r.p,{children:"The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories."}),"\n",(0,i.jsxs)(r.p,{children:["Please ",(0,i.jsx)(r.a,{href:"https://moderne.io/product",children:"contact Moderne"})," for more information about safely running the recipes on your own codebase in a private SaaS."]}),"\n",(0,i.jsx)(r.h2,{id:"data-tables",children:"Data Tables"}),"\n",(0,i.jsxs)(o.A,{groupId:"data-tables",children:[(0,i.jsxs)(n.A,{value:"org.openrewrite.table.SourcesFileResults",label:"SourcesFileResults",children:[(0,i.jsx)(r.h3,{id:"source-files-that-had-results",children:"Source files that had results"}),(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"org.openrewrite.table.SourcesFileResults"})}),(0,i.jsx)(r.p,{children:(0,i.jsx)(r.em,{children:"Source files that were modified by the recipe run."})}),(0,i.jsxs)(r.table,{children:[(0,i.jsx)(r.thead,{children:(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.th,{children:"Column Name"}),(0,i.jsx)(r.th,{children:"Description"})]})}),(0,i.jsxs)(r.tbody,{children:[(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Source path before the run"}),(0,i.jsxs)(r.td,{children:["The source path of the file before the run. ",(0,i.jsx)(r.code,{children:"null"})," when a source file was created during the run."]})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Source path after the run"}),(0,i.jsxs)(r.td,{children:["A recipe may modify the source path. This is the path after the run. ",(0,i.jsx)(r.code,{children:"null"})," when a source file was deleted during the run."]})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Parent of the recipe that made changes"}),(0,i.jsx)(r.td,{children:"In a hierarchical recipe, the parent of the recipe that made a change. Empty if this is the root of a hierarchy or if the recipe is not hierarchical at all."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Recipe that made changes"}),(0,i.jsx)(r.td,{children:"The specific recipe that made a change."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Estimated time saving"}),(0,i.jsx)(r.td,{children:"An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Cycle"}),(0,i.jsx)(r.td,{children:"The recipe cycle in which the change was made."})]})]})]})]}),(0,i.jsxs)(n.A,{value:"org.openrewrite.table.SearchResults",label:"SearchResults",children:[(0,i.jsx)(r.h3,{id:"source-files-that-had-search-results",children:"Source files that had search results"}),(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"org.openrewrite.table.SearchResults"})}),(0,i.jsx)(r.p,{children:(0,i.jsx)(r.em,{children:"Search results that were found during the recipe run."})}),(0,i.jsxs)(r.table,{children:[(0,i.jsx)(r.thead,{children:(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.th,{children:"Column Name"}),(0,i.jsx)(r.th,{children:"Description"})]})}),(0,i.jsxs)(r.tbody,{children:[(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Source path of search result before the run"}),(0,i.jsx)(r.td,{children:"The source path of the file with the search result markers present."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Source path of search result after run the run"}),(0,i.jsxs)(r.td,{children:["A recipe may modify the source path. This is the path after the run. ",(0,i.jsx)(r.code,{children:"null"})," when a source file was deleted during the run."]})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Result"}),(0,i.jsx)(r.td,{children:"The trimmed printed tree of the LST element that the marker is attached to."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Description"}),(0,i.jsx)(r.td,{children:"The content of the description of the marker."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Recipe that added the search marker"}),(0,i.jsx)(r.td,{children:"The specific recipe that added the Search marker."})]})]})]})]}),(0,i.jsxs)(n.A,{value:"org.openrewrite.table.SourcesFileErrors",label:"SourcesFileErrors",children:[(0,i.jsx)(r.h3,{id:"source-files-that-errored-on-a-recipe",children:"Source files that errored on a recipe"}),(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"org.openrewrite.table.SourcesFileErrors"})}),(0,i.jsx)(r.p,{children:(0,i.jsx)(r.em,{children:"The details of all errors produced by a re
1cipe run."})}),(0,i.jsxs)(r.table,{children:[(0,i.jsx)(r.thead,{children:(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.th,{children:"Column Name"}),(0,i.jsx)(r.th,{children:"Description"})]})}),(0,i.jsxs)(r.tbody,{children:[(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Source path"}),(0,i.jsx)(r.td,{children:"The file that failed to parse."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Recipe that made changes"}),(0,i.jsx)(r.td,{children:"The specific recipe that made a change."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Stack trace"}),(0,i.jsx)(r.td,{children:"The stack trace of the failure."})]})]})]})]}),(0,i.jsxs)(n.A,{value:"org.openrewrite.table.RecipeRunStats",label:"RecipeRunStats",children:[(0,i.jsx)(r.h3,{id:"recipe-performance",children:"Recipe performance"}),(0,i.jsx)(r.p,{children:(0,i.jsx)(r.strong,{children:"org.openrewrite.table.RecipeRunStats"})}),(0,i.jsx)(r.p,{children:(0,i.jsx)(r.em,{children:"Statistics used in analyzing the performance of recipes."})}),(0,i.jsxs)(r.table,{children:[(0,i.jsx)(r.thead,{children:(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.th,{children:"Column Name"}),(0,i.jsx)(r.th,{children:"Description"})]})}),(0,i.jsxs)(r.tbody,{children:[(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"The recipe"}),(0,i.jsx)(r.td,{children:"The recipe whose stats are being measured both individually and cumulatively."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Source file count"}),(0,i.jsx)(r.td,{children:"The number of source files the recipe ran over."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Source file changed count"}),(0,i.jsx)(r.td,{children:"The number of source files which were changed in the recipe run. Includes files created, deleted, and edited."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Cumulative scanning time (ns)"}),(0,i.jsx)(r.td,{children:"The total time spent across the scanning phase of this recipe."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Max scanning time (ns)"}),(0,i.jsx)(r.td,{children:"The max time scanning any one source file."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Cumulative edit time (ns)"}),(0,i.jsx)(r.td,{children:"The total time spent across the editing phase of this recipe."})]}),(0,i.jsxs)(r.tr,{children:[(0,i.jsx)(r.td,{children:"Max edit time (ns)"}),(0,i.jsx)(r.td,{children:"The max time editing any one source file."})]})]})]})]})]})]})}function j(e={}){let{wrapper:r}={...(0,a.R)(),...e.components};return r?(0,i.jsx)(r,{...e,children:(0,i.jsx)(u,{...e})}):u(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.