diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-06-17 13:40:36 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-06-17 13:40:36 +0200 |
commit | e0ca1501f65ffe1facf434526183c829eece882f (patch) | |
tree | 91d6acd99ea473cb8325bef87bb1ddc90f4921cc /config-model | |
parent | f006c1c153d491a9afdf61e07fb5a90ade0eeae0 (diff) |
Throw explicitly on unsupported operation
Diffstat (limited to 'config-model')
-rw-r--r-- | config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java b/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java index d896a7f7d22..da338ad3107 100644 --- a/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java +++ b/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java @@ -3,7 +3,6 @@ package com.yahoo.documentmodel; import com.yahoo.document.DataType; import com.yahoo.document.Document; -import com.yahoo.document.DocumentId; import com.yahoo.document.Field; import com.yahoo.document.StructDataType; import com.yahoo.document.StructuredDataType; @@ -219,7 +218,7 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp @Override public Document createFieldValue() { - return new Document(null, (DocumentId)null); // XXX: Always causes NPE + throw new RuntimeException("Cannot create an instance of " + this); } @Override @@ -365,6 +364,7 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp this.name = name; } + @Override public String toString() { return name; } public final String getName() { return name; } |