diff options
author | Arne H Juul <arnej@yahooinc.com> | 2021-11-30 14:06:52 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2021-11-30 15:16:33 +0000 |
commit | 97f60c94615928e3e839fd2c5215b6f262b9d697 (patch) | |
tree | 80b49998c0cdec464ce36b9999198e7222ec03f5 /document | |
parent | cc21405856be114eb720d6a7565182654cc227d8 (diff) |
deprecate classes scheduled for removal
Diffstat (limited to 'document')
9 files changed, 20 insertions, 0 deletions
diff --git a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java index a6f2923d68f..55320eb8501 100644 --- a/document/src/main/java/com/yahoo/document/DocumentTypeManager.java +++ b/document/src/main/java/com/yahoo/document/DocumentTypeManager.java @@ -165,6 +165,7 @@ public class DocumentTypeManager { } } + @SuppressWarnings("deprecation") DataType getDataTypeAndReturnTemporary(int code, String detailedType) { if (hasDataType(code)) { return getDataType(code, detailedType); @@ -186,6 +187,7 @@ public class DocumentTypeManager { * * @param type The datatype to register */ + @SuppressWarnings("deprecation") void registerSingleType(DataType type) { if (type instanceof TensorDataType) return; // built-in dynamic: Created on the fly if (dataTypes.containsKey(type.getId())) { @@ -315,6 +317,7 @@ public class DocumentTypeManager { } } + @SuppressWarnings("deprecation") private void replaceTemporaryTypes(DataType type, List<DataType> seenStructs) { if (type instanceof WeightedSetDataType) { replaceTemporaryTypesInWeightedSet((WeightedSetDataType) type, seenStructs); @@ -356,6 +359,7 @@ public class DocumentTypeManager { } } + @SuppressWarnings("deprecation") private void replaceTemporaryTypeInReference(ReferenceDataType referenceDataType) { if (referenceDataType.getTargetType() instanceof TemporaryStructuredDataType) { referenceDataType.setTargetType((DocumentType) getDataType(referenceDataType.getTargetType().getId())); @@ -363,6 +367,7 @@ public class DocumentTypeManager { // TODO should we recursively invoke replaceTemporaryTypes for the target type? It should only ever be a doc type } + @SuppressWarnings("deprecation") private void replaceTemporaryTypesInCollection(CollectionDataType collectionDataType, List<DataType> seenStructs) { if (collectionDataType.getNestedType() instanceof TemporaryDataType) { collectionDataType.setNestedType(getDataType(collectionDataType.getNestedType().getCode(), "")); @@ -371,6 +376,7 @@ public class DocumentTypeManager { } } + @SuppressWarnings("deprecation") private void replaceTemporaryTypesInMap(MapDataType mapDataType, List<DataType> seenStructs) { if (mapDataType.getValueType() instanceof TemporaryDataType) { mapDataType.setValueType(getDataType(mapDataType.getValueType().getCode(), "")); @@ -385,6 +391,7 @@ public class DocumentTypeManager { } } + @SuppressWarnings("deprecation") private void replaceTemporaryTypesInWeightedSet(WeightedSetDataType weightedSetDataType, List<DataType> seenStructs) { if (weightedSetDataType.getNestedType() instanceof TemporaryDataType) { weightedSetDataType.setNestedType(getDataType(weightedSetDataType.getNestedType().getCode(), "")); diff --git a/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java b/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java index 5ba3f4d6a6a..c545b6f1491 100644 --- a/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java +++ b/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java @@ -194,6 +194,7 @@ public class DocumentTypeManagerConfigurer implements ConfigSubscriber.SingleSub manager.register(type); } + @SuppressWarnings("deprecation") private void registerReferenceType(int id, DocumentmanagerConfig.Datatype.Referencetype refType) { ReferenceDataType referenceType; if (manager.hasDataType(refType.target_type_id())) { diff --git a/document/src/main/java/com/yahoo/document/ReferenceDataType.java b/document/src/main/java/com/yahoo/document/ReferenceDataType.java index 78a30c0fcf2..c3b5f6590b6 100644 --- a/document/src/main/java/com/yahoo/document/ReferenceDataType.java +++ b/document/src/main/java/com/yahoo/document/ReferenceDataType.java @@ -27,6 +27,7 @@ public class ReferenceDataType extends DataType { * of the target document type might not yet be known. The temporary data type should be * replaced later using setTargetType(). */ + @SuppressWarnings("deprecation") public ReferenceDataType(TemporaryStructuredDataType temporaryTargetType, int id) { this((StructuredDataType) temporaryTargetType, id); } @@ -54,6 +55,7 @@ public class ReferenceDataType extends DataType { /** * Creates a new type where the numeric ID is based on the hash of targetType */ + @SuppressWarnings("deprecation") public static ReferenceDataType createWithInferredId(TemporaryStructuredDataType targetType) { return new ReferenceDataType(targetType); } @@ -67,6 +69,7 @@ public class ReferenceDataType extends DataType { * @throws IllegalStateException if the previously stored target type is already a concrete * instance (not TemporaryStructuredDataType). */ + @SuppressWarnings("deprecation") public void setTargetType(StructuredDataType targetType) { if (! (this.targetType instanceof TemporaryStructuredDataType)) { throw new IllegalStateException(String.format( diff --git a/document/src/main/java/com/yahoo/document/TemporaryDataType.java b/document/src/main/java/com/yahoo/document/TemporaryDataType.java index c32e271737c..71f36ecde90 100644 --- a/document/src/main/java/com/yahoo/document/TemporaryDataType.java +++ b/document/src/main/java/com/yahoo/document/TemporaryDataType.java @@ -5,7 +5,9 @@ import com.yahoo.document.datatypes.FieldValue; /** * @author Einar M R Rosenvinge + * @deprecated will be removed soon */ +@Deprecated class TemporaryDataType extends DataType { private final String detailedType; diff --git a/document/src/main/java/com/yahoo/document/TemporaryStructuredDataType.java b/document/src/main/java/com/yahoo/document/TemporaryStructuredDataType.java index 9d648367c4e..865310e7009 100644 --- a/document/src/main/java/com/yahoo/document/TemporaryStructuredDataType.java +++ b/document/src/main/java/com/yahoo/document/TemporaryStructuredDataType.java @@ -5,8 +5,10 @@ package com.yahoo.document; * Internal class, DO NOT USE!! * Only public because it must be used from com.yahoo.searchdefinition.parser. * + * @deprecated will be removed soon * @author Einar M R Rosenvinge */ +@Deprecated // TODO: Remove on Vespa 8 public class TemporaryStructuredDataType extends StructDataType { TemporaryStructuredDataType(String name) { diff --git a/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java b/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java index 1a0e2ad1e2b..3fa81dd8d5b 100644 --- a/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java +++ b/document/src/test/java/com/yahoo/document/DocumentTypeManagerTestCase.java @@ -525,6 +525,7 @@ search annotationsimplicitstruct { assertReferenceTypePresentInManager(manager, 87654321, "referenced_type2"); } + @SuppressWarnings("deprecation") @Test public void no_temporary_targets_in_references_or_names() { DocumentTypeManager manager = createConfiguredManager("file:src/test/document/documentmanager.replaced_temporary.cfg"); diff --git a/document/src/test/java/com/yahoo/document/ReferenceDataTypeTestCase.java b/document/src/test/java/com/yahoo/document/ReferenceDataTypeTestCase.java index d44f0880395..53c8a0ecc94 100644 --- a/document/src/test/java/com/yahoo/document/ReferenceDataTypeTestCase.java +++ b/document/src/test/java/com/yahoo/document/ReferenceDataTypeTestCase.java @@ -72,6 +72,7 @@ public class ReferenceDataTypeTestCase { assertTrue(fixture.refType.isValueCompatible(fixture.refTypeClone.createFieldValue())); } + @SuppressWarnings("deprecation") @Test public void reference_type_can_be_constructed_with_temporary_structured_data_type() { TemporaryStructuredDataType tempType = new TemporaryStructuredDataType("cooldoc"); @@ -81,6 +82,7 @@ public class ReferenceDataTypeTestCase { assertEquals(tempType, refType.getTargetType()); } + @SuppressWarnings("deprecation") @Test public void can_replace_temporary_target_data_type() { TemporaryStructuredDataType tempType = new TemporaryStructuredDataType("cooldoc"); diff --git a/document/src/test/java/com/yahoo/document/TemporaryDataTypeTestCase.java b/document/src/test/java/com/yahoo/document/TemporaryDataTypeTestCase.java index 0e85e085316..80154891d83 100644 --- a/document/src/test/java/com/yahoo/document/TemporaryDataTypeTestCase.java +++ b/document/src/test/java/com/yahoo/document/TemporaryDataTypeTestCase.java @@ -10,6 +10,7 @@ import static org.junit.Assert.assertNull; /** * @author Einar M R Rosenvinge */ +@SuppressWarnings("deprecation") public class TemporaryDataTypeTestCase { @Test diff --git a/document/src/test/java/com/yahoo/document/TemporaryStructuredDataTypeTestCase.java b/document/src/test/java/com/yahoo/document/TemporaryStructuredDataTypeTestCase.java index 5e4530d0886..3b5cd29b90d 100644 --- a/document/src/test/java/com/yahoo/document/TemporaryStructuredDataTypeTestCase.java +++ b/document/src/test/java/com/yahoo/document/TemporaryStructuredDataTypeTestCase.java @@ -10,6 +10,7 @@ import static org.junit.Assert.assertNotEquals; * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a> * @since 5.1.10 */ +@SuppressWarnings("deprecation") public class TemporaryStructuredDataTypeTestCase { @Test public void basic() { |