Skip to main content
Moderne OnlyThis recipe is proprietary to Moderne and runs on the Moderne platform or CLI — it isn’t part of the open-source catalog. Available with a Moderne subscription.Contact Sales

Find Java method returns

Recipe IDio.moderne.prethink.FindJavaMethodReturns
Artifactio.moderne.recipe:rewrite-prethink

Report explicit return sites owned by ordinary methods with bodies, retaining actual method, body, return and direct expression identities, independently nullable attribution and original printer ranges. Preserve bare returns, explicit null expressions and repeated physical sites without unwrapping expressions. Exclude lambda-owned returns and constructor or initializer bodies; independent nested ordinary methods own their returns. Does not change sources, bind returned locals, select unique source targets or infer reaching values or runtime flow.

Single recipeOpenRewriteModerne Proprietary License
Try in PlatformTry this recipe in the Moderne platform. Not a user yet? You’ll get a no-setup demo environment, with nothing to install or configure.

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.

shell
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.

mod config recipes jar install io.moderne.recipe:rewrite-prethink:RELEASE

Data tables​

Java method returns
io.moderne.prethink.table.JavaMethodReturns

Explicit 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.

Export after a run
mod study . --last-recipe-run \
--data-table io.moderne.prethink.table.JavaMethodReturns
ColumnDescription
Source pathActual Java compilation-unit source path, without normalization.
Source setActual sole JavaSourceSet name; null for missing or duplicate source-set markers independently of project markers. Preserve empty values.
Project IDActual sole JavaProject marker UUID; null for missing or duplicate project markers. Never normalize or substitute a project name.
Project nameActual sole JavaProject name, descriptive only; preserve null and empty values. Null for missing or duplicate project markers independently of source-set markers.
Source set IDActual sole JavaSourceSet marker UUID; null for missing or duplicate source-set markers independently of project markers.
Source file IDActual 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 IDActual nearest owning ordinary J.MethodDeclaration UUID. Ownership stops at lambda, constructor and class-body boundaries; independent nested ordinary methods own their returns.
Method body IDActual owning ordinary method body J.Block UUID, not an enclosing nested statement block or a synthetic identity.
Method nameActual syntactic owning method name. Names and overload spellings are descriptive and do not establish identity or a unique source target.
Method signatureOpaque 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 typeActual attributed owning method declaring-type fully qualified name; null when unavailable or unknown. Independently observed, with no syntax or path fallback.
Method return typeOpaque 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 lineWhole actual owning method node start after its prefix, from unchanged Coordinates. Positive one-based line.
Method start columnWhole actual owning method node start after its prefix. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates.
Method end lineExclusive whole actual owning method node end from unchanged Coordinates. Positive one-based line.
Method end columnExclusive whole actual owning method node end. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates.
Body start lineActual owning method body start including the opening brace, after its prefix. Positive one-based line from unchanged Coordinates.
Body start columnActual owning method body start including the opening brace. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates.
Body end lineExclusive actual owning method body end including the closing brace. Positive one-based line from unchanged Coordinates.
Body end columnExclusive actual owning method body end including the closing brace. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates.
Return IDActual physical J.Return UUID. Preserve distinct equal-text occurrences and multiplicity; no synthetic identity or source-order matching.
Return kindWITH_EXPRESSION for a written direct return expression; BARE for return without an expression. Explicit null is a Literal expression, never BARE.
Return start lineActual J.Return node start at the return keyword, after its prefix. Positive one-based line from unchanged Coordinates.
Return start columnActual J.Return keyword start. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates.
Return end lineExclusive actual J.Return node end, excluding statement semicolon and right padding. BARE spans only the return keyword. Positive one-based line.
Return end columnExclusive 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 IDActual 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 kindDirect 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 typeOpaque 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 lineActual full direct expression start after its prefix from unchanged Coordinates. Positive one-based line for WITH_EXPRESSION; null for BARE.
Expression start columnActual full direct expression start. Positive one-based UTF-16 column, tab one, CRLF-aware, from unchanged Coordinates; null for BARE.
Expression end lineExclusive actual full direct expression end from unchanged Coordinates. Positive one-based line for WITH_EXPRESSION; null for BARE.
Expression end columnExclusive 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.SourcesFileResults

Source files that were modified by the recipe run.

Export after a run
mod study . --last-recipe-run \
--data-table org.openrewrite.table.SourcesFileResults
ColumnDescription
Source path before the runThe source path of the file before the run. null when a source file was created during the run.
Source path after the runA 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 changesIn 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 changesThe specific recipe that made a change.
Estimated time savingAn estimated effort that a developer to fix manually instead of using this recipe, in unit of seconds.
CycleThe recipe cycle in which the change was made.
Source files that had search results
org.openrewrite.table.SearchResults

Search results that were found during the recipe run.

Export after a run
mod study . --last-recipe-run \
--data-table org.openrewrite.table.SearchResults
ColumnDescription
Source path of search result before the runThe source path of the file with the search result markers present.
Source path of search result after run the runA recipe may modify the source path. This is the path after the run. null when a source file was deleted during the run.
ResultThe trimmed printed tree of the LST element that the marker is attached to.
DescriptionThe content of the description of the marker.
Recipe that added the search markerThe specific recipe that added the Search marker.
Source files that errored on a recipe
org.openrewrite.table.SourcesFileErrors

The details of all errors produced by a recipe run.

Export after a run
mod study . --last-recipe-run \
--data-table org.openrewrite.table.SourcesFileErrors
ColumnDescription
Source pathThe file that failed to parse.
Recipe that made changesThe specific recipe that made a change.
Stack traceThe stack trace of the failure.
Recipe performance
org.openrewrite.table.RecipeRunStats

Statistics used in analyzing the performance of recipes.

Export after a run
mod study . --last-recipe-run \
--data-table org.openrewrite.table.RecipeRunStats
ColumnDescription
The recipeThe recipe whose stats are being measured both individually and cumulatively.
Source file countThe number of source files the recipe ran over.
Source file changed countThe 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.