lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [lucenenet] NightOwl888 commented on a change in pull request #287: Implemenation of "System Properties" in .NET (addresses #254)
Date Wed, 13 May 2020 22:33:47 GMT

NightOwl888 commented on a change in pull request #287:

File path: src/Lucene.Net/Support/Util/SystemProperties.cs
@@ -163,7 +155,16 @@ private static T GetProperty<T>(string key, T defaultValue, Func<string,
T> conv
         /// <exception cref="SecurityException">The caller does not have the required
permission to perform this operation.</exception>
         public static void SetProperty(string key, string value)
-            Environment.SetEnvironmentVariable(key, value);
+            //Environment.SetEnvironmentVariable(key, value);
+            IConfiguration configuration = ConfigurationSettings.GetConfigurationFactory().CreateConfiguration();
+            try

Review comment:
       Please remove this unused try-finally block. If this was meant to be a try-catch, it
would be better to allow exceptions when users set the property to be thrown, so they can
see them at that point.
   We only swallow exceptions during read by default because they can cause the program to
inexplicably stop running when permissions are not set for the current user to read them during
static initialization.

This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:

View raw message