Author: tilman
Date: Sun Jan  4 08:29:06 2026
New Revision: 1931085

Log:
PDFBOX-5660: improve exception message, adjust test

Modified:
   
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java
   
pdfbox/branches/3.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java

Modified: 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java
==============================================================================
--- 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java
    Sun Jan  4 08:29:01 2026        (r1931084)
+++ 
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java
    Sun Jan  4 08:29:06 2026        (r1931085)
@@ -229,7 +229,7 @@ public final class TypeMapping
                IllegalAccessException | InvocationTargetException | 
SecurityException |
                NoSuchMethodException e)
         {
-            throw new IllegalArgumentException("Failed to instantiate " + 
clz.getSimpleName() + " property with value " + value, e);
+            throw new IllegalArgumentException("Failed to instantiate " + 
clz.getSimpleName() + " property with value '" + value + "'", e);
         }
     }
 

Modified: 
pdfbox/branches/3.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java
==============================================================================
--- 
pdfbox/branches/3.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java
        Sun Jan  4 08:29:01 2026        (r1931084)
+++ 
pdfbox/branches/3.0/xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java
        Sun Jan  4 08:29:06 2026        (r1931085)
@@ -1431,7 +1431,7 @@ class DomXmpParserTest
         final DomXmpParser xmpParser1 = new DomXmpParser();
         XmpParsingException ex = assertThrows(XmpParsingException.class,
                 () -> xmpParser1.parse(s.getBytes(StandardCharsets.UTF_8)));
-        assertEquals("Failed to instantiate DateType property with value 
2019-05-02T22:03:5Z in xmp:CreateDate", ex.getMessage());
+        assertEquals("Failed to instantiate DateType property with value 
'2019-05-02T22:03:5Z' in xmp:CreateDate", ex.getMessage());
     }
 
     @Test
@@ -1450,7 +1450,7 @@ class DomXmpParserTest
         final DomXmpParser xmpParser1 = new DomXmpParser();
         XmpParsingException ex = assertThrows(XmpParsingException.class,
                 () -> xmpParser1.parse(s.getBytes(StandardCharsets.UTF_8)));
-        assertEquals("Failed to instantiate DateType property with value 
2016-03-09T19:47:1Z in xap:CreateDate", ex.getMessage());
+        assertEquals("Failed to instantiate DateType property with value 
'2016-03-09T19:47:1Z' in xap:CreateDate", ex.getMessage());
     }
 
     @Test

Reply via email to