diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-01-19 07:15:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-19 07:15:31 +0100 |
commit | 3b3483fd4da48330149a56ec4427fb3a52d32bd4 (patch) | |
tree | 2476b55276b5f4b43f9abaa748efdc1f0c8e4147 /document | |
parent | f62cc3b0646596be4d06661d3b94d0ebb26e296f (diff) | |
parent | daced04729f503e3ad165926b41af2cbcdb53b13 (diff) |
Merge pull request #25616 from vespa-engine/arnej/stricter-span-node-id-check
check complete span node type
Diffstat (limited to 'document')
-rw-r--r-- | document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java index 6ab0698e0bd..a9c3d4804a1 100644 --- a/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java +++ b/document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java @@ -587,19 +587,19 @@ public class VespaDocumentDeserializer6 extends BufferSerializer implements Docu buf.position(buf.position() - 1); SpanNode retval; - if ((type & Span.ID) == Span.ID) { + if (type == Span.ID) { retval = new Span(); if (spanNodes != null) { spanNodes.add(retval); } read((Span) retval); - } else if ((type & SpanList.ID) == SpanList.ID) { + } else if (type == SpanList.ID) { retval = new SpanList(); if (spanNodes != null) { spanNodes.add(retval); } read((SpanList) retval); - } else if ((type & AlternateSpanList.ID) == AlternateSpanList.ID) { + } else if (type == AlternateSpanList.ID) { retval = new AlternateSpanList(); if (spanNodes != null) { spanNodes.add(retval); @@ -706,7 +706,7 @@ public class VespaDocumentDeserializer6 extends BufferSerializer implements Docu public void read(Span span) { byte type = buf.get(); - if ((type & Span.ID) != Span.ID) { + if (type != Span.ID) { throw new DeserializationException("Cannot deserialize Span with type " + type); } span.setFrom(buf.getInt1_2_4Bytes()); @@ -727,7 +727,7 @@ public class VespaDocumentDeserializer6 extends BufferSerializer implements Docu public void read(SpanList spanList) { byte type = buf.get(); - if ((type & SpanList.ID) != SpanList.ID) { + if (type != SpanList.ID) { throw new DeserializationException("Cannot deserialize SpanList with type " + type); } List<SpanNode> nodes = readSpanList(); @@ -738,7 +738,7 @@ public class VespaDocumentDeserializer6 extends BufferSerializer implements Docu public void read(AlternateSpanList altSpanList) { byte type = buf.get(); - if ((type & AlternateSpanList.ID) != AlternateSpanList.ID) { + if (type != AlternateSpanList.ID) { throw new DeserializationException("Cannot deserialize AlternateSpanList with type " + type); } int numSubTrees = buf.getInt1_2_4Bytes(); |