Rewrites generic type arguments such as Map<K, V> to Map<K,V> in Java source, in code and inside comments and Javadoc.
--check to see which files would change, for example in a review or a script.python3 scripts/normalize-generic-commas.py juneau-core python3 scripts/normalize-generic-commas.py path/to/File.java other/dir python3 scripts/normalize-generic-commas.py --check juneau-core
| Option | Argument | Default | Meaning |
|---|---|---|---|
--check | none | off | Dry run. Report the files that would change and write nothing. Must be the first argument. |
path | one or more (positional) | none | A .java file, or a directory walked recursively. target/ and .git/ are skipped. At least one is required. |
main)..java files under each path (find_java_files).transform_source). Strings, chars and text blocks are copied through untouched.<, walks forward tracking nesting depth, and accepts only characters that can appear in a type-argument list. The first other character abandons the match and the < is left alone.--check, and prints a summary.Changed: <path> (code=n, comment=m) per file, or WOULD CHANGE: with --check, then a summary of files scanned, files changed, and comma sites tightened in code and in comments.
| Code | Meaning |
|---|---|
| 0 | Done, or --check found nothing to change. |
| 1 | No path was given, or --check found files that would change. |
<...> span.List<@NonNull String>).?, so lists of comparison operators like <123, >=123 are not treated as generics._MAX_SPAN).--check it edits files directly. Review the diff afterwards.None.