TRUNK-4223: SonarQube - instanceof will always return true