protected void doAdditionalClassChecks( ClassDeclaration jpfClass )
{
// Make sure there are no other page flows in this package/directory.
checkForOverlappingClasses( jpfClass, JPF_BASE_CLASS, JPF_FILE_EXTENSION_DOT, "error.overlapping-pageflows" );
PackageDeclaration pkg = jpfClass.getPackage();
File jpfFile = CompilerUtils.getSourceFile( jpfClass, true );
File parentDir = jpfFile.getParentFile();
//
// Check the package name.
//
String jpfPackageName = pkg.getQualifiedName();
if ( jpfPackageName != null && jpfPackageName.length() > 0 )
{
String expectedPackage = parentDir.getAbsolutePath().replace( '\\', '/' ).replace( '/', '.' );
if ( ! expectedPackage.endsWith( jpfPackageName ) )
{
getDiagnostics().addError( jpfClass, "error.wrong-package-for-directory", parentDir.getPath() );
}
}
//
// Issue a warning if the class name is the same as the parent package name.
// This causes ambiguity when resolving inner classes.
//
if ( jpfClass.getSimpleName().equals( pkg.getQualifiedName() ) )
{
getDiagnostics().addWarning( jpfClass, "warning.classname-same-as-package" );
}
//