diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-12 11:41:41 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-12 11:41:41 +0000 |
commit | 02fa1bc6828cf80cc34040769d92db4ae9361cc9 (patch) | |
tree | 3fc17ad0ca5923f0eca1121a7ddee23670c68906 /document/src/main | |
parent | 55b8a24439e9dc41122a98bd7537968983e8a9ec (diff) |
Fix comments and messages and unify on '>'.
Diffstat (limited to 'document/src/main')
-rw-r--r-- | document/src/main/java/com/yahoo/document/DocumentId.java | 7 | ||||
-rw-r--r-- | document/src/main/java/com/yahoo/document/idstring/IdString.java | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/document/src/main/java/com/yahoo/document/DocumentId.java b/document/src/main/java/com/yahoo/document/DocumentId.java index 30ca9be8231..26adb0b6dc5 100644 --- a/document/src/main/java/com/yahoo/document/DocumentId.java +++ b/document/src/main/java/com/yahoo/document/DocumentId.java @@ -2,7 +2,10 @@ package com.yahoo.document; import com.yahoo.document.idstring.IdString; -import com.yahoo.document.serialization.*; +import com.yahoo.document.serialization.DeserializationException; +import com.yahoo.document.serialization.DocumentReader; +import com.yahoo.document.serialization.DocumentWriter; +import com.yahoo.document.serialization.SerializationException; import com.yahoo.vespa.objects.Deserializer; import com.yahoo.vespa.objects.Identifiable; import com.yahoo.vespa.objects.Serializer; @@ -34,7 +37,7 @@ public class DocumentId extends Identifiable implements Serializable { throw new IllegalArgumentException("Cannot create DocumentId from null id."); } if (id.length() > IdString.MAX_LENGTH) { - throw new IllegalArgumentException("The document id(" + id.length() + ") is too long(65536). " + + throw new IllegalArgumentException("The document id(" + id.length() + ") is too long(" + IdString.MAX_LENGTH + "). " + "However if you have already fed a document earlier on and want to remove it, you can do so by " + "calling new DocumentId(IdString.createIdStringLessStrict()) that will bypass this restriction."); } diff --git a/document/src/main/java/com/yahoo/document/idstring/IdString.java b/document/src/main/java/com/yahoo/document/idstring/IdString.java index 404db928f30..c5f5a088bf9 100644 --- a/document/src/main/java/com/yahoo/document/idstring/IdString.java +++ b/document/src/main/java/com/yahoo/document/idstring/IdString.java @@ -53,7 +53,7 @@ public abstract class IdString { * The document id string can only contain text characters. */ public static IdString createIdString(String id) { - if (id.length() >= MAX_LENGTH) { + if (id.length() > MAX_LENGTH) { throw new IllegalArgumentException("Document id length " + id.length() + " is longer than max length of " + MAX_LENGTH); } validateTextString(id); |