Handle namespace collision warnings

This handles namespace conflicts warning when you use a class that conflicts with different class names the namespace hierarchy.

@ke-yu @aparajit-pratap 

Notice there is a ``if (className.Length > 1)`` checking before. It is hard to reason what's the condition of ``else`` here: ``className.Length == 0`` or ``className.Length > 1`` because there are two ``if`` with similar condition. Can we combine these two ``if`` together?