private void checkUserDefConflict(Bundle bundle, Bundle.DefEntry userDef, List<Bundle> bundlesAdded) {
        final String defName = userDef.defName;
        final String defNamespace = userDef.defNamespace;
        File[] builtinDefsWithSameName = defDir.listFiles((dir, name) ->    name.matches(defName + ".def")
                                                                         || name.matches(defNamespace + "." + defName + ".def"));
        if (builtinDefsWithSameName != null && builtinDefsWithSameName.length > 0) {
            String message = "a built-in config definition (" + getFilePathsCommaSeparated(builtinDefsWithSameName) + ")";
            for (Bundle b : bundlesAdded) {
                for (Bundle.DefEntry defEntry : b.getDefEntries()) {
                    if (defEntry.defName.equals(defName) && defEntry.defNamespace.equals(defNamespace)) {
                        message = "the same config definition in the bundle '" + b.getFile().getName() + "'";
                    }
                }
            }
            throw new IllegalArgumentException("The config definition with name '" + defNamespace + "." + defName +
                    "' contained in the bundle '" + bundle.getFile().getName() +
                    "' conflicts with " + message + ". Please choose a different name.");
        }
    }
A @{link ConfigDefinitionDir} contains a set of config definitions. New definitions may be added,
but they cannot conflict with the existing ones.

@author Ulf Lilleengen
config-application-package/src/main/java/com/yahoo/config/application/ConfigDefinitionDir.java