Revert r174026, "Remove Attribute::hasAttributes() and make Attribute::hasAttribute() private."

It broke many hosts to crash.