Skip to content

[GR-68578] Add rewrite support for errorprone.refasterrules #11932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Pankraz76
Copy link

Add rewrite support

PoC:

quite fast considering it large scale:

[INFO] Project [JSONExporter] Parsing source files
[INFO] Running recipe(s)...
[INFO] Printing available datatables to: target/rewrite/datatables/2025-08-11_13-27-08-175
[WARNING] These recipes would make changes to visualizer/IdealGraphVisualizer/Data/src/main/java/org/graalvm/visualizer/data/serialization/lazy/NetworkStreamContent.java:
[WARNING]     tech.picnic.errorprone.refasterrules.FileRulesRecipes
[WARNING]         tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesCreateTempFileInCustomDirectoryToFileRecipe
[WARNING] These recipes would make changes to visualizer/IdealGraphVisualizer/Data/src/test/java/org/graalvm/visualizer/data/serialization/lazy/ScanningBuilderTest.java:
[WARNING]     tech.picnic.errorprone.refasterrules.FileRulesRecipes
[WARNING]         tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesCreateTempFileToFileRecipe
[WARNING] These recipes would make changes to visualizer/IdealGraphVisualizer/Data/src/test/java/org/graalvm/visualizer/data/serialization/lazy/NetworkStreamContentTest.java:
[WARNING]     tech.picnic.errorprone.refasterrules.FileRulesRecipes
[WARNING]         tech.picnic.errorprone.refasterrules.FileRulesRecipes$FilesCreateTempFileToFileRecipe
[WARNING] These recipes would make changes to visualizer/IdealGraphVisualizer/View/src/main/java/org/graalvm/visualizer/view/impl/GraphTypeContainer.java:
[WARNING]     org.openrewrite.staticanalysis.UnnecessaryParentheses
[WARNING] These recipes would make changes to visualizer/IdealGraphVisualizer/View/src/main/java/org/graalvm/visualizer/view/impl/GraphViewerImplementation.java:
[WARNING]     org.openrewrite.staticanalysis.UnnecessaryParentheses
[WARNING] These recipes would make changes to visualizer/IdealGraphVisualizer/View/src/main/java/org/graalvm/visualizer/view/impl/FilterView.java:
[WARNING]     org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments
[WARNING]         org.openrewrite.staticanalysis.UnnecessaryParentheses
[WARNING] These recipes would make changes to visualizer/IdealGraphVisualizer/View/src/main/java/org/graalvm/visualizer/view/impl/DiagramCache.java:
[WARNING]     org.openrewrite.staticanalysis.ModifierOrder
[WARNING] Patch file available:
[WARNING]     /Users/vincent.potucek/IdeaProjects/graal/visualizer/IdealGraphVisualizer/target/rewrite/rewrite.patch
[WARNING] Estimate time saved: 24m
[WARNING] Run 'mvn rewrite:run' to apply the recipes.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for IdealGraphVisualizer-parent 1.23-SNAPSHOT:
[INFO] 
[INFO] IdealGraphVisualizer-parent ........................ SUCCESS [  0.509 s]
[INFO] IdealGraphVisualizer-branding ...................... SUCCESS [  0.676 s]
[INFO] Settings ........................................... SUCCESS [  0.239 s]
[INFO] Data ............................................... SUCCESS [  2.229 s]
[INFO] Util ............................................... SUCCESS [  0.564 s]
[INFO] Bytecodes .......................................... SUCCESS [  0.251 s]
[INFO] Layout ............................................. SUCCESS [  0.194 s]
[INFO] HierarchicalLayout ................................. SUCCESS [  0.376 s]
[INFO] ControlFlow ........................................ SUCCESS [  0.279 s]
[INFO] Difference ......................................... SUCCESS [  0.185 s]
[INFO] NetworkConnection .................................. SUCCESS [  0.200 s]
[INFO] Graph .............................................. SUCCESS [  0.431 s]
[INFO] ViewerApi .......................................... SUCCESS [  0.215 s]
[INFO] Coordinator ........................................ SUCCESS [  0.596 s]
[INFO] PolyglotRunner ..................................... SUCCESS [  0.304 s]
[INFO] Filter ............................................. SUCCESS [  0.623 s]
[INFO] Graal .............................................. SUCCESS [  0.390 s]
[INFO] SelectionCoordinator ............................... SUCCESS [  0.188 s]
[INFO] Shell .............................................. SUCCESS [  0.657 s]
[INFO] FilterProfiles ..................................... SUCCESS [  0.948 s]
[INFO] FilterWindow ....................................... SUCCESS [  0.688 s]
[INFO] View ............................................... SUCCESS [  2.821 s]
[INFO] GraphSearch ........................................ SUCCESS [  0.619 s]
[INFO] SettingsUI ......................................... SUCCESS [  0.292 s]
[INFO] SourceRepository ................................... SUCCESS [  2.437 s]
[INFO] VisualizerUI ....................................... SUCCESS [  0.070 s]
[INFO] JavaSources ........................................ SUCCESS [  0.750 s]
[INFO] Upgrade ............................................ SUCCESS [  0.077 s]
[INFO] IdealGraphVisualizer-app ........................... SUCCESS [  5.627 s]
[INFO] JSONExporter ....................................... FAILURE [ 20.958 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  44.810 s
[INFO] Finished at: 2025-08-11T13:27:08+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:6.15.0:dryRun (default) on project JSONExporter: Applying recipes would make changes. See logs for more details. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :JSONExporter
➜  IdealGraphVisualizer git:(apply-rw-plugin) ✗ 

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Aug 11, 2025
@Pankraz76 Pankraz76 changed the title Add rewrite support [GR-68578] Add rewrite support for errorprone.refasterrules Aug 11, 2025
Copy link
Author

@Pankraz76 Pankraz76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant