No need to call get_class twice
Merge pull request #4860 from zupolgec/4.2

No need to call get_class twice