private static boolean containsConflictingInnerClass(String fqName,PsiClass aClass){
  final String shortName=ClassUtil.extractClassName(fqName);
  if (shortName.equals(aClass.getName()) && !fqName.equals(aClass.getQualifiedName())) {
    return true;
  }
  final PsiClass[] classes=aClass.getInnerClasses();
  for (  PsiClass innerClass : classes) {
    if (containsConflictingInnerClass(fqName,innerClass)) {
      return true;
    }
  }
  return false;
}

private static boolean containsConflictingInnerClass ( String fqName , PsiClass aClass ) { final String shortName = ClassUtil . extractClassName ( fqName ) ; if ( shortName . equals ( aClass . getName ( ) ) && ! fqName . equals ( aClass . getQualifiedName ( ) ) ) { return true ; } final PsiClass [ ] classes = aClass . getInnerClasses ( ) ; for ( PsiClass innerClass : classes ) { if ( containsConflictingInnerClass ( fqName , innerClass ) ) { return true ; } } return false ; }
importutils currently checks all inner classes , even those that are contained in inner classes themselves , because it doesn ' t know the location of the original fully qualified reference . it should really only check if the containing class of the fully qualified reference has any conflicting inner classes .
