NightOwl888 opened a new issue #573:
URL: https://github.com/apache/lucenenet/issues/573
Due to the fact that .NET has no overload of `Convert.ToString(long, int)`
that accepts a radix of `Character.MaxRadix` (36), we have broken compatibility
with Java by not generating the same segment names. Here is a listing of all of
the lines in Lucene that use `Character.MAX_RADIX`. Of course, the ones we are
interested in are the `toString()` methods, but these should all be reviewed.
```
Search "MAX_RADIX" (10 hits in 10 files of 3216 searched)
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\java\org\apache\lucene\index\CheckIndex.java
(1 hit)
Line 502: int segmentName =
Integer.parseInt(info.info.name.substring(1), Character.MAX_RADIX);
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\java\org\apache\lucene\index\IndexFileNames.java
(1 hit)
Line 98: .append(base).append('_').append(Long.toString(gen,
Character.MAX_RADIX));
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\java\org\apache\lucene\index\IndexWriter.java
(1 hit)
Line 1676: return "_" + Integer.toString(segmentInfos.counter++,
Character.MAX_RADIX);
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\java\org\apache\lucene\index\ReadersAndUpdates.java
(1 hit)
Line 397: final String segmentSuffix =
Long.toString(nextFieldInfosGen, Character.MAX_RADIX);
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\java\org\apache\lucene\index\SegmentDocValues.java
(1 hit)
Line 46: segmentSuffix = Long.toString(gen.longValue(),
Character.MAX_RADIX);
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\java\org\apache\lucene\index\SegmentInfos.java
(1 hit)
Line 253: Character.MAX_RADIX);
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\java\org\apache\lucene\index\SegmentReader.java
(1 hit)
Line 221: final String segmentSuffix = info.getFieldInfosGen() ==
-1 ? "" : Long.toString(info.getFieldInfosGen(), Character.MAX_RADIX);
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\java\org\apache\lucene\util\ArrayUtil.java
(1 hit)
Line 87: || radix > Character.MAX_RADIX) {
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\test\org\apache\lucene\codecs\lucene3x\TestTermInfosReaderIndex.java
(1 hit)
Line 207: return
Long.toString(random().nextLong(),Character.MAX_RADIX);
F:\Projects\_Test\lucene-solr-4.8.1\lucene\core\src\test\org\apache\lucene\index\TestCodecs.java
(1 hit)
Line 290: final String text = Integer.toString(i,
Character.MAX_RADIX);
```
Updating these is a breaking change, so it would probably be a good idea to
put in a compatibility switch so the next release can read indexes that were
produced by previous beta versions.
J2N has an extension methods in the `J2N` namespace that accept a radix of
`J2N.Character.MaxRadix` for both `int` and `long` which we can use to fix this.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]