Attached a patch with what I am thinking to fix this issue.
Andrew Wang, Could you please take a look at this?
Now CrptoCodec#getInstance may return null in the case of no configuration. We can not throw exception as DFSClient may fail to initialize as we do initialization of codec in DFSClient's Ctor. TestDistributedFileSystem#testAllWithNoXmlDefaults is trying to verify the server basoc with no default xmls loaded. But if there an exception due to no configurations in xml, then dfsClient initialization itself will fail. So, it will mandate to configure that codec related configurations. So,To avoid this, now we simply return null if no configuration available with a log and has javadoc updated about the behaviour.