Skip to content

Instantly share code, notes, and snippets.

@olivergondza
Created June 7, 2015 16:28
Show Gist options
  • Save olivergondza/ba0d967c5f5616f6baf5 to your computer and use it in GitHub Desktop.
Save olivergondza/ba0d967c5f5616f6baf5 to your computer and use it in GitHub Desktop.
Detect non-static classes in java code
for f in `find $1 -iname *.java`; do
out=`grep "class\ " $f | grep -v -e "[[:space:]]*\*" -e "[[:space:]]//" | sed '1d' | grep -v -e static`
if [ $? == 0 ]; then
echo $f
echo $out | grep --color=auto class
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment