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:
Edit: Never mind, whartung enlightened me in a sibling comment. Leaving the egg on my face for posterity below.
---
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.
- 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.
This feels like something where the right solution is to drop down to the terminal and use the old standbys - sed/grep/find, etc. Could probably wrap it all up in `make` or `just` if this is something you do regularly.
It's not trivial. Some class names are substrings of other classes. I'm pretty sure this requires loading and parsing the source code's AST to accomplish without breaking the build. The SO thread goes into more gnarly details.
Sorry, I didn't mean to imply it was trivial, by any means. Just that there are powerful tools for "manipulating many line-delimited text files at once" and those tools seem likely to fit your goal.
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.
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-...
FYI, the following plug-in for IDEA supports regular expressions (as of Jan 20, 2023), so it may be a viable solution:
https://plugins.jetbrains.com/plugin/17455-rename-files-refa...