lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [lucenenet] 39/42: BUG: Lucene.Net.Util.StringHelper - Use Time.CurrentTimeMilliseconds() instead of DateTime.Now.Millisecond. The latter is a mis-translation from Java which contains only numbers 0 to 999, the former returns a long based on Stopwatch.GetTimestamp() that has several orders of magnitude more possible values.
Date Wed, 07 Aug 2019 22:26:36 GMT
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit f0fb88fac6571f4c0a8fdf37803e6937d0f6c845
Author: Shad Storhaug <shad@shadstorhaug.com>
AuthorDate: Wed Aug 7 11:12:09 2019 +0700

    BUG: Lucene.Net.Util.StringHelper - Use Time.CurrentTimeMilliseconds() instead of DateTime.Now.Millisecond.
The latter is a mis-translation from Java which contains only numbers 0 to 999, the former
returns a long based on Stopwatch.GetTimestamp() that has several orders of magnitude more
possible values.
---
 src/Lucene.Net/Util/StringHelper.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Lucene.Net/Util/StringHelper.cs b/src/Lucene.Net/Util/StringHelper.cs
index 0dcbac2..459ee71 100644
--- a/src/Lucene.Net/Util/StringHelper.cs
+++ b/src/Lucene.Net/Util/StringHelper.cs
@@ -56,7 +56,7 @@ namespace Lucene.Net.Util
             }
             else
             {
-                return DateTime.Now.Millisecond;
+                return (int)Time.CurrentTimeMilliseconds();
             }
         }
 


Mime
View raw message