Skip to content

Commit 22d7dd3

Browse files
committed
PDFBOX-5660: improve exception message, adjust test
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1931084 13f79535-47bb-0310-9956-ffa450edef68
1 parent f3b9de4 commit 22d7dd3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

xmpbox/src/main/java/org/apache/xmpbox/type/TypeMapping.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public AbstractSimpleProperty instanciateSimpleProperty(String nsuri, String pre
208208
IllegalAccessException | InvocationTargetException | SecurityException |
209209
NoSuchMethodException e)
210210
{
211-
throw new IllegalArgumentException("Failed to instantiate " + clz.getSimpleName() + " property with value " + value, e);
211+
throw new IllegalArgumentException("Failed to instantiate " + clz.getSimpleName() + " property with value '" + value + "'", e);
212212
}
213213
}
214214

xmpbox/src/test/java/org/apache/xmpbox/xml/DomXmpParserTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ void testNoInstantiation() throws XmpParsingException
14271427
final DomXmpParser xmpParser1 = new DomXmpParser();
14281428
XmpParsingException ex = assertThrows(XmpParsingException.class,
14291429
() -> xmpParser1.parse(s.getBytes(StandardCharsets.UTF_8)));
1430-
assertEquals("Failed to instantiate DateType property with value 2019-05-02T22:03:5Z in xmp:CreateDate", ex.getMessage());
1430+
assertEquals("Failed to instantiate DateType property with value '2019-05-02T22:03:5Z' in xmp:CreateDate", ex.getMessage());
14311431
}
14321432

14331433
@Test
@@ -1446,7 +1446,7 @@ void testNoInstantiation2() throws XmpParsingException
14461446
final DomXmpParser xmpParser1 = new DomXmpParser();
14471447
XmpParsingException ex = assertThrows(XmpParsingException.class,
14481448
() -> xmpParser1.parse(s.getBytes(StandardCharsets.UTF_8)));
1449-
assertEquals("Failed to instantiate DateType property with value 2016-03-09T19:47:1Z in xap:CreateDate", ex.getMessage());
1449+
assertEquals("Failed to instantiate DateType property with value '2016-03-09T19:47:1Z' in xap:CreateDate", ex.getMessage());
14501450
}
14511451

14521452
@Test

0 commit comments

Comments
 (0)