SONARJAVA-402 Better check of hierarchy cycle

Trigger the completion if type is not completed.
Improve error message.
extract in a separate method.