mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Fabio Pistolesi
17.36.2015 49a471eba37e2fc79c349792d4b6c840401311fb
OPENDJ-2233 CR-7906 Changelog cursoring seems to rely on exception handling too much.

Avoid try to reading past EOF, as it generates too many exceptions unnecessarily.
1 files modified
6 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogReader.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/BlockLogReader.java
@@ -295,8 +295,12 @@
  {
    try
    {
      // read length of record
      // read length of record if not already at EOF
      final long filePosition = reader.getFilePointer();
      if (reader.length() == filePosition)
      {
        return null;
      }
      int distanceToBlockStart = getDistanceToNextBlockStart(filePosition, blockSize);
      final int recordLength = readRecordLength(distanceToBlockStart);