summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorArne Juul <arnej@yahooinc.com>2023-01-18 12:23:44 +0000
committerArne Juul <arnej@yahooinc.com>2023-01-18 12:23:44 +0000
commitdaced04729f503e3ad165926b41af2cbcdb53b13 (patch)
treee12281329a832fd2f3122954e8cbeb5c089fc8b4 /document
parent6c457e6dd5993ec2ef15177dab4a16e3d3702b85 (diff)
check complete span node type
* this matches actual serialization format and C++ implementation
Diffstat (limited to 'document')
-rw-r--r--document/src/main/java/com/yahoo/document/serialization/VespaDocumentDeserializer6.java12
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();