Remove validation of logger names This reverts commit 3c4de1c2337bbee0b44ef4e3dfded56aff6a2218 and relates to LOG4NET-580.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4net/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4net/commit/35e591d6 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4net/tree/35e591d6 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4net/diff/35e591d6 Branch: refs/heads/feature/cd-pipeline Commit: 35e591d6f8a6e6ab052253ebcd2f26fb9617b4dd Parents: af33f42 Author: Dominik Psenner <dpsen...@apache.org> Authored: Tue Oct 31 17:32:01 2017 +0100 Committer: Dominik Psenner <dpsen...@apache.org> Committed: Tue Oct 31 17:32:01 2017 +0100 ---------------------------------------------------------------------- src/Repository/Hierarchy/Hierarchy.cs | 42 ------------------------------ 1 file changed, 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/35e591d6/src/Repository/Hierarchy/Hierarchy.cs ---------------------------------------------------------------------- diff --git a/src/Repository/Hierarchy/Hierarchy.cs b/src/Repository/Hierarchy/Hierarchy.cs index 1843d96..7d71872 100644 --- a/src/Repository/Hierarchy/Hierarchy.cs +++ b/src/Repository/Hierarchy/Hierarchy.cs @@ -726,22 +726,11 @@ namespace log4net.Repository.Hierarchy { throw new ArgumentNullException("name"); } - if (factory == null) { throw new ArgumentNullException("factory"); } - if (name == string.Empty) - { - throw new ArgumentException("Invalid logger name: a logger name must not be empty.", "name"); - } - - if (name != name.Trim()) - { - throw new ArgumentException("Invalid logger name: a logger name must not be prefixed or suffixed by whitespaces.", "name"); - } - LoggerKey key = new LoggerKey(name); // Synchronize to prevent write conflicts. Read conflicts (in @@ -851,37 +840,6 @@ namespace log4net.Repository.Hierarchy int length = name.Length; bool parentFound = false; - if (name == null) - { - throw new ArgumentException("Invalid logger name: a logger name must not be null.", "log"); - } - - if (name == string.Empty) - { - throw new ArgumentException("Invalid logger name: a logger name must not be empty.", "log"); - } - - if (name != name.Trim()) - { - throw new ArgumentException("Invalid logger name: a logger name must not be prefixed or suffixed with whitespaces.", "log"); - } - - string[] nameParts = name.Split('.'); - for (int i = 0; i < nameParts.Length; i++) - { - string namePart = nameParts[i]; - - if (namePart == string.Empty) - { - throw new ArgumentException("Invalid logger name: a logger name must not contain a substring of two dots or more.", "log"); - } - - if (namePart != namePart.Trim()) - { - throw new ArgumentException("Invalid logger name: each part in a logger name when split by a dot must not be prefixed or suffixed with whitespaces.", "log"); - } - } - // if name = "w.x.y.z", loop through "w.x.y", "w.x" and "w", but not "w.x.y.z" for (int i = name.LastIndexOf('.', length - 1); i >= 0; i = name.LastIndexOf('.', i - 1)) {