Commit 4f3aaa0
authored
Migrate GraalVM resource-config.json from regex to glob patterns (#976)
* Migrate GraalVM resource-config.json from regex to glob patterns
GraalVM JDK 23 changed the resource hints syntax in resource-config.json
from Java regex pattern format to glob pattern format. This recipe
automatically migrates the configuration files.
Changes:
- New recipe: MigrateGraalVMResourceConfig
- Converts pattern entries to glob entries (e.g., ".*\.txt" -> "**/*.txt")
- Restructures JSON from {resources: {includes: [...]}} to {resources: [...]}
- Removes excludes section (no longer supported in GraalVM 23+)
- Marks unconvertible patterns (character classes, alternations) for manual review
Fixes moderneinc/customer-requests#1755
* Address PR review feedback
- Update copyright year to 2026
- Use Tree.randomId() instead of UUID.randomUUID()
- Use ListUtils.map for more concise code
- Fix else-if code style (same line)
- Fix string comparison order ("**".equals(glob))
- Use defaults(RecipeSpec) pattern in tests
- Integrate RegexToGlobConverter into MigrateGraalVMResourceConfig
(reducing public API surface per reviewer suggestion)
* Address additional PR review feedback
- Convert getDisplayName/getDescription methods to String fields
- Use StringUtils.isNullOrEmpty() for null/empty check
- Add StringUtils import
* apply OR BestPractices
* include in MigrateGraalVMResourceConfig into Java 25 migration
* update recipes1 parent 9dae6ab commit 4f3aaa0
6 files changed
Lines changed: 801 additions & 1 deletion
File tree
- src
- main
- java/org/openrewrite/java/migrate
- resources/META-INF/rewrite
- test/java/org/openrewrite/java/migrate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
0 commit comments