diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-06-07 16:20:08 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-06-08 11:45:32 +0200 |
commit | 8becab6c0ef366812526617d963a26745d1abf9c (patch) | |
tree | c1c3e9d65f1a960f22a8a6cf41d583822aaacbc1 /config-model/src/main/java/com/yahoo/documentmodel | |
parent | c038e525c5080f4404d1331e5a04131b1422aa66 (diff) |
GC deprecation warnings.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/documentmodel')
-rw-r--r-- | config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java | 41 |
1 files changed, 2 insertions, 39 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 7f15da3179f..8c644279281 100644 --- a/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java +++ b/config-model/src/main/java/com/yahoo/documentmodel/NewDocumentType.java @@ -91,25 +91,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp public DataType getContentStruct() { return contentStruct; } public Collection<NewDocumentType> getInherited() { return inherits.values(); } public NewDocumentType getInherited(Name inherited) { return inherits.get(inherited.getId()); } - public NewDocumentType removeInherited(Name inherited) { return inherits.remove(inherited.getId()); } - - /** - * Data type of the header fields of this and all inherited document types - * Used by DocumentGenMojo - * @return merged {@link StructDataType} - */ - public StructDataType allHeader() { - StructDataType ret = new StructDataType(contentStruct.getName()); - for (Field f : contentStruct.getFields()) { - ret.addField(f); - } - for (NewDocumentType inherited : getInherited()) { - for (Field f : ((StructDataType) inherited.getContentStruct()).getFields()) { - ret.addField(f); - } - } - return ret; - } @Override public Class<Document> getValueClass() { @@ -132,7 +113,7 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp return false; } - private boolean verifyInheritance(NewDocumentType inherited) { + private void verifyInheritance(NewDocumentType inherited) { for (Field f : getFields()) { Field inhF = inherited.getField(f.getName()); if (inhF != null && !inhF.equals(f)) { @@ -151,7 +132,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp } } } - return true; } public void inherit(NewDocumentType inherited) { @@ -213,9 +193,7 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp } public Collection<Field> getFields() { - Collection<Field> collection = new LinkedList<>(); - collection.addAll(contentStruct.getFields()); - return Collections.unmodifiableCollection(collection); + return contentStruct.getFields(); } @Override @@ -311,20 +289,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp } return null; } - public AnnotationType getAnnotationType(int id) { - AnnotationType a = annotations.getType(id); - if (a != null) { - return a; - } else { - for (NewDocumentType dt : getInherited()) { - a = dt.getAnnotationType(id); - if (a != null) { - return a; - } - } - } - return null; - } public NewDocumentType add(AnnotationType type) { annotations.register(type); @@ -386,7 +350,6 @@ public final class NewDocumentType extends StructuredDataType implements DataTyp private NewDocumentReferenceDataType refToThis = null; - @SuppressWarnings("deprecation") public NewDocumentReferenceDataType getReferenceDataType() { if (refToThis == null) { refToThis = new NewDocumentReferenceDataType(this); |