Program: 104620
Project: 104620
Buggy source:
@Override public <T>Page<T> moreLikeThis(MoreLikeThisQuery query,Class<T> clazz){
  int startRecord=0;
  ElasticsearchPersistentEntity persistentEntity=getPersistentEntityFor(clazz);
  String indexName=isNotBlank(query.getIndexName()) ? query.getIndexName() : persistentEntity.getIndexName();
  String type=isNotBlank(query.getType()) ? query.getType() : persistentEntity.getIndexType();
  Assert.notNull(indexName,"String_Node_Str");
  Assert.notNull(type,"String_Node_Str");
  Assert.notNull(query.getId(),"String_Node_Str");
  MoreLikeThisRequestBuilder requestBuilder=client.prepareMoreLikeThis(indexName,type,query.getId());
  if (query.getPageable() != null) {
    startRecord=((query.getPageable().getPageNumber() - 1) * query.getPageable().getPageSize());
    requestBuilder.setSearchSize(query.getPageable().getPageSize());
  }
  requestBuilder.setSearchFrom(startRecord < 0 ? 0 : startRecord);
  if (isNotEmpty(query.getSearchIndices())) {
    requestBuilder.setSearchIndices(toArray(query.getSearchIndices()));
  }
  if (isNotEmpty(query.getSearchTypes())) {
    requestBuilder.setSearchTypes(toArray(query.getSearchTypes()));
  }
  if (isNotEmpty(query.getFields())) {
    requestBuilder.setField(toArray(query.getFields()));
  }
  if (isNotBlank(query.getRouting())) {
    requestBuilder.setRouting(query.getRouting());
  }
  if (query.getPercentTermsToMatch() != null) {
    requestBuilder.setPercentTermsToMatch(query.getPercentTermsToMatch());
  }
  if (query.getMinTermFreq() != null) {
    requestBuilder.setMinTermFreq(query.getMinTermFreq());
  }
  if (query.getMaxQueryTerms() != null) {
    requestBuilder.maxQueryTerms(query.getMaxQueryTerms());
  }
  if (isNotEmpty(query.getStopWords())) {
    requestBuilder.setStopWords(toArray(query.getStopWords()));
  }
  if (query.getMinDocFreq() != null) {
    requestBuilder.setMinDocFreq(query.getMinDocFreq());
  }
  if (query.getMaxDocFreq() != null) {
    requestBuilder.setMaxDocFreq(query.getMaxDocFreq());
  }
  if (query.getMinWordLen() != null) {
    requestBuilder.setMinWordLen(query.getMinWordLen());
  }
  if (query.getMaxWordLen() != null) {
    requestBuilder.setMaxWordLen(query.getMaxWordLen());
  }
  if (query.getBoostTerms() != null) {
    requestBuilder.setBoostTerms(query.getBoostTerms());
  }
  SearchResponse response=requestBuilder.execute().actionGet();
  return mapResults(response,clazz,query.getPageable());
}

Fixed version (ground truth):
@Override public <T>Page<T> moreLikeThis(MoreLikeThisQuery query,Class<T> clazz){
  int startRecord=0;
  ElasticsearchPersistentEntity persistentEntity=getPersistentEntityFor(clazz);
  String indexName=isNotBlank(query.getIndexName()) ? query.getIndexName() : persistentEntity.getIndexName();
  String type=isNotBlank(query.getType()) ? query.getType() : persistentEntity.getIndexType();
  Assert.notNull(indexName,"String_Node_Str");
  Assert.notNull(type,"String_Node_Str");
  Assert.notNull(query.getId(),"String_Node_Str");
  MoreLikeThisRequestBuilder requestBuilder=client.prepareMoreLikeThis(indexName,type,query.getId());
  if (query.getPageable() != null) {
    startRecord=query.getPageable().getPageNumber() * query.getPageable().getPageSize();
    requestBuilder.setSearchSize(query.getPageable().getPageSize());
  }
  requestBuilder.setSearchFrom(startRecord);
  if (isNotEmpty(query.getSearchIndices())) {
    requestBuilder.setSearchIndices(toArray(query.getSearchIndices()));
  }
  if (isNotEmpty(query.getSearchTypes())) {
    requestBuilder.setSearchTypes(toArray(query.getSearchTypes()));
  }
  if (isNotEmpty(query.getFields())) {
    requestBuilder.setField(toArray(query.getFields()));
  }
  if (isNotBlank(query.getRouting())) {
    requestBuilder.setRouting(query.getRouting());
  }
  if (query.getPercentTermsToMatch() != null) {
    requestBuilder.setPercentTermsToMatch(query.getPercentTermsToMatch());
  }
  if (query.getMinTermFreq() != null) {
    requestBuilder.setMinTermFreq(query.getMinTermFreq());
  }
  if (query.getMaxQueryTerms() != null) {
    requestBuilder.maxQueryTerms(query.getMaxQueryTerms());
  }
  if (isNotEmpty(query.getStopWords())) {
    requestBuilder.setStopWords(toArray(query.getStopWords()));
  }
  if (query.getMinDocFreq() != null) {
    requestBuilder.setMinDocFreq(query.getMinDocFreq());
  }
  if (query.getMaxDocFreq() != null) {
    requestBuilder.setMaxDocFreq(query.getMaxDocFreq());
  }
  if (query.getMinWordLen() != null) {
    requestBuilder.setMinWordLen(query.getMinWordLen());
  }
  if (query.getMaxWordLen() != null) {
    requestBuilder.setMaxWordLen(query.getMaxWordLen());
  }
  if (query.getBoostTerms() != null) {
    requestBuilder.setBoostTerms(query.getBoostTerms());
  }
  SearchResponse response=requestBuilder.execute().actionGet();
  return mapResults(response,clazz,query.getPageable());
}