#!/bin/sh

#
# duplicate-class-names.sh
#

# Script to print out classes in different packages with the same name.
#
# Such name clashes are to be avoided, since when more than one of them
# is needed in the same source file, it becomes necessary to reference
# all but one using fully qualified package prefixes.

names=$(git ls-files \*.java |
	sed -e 's|.*/||' -e 's|\.java$||' |
	sort |
	uniq -d)
for name in $names
do
	printf '\t%s\n' $name
	git ls-files \*/$name.java
done

Add script for finding classes with the same name
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
