Here is the reasoning for adding this check:

The code which creates this constant namespace + "metadata." and the code that assumes that this constant ends with a "." are in different places & anyone changing the constant will have no idea about this assumption. There can possibly be two solutions to this: have a test case to make sure this assumption is not broken OR don't make this assumption. I went for the latter, if you think the former is better than I don't have any issues but certainly making the assumption of the constant value did not seem correct to me.