public void verifyChecksum() throws LogConsistencyException {
  try {
    if (!checkCrc()) {
      String fileName;
      if (file == null)       fileName="unknown";
 else       fileName=file.getName();
      String message="Log record CRC failure: file=" + fileName + " offset="+ getOffset()+ " crc type="+ getCrcType()+ " stored crc="+ crc+ " computed crc="+ computedCrc;
      throw new LogConsistencyException(message);
    }
  }
 catch (  IOException e) {
    String fileName;
    if (file == null)     fileName="unknown";
 else     fileName=file.getName();
    String message="CRC computation failure: file=" + fileName + " offset="+ getOffset()+ " crc type="+ getCrcType()+ " stored crc="+ getCrc();
    throw new LogConsistencyException(message,e);
  }
}

public void verifyChecksum ( ) throws LogConsistencyException { try { if ( ! checkCrc ( ) ) { String fileName ; if ( file == null ) fileName = "unknown" ; else fileName = file . getName ( ) ; String message = "Log record CRC failure: file=" + fileName + " offset=" + getOffset ( ) + " crc type=" + getCrcType ( ) + " stored crc=" + crc + " computed crc=" + computedCrc ; throw new LogConsistencyException ( message ) ; } } catch ( IOException e ) { String fileName ; if ( file == null ) fileName = "unknown" ; else fileName = file . getName ( ) ; String message = "CRC computation failure: file=" + fileName + " offset=" + getOffset ( ) + " crc type=" + getCrcType ( ) + " stored crc=" + getCrc ( ) ; throw new LogConsistencyException ( message , e ) ; } }
verifies the crc value . this generates an exception if the exception is bad .
