Projects >> elasticsearch >>eed557742f5db7cd82d22b69a84220cc598fd744

Chunk
Conflicting content
    private static Map addBuildIns(Map suggesters) {
        final Map map = new HashMap<>();
<<<<<<< HEAD
        map.put("phrase", new PhraseSuggester(scriptService));
        map.put("term", new TermSuggester());
        map.put("completion", new CompletionSuggester());
=======
        map.put("phrase", PhraseSuggester.PROTOTYPE);
        map.put("term", TermSuggester.PROTOTYPE);
        map.put("completion", CompletionSuggester.PROTOTYPE);
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        map.putAll(suggesters);
        return map;
    }
Solution content
    private static Map addBuildIns(Map suggesters) {
        final Map map = new HashMap<>();
        map.put("phrase", PhraseSuggester.PROTOTYPE);
        map.put("term", TermSuggester.PROTOTYPE);
        map.put("completion", CompletionSuggester.PROTOTYPE);
        map.putAll(suggesters);
        return map;
    }
File
Suggesters.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
package org.elasticsearch.search.suggest;

<<<<<<< HEAD
import org.apache.lucene.util.BytesRef;
=======
import org.apache.lucene.analysis.Analyzer;
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
import org.elasticsearch.action.support.ToXContentToBytes;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.ParseField;
Solution content
package org.elasticsearch.search.suggest;

import org.apache.lucene.analysis.Analyzer;
import org.elasticsearch.action.support.ToXContentToBytes;
import org.elasticsearch.common.ParseField;
File
SuggestionBuilder.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
    protected abstract SuggestionBuilder innerFromXContent(QueryParseContext parseContext, String name) throws IOException;

<<<<<<< HEAD
    public SuggestionContext build(QueryShardContext context, @Nullable String globalText) throws IOException {
        SuggestionContext suggestionContext = innerBuild(context);
        // copy over common settings to each suggestion builder
        SuggestUtils.suggestionToSuggestionContext(this, context.getMapperService(), suggestionContext);
        SuggestUtils.verifySuggestion(context.getMapperService(), new BytesRef(globalText), suggestionContext);
        suggestionContext.setShardContext(context);
        // TODO make field mandatory in the builder, then remove this
        if (suggestionContext.getField() == null) {
            throw new IllegalArgumentException("The required field option is missing");
        }
        return suggestionContext;
    }

    protected abstract SuggestionContext innerBuild(QueryShardContext context) throws IOException;

    public String getSuggesterName() {
=======
    protected abstract SuggestionContext build(QueryShardContext context) throws IOException;

    /**
     * Transfers the text, prefix, regex, analyzer, fieldname, size and shard size settings from the
     * original {@link SuggestionBuilder} to the target {@link SuggestionContext}
     */
    protected void populateCommonFields(MapperService mapperService,
            SuggestionSearchContext.SuggestionContext suggestionContext) throws IOException {

        if (analyzer != null) {
            Analyzer luceneAnalyzer = mapperService.analysisService().analyzer(analyzer);
            if (luceneAnalyzer == null) {
                throw new IllegalArgumentException("Analyzer [" + luceneAnalyzer + "] doesn't exists");
            }
            suggestionContext.setAnalyzer(luceneAnalyzer);
        }

        if (fieldname != null) {
            suggestionContext.setField(fieldname);
        }

        if (size != null) {
            suggestionContext.setSize(size);
        }

        if (shardSize != null) {
            suggestionContext.setShardSize(shardSize);
        } else {
            // if no shard size is set in builder, use size (or at least 5)
            suggestionContext.setShardSize(Math.max(suggestionContext.getSize(), 5));
        }

        if (text != null) {
            suggestionContext.setText(BytesRefs.toBytesRef(text));
        }
        if (prefix != null) {

            suggestionContext.setPrefix(BytesRefs.toBytesRef(prefix));
        }
        if (regex != null) {
            suggestionContext.setRegex(BytesRefs.toBytesRef(regex));
        }
        if (text != null && prefix == null) {
            suggestionContext.setPrefix(BytesRefs.toBytesRef(text));
        } else if (text == null && prefix != null) {
            suggestionContext.setText(BytesRefs.toBytesRef(prefix));
        } else if (text == null && regex != null) {
            suggestionContext.setText(BytesRefs.toBytesRef(regex));
        }
    }
    private String getSuggesterName() {
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        //default impl returns the same as writeable name, but we keep the distinction between the two just to make sure
        return getWriteableName();
    }
Solution content
    protected abstract SuggestionBuilder innerFromXContent(QueryParseContext parseContext, String name) throws IOException;

    public SuggestionContext build(QueryShardContext context) throws IOException {
        SuggestionContext suggestionContext = innerBuild(context);
        // TODO make field mandatory in the builder, then remove this
        if (suggestionContext.getField() == null) {
            throw new IllegalArgumentException("The required field option is missing");
        }
        return suggestionContext;
    }

    protected abstract SuggestionContext innerBuild(QueryShardContext context) throws IOException;

    /**
     * Transfers the text, prefix, regex, analyzer, fieldname, size and shard size settings from the
     * original {@link SuggestionBuilder} to the target {@link SuggestionContext}
     */
    protected void populateCommonFields(MapperService mapperService,
            SuggestionSearchContext.SuggestionContext suggestionContext) throws IOException {

        Objects.requireNonNull(fieldname, "fieldname must not be null");

        MappedFieldType fieldType = mapperService.fullName(fieldname);
        if (fieldType == null) {
            throw new IllegalArgumentException("no mapping found for field [" + fieldname + "]");
        } else if (analyzer == null) {
            // no analyzer name passed in, so try the field's analyzer, or the default analyzer
            if (fieldType.searchAnalyzer() == null) {
                suggestionContext.setAnalyzer(mapperService.searchAnalyzer());
            } else {
                suggestionContext.setAnalyzer(fieldType.searchAnalyzer());
            }
        } else {
            Analyzer luceneAnalyzer = mapperService.analysisService().analyzer(analyzer);
            if (luceneAnalyzer == null) {
                throw new IllegalArgumentException("analyzer [" + analyzer + "] doesn't exists");
            }
            suggestionContext.setAnalyzer(luceneAnalyzer);
        }

        suggestionContext.setField(fieldname);

        if (size != null) {
            suggestionContext.setSize(size);
        }

        if (shardSize != null) {
            suggestionContext.setShardSize(shardSize);
        } else {
            // if no shard size is set in builder, use size (or at least 5)
            suggestionContext.setShardSize(Math.max(suggestionContext.getSize(), 5));
        }

        if (text != null) {
            suggestionContext.setText(BytesRefs.toBytesRef(text));
        }
        if (prefix != null) {
            suggestionContext.setPrefix(BytesRefs.toBytesRef(prefix));
        }
        if (regex != null) {
            suggestionContext.setRegex(BytesRefs.toBytesRef(regex));
        }
        if (text != null && prefix == null) {
            suggestionContext.setPrefix(BytesRefs.toBytesRef(text));
        } else if (text == null && prefix != null) {
            suggestionContext.setText(BytesRefs.toBytesRef(prefix));
        } else if (text == null && regex != null) {
            suggestionContext.setText(BytesRefs.toBytesRef(regex));
        }
    }

    private String getSuggesterName() {
        //default impl returns the same as writeable name, but we keep the distinction between the two just to make sure
        return getWriteableName();
    }
File
SuggestionBuilder.java
Developer's decision
Manual
Kind of conflict
Comment
Method declaration
Method interface
Method signature
Chunk
Conflicting content
        return suggestions;
    }

<<<<<<< HEAD
    public static class SuggestionContext {
=======
    public abstract static class SuggestionContext {
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929

        private BytesRef text;
        private BytesRef prefix;
Solution content
        return suggestions;
    }

    public abstract static class SuggestionContext {

        private BytesRef text;
        private BytesRef prefix;
File
SuggestionSearchContext.java
Developer's decision
Version 2
Kind of conflict
Class signature
Chunk
Conflicting content
        private int size = 5;
        private int shardSize = -1;
        private QueryShardContext shardContext;
<<<<<<< HEAD
=======
        private Suggester suggester;

        protected SuggestionContext(Suggester suggester, QueryShardContext shardContext) {
            this.suggester = suggester;
            this.shardContext = shardContext;
        }
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929

        public BytesRef getText() {
            return text;
Solution content
        private int size = 5;
        private int shardSize = -1;
        private QueryShardContext shardContext;
        private Suggester suggester;

        protected SuggestionContext(Suggester suggester, QueryShardContext shardContext) {
            this.suggester = suggester;
            this.shardContext = shardContext;
        }

        public BytesRef getText() {
            return text;
File
SuggestionSearchContext.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method declaration
Chunk
Conflicting content
            this.shardSize = shardSize;
        }

<<<<<<< HEAD
        public void setShardContext(QueryShardContext context) {
            this.shardContext = context;
        }

        public QueryShardContext getShardContext() {
            return this.shardContext;
        }

        @Override
        public String toString() {
            return "[" +
                       "text=" + text +
                       ",field=" + field +
                       ",prefix=" + prefix +
                       ",regex=" + regex +
                       ",size=" + size +
                       ",shardSize=" + shardSize +
                       ",suggester=" + suggester +
                       ",analyzer=" + analyzer +
                       ",shardContext=" + shardContext +
                   "]";
=======
        public QueryShardContext getShardContext() {
            return this.shardContext;
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        }
    }
Solution content
                       ",analyzer=" + analyzer +
            this.shardSize = shardSize;
        }

        public QueryShardContext getShardContext() {
            return this.shardContext;
        }

        @Override
        public String toString() {
            return "[" +
                       "text=" + text +
                       ",field=" + field +
                       ",prefix=" + prefix +
                       ",regex=" + regex +
                       ",size=" + size +
                       ",shardSize=" + shardSize +
                       ",suggester=" + suggester +
                       ",shardContext=" + shardContext +
                   "]";
        }
    }
File
SuggestionSearchContext.java
Developer's decision
Combination
Kind of conflict
Annotation
Attribute
Method declaration
Method signature
Return statement
Chunk
Conflicting content
    @Override
    public SuggestionSearchContext.SuggestionContext parse(XContentParser parser,  QueryShardContext shardContext) throws IOException {
        MapperService mapperService = shardContext.getMapperService();
<<<<<<< HEAD
        final CompletionSuggestionContext suggestion = new CompletionSuggestionContext(completionSuggester, mapperService);
=======
        final CompletionSuggestionContext suggestion = new CompletionSuggestionContext(shardContext);
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        final ContextAndSuggest contextAndSuggest = new ContextAndSuggest(mapperService);
        TLP_PARSER.parse(parser, suggestion, contextAndSuggest);
        final XContentParser contextParser = contextAndSuggest.contextParser;
Solution content
    @Override
    public SuggestionSearchContext.SuggestionContext parse(XContentParser parser,  QueryShardContext shardContext) throws IOException {
        MapperService mapperService = shardContext.getMapperService();
        final CompletionSuggestionContext suggestion = new CompletionSuggestionContext(shardContext);
        final ContextAndSuggest contextAndSuggest = new ContextAndSuggest(mapperService);
        TLP_PARSER.parse(parser, suggestion, contextAndSuggest);
        final XContentParser contextParser = contextAndSuggest.contextParser;
File
CompletionSuggestParser.java
Developer's decision
Version 2
Kind of conflict
Other
Chunk
Conflicting content
public class CompletionSuggester extends Suggester {

<<<<<<< HEAD
    static final CompletionSuggester PROTOTYPE = new CompletionSuggester();
=======
    public static final CompletionSuggester PROTOTYPE = new CompletionSuggester();
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929

    @Override
    public SuggestContextParser getContextParser() {
Solution content
public class CompletionSuggester extends Suggester {

    public static final CompletionSuggester PROTOTYPE = new CompletionSuggester();

    @Override
    public SuggestContextParser getContextParser() {
File
CompletionSuggester.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
    }

    @Override
<<<<<<< HEAD
    protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
=======
    protected SuggestionContext build(QueryShardContext context) throws IOException {
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        // NORELEASE
        throw new UnsupportedOperationException();
    }
Solution content
    }

    @Override
    protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
        CompletionSuggestionContext suggestionContext = new CompletionSuggestionContext(context);
        // copy over common settings to each suggestion builder
        populateCommonFields(context.getMapperService(), suggestionContext);
        // NORELEASE
        // still need to populate CompletionSuggestionContext's specific settings
        return suggestionContext;
    }
File
CompletionSuggestionBuilder.java
Developer's decision
Manual
Kind of conflict
Method signature
Chunk
Conflicting content
import org.apache.lucene.search.suggest.document.CompletionQuery;
import org.elasticsearch.common.unit.Fuzziness;
<<<<<<< HEAD
import org.elasticsearch.index.mapper.MapperService;
=======
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
import org.elasticsearch.index.mapper.core.CompletionFieldMapper;
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.search.suggest.SuggestionSearchContext;
Solution content
import org.apache.lucene.search.suggest.document.CompletionQuery;
import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.index.mapper.core.CompletionFieldMapper;
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.search.suggest.SuggestionSearchContext;
File
CompletionSuggestionContext.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
    private CompletionSuggestionBuilder.FuzzyOptionsBuilder fuzzyOptionsBuilder;
    private CompletionSuggestionBuilder.RegexOptionsBuilder regexOptionsBuilder;
    private Map> queryContexts = Collections.emptyMap();
<<<<<<< HEAD
    private final MapperService mapperService;
    private Set payloadFields = Collections.emptySet();

    CompletionSuggestionContext(Suggester suggester, MapperService mapperService) {
        super(suggester);
        this.mapperService = mapperService;
    }

=======
    private Set payloadFields = Collections.emptySet();

>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
    CompletionFieldMapper.CompletionFieldType getFieldType() {
        return this.fieldType;
    }
Solution content
    private CompletionSuggestionBuilder.FuzzyOptionsBuilder fuzzyOptionsBuilder;
    private CompletionSuggestionBuilder.RegexOptionsBuilder regexOptionsBuilder;
    private Map> queryContexts = Collections.emptyMap();
    private Set payloadFields = Collections.emptySet();

    CompletionFieldMapper.CompletionFieldType getFieldType() {
        return this.fieldType;
    }
File
CompletionSuggestionContext.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method declaration
Method invocation
Chunk
Conflicting content
        this.queryContexts = queryContexts;
    }

<<<<<<< HEAD

    MapperService getMapperService() {
        return mapperService;
    }

=======
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
    void setPayloadFields(Set fields) {
        this.payloadFields = fields;
    }
Solution content
        this.queryContexts = queryContexts;
    }

    void setPayloadFields(Set fields) {
        this.payloadFields = fields;
    }
File
CompletionSuggestionContext.java
Developer's decision
Version 2
Kind of conflict
Method declaration
Chunk
Conflicting content
    @Override
    public SuggestionSearchContext.SuggestionContext parse(XContentParser parser, QueryShardContext shardContext) throws IOException {
        MapperService mapperService = shardContext.getMapperService();
<<<<<<< HEAD
        PhraseSuggestionContext suggestion = new PhraseSuggestionContext(suggester);
=======
        ScriptService scriptService = shardContext.getScriptService();
        PhraseSuggestionContext suggestion = new PhraseSuggestionContext(shardContext);
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        ParseFieldMatcher parseFieldMatcher = mapperService.getIndexSettings().getParseFieldMatcher();
        XContentParser.Token token;
        String fieldName = null;
Solution content
    @Override
    public SuggestionSearchContext.SuggestionContext parse(XContentParser parser, QueryShardContext shardContext) throws IOException {
        MapperService mapperService = shardContext.getMapperService();
        ScriptService scriptService = shardContext.getScriptService();
        PhraseSuggestionContext suggestion = new PhraseSuggestionContext(shardContext);
        ParseFieldMatcher parseFieldMatcher = mapperService.getIndexSettings().getParseFieldMatcher();
        XContentParser.Token token;
        String fieldName = null;
File
PhraseSuggestParser.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
public final class PhraseSuggester extends Suggester {
    private final BytesRef SEPARATOR = new BytesRef(" ");
    private static final String SUGGESTION_TEMPLATE_VAR_NAME = "suggestion";
<<<<<<< HEAD
    private final ScriptService scriptService;

    static PhraseSuggester PROTOTYPE;

    public PhraseSuggester(ScriptService scriptService) {
        this.scriptService = scriptService;
        PROTOTYPE = this;
    }
=======

    public static final PhraseSuggester PROTOTYPE = new PhraseSuggester();
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929

    /*
     * More Ideas:
Solution content
public final class PhraseSuggester extends Suggester {
    private final BytesRef SEPARATOR = new BytesRef(" ");
    private static final String SUGGESTION_TEMPLATE_VAR_NAME = "suggestion";

    public static final PhraseSuggester PROTOTYPE = new PhraseSuggester();

    /*
     * More Ideas:
File
PhraseSuggester.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method declaration
Method invocation
Chunk
Conflicting content
import org.elasticsearch.search.suggest.SuggestionBuilder;
import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext;
import org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator;
<<<<<<< HEAD
import org.elasticsearch.search.suggest.phrase.WordScorer.WordScorerFactory;
=======
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929

import java.io.IOException;
import java.util.ArrayList;
Solution content
import org.elasticsearch.search.suggest.SuggestionBuilder;
import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext;
import org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator;

import java.io.IOException;
import java.util.ArrayList;
File
PhraseSuggestionBuilder.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content

    @Override
<<<<<<< HEAD
    public SuggestionContext innerBuild(QueryShardContext context) throws IOException {
        PhraseSuggestionContext suggestionContext = new PhraseSuggestionContext(PhraseSuggester.PROTOTYPE);
        MapperService mapperService = context.getMapperService();
        suggestionContext.setShardContext(context);
=======
    public SuggestionContext build(QueryShardContext context) throws IOException {
        PhraseSuggestionContext suggestionContext = new PhraseSuggestionContext(context);
        MapperService mapperService = context.getMapperService();
        populateCommonFields(mapperService, suggestionContext);
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929

        suggestionContext.setSeparator(BytesRefs.toBytesRef(this.separator));
        suggestionContext.setRealWordErrorLikelihood(this.realWordErrorLikelihood);
Solution content

    @Override
    public SuggestionContext innerBuild(QueryShardContext context) throws IOException {
        PhraseSuggestionContext suggestionContext = new PhraseSuggestionContext(context);
        MapperService mapperService = context.getMapperService();
        // copy over common settings to each suggestion builder
        populateCommonFields(mapperService, suggestionContext);

        suggestionContext.setSeparator(BytesRefs.toBytesRef(this.separator));
        suggestionContext.setRealWordErrorLikelihood(this.realWordErrorLikelihood);
File
PhraseSuggestionBuilder.java
Developer's decision
Manual
Kind of conflict
Method invocation
Method signature
Variable
Chunk
Conflicting content
            suggestionContext.setCollatePrune(this.collatePrune);
        }

<<<<<<< HEAD
=======
        // TODO remove this when field is mandatory in builder ctor
        if (suggestionContext.getField() == null) {
            throw new IllegalArgumentException("The required field option is missing");
        }

>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        MappedFieldType fieldType = mapperService.fullName(suggestionContext.getField());
        if (fieldType == null) {
            throw new IllegalArgumentException("No mapping found for field [" + suggestionContext.getField() + "]");
Solution content
        builder.maxErrors = in.readFloat();
            suggestionContext.setCollatePrune(this.collatePrune);
        }

        if (suggestionContext.model() == null) {
            suggestionContext.setModel(StupidBackoffScorer.FACTORY);
        }

        if (this.gramSize == null || suggestionContext.generators().isEmpty()) {
            final ShingleTokenFilterFactory.Factory shingleFilterFactory = SuggestUtils
                    .getShingleFilterFactory(suggestionContext.getAnalyzer());
            if (this.gramSize == null) {
                // try to detect the shingle size
                if (shingleFilterFactory != null) {
                    suggestionContext.setGramSize(shingleFilterFactory.getMaxShingleSize());
                    if (suggestionContext.getAnalyzer() == null && shingleFilterFactory.getMinShingleSize() > 1
                            && !shingleFilterFactory.getOutputUnigrams()) {
                        throw new IllegalArgumentException("The default analyzer for field: [" + suggestionContext.getField()
                                + "] doesn't emit unigrams. If this is intentional try to set the analyzer explicitly");
                    }
                }
            }
            if (suggestionContext.generators().isEmpty()) {
                if (shingleFilterFactory != null && shingleFilterFactory.getMinShingleSize() > 1
                        && !shingleFilterFactory.getOutputUnigrams() && suggestionContext.getRequireUnigram()) {
                    throw new IllegalArgumentException("The default candidate generator for phrase suggest can't operate on field: ["
                            + suggestionContext.getField() + "] since it doesn't emit unigrams. "
                            + "If this is intentional try to set the candidate generator field explicitly");
                }
                // use a default generator on the same field
                DirectCandidateGenerator generator = new DirectCandidateGenerator();
                generator.setField(suggestionContext.getField());
                suggestionContext.addGenerator(generator);
            }
        }
        return suggestionContext;
    }

    private static void ensureNoSmoothing(PhraseSuggestionBuilder suggestion) {
        if (suggestion.smoothingModel() != null) {
            throw new IllegalArgumentException("only one smoothing model supported");
        }
    }

    @Override
    public String getWriteableName() {
        return SUGGESTION_NAME;
    }

    @Override
    public void doWriteTo(StreamOutput out) throws IOException {
        out.writeFloat(maxErrors);
        out.writeFloat(realWordErrorLikelihood);
        out.writeFloat(confidence);
        out.writeOptionalVInt(gramSize);
        boolean hasModel = model != null;
        out.writeBoolean(hasModel);
        if (hasModel) {
            out.writePhraseSuggestionSmoothingModel(model);
        }
        out.writeBoolean(forceUnigrams);
        out.writeVInt(tokenLimit);
        out.writeOptionalString(preTag);
        out.writeOptionalString(postTag);
        out.writeString(separator);
        if (collateQuery != null) {
            out.writeBoolean(true);
            collateQuery.writeTo(out);
        } else {
            out.writeBoolean(false);
        }
        out.writeMap(collateParams);
        out.writeOptionalBoolean(collatePrune);
        out.writeVInt(this.generators.size());
        for (Entry> entry : this.generators.entrySet()) {
            out.writeString(entry.getKey());
            List generatorsList = entry.getValue();
            out.writeVInt(generatorsList.size());
            for (CandidateGenerator generator : generatorsList) {
                generator.writeTo(out);
            }
        }
    }

    @Override
    public PhraseSuggestionBuilder doReadFrom(StreamInput in, String name) throws IOException {
        PhraseSuggestionBuilder builder = new PhraseSuggestionBuilder(name);
        builder.realWordErrorLikelihood = in.readFloat();
        builder.confidence = in.readFloat();
        builder.gramSize = in.readOptionalVInt();
        if (in.readBoolean()) {
            builder.model = in.readPhraseSuggestionSmoothingModel();
        }
        builder.forceUnigrams = in.readBoolean();
        builder.tokenLimit = in.readVInt();
        builder.preTag = in.readOptionalString();
        builder.postTag = in.readOptionalString();
        builder.separator = in.readString();
        if (in.readBoolean()) {
            builder.collateQuery = Template.readTemplate(in);
        }
        builder.collateParams = in.readMap();
        builder.collatePrune = in.readOptionalBoolean();
        int generatorsEntries = in.readVInt();
        for (int i = 0; i < generatorsEntries; i++) {
            String type = in.readString();
            int numberOfGenerators = in.readVInt();
            List generatorsList = new ArrayList<>(numberOfGenerators);
            for (int g = 0; g < numberOfGenerators; g++) {
                DirectCandidateGeneratorBuilder generator = DirectCandidateGeneratorBuilder.PROTOTYPE.readFrom(in);
                generatorsList.add(generator);
            }
            builder.generators.put(type, generatorsList);
        }
        return builder;
    }

    @Override
    protected boolean doEquals(PhraseSuggestionBuilder other) {
        return Objects.equals(maxErrors, other.maxErrors) &&
                Objects.equals(separator, other.separator) &&
                Objects.equals(realWordErrorLikelihood, other.realWordErrorLikelihood) &&
                Objects.equals(confidence, other.confidence) &&
                Objects.equals(generators, other.generators) &&
                Objects.equals(gramSize, other.gramSize) &&
                Objects.equals(model, other.model) &&
                Objects.equals(forceUnigrams, other.forceUnigrams) &&
                Objects.equals(tokenLimit, other.tokenLimit) &&
                Objects.equals(preTag, other.preTag) &&
                Objects.equals(postTag, other.postTag) &&
                Objects.equals(collateQuery, other.collateQuery) &&
                Objects.equals(collateParams, other.collateParams) &&
                Objects.equals(collatePrune, other.collatePrune);
    }

    @Override
    protected int doHashCode() {
        return Objects.hash(maxErrors, separator, realWordErrorLikelihood, confidence,
                generators, gramSize, model, forceUnigrams, tokenLimit, preTag, postTag,
                collateQuery, collateParams, collatePrune);
    }

    /**
     * {@link CandidateGenerator} interface.
     */
    public interface CandidateGenerator extends Writeable, ToXContent {
        String getType();

        CandidateGenerator fromXContent(QueryParseContext parseContext) throws IOException;

        PhraseSuggestionContext.DirectCandidateGenerator build(MapperService mapperService) throws IOException;
    }
}
File
PhraseSuggestionBuilder.java
Developer's decision
Manual
Kind of conflict
Comment
If statement
Chunk
Conflicting content
public final class TermSuggester extends Suggester {

<<<<<<< HEAD
    static final TermSuggester PROTOTYPE = new TermSuggester();
=======
    public static final TermSuggester PROTOTYPE = new TermSuggester();
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929

    @Override
    public TermSuggestion innerExecute(String name, TermSuggestionContext suggestion, IndexSearcher searcher, CharsRefBuilder spare)
Solution content
public final class TermSuggester extends Suggester {

    public static final TermSuggester PROTOTYPE = new TermSuggester();

    @Override
    public TermSuggestion innerExecute(String name, TermSuggestionContext suggestion, IndexSearcher searcher, CharsRefBuilder spare)
File
TermSuggester.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.query.QueryParseContext;
import org.elasticsearch.index.query.QueryShardContext;
<<<<<<< HEAD
import org.elasticsearch.search.suggest.DirectSpellcheckerSettings;
import org.elasticsearch.search.suggest.SuggestUtils;
=======
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
import org.elasticsearch.search.suggest.SuggestionBuilder;
import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext;
Solution content
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.query.QueryParseContext;
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.search.suggest.DirectSpellcheckerSettings;
import org.elasticsearch.search.suggest.SortBy;
import org.elasticsearch.search.suggest.SuggestionBuilder;
import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext;
File
TermSuggestionBuilder.java
Developer's decision
Manual
Kind of conflict
Import
Chunk
Conflicting content
    }

    @Override
<<<<<<< HEAD
    protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
        TermSuggestionContext suggestionContext = new TermSuggestionContext(TermSuggester.PROTOTYPE);
        return fillSuggestionContext(suggestionContext);
=======
    protected SuggestionContext build(QueryShardContext context) throws IOException {
        // NORELEASE
        throw new UnsupportedOperationException();
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
    }

    @Override
Solution content
    }

    @Override
    protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
        TermSuggestionContext suggestionContext = new TermSuggestionContext(context);
        // copy over common settings to each suggestion builder
        populateCommonFields(context.getMapperService(), suggestionContext);
        // Transfers the builder settings to the target TermSuggestionContext
        DirectSpellcheckerSettings settings = suggestionContext.getDirectSpellCheckerSettings();
        settings.accuracy(accuracy);
        settings.maxEdits(maxEdits);
        settings.maxInspections(maxInspections);
        settings.maxTermFreq(maxTermFreq);
        settings.minDocFreq(minDocFreq);
        settings.minWordLength(minWordLength);
        settings.prefixLength(prefixLength);
        settings.sort(sort);
        settings.stringDistance(stringDistance.toLucene());
        settings.suggestMode(suggestMode.toLucene());
        return suggestionContext;
    }

    @Override
File
TermSuggestionBuilder.java
Developer's decision
Manual
Kind of conflict
Comment
Method invocation
Method signature
Return statement
Throw statement
Variable
Chunk
Conflicting content
    public DirectSpellcheckerSettings getDirectSpellCheckerSettings() {
        return settings;
    }
<<<<<<< HEAD

    @Override
    public String toString() {
        return "SpellcheckerSettings" + settings + ", BaseSettings" + super.toString();
    }

}
=======
}
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
Solution content
    public DirectSpellcheckerSettings getDirectSpellCheckerSettings() {
        return settings;
    }

    @Override
    public String toString() {
        return "SpellcheckerSettings" + settings + ", BaseSettings" + super.toString();
    }

}
File
TermSuggestionContext.java
Developer's decision
Version 1
Kind of conflict
Annotation
Method declaration
Chunk
Conflicting content
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
<<<<<<< HEAD
import java.util.Map;
=======
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
import java.util.function.Consumer;
import java.util.function.Supplier;
Solution content
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.function.Consumer;
import java.util.function.Supplier;
File
AbstractSuggestionBuilderTestCase.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
                return new CompiledScript(ScriptType.INLINE, "mockName", "mocklang", script);
            }
        };
<<<<<<< HEAD
        suggesters = new Suggesters(Collections.emptyMap(), scriptService, null);
=======
        suggesters = new Suggesters(Collections.emptyMap());
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        parseElement = new SuggestParseElement(suggesters);

        namedWriteableRegistry = new NamedWriteableRegistry();
Solution content
                return new CompiledScript(ScriptType.INLINE, "mockName", "mocklang", script);
            }
        };
        suggesters = new Suggesters(Collections.emptyMap());
        parseElement = new SuggestParseElement(suggesters);

        namedWriteableRegistry = new NamedWriteableRegistry();
File
AbstractSuggestionBuilderTestCase.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
        for (int runs = 0; runs < NUMBER_OF_TESTBUILDERS; runs++) {
            SuggestBuilder suggestBuilder = new SuggestBuilder();
<<<<<<< HEAD
            suggestBuilder.setText(randomAsciiOfLength(10));
=======
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
            SB suggestionBuilder = randomTestBuilder();
            suggestBuilder.addSuggestion(suggestionBuilder);
Solution content
        for (int runs = 0; runs < NUMBER_OF_TESTBUILDERS; runs++) {
            SuggestBuilder suggestBuilder = new SuggestBuilder();
            SB suggestionBuilder = randomTestBuilder();
            suggestBuilder.addSuggestion(suggestionBuilder);
File
AbstractSuggestionBuilderTestCase.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
            if (suggestionBuilder.text() == null) {
                // we either need suggestion text or global text
<<<<<<< HEAD
                suggestBuilder.setText("This is some global Text");
=======
                suggestBuilder.setText(randomAsciiOfLengthBetween(5, 50));
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
            }
            if (suggestionBuilder.text() != null && suggestionBuilder.prefix() != null) {
                suggestionBuilder.prefix(null);
Solution content
            if (suggestionBuilder.text() == null) {
                // we either need suggestion text or global text
                suggestBuilder.setGlobalText(randomAsciiOfLengthBetween(5, 50));
            }
            if (suggestionBuilder.text() != null && suggestionBuilder.prefix() != null) {
                suggestionBuilder.prefix(null);
File
AbstractSuggestionBuilderTestCase.java
Developer's decision
Manual
Kind of conflict
Method invocation
Chunk
Conflicting content
                xContentBuilder.prettyPrint();
            }
            suggestBuilder.toXContent(xContentBuilder, ToXContent.EMPTY_PARAMS);
<<<<<<< HEAD
            System.out.println(suggestBuilder);

            XContentParser parser = XContentHelper.createParser(xContentBuilder.bytes());
            parser.nextToken(); // set cursor to START_OBJECT
            SuggestionSearchContext suggestionSearchContext = parseElement.parseInternal(parser, mockShardContext);
            SuggestionContext oldSchoolContext = suggestionSearchContext.suggestions().get(suggestionBuilder.name());

            SuggestionContext newSchoolContext = suggestionBuilder.build(mockShardContext, suggestBuilder.getGlobalText());

            assertNotSame(oldSchoolContext, newSchoolContext);
            // deep comparison of analyzers is difficult here, but we check they are same class
            if (oldSchoolContext.getAnalyzer() == null) {
                assertNull(newSchoolContext.getAnalyzer());
            } else if (newSchoolContext.getAnalyzer() == null) {
                assertNull(oldSchoolContext.getAnalyzer());
            } else {
                assertEquals(oldSchoolContext.getAnalyzer().getClass(), newSchoolContext.getAnalyzer().getClass());
            }
            assertEquals(oldSchoolContext.getField(), newSchoolContext.getField());
            // TODO consolidate text/prefix/regex
            //assertEquals(oldSchoolContext.getPrefix(), newSchoolContext.getPrefix());
            //assertEquals(oldSchoolContext.getRegex(), newSchoolContext.getRegex());
            assertEquals(oldSchoolContext.getShardSize(), newSchoolContext.getShardSize());
            assertEquals(oldSchoolContext.getSize(), newSchoolContext.getSize());
            assertEquals(oldSchoolContext.getSuggester().getClass(), newSchoolContext.getSuggester().getClass());
            // TODO consolidate text/prefix/regex
            //assertEquals(oldSchoolContext.getText(), newSchoolContext.getText());
            assertEquals(oldSchoolContext.getClass(), newSchoolContext.getClass());

            assertSuggestionContext(oldSchoolContext, newSchoolContext);
=======

            XContentParser parser = XContentHelper.createParser(xContentBuilder.bytes());
            parser.nextToken(); // set cursor to START_OBJECT
            SuggestionSearchContext parsedSuggestionSearchContext = parseElement.parseInternal(parser, mockShardContext);

            SuggestionSearchContext buildSuggestSearchContext = suggestBuilder.build(mockShardContext);
            assertEquals(parsedSuggestionSearchContext.suggestions().size(), buildSuggestSearchContext.suggestions().size());
            Iterator> iterator = buildSuggestSearchContext.suggestions().entrySet().iterator();
            for (Entry entry : parsedSuggestionSearchContext.suggestions().entrySet()) {
                Entry other = iterator.next();
                assertEquals(entry.getKey(), other.getKey());

                SuggestionContext oldSchoolContext = entry.getValue();
                SuggestionContext newSchoolContext = other.getValue();
                assertNotSame(oldSchoolContext, newSchoolContext);
                // deep comparison of analyzers is difficult here, but we check they are set or not set
                if (oldSchoolContext.getAnalyzer() != null) {
                    assertNotNull(newSchoolContext.getAnalyzer());
                } else {
                    assertNull(newSchoolContext.getAnalyzer());
                }
                assertEquals(oldSchoolContext.getField(), newSchoolContext.getField());
                assertEquals(oldSchoolContext.getPrefix(), newSchoolContext.getPrefix());
                assertEquals(oldSchoolContext.getRegex(), newSchoolContext.getRegex());
                assertEquals(oldSchoolContext.getShardSize(), newSchoolContext.getShardSize());
                assertEquals(oldSchoolContext.getSize(), newSchoolContext.getSize());
                assertEquals(oldSchoolContext.getSuggester().getClass(), newSchoolContext.getSuggester().getClass());
                assertEquals(oldSchoolContext.getText(), newSchoolContext.getText());
                assertEquals(oldSchoolContext.getClass(), newSchoolContext.getClass());

                assertSuggestionContext(oldSchoolContext, newSchoolContext);
            }
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        }
    }
Solution content
                xContentBuilder.prettyPrint();
            }
            suggestBuilder.toXContent(xContentBuilder, ToXContent.EMPTY_PARAMS);

            XContentParser parser = XContentHelper.createParser(xContentBuilder.bytes());
            parser.nextToken(); // set cursor to START_OBJECT
            SuggestionSearchContext parsedSuggestionSearchContext = parseElement.parseInternal(parser, mockShardContext);

            SuggestionSearchContext buildSuggestSearchContext = suggestBuilder.build(mockShardContext);
            assertEquals(parsedSuggestionSearchContext.suggestions().size(), buildSuggestSearchContext.suggestions().size());
            Iterator> iterator = buildSuggestSearchContext.suggestions().entrySet().iterator();
            for (Entry entry : parsedSuggestionSearchContext.suggestions().entrySet()) {
                Entry other = iterator.next();
                assertEquals(entry.getKey(), other.getKey());

                SuggestionContext oldSchoolContext = entry.getValue();
                SuggestionContext newSchoolContext = other.getValue();
                assertNotSame(oldSchoolContext, newSchoolContext);
                // deep comparison of analyzers is difficult here, but we check they are set or not set
                if (oldSchoolContext.getAnalyzer() != null) {
                    assertNotNull(newSchoolContext.getAnalyzer());
                } else {
                    assertNull(newSchoolContext.getAnalyzer());
                }
                assertEquals(oldSchoolContext.getField(), newSchoolContext.getField());
                assertEquals(oldSchoolContext.getPrefix(), newSchoolContext.getPrefix());
                assertEquals(oldSchoolContext.getRegex(), newSchoolContext.getRegex());
                assertEquals(oldSchoolContext.getShardSize(), newSchoolContext.getShardSize());
                assertEquals(oldSchoolContext.getSize(), newSchoolContext.getSize());
                assertEquals(oldSchoolContext.getSuggester().getClass(), newSchoolContext.getSuggester().getClass());
                assertEquals(oldSchoolContext.getText(), newSchoolContext.getText());
                assertEquals(oldSchoolContext.getClass(), newSchoolContext.getClass());

                assertSuggestionContext(oldSchoolContext, newSchoolContext);
            }
        }
    }
File
AbstractSuggestionBuilderTestCase.java
Developer's decision
Version 2
Kind of conflict
Comment
For statement
If statement
Method invocation
Variable
Chunk
Conflicting content
        }

        @Override
<<<<<<< HEAD
        protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
            Map options = new HashMap<>();
            options.put("field", randomField);
            options.put("suffix", randomSuffix);
            return new CustomSuggester.CustomSuggestionsContext(new CustomSuggester(), options);
=======
        protected SuggestionContext build(QueryShardContext context) throws IOException {
            // NORELEASE
            return null;
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
        }

    }
Solution content
        }

        @Override
        protected SuggestionContext innerBuild(QueryShardContext context) throws IOException {
            Map options = new HashMap<>();
            options.put("field", randomField);
            options.put("suffix", randomSuffix);
            return new CustomSuggester.CustomSuggestionsContext(context, options);
        }

    }
File
CustomSuggesterSearchIT.java
Developer's decision
Manual
Kind of conflict
Comment
Method signature
Return statement
Chunk
Conflicting content
import org.elasticsearch.script.Template;
import org.elasticsearch.search.suggest.AbstractSuggestionBuilderTestCase;
import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext;
<<<<<<< HEAD
import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder.Laplace;
import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder.LinearInterpolation;
import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder.SmoothingModel;
import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder.StupidBackoff;
=======
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
import org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator;
import org.junit.BeforeClass;
Solution content
import org.elasticsearch.script.Template;
import org.elasticsearch.search.suggest.AbstractSuggestionBuilderTestCase;
import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext;
import org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator;
import org.junit.BeforeClass;
File
PhraseSuggestionBuilderTests.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
        }
    }

<<<<<<< HEAD
=======
    @Override
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
    protected void assertSuggestionContext(SuggestionContext oldSuggestion, SuggestionContext newSuggestion) {
        assertThat(oldSuggestion, instanceOf(PhraseSuggestionContext.class));
        assertThat(newSuggestion, instanceOf(PhraseSuggestionContext.class));
Solution content
        }
    }

    @Override
    protected void assertSuggestionContext(SuggestionContext oldSuggestion, SuggestionContext newSuggestion) {
        assertThat(oldSuggestion, instanceOf(PhraseSuggestionContext.class));
        assertThat(newSuggestion, instanceOf(PhraseSuggestionContext.class));
File
PhraseSuggestionBuilderTests.java
Developer's decision
Version 2
Kind of conflict
Annotation
Chunk
Conflicting content
package org.elasticsearch.search.suggest.term;

import org.elasticsearch.search.suggest.AbstractSuggestionBuilderTestCase;
<<<<<<< HEAD
import org.elasticsearch.search.suggest.DirectSpellcheckerSettings;
=======
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext;
import org.elasticsearch.search.suggest.term.TermSuggestionBuilder.SortBy;
import org.elasticsearch.search.suggest.term.TermSuggestionBuilder.StringDistanceImpl;
Solution content
package org.elasticsearch.search.suggest.term;

import org.elasticsearch.search.suggest.AbstractSuggestionBuilderTestCase;
import org.elasticsearch.search.suggest.DirectSpellcheckerSettings;
import org.elasticsearch.search.suggest.SortBy;
import org.elasticsearch.search.suggest.SuggestionSearchContext.SuggestionContext;
import org.elasticsearch.search.suggest.term.TermSuggestionBuilder.StringDistanceImpl;
File
TermSuggestionBuilderTests.java
Developer's decision
Manual
Kind of conflict
Import
Chunk
Conflicting content
    @Override
    protected void assertSuggestionContext(SuggestionContext oldSuggestion, SuggestionContext newSuggestion) {
<<<<<<< HEAD
        @SuppressWarnings("unchecked")
        TermSuggestionContext oldContext = (TermSuggestionContext) oldSuggestion;
        @SuppressWarnings("unchecked")
        TermSuggestionContext newContext = (TermSuggestionContext) newSuggestion;
        assertSpellcheckerSettings(oldContext.getDirectSpellCheckerSettings(), newContext.getDirectSpellCheckerSettings());

    }

    private void assertSpellcheckerSettings(DirectSpellcheckerSettings oldSettings, DirectSpellcheckerSettings newSettings) {
        final double delta = 0.0d;
        // make sure the objects aren't the same
        assertNotSame(oldSettings, newSettings);
        // make sure the objects aren't null
        assertNotNull(oldSettings);
        assertNotNull(newSettings);
        // and now, make sure they are equal..
        assertEquals(oldSettings.accuracy(), newSettings.accuracy(), delta);
        assertEquals(oldSettings.maxEdits(), newSettings.maxEdits());
        assertEquals(oldSettings.maxInspections(), newSettings.maxInspections());
        assertEquals(oldSettings.maxTermFreq(), newSettings.maxTermFreq(), delta);
        assertEquals(oldSettings.minDocFreq(), newSettings.minDocFreq(), delta);
        assertEquals(oldSettings.minWordLength(), newSettings.minWordLength());
        assertEquals(oldSettings.prefixLength(), newSettings.prefixLength());
        assertEquals(oldSettings.sort(), newSettings.sort());
        assertEquals(oldSettings.stringDistance().getClass(), newSettings.stringDistance().getClass());
        assertEquals(oldSettings.suggestMode().getClass(), newSettings.suggestMode().getClass());
=======
        // put assertions on TermSuggestionContext here
>>>>>>> bbeb09eae7ac3c5d9837bb26eacfac6bba468929
    }

}
Solution content
    @Override
    protected void assertSuggestionContext(SuggestionContext oldSuggestion, SuggestionContext newSuggestion) {
        @SuppressWarnings("unchecked")
        TermSuggestionContext oldContext = (TermSuggestionContext) oldSuggestion;
        @SuppressWarnings("unchecked")
        TermSuggestionContext newContext = (TermSuggestionContext) newSuggestion;
        assertSpellcheckerSettings(oldContext.getDirectSpellCheckerSettings(), newContext.getDirectSpellCheckerSettings());

    }

    private void assertSpellcheckerSettings(DirectSpellcheckerSettings oldSettings, DirectSpellcheckerSettings newSettings) {
        final double delta = 0.0d;
        // make sure the objects aren't the same
        assertNotSame(oldSettings, newSettings);
        // make sure the objects aren't null
        assertNotNull(oldSettings);
        assertNotNull(newSettings);
        // and now, make sure they are equal..
        assertEquals(oldSettings.accuracy(), newSettings.accuracy(), delta);
        assertEquals(oldSettings.maxEdits(), newSettings.maxEdits());
        assertEquals(oldSettings.maxInspections(), newSettings.maxInspections());
        assertEquals(oldSettings.maxTermFreq(), newSettings.maxTermFreq(), delta);
        assertEquals(oldSettings.minDocFreq(), newSettings.minDocFreq(), delta);
        assertEquals(oldSettings.minWordLength(), newSettings.minWordLength());
        assertEquals(oldSettings.prefixLength(), newSettings.prefixLength());
        assertEquals(oldSettings.sort(), newSettings.sort());
        assertEquals(oldSettings.stringDistance().getClass(), newSettings.stringDistance().getClass());
        assertEquals(oldSettings.suggestMode().getClass(), newSettings.suggestMode().getClass());
    }

}
File
TermSuggestionBuilderTests.java
Developer's decision
Version 1
Kind of conflict
Annotation
Cast expression
Comment
Method invocation
Method signature
Variable