public static CommitVersionInfo build(IndexCommit commit){
  long generation=commit.getGeneration();
  long version=0;
  try {
    final Map<String,String> commitData=commit.getUserData();
    String commitTime=commitData.get(SolrIndexWriter.COMMIT_TIME_MSEC_KEY);
    if (commitTime != null) {
      try {
        version=Long.parseLong(commitTime);
      }
 catch (      NumberFormatException e) {
        LOG.warn("Version in commitData was not formatted correctly: " + commitTime,e);
      }
    }
  }
 catch (  IOException e) {
    LOG.warn("Unable to get version from commitData, commit: " + commit,e);
  }
  return new CommitVersionInfo(generation,version);
}

public static CommitVersionInfo build ( IndexCommit commit ) { long generation = commit . getGeneration ( ) ; long version = 0 ; try { final Map < String , String > commitData = commit . getUserData ( ) ; String commitTime = commitData . get ( SolrIndexWriter . COMMIT_TIME_MSEC_KEY ) ; if ( commitTime != null ) { try { version = Long . parseLong ( commitTime ) ; } catch ( NumberFormatException e ) { LOG . warn ( "Version in commitData was not formatted correctly: " + commitTime , e ) ; } } } catch ( IOException e ) { LOG . warn ( "Unable to get version from commitData, commit: " + commit , e ) ; } return new CommitVersionInfo ( generation , version ) ; }
builds a commitversioninfo data for the specified indexcommit . will never be null , ut version and generation may be zero if there are problems extracting them from the commit data
