You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2016/10/11 18:34:50 UTC

[05/47] lucenenet git commit: Fixed bugs with Codecs.SimpleText.SimpleTextUtil checksum formatting.

Fixed bugs with Codecs.SimpleText.SimpleTextUtil checksum formatting.


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

Branch: refs/heads/master
Commit: 12a8118cae6e96b2a0b964cc0ad38b929d1c0524
Parents: 9a1fa37
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Oct 6 23:54:23 2016 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sat Oct 8 17:15:40 2016 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/12a8118c/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
index d9cca8f..ceea7ad 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
@@ -1,4 +1,6 @@
-\ufeff/*
+\ufeffusing System.Globalization;
+
+/*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -90,7 +92,7 @@ namespace Lucene.Net.Codecs.SimpleText
             // Pad with zeros so different checksum values use the
             // same number of bytes
             // (BaseIndexFileFormatTestCase.testMergeStability cares):
-            var checksum = string.Format("{0:D}", output.Checksum);
+            var checksum = string.Format(CultureInfo.InvariantCulture, "{0:D20}", output.Checksum);
             Write(output, CHECKSUM);
             Write(output, checksum, scratch);
             WriteNewline(output);
@@ -99,7 +101,7 @@ namespace Lucene.Net.Codecs.SimpleText
         public static void CheckFooter(ChecksumIndexInput input)
         {
             var scratch = new BytesRef();
-            var expectedChecksum = string.Format("{0:D}", input.Checksum);
+            var expectedChecksum = string.Format(CultureInfo.InvariantCulture, "{0:D20}", input.Checksum);
             ReadLine(input, scratch);
 
             if (StringHelper.StartsWith(scratch, CHECKSUM) == false)