Skip to content

Commit 86b729d

Browse files
committed
Refactoring
1 parent 4411cac commit 86b729d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

msgpack-jackson/src/main/java/org/msgpack/jackson/dataformat/MessagePackParser.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public JsonToken nextToken()
342342
ExtensionTypeHeader header = messageUnpacker.unpackExtensionTypeHeader();
343343
extensionTypeValue = new MessagePackExtensionType(header.getType(), messageUnpacker.readPayload(header.getLength()));
344344
if (parsingContext.inObject() && _currToken != JsonToken.FIELD_NAME) {
345-
parsingContext.setCurrentName(getExtensionTypeValue().toString());
345+
parsingContext.setCurrentName(deserializedExtensionTypeValue().toString());
346346
nextToken = JsonToken.FIELD_NAME;
347347
}
348348
else {
@@ -398,7 +398,7 @@ public String getText()
398398
case BIG_INT:
399399
return String.valueOf(biValue);
400400
case EXT:
401-
return getExtensionTypeValue().toString();
401+
return deserializedExtensionTypeValue().toString();
402402
default:
403403
throw new IllegalStateException("Invalid type=" + type);
404404
}
@@ -573,7 +573,7 @@ public BigDecimal getDecimalValue()
573573
}
574574
}
575575

576-
private Object getExtensionTypeValue()
576+
private Object deserializedExtensionTypeValue()
577577
throws IOException
578578
{
579579
if (extTypeCustomDesers != null) {
@@ -582,7 +582,7 @@ private Object getExtensionTypeValue()
582582
return deser.deserialize(extensionTypeValue.getData());
583583
}
584584
}
585-
return extensionTypeValue;
585+
throw new RuntimeException("Unsupported extension type=" + extensionTypeValue.getType());
586586
}
587587

588588
@Override
@@ -593,7 +593,7 @@ public Object getEmbeddedObject()
593593
case BYTES:
594594
return bytesValue;
595595
case EXT:
596-
return getExtensionTypeValue();
596+
return deserializedExtensionTypeValue();
597597
default:
598598
throw new IllegalStateException("Invalid type=" + type);
599599
}

0 commit comments

Comments
 (0)