lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [07/26] lucenenet git commit: BUG: Lucene.Net.QueryParser.Xml.DOMUtils: Fixed numeric conversions to use invariant culture
Date Wed, 08 Mar 2017 18:23:43 GMT
BUG: Lucene.Net.QueryParser.Xml.DOMUtils: Fixed numeric conversions to use invariant culture


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/f1c8b484
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/f1c8b484
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/f1c8b484

Branch: refs/heads/api-work
Commit: f1c8b48457a05f04bdb432816ce4870328cc3191
Parents: 7d22b2e
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Mar 8 01:22:04 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Mar 8 16:56:42 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.QueryParser/Xml/DOMUtils.cs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f1c8b484/src/Lucene.Net.QueryParser/Xml/DOMUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Xml/DOMUtils.cs b/src/Lucene.Net.QueryParser/Xml/DOMUtils.cs
index 3e3379e..72f99d8 100644
--- a/src/Lucene.Net.QueryParser/Xml/DOMUtils.cs
+++ b/src/Lucene.Net.QueryParser/Xml/DOMUtils.cs
@@ -1,4 +1,5 @@
 ´╗┐using System;
+using System.Globalization;
 using System.IO;
 using System.Text;
 using System.Xml;
@@ -151,20 +152,20 @@ namespace Lucene.Net.QueryParsers.Xml
         public static float GetAttribute(XmlElement element, string attributeName, float
deflt)
         {
             string result = element.GetAttribute(attributeName);
-            return (result == null) || ("".Equals(result)) ? deflt : Convert.ToSingle(result);
+            return (result == null) || ("".Equals(result)) ? deflt : Convert.ToSingle(result,
CultureInfo.InvariantCulture);
         }
 
         public static int GetAttribute(XmlElement element, string attributeName, int deflt)
         {
             string result = element.GetAttribute(attributeName);
-            return (result == null) || ("".Equals(result)) ? deflt : Convert.ToInt32(result);
+            return (result == null) || ("".Equals(result)) ? deflt : Convert.ToInt32(result,
CultureInfo.InvariantCulture);
         }
 
         public static bool GetAttribute(XmlElement element, string attributeName,
                                            bool deflt)
         {
             string result = element.GetAttribute(attributeName);
-            return (result == null) || ("".Equals(result)) ? deflt : Convert.ToBoolean(result);
+            return (result == null) || ("".Equals(result)) ? deflt : Convert.ToBoolean(result,
CultureInfo.InvariantCulture);
         }
 
         /* Returns text of node and all child nodes - without markup */


Mime
View raw message