Skip to content

Commit 256b24e

Browse files
authored
fix: Unmarshalling hexBinary with leading whitespaces yields null (#313)
* fix: Unmarshalling hexBinary with leading whitespaces yields `null` Fixes #312 * doc: update copyright years
1 parent 57884ff commit 256b24e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/src/main/java/jakarta/xml/bind/annotation/adapters/HexBinaryAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2004, 2021 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2004, 2025 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -28,7 +28,7 @@ public HexBinaryAdapter() {}
2828
@Override
2929
public byte[] unmarshal(String s) {
3030
if(s==null) return null;
31-
return DatatypeConverter.parseHexBinary(s);
31+
return DatatypeConverter.parseHexBinary(s.trim());
3232
}
3333

3434
@Override

0 commit comments

Comments
 (0)