Skip to content

Commit

Permalink
issues/333 - Tidy for review
Browse files Browse the repository at this point in the history
  • Loading branch information
meywood committed Sep 10, 2024
1 parent 59facc2 commit e47e354
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public abstract class AbstractSerializedKeyTaggedHexDeserializer<T extends Abstr
private static final String NULL_PUBLIC_KEY = "00";

@Override
public T deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
JsonNode node = p.getCodec().readTree(p);
public T deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException {
final JsonNode node = p.getCodec().readTree(p);

String strKey = node.textValue();
final String strKey = node.textValue();

if (strKey.contains("-")) {
try {
Expand All @@ -48,10 +48,10 @@ public T deserialize(JsonParser p, DeserializationContext ctxt) throws IOExcepti
return null;
}

T object = this.getInstanceOf();
final T object = this.getInstanceOf();

try {
byte[] bytes = ByteUtils.parseHexString(node.asText());
final byte[] bytes = ByteUtils.parseHexString(strKey);
this.loadKey(object, bytes);
} catch (NoSuchAlgorithmException | NoSuchKeyTagException e) {
throw new DeserializationException("Problem deserializing Algorithm tagged hex string", e);
Expand All @@ -62,5 +62,5 @@ public T deserialize(JsonParser p, DeserializationContext ctxt) throws IOExcepti

protected abstract T getInstanceOf();

protected abstract void loadKey(T key, byte[] bytes) throws NoSuchAlgorithmException, NoSuchKeyTagException;
protected abstract void loadKey(final T key, final byte[] bytes) throws NoSuchAlgorithmException, NoSuchKeyTagException;
}

0 comments on commit e47e354

Please sign in to comment.