diff --git a/Duplicati/Library/Compression/FileArchiveZip.cs b/Duplicati/Library/Compression/FileArchiveZip.cs index 98c3fca30..cea03d22a 100644 --- a/Duplicati/Library/Compression/FileArchiveZip.cs +++ b/Duplicati/Library/Compression/FileArchiveZip.cs @@ -207,7 +207,7 @@ namespace Duplicati.Library.Compression public FileArchiveZip(string filename, Dictionary options) { if (string.IsNullOrEmpty(filename) && filename.Trim().Length == 0) - throw new ArgumentException("Invalid filename.", "filename"); + throw new ArgumentException("Invalid filename.", nameof(filename)); if (File.Exists(filename) && new FileInfo(filename).Length > 0) { diff --git a/Duplicati/Library/Encryption/AESEncryption.cs b/Duplicati/Library/Encryption/AESEncryption.cs index dc8b0c8c1..d342e35c1 100644 --- a/Duplicati/Library/Encryption/AESEncryption.cs +++ b/Duplicati/Library/Encryption/AESEncryption.cs @@ -71,7 +71,7 @@ namespace Duplicati.Library.Encryption public AESEncryption(string passphrase, Dictionary options) { if(string.IsNullOrEmpty(passphrase)) - throw new ArgumentException(Strings.AESEncryption.EmptyKeyError, "passphrase"); + throw new ArgumentException(Strings.AESEncryption.EmptyKeyError, nameof(passphrase)); m_key = passphrase; diff --git a/Duplicati/Library/Main/Database/LocalListDatabase.cs b/Duplicati/Library/Main/Database/LocalListDatabase.cs index ebc65e31c..07f723e3b 100644 --- a/Duplicati/Library/Main/Database/LocalListDatabase.cs +++ b/Duplicati/Library/Main/Database/LocalListDatabase.cs @@ -223,7 +223,7 @@ namespace Duplicati.Library.Main.Database if (filter == null || filter.Empty) pathprefix = ""; else if (filter as Library.Utility.FilterExpression == null || ((Library.Utility.FilterExpression)filter).Type != Duplicati.Library.Utility.FilterType.Simple || ((Library.Utility.FilterExpression)filter).GetSimpleList().Length != 1) - throw new ArgumentException("Filter for list-folder-contents must be a path prefix with no wildcards", "filter"); + throw new ArgumentException("Filter for list-folder-contents must be a path prefix with no wildcards", nameof(filter)); else pathprefix = ((Library.Utility.FilterExpression)filter).GetSimpleList().First(); diff --git a/Duplicati/Library/Main/Database/PathLookupHelper.cs b/Duplicati/Library/Main/Database/PathLookupHelper.cs index 58877ba2c..80cd71767 100644 --- a/Duplicati/Library/Main/Database/PathLookupHelper.cs +++ b/Duplicati/Library/Main/Database/PathLookupHelper.cs @@ -165,7 +165,7 @@ namespace Duplicati.Library.Main.Database public bool TryGetChild(string name, out FolderEntry v) { if (string.IsNullOrEmpty(name)) - throw new ArgumentException("Invalid pathname.", "name"); + throw new ArgumentException("Invalid pathname.", nameof(name)); if (m_folders == null) { diff --git a/Duplicati/Library/Snapshots/DefineDosDevice.cs b/Duplicati/Library/Snapshots/DefineDosDevice.cs index 36a60c937..adc45c668 100644 --- a/Duplicati/Library/Snapshots/DefineDosDevice.cs +++ b/Duplicati/Library/Snapshots/DefineDosDevice.cs @@ -114,7 +114,7 @@ namespace Duplicati.Library.Snapshots drive = drive.Substring(0, drive.Length - 1); if (!drive.EndsWith(":")) - throw new ArgumentException("The drive specification must end with a colon.", "drive"); + throw new ArgumentException("The drive specification must end with a colon.", nameof(drive)); Win32API.DDD_Flags flags = 0; if (!notifyShell) diff --git a/Duplicati/Library/Utility/BlockingQueue.cs b/Duplicati/Library/Utility/BlockingQueue.cs index 0b4aef276..813876066 100644 --- a/Duplicati/Library/Utility/BlockingQueue.cs +++ b/Duplicati/Library/Utility/BlockingQueue.cs @@ -157,7 +157,7 @@ namespace Duplicati.Library.Utility : this() { if (maxCapacity <= 0) - throw new ArgumentException("maxCapacity must be a positive number", "maxCapacity"); + throw new ArgumentException("maxCapacity must be a positive number", nameof(maxCapacity)); m_maxCapacity = maxCapacity; } diff --git a/Duplicati/Library/Utility/Uri.cs b/Duplicati/Library/Utility/Uri.cs index 1d4f856dd..5f39e5db1 100644 --- a/Duplicati/Library/Utility/Uri.cs +++ b/Duplicati/Library/Utility/Uri.cs @@ -158,7 +158,7 @@ namespace Duplicati.Library.Utility catch { } - throw new ArgumentException(Strings.Uri.UriParseError(url), "url"); + throw new ArgumentException(Strings.Uri.UriParseError(url), nameof(url)); } this.Scheme = m.Groups["scheme"].Value;