Author: tilman
Date: Fri Jun 27 19:06:46 2025
New Revision: 1926770
URL: http://svn.apache.org/viewvc?rev=1926770&view=rev
Log:
PDFBOX-6026: remove jdk8 code
Modified:
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/parser/DeserializationTest.java
Modified:
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/parser/DeserializationTest.java
URL:
http://svn.apache.org/viewvc/pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/parser/DeserializationTest.java?rev=1926770&r1=1926769&r2=1926770&view=diff
==============================================================================
---
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/parser/DeserializationTest.java
(original)
+++
pdfbox/branches/2.0/xmpbox/src/test/java/org/apache/xmpbox/parser/DeserializationTest.java
Fri Jun 27 19:06:46 2025
@@ -26,7 +26,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
-import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
@@ -357,8 +356,8 @@ class DeserializationTest
throws TransformerException, NoSuchAlgorithmException,
UnsupportedEncodingException
{
serializer.serialize(metadata, baos, true);
- String replaced =
baos.toString(StandardCharsets.UTF_8.displayName()).replace("\r\n", "\n");
- byte[] ba = replaced.getBytes(StandardCharsets.UTF_8);
+ String replaced = baos.toString("UTF-8").replace("\r\n", "\n");
+ byte[] ba = replaced.getBytes("UTF-8");
byte[] digest = MessageDigest.getInstance("SHA-256").digest(ba);
String result = new BigInteger(1, digest).toString();
assertEquals(expected, result);