Skip to content

Commit b4e2b85

Browse files
committed
Add script for finding classes with the same name
This script migrated from ImageJ: https://github.com/imagej/imagej/blob/2c503fa63e4ba77e68a2d8104201f6a886b4b0b3/bin/get-duplicate-class-names.sh
1 parent d256263 commit b4e2b85

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Diff for: duplicate-class-names.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
#
4+
# duplicate-class-names.sh
5+
#
6+
7+
# Script to print out classes in different packages with the same name.
8+
#
9+
# Such name clashes are to be avoided, since when more than one of them
10+
# is needed in the same source file, it becomes necessary to reference
11+
# all but one using fully qualified package prefixes.
12+
13+
names=$(git ls-files \*.java |
14+
sed -e 's|.*/||' -e 's|\.java$||' |
15+
sort |
16+
uniq -d)
17+
for name in $names
18+
do
19+
printf '\t%s\n' $name
20+
git ls-files \*/$name.java
21+
done

0 commit comments

Comments
 (0)