Also do not rely on Java class comparison, check against qualified names. (cherry picked from commit 7610945)
7610945