#! /bin/bash

tmpfile=/tmp/grep$$
for file in $*; do
    packageEx=$(echo $file | sed -e 's,^modules/javafx.*/src/main/java/,,' -e 's,/[^/]*.java$,,' -e 's,/,.,g')
    packageStatement=$(grep '^ *package' $file)
    packageObs=$(echo $packageStatement | sed -e 's,^ *package *,,' -e 's,;.*$,,')
    if [ "$packageEx" != "$packageObs" ]; then
        echo "*** $file : $packageStatement"
    fi
done
