Apache Lucene open-source search software
fixed copy method in ValuesAttribute
Simon Willnauer3a4d4aa0c6e1
diff --git a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java b/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.javaindex de030dadf23..b28300713ed 100644--- a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java+++ b/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/DocMaker.java@@ -175,7 +175,8 @@ public class DocMaker {Field idField = ds.getField(ID_FIELD, storeVal, Index.NOT_ANALYZED_NO_NORMS, termVecVal);idField.setValue("doc" + (r != null ? r.nextInt(updateDocIDLimit) : incrNumDocsCreated()));doc.add(idField);-+ trySetIndexValues(idField);+// Set NAME_FIELDString name = docData.getName();if (name == null) name = "";@@ -390,16 +391,15 @@ public class DocMaker {String[] split = fields.split(";");Map<String, Values> result = new HashMap<String, Values>();for (String tuple : split) {- final String[] nameValue = tuple.split(":");+ final String[] nameValue = tuple.split("=");if (nameValue.length != 2) {throw new IllegalArgumentException("illegal doc.stored.values format: "- + fields + " expected fieldname:ValuesType;...;...;");+ + fields + " expected fieldname=ValuesType;...;...;");}result.put(nameValue[0].trim(), Values.valueOf(nameValue[1]));}return result;}-/** Set the configuration parameters of this doc maker. */public void setConfig(Config config) {this.config = config;diff --git a/lucene/src/java/org/apache/lucene/document/ValuesField.java b/lucene/src/java/org/apache/lucene/document/ValuesField.javaindex df9332dc42d..43fc6bd6623 100644--- a/lucene/src/java/org/apache/lucene/document/ValuesField.java+++ b/lucene/src/java/org/apache/lucene/document/ValuesField.java@@ -130,7 +130,6 @@ public class ValuesField extends AbstractField {default:throw new IllegalArgumentException("unknown type: " + type);}-return valField.set(field);}}diff --git a/lucene/src/java/org/apache/lucene/index/values/ValuesAttributeImpl.java b/lucene/src/java/org/apache/lucene/index/values/ValuesAttributeImpl.javaindex 714ba4b7969..fe504514ba7 100644--- a/lucene/src/java/org/apache/lucene/index/values/ValuesAttributeImpl.java+++ b/lucene/src/java/org/apache/lucene/index/values/ValuesAttributeImpl.java@@ -77,15 +77,15 @@ public class ValuesAttributeImpl extends AttributeImpl implements ValuesAttributcase BYTES_VAR_DEREF:case BYTES_VAR_SORTED:case BYTES_VAR_STRAIGHT:- bytes = (BytesRef) other.bytes.clone();+ other.bytes.copy(bytes);break;case PACKED_INTS:case PACKED_INTS_FIXED:- ints = (LongsRef) other.ints.clone();+ other.ints.copy(ints);break;case SIMPLE_FLOAT_4BYTE:case SIMPLE_FLOAT_8BYTE:- floats = (FloatsRef) other.floats.clone();+ other.floats.copy(floats);break;}