Fix Idea warning
Only return primitive if return type is not array