Anomaly identified by the detector. Please review whether this anomaly corresponds to a misuse.
Finding:
9
In File:
org/apache/lucene/search/MultiPhraseQuery.java
In Method:
add(Term[], int)
Code with Finding:
class MultiPhraseQuery {
/**
* Allows to specify the relative position of terms within the phrase.
*
* @see PhraseQuery#add(Term, int)
* @param terms
* @param position
*/
public void add(Term[] terms, int position) {
if (termArrays.size() == 0)
field = terms[0].field();
for (int i = 0; i < terms.length; i++) {
if (terms[i].field() != field) {
throw new IllegalArgumentException(
"All phrase terms must be in the same field (" + field + "): "
+ terms[i]);
}
}
termArrays.add(terms);
positions.add(new Integer(position));
}
}