mirror of https://github.com/apache/lucene.git
precicion has to be a positive value
This commit is contained in:
parent
f4c186c9cb
commit
c3aa3f9fa6
|
@ -38,6 +38,9 @@ class Preference implements MapWriter {
|
|||
name = Policy.SortParam.get(m.get(sort.name()).toString());
|
||||
Object p = m.getOrDefault("precision", 0);
|
||||
precision = p instanceof Number ? ((Number) p).intValue() : Integer.parseInt(p.toString());
|
||||
if (precision < 0) {
|
||||
throw new RuntimeException("precision must be a positive value ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue