1"use strict";(self.webpackChunkrewrite_docs=self.webpackChunkrewrite_docs||[]).push([["10334"],{29289:function(e,r,s){s.r(r),s.d(r,{frontMatter:()=>d,toc:()=>j,default:()=>x,metadata:()=>i,assets:()=>p,contentTitle:()=>o});var i=JSON.parse('{"id":"recipes/java/migrate/lang/migratecharacterisspacetoiswhitespace","title":"Use `Character#isWhitespace(char)`","description":"isWhitespace(char)`","source":"@site/docs/recipes/java/migrate/lang/migratecharacterisspacetoiswhitespace.md","sourceDirName":"recipes/java/migrate/lang","slug":"/recipes/java/migrate/lang/migratecharacterisspacetoiswhitespace","permalink":"/recipes/java/migrate/lang/migratecharacterisspacetoiswhitespace","draft":false,"unlisted":false,"editUrl":"https://github.com/openrewrite/rewrite-docs/edit/master/docs/recipes/java/migrate/lang/migratecharacterisspacetoiswhitespace.md","tags":[],"version":"current","frontMatter":{"title":"Use `Character#isWhitespace(char)`","sidebar_label":"Use `Character#isWhitespace(char)`"},"sidebar":"docs","previous":{"title":"Use `Character#isJavaIdentifierStart(char)`","permalink":"/recipes/java/migrate/lang/migratecharacterisjavalettertoisjavaidentifierstart"},"next":{"title":"Use `ClassLoader#defineClass(String, byte[], int, int)`","permalink":"/recipes/java/migrate/lang/migrateclassloaderdefineclass"}}'),t=s(74848),a=s(84429),c=s(84109),n=s(93703),h=s(70440),l=s(48416);let d={title:"Use `Character#isWhitespace(char)`",sidebar_label:"Use `Character#isWhitespace(char)`"},o="Use Character#isWhitespace(char)",p={},j=[{value:"Recipe source",id:"recipe-source",level:2},{value:"Definition",id:"definition",level:2},{value:"Used by",id:"used-by",level:2},{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",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,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.header,{children:(0,t.jsxs)(r.h1,{id:"use-characteriswhitespacechar",children:["Use ",(0,t.jsx)(r.code,{children:"Character#isWhitespace(char)"})]})}),"\n",(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"org.openrewrite.java.migrate.lang.MigrateCharacterIsSpaceToIsWhitespace"})}),"\n",(0,t.jsx)(r.p,{children:(0,t.jsxs)(r.em,{children:["Use ",(0,t.jsx)(r.code,{children:"Character#isWhitespace(char)"})," instead of the deprecated ",(0,t.jsx)(r.code,{children:"Character#isSpace(char)"})," in Java 1.1 or higher."]})}),"\n",(0,t.jsx)(r.h2,{id:"recipe-source",children:"Recipe source"}),"\n",(0,t.jsxs)(r.p,{children:[(0,t.jsx)(r.a,{href:"https://github.com/openrewrite/rewrite-migrate-java/blob/main/src/main/resources/META-INF/rewrite/java-lang-apis.yml",children:"GitHub: java-lang-apis.yml"}),",\n",(0,t.jsx)(r.a,{href:"https://github.com/openrewrite/rewrite-migrate-java/issues",children:"Issue Tracker"}),",\n",(0,t.jsx)(r.a,{href:"https://artifacts.codegenomeproject.org/maven/org/openrewrite/recipe/rewrite-migrate-java/",children:"Code Genome Project"})]}),"\n",(0,t.jsxs)(r.p,{children:["This recipe is available under the ",(0,t.jsx)(r.a,{href:"https://docs.moderne.io/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,t.jsx)(r.h2,{id:"definition",children:"Definition"}),"\n",(0,t.jsxs)(c.A,{groupId:"recipeType",children:[(0,t.jsxs)(n.A,{value:"recipe-list",label:"Recipe List",children:[(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"Preconditions"})}),(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsx)(r.li,{children:(0,t.jsx)(r.a,{href:"../../../core/singleton",children:"Singleton"})}),"\n"]}),(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"Recipes"})}),(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:[(0,t.jsx)(r.a,{href:"../../../java/changemethodname",children:"Change method n
1ame"}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsxs)(r.li,{children:["methodPattern: ",(0,t.jsx)(r.code,{children:"java.lang.Character isSpace(char)"})]}),"\n",(0,t.jsxs)(r.li,{children:["newMethodName: ",(0,t.jsx)(r.code,{children:"isWhitespace"})]}),"\n"]}),"\n"]}),"\n"]})]}),(0,t.jsx)(n.A,{value:"yaml-recipe-list",label:"Yaml Recipe List",children:(0,t.jsx)(r.pre,{children:(0,t.jsx)(r.code,{className:"language-yaml",children:"---\ntype: specs.openrewrite.org/v1beta/recipe\nname: org.openrewrite.java.migrate.lang.MigrateCharacterIsSpaceToIsWhitespace\ndisplayName: Use `Character#isWhitespace(char)`\ndescription: |\n Use `Character#isWhitespace(char)` instead of the deprecated `Character#isSpace(char)` in Java 1.1 or higher.\npreconditions:\n - org.openrewrite.Singleton\nrecipeList:\n - org.openrewrite.java.ChangeMethodName:\n methodPattern: java.lang.Character isSpace(char)\n newMethodName: isWhitespace\n\n"})})})]}),"\n",(0,t.jsx)(r.h2,{id:"used-by",children:"Used by"}),"\n",(0,t.jsx)(r.p,{children:"This recipe is used as part of the following composite recipes:"}),"\n",(0,t.jsxs)(r.ul,{children:["\n",(0,t.jsx)(r.li,{children:(0,t.jsxs)(r.a,{href:"/recipes/java/migrate/lang/javalangapis",children:["Use modernized ",(0,t.jsx)(r.code,{children:"java.lang"})," APIs"]})}),"\n"]}),"\n",(0,t.jsx)(r.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsx)(h.A,{recipeName:"org.openrewrite.java.migrate.lang.MigrateCharacterIsSpaceToIsWhitespace",displayName:"Use `Character#isWhitespace(char)`",groupId:"org.openrewrite.recipe",artifactId:"rewrite-migrate-java",versionKey:"VERSION_ORG_OPENREWRITE_RECIPE_REWRITE_MIGRATE_JAVA",hasDataTables:!0}),"\n",(0,t.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,t.jsx)(l.A,{link:"https://app.moderne.io/recipes/org.openrewrite.java.migrate.lang.MigrateCharacterIsSpaceToIsWhitespace"}),"\n",(0,t.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,t.jsxs)(r.p,{children:["Please ",(0,t.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,t.jsx)(r.h2,{id:"data-tables",children:"Data Tables"}),"\n",(0,t.jsxs)(c.A,{groupId:"data-tables",children:[(0,t.jsxs)(n.A,{value:"org.openrewrite.table.SourcesFileResults",label:"SourcesFileResults",children:[(0,t.jsx)(r.h3,{id:"source-files-that-had-results",children:"Source files that had results"}),(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"org.openrewrite.table.SourcesFileResults"})}),(0,t.jsx)(r.p,{children:(0,t.jsx)(r.em,{children:"Source files that were modified by the recipe run."})}),(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"Column Name"}),(0,t.jsx)(r.th,{children:"Description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Source path before the run"}),(0,t.jsxs)(r.td,{children:["The source path of the file before the run. ",(0,t.jsx)(r.code,{children:"null"})," when a source file was created during the run."]})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Source path after the run"}),(0,t.jsxs)(r.td,{children:["A recipe may modify the source path. This is the path after the run. ",(0,t.jsx)(r.code,{children:"null"})," when a source file was deleted during the run."]})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Parent of the recipe that made changes"}),(0,t.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,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Recipe that made changes"}),(0,t.jsx)(r.td,{children:"The specific recipe that made a change."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Estimated time saving"}),(0,t.jsx)(r.td,{children:"An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Cycle"}),(0,t.jsx)(r.td,{children:"The recipe cycle in which the change was made."})]})]})]})]}),(0,t.jsxs)(n.A,{value:"org.openrewrite.table.SearchResults",label:"SearchResults",children:[(0,t.jsx)(r.h3,{id:"source-files-that-had-search-results",children:"Source files that had search results"}),(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"org.openrewrite.table.SearchResults"})}),(0,t.jsx)(r.p,{children:(0,t.jsx)(r.em,{children:"Search results that were found during the recipe run."})}),(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"Column Name"}),(0,t.jsx)(r.th,{children:"Description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Source path of search result before the run"}),(0,t.jsx)(r.td,{children:"The source path of the file with the search result markers present."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Source path of search result after run the run"}),(0,t.jsxs)(r.td,{children:["A recipe may modify the source path. This is the path after the run. ",(0,t.jsx)(r.code,{children:"null"})," when a source file was deleted during the run."]})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Result"}),(0,t.jsx)(r.td,{children:"The trimmed printed tree of the LST element that the marker is attached to."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Description"}),(0,t.jsx)(r.td,{children:"The content of the description of the marker."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Recipe that added the search marker"}),(0,t.jsx)(r.td,{children:"The specific recipe that added the Search marker."})]})]})]})]}),(0,t.jsxs)(n.A,{value:"org.openrewrite.table.SourcesFileErrors",label:"SourcesFileErrors",children:[(0,t.jsx)(r.h3,{id:"source-files-that-errored-on-a-recipe",children:"Source files that errored on a recipe"}),(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"org.openrewrite.table.SourcesFileErrors"})}),(0,t.jsx)(r.p,{children:(0,t.jsx)(r.em,{children:"The details of all errors produced by a re
1cipe run."})}),(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"Column Name"}),(0,t.jsx)(r.th,{children:"Description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Source path"}),(0,t.jsx)(r.td,{children:"The file that failed to parse."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Recipe that made changes"}),(0,t.jsx)(r.td,{children:"The specific recipe that made a change."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Stack trace"}),(0,t.jsx)(r.td,{children:"The stack trace of the failure."})]})]})]})]}),(0,t.jsxs)(n.A,{value:"org.openrewrite.table.RecipeRunStats",label:"RecipeRunStats",children:[(0,t.jsx)(r.h3,{id:"recipe-performance",children:"Recipe performance"}),(0,t.jsx)(r.p,{children:(0,t.jsx)(r.strong,{children:"org.openrewrite.table.RecipeRunStats"})}),(0,t.jsx)(r.p,{children:(0,t.jsx)(r.em,{children:"Statistics used in analyzing the performance of recipes."})}),(0,t.jsxs)(r.table,{children:[(0,t.jsx)(r.thead,{children:(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.th,{children:"Column Name"}),(0,t.jsx)(r.th,{children:"Description"})]})}),(0,t.jsxs)(r.tbody,{children:[(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"The recipe"}),(0,t.jsx)(r.td,{children:"The recipe whose stats are being measured both individually and cumulatively."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Source file count"}),(0,t.jsx)(r.td,{children:"The number of source files the recipe ran over."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Source file changed count"}),(0,t.jsx)(r.td,{children:"The number of source files which were changed in the recipe run. Includes files created, deleted, and edited."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Cumulative scanning time (ns)"}),(0,t.jsx)(r.td,{children:"The total time spent across the scanning phase of this recipe."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Max scanning time (ns)"}),(0,t.jsx)(r.td,{children:"The max time scanning any one source file."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Cumulative edit time (ns)"}),(0,t.jsx)(r.td,{children:"The total time spent across the editing phase of this recipe."})]}),(0,t.jsxs)(r.tr,{children:[(0,t.jsx)(r.td,{children:"Max edit time (ns)"}),(0,t.jsx)(r.td,{children:"The max time editing any one source file."})]})]})]})]})]})]})}function x(e={}){let{wrapper:r}={...(0,a.R)(),...e.components};return r?(0,t.jsx)(r,{...e,children:(0,t.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.