From e0ca1501f65ffe1facf434526183c829eece882f Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Thu, 17 Jun 2021 13:40:36 +0200 Subject: Throw explicitly on unsupported operation --- .../src/main/java/com/yahoo/documentmodel/NewDocumentType.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config-model') 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; } -- cgit v1.2.3