If you have a trivial solution to rename hundreds of Java classes and their references en masse without breaking the build and without renaming each file one-at-a-time, do tell. You can find more details about potential solutions I've tried here:
https://stackoverflow.com/questions/75154524/bulk-rename-of-...
---
type: specs.openrewrite.org/v1beta/recipe
name: com.yourorg.ChangeTypeExample
displayName: Change type example
recipeList:
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: (.+)
newFullyQualifiedTypeName: Kt$1- build the current TeX.jar
- jar tf TeX.jar | grep whatever to get a list of to-be-renamed classes
- use sed or manual editing to generate a large list of recipes
- run those recipes
Instead of jar tf, grep for “^package foo.bar.baz” and “class (complex regex)” in the source code to get a list of package and class names, or use the directory structure. Maybe do all of them, and compare the results for robustness.
That list will be large and it may not go perfect in one go, but it’s a one-off job, and you‘ll get there.
It's possible you do in fact need to parse the AST for your goals - I haven't spent the requisite time to deeply understand the problem.
---
Why do you want to change all the files? The license only says you have to change the names of files that you modify. It's a pretty weird term.
If for some reason you were determined to change the names of all files then you ought to be able to create a plugin that walks the tree of classes and invokes the refactoring capabilities of the IDE to make the change. It's a strange use-case though so I'm not really surprised there isn't a ready tool for it.
Ever pull on a thread to unravel an entire sweater?
Imagine wanting to add an SVG typesetter. To do this, the interface implemented by the DVI typesetter needs to be extracted and generalized so that it works for both SVG and DVI (to maintain existing behaviour). The `Typesetter` interface is used by, for example, `BaseNode`, so any changes to that interface could touch `BaseNode`. Changes to `BaseNode` can affect all `*Node` classes, which then cascade over to `*Noad` and `*Prim` classes, and from there the rest of the source base.
So, the workaround can be quite impactful in the end. Renaming the entirety of the code base, potentially.
Moreover, under the following definition in the license:
`Modification' of a file
means any procedure that produces a derivative file under any
applicable law -- that is, a file containing the original file or
a significant portion of it, either verbatim or with modifications
and/or translated into another language.
…compilation would count as modification (“translated into another language”), and compilation also changes the file name (from .java to .class), so distributing the compilation output should be fine. Furthermore, any changes to the sources can be distributed as a diff patch, which also has a different file name.
The license term seems petty, and would be annoying, but the workaround is trivial.