Explorar o código

fix creating uid to bytes

Shay Banon %!s(int64=13) %!d(string=hai) anos
pai
achega
2950799243
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/main/java/org/elasticsearch/index/mapper/Uid.java

+ 2 - 2
src/main/java/org/elasticsearch/index/mapper/Uid.java

@@ -103,8 +103,8 @@ public final class Uid {
     public static BytesRef createUidAsBytes(String type, String id) {
     public static BytesRef createUidAsBytes(String type, String id) {
         BytesRef ref = new BytesRef(type.length() + 1 + id.length());
         BytesRef ref = new BytesRef(type.length() + 1 + id.length());
         ref.copyChars(type);
         ref.copyChars(type);
-        ref.copyBytes(DELIMITER_BYTES);
-        ref.copyChars(id);
+        ref.append(DELIMITER_BYTES);
+        ref.append(new BytesRef(id));
         return ref;
         return ref;
     }
     }