Usage
Run this recipe
This recipe has no required configuration options. Users of Moderne can run it via the Moderne CLI.
You will need to have configured the Moderne CLI on your machine before you can run the following command.
mod run . --recipe FindJavaMethodReturns
If the recipe is not available locally, then you can install it using:
RELEASE resolves to the newest release and LATEST to the newest build of any kind, including snapshots. Either one lets mod config recipes upgrade pull in later versions without editing this command; a pinned version stays where you put it.
- RELEASE
- LATEST
- Pinned version
mod config recipes jar install io.moderne.recipe:rewrite-prethink:RELEASE
mod config recipes jar install io.moderne.recipe:rewrite-prethink:LATEST
mod config recipes jar install io.moderne.recipe:rewrite-prethink:0.18.0
Data tables
Java method returns
io.moderne.prethink.table.JavaMethodReturnsExplicit return sites owned by an ordinary method with a body, preserving actual method, body, return and direct expression UUIDs, nullable attribution and original source ranges. Lambda-owned returns and constructor or initializer bodies are excluded; independent nested ordinary methods own their returns. Repeated physical nodes remain distinct. No local-declaration binding, reaching-value inference, unique source-target resolution or runtime-flow claim.
mod study . --last-recipe-run \
--data-table io.moderne.prethink.table.JavaMethodReturns
| Column | Description |
|---|---|
| Source path | Actual Java compilation-unit source path, without normalization. |
| Source set | Actual sole JavaSourceSet name; null for missing or duplicate source-set markers independently of project markers. Preserve empty values. |
| Project ID | Actual sole JavaProject marker UUID; null for missing or duplicate project markers. Never normalize or substitute a project name. |
| Project name | Actual sole JavaProject name, descriptive only; preserve null and empty values. Null for missing or duplicate project markers independently of source-set markers. |
| Source set ID | Actual sole JavaSourceSet marker UUID; null for missing or duplicate source-set markers independently of project markers. |
| Source file ID | Actual compilation-unit UUID in the externally verified VCS, commit, model-input and producer namespace. Equal CU IDs alone do not establish nested-node identity. |
| Method ID | Actual nearest owning ordinary J.MethodDeclaration UUID. Ownership stops at lambda, constructor and class-body boundaries; independent nested ordinary methods own their returns. |
| Method body ID | Actual owning ordinary method body J.Block UUID, not an enclosing nested statement block or a synthetic identity. |
| Method name | Actual syntactic owning method name. Names and overload spellings are descriptive and do not establish identity or a unique source target. |
| Method signature | Opaque actual owning JavaType.Method.toString when available; null for unavailable method attribution. Do not parse it, synthesize a signature or treat it as a unique declaration key. |
| Method declaring type | Actual attributed owning method declaring-type fully qualified name; null when unavailable or unknown. Independently observed, with no syntax or path fallback. |
| Method return type | Opaque actual owning method return JavaType.toString; null for missing or whole Unknown type. Do not substitute an expression type or infer an effective returned value. |
| Method start line | Whole actual owning method node start after its prefix, from unchanged Coordinates. Positive one-based line. |
| Method start column | Whole actual owning method node start after its prefix. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates. |
| Method end line | Exclusive whole actual owning method node end from unchanged Coordinates. Positive one-based line. |
| Method end column | Exclusive whole actual owning method node end. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates. |
| Body start line | Actual owning method body start including the opening brace, after its prefix. Positive one-based line from unchanged Coordinates. |
| Body start column | Actual owning method body start including the opening brace. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates. |
| Body end line | Exclusive actual owning method body end including the closing brace. Positive one-based line from unchanged Coordinates. |
| Body end column | Exclusive actual owning method body end including the closing brace. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates. |
| Return ID | Actual physical J.Return UUID. Preserve distinct equal-text occurrences and multiplicity; no synthetic identity or source-order matching. |
| Return kind | WITH_EXPRESSION for a written direct return expression; BARE for return without an expression. Explicit null is a Literal expression, never BARE. |
| Return start line | Actual J.Return node start at the return keyword, after its prefix. Positive one-based line from unchanged Coordinates. |
| Return start column | Actual J.Return keyword start. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates. |
| Return end line | Exclusive actual J.Return node end, excluding statement semicolon and right padding. BARE spans only the return keyword. Positive one-based line. |
| Return end column | Exclusive actual J.Return node end from unchanged Coordinates, excluding statement semicolon and right padding. BARE ends after its keyword; one-based UTF-16 column, tab one, CRLF-aware. |
| Expression ID | Actual direct J.Return expression UUID for WITH_EXPRESSION; null for BARE. Preserve wrappers and never substitute an inner invocation or declaration UUID. A bare identifier has no declaration-binding claim. |
| Expression kind | Direct root label: Identifier, FieldAccess, MethodInvocation, NewClass, NewArray, Literal, TypeCast, Parentheses, Assignment, AssignmentOperation, Binary, Unary, Ternary, Lambda, MemberReference, ArrayAccess, InstanceOf or Other. Null for BARE; no unwrapping. |
| Expression type | Opaque actual direct expression JavaType.toString; null for BARE or missing or whole Unknown type. Literal-null type text may be the string null. Independent of the declared method return type, without value inference. |
| Expression start line | Actual full direct expression start after its prefix from unchanged Coordinates. Positive one-based line for WITH_EXPRESSION; null for BARE. |
| Expression start column | Actual full direct expression start. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates; null for BARE. |
| Expression end line | Exclusive actual full direct expression end from unchanged Coordinates. Positive one-based line for WITH_EXPRESSION; null for BARE. |
| Expression end column | Exclusive actual full direct expression end. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates; null for BARE. |
Source files that had results
org.openrewrite.table.SourcesFileResultsSource files that were modified by the recipe run.
mod study . --last-recipe-run \
--data-table org.openrewrite.table.SourcesFileResults
| Column | Description |
|---|---|
| Source path before the run | The source path of the file before the run. null when a source file was created during the run. |
| Source path after the run | A recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run. |
| Parent of the recipe that made changes | 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. |
| Recipe that made changes | The specific recipe that made a change. |
| Estimated time saving | An estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds. |
| Cycle | The recipe cycle in which the change was made. |
Source files that had search results
org.openrewrite.table.SearchResultsSearch results that were found during the recipe run.
mod study . --last-recipe-run \
--data-table org.openrewrite.table.SearchResults
| Column | Description |
|---|---|
| Source path of search result before the run | The source path of the file with the search result markers present. |
| Source path of search result after run the run | A recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run. |
| Result | The trimmed printed tree of the LST element that the marker is attached to. |
| Description | The content of the description of the marker. |
| Recipe that added the search marker | The specific recipe that added the Search marker. |
Source files that errored on a recipe
org.openrewrite.table.SourcesFileErrorsThe details of all errors produced by a recipe run.
mod study . --last-recipe-run \
--data-table org.openrewrite.table.SourcesFileErrors
| Column | Description |
|---|---|
| Source path | The file that failed to parse. |
| Recipe that made changes | The specific recipe that made a change. |
| Stack trace | The stack trace of the failure. |
Recipe performance
org.openrewrite.table.RecipeRunStatsStatistics used in analyzing the performance of recipes.
mod study . --last-recipe-run \
--data-table org.openrewrite.table.RecipeRunStats
| Column | Description |
|---|---|
| The recipe | The recipe whose stats are being measured both individually and cumulatively. |
| Source file count | The number of source files the recipe ran over. |
| Source file changed count | The number of source files which were changed in the recipe run. Includes files created, deleted, and edited. |
| Cumulative scanning time (ns) | The total time spent across the scanning phase of this recipe. |
| Max scanning time (ns) | The max time scanning any one source file. |
| Cumulative edit time (ns) | The total time spent across the editing phase of this recipe. |
| Max edit time (ns) | The max time editing any one source file. |