Author: tilman
Date: Sun Nov 30 16:22:48 2025
New Revision: 1930141
Log:
PDFBOX-5660: improve exception message, refactor
Modified:
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
Modified:
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
==============================================================================
---
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
Sun Nov 30 14:41:49 2025 (r1930140)
+++
pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
Sun Nov 30 16:22:48 2025 (r1930141)
@@ -627,11 +627,13 @@ public class DomXmpParser
// Instantiate abstract structured type with hint from first element
Element firstLiDescriptionElementChild =
liDescriptionElementChildren.get(0);
nsFinder.push(firstLiDescriptionElementChild);
- PropertyType ctype = checkPropertyDefinition(xmp,
DomHelper.getQName(firstLiDescriptionElementChild));
+ QName qName = DomHelper.getQName(firstLiDescriptionElementChild);
+ PropertyType ctype = checkPropertyDefinition(xmp, qName);
if (ctype == null)
{
- throw new XmpParsingException(ErrorType.NoType, "ctype is null,
first: " + firstLiDescriptionElementChild +
- ", DomHelper.getQName(first): " +
DomHelper.getQName(firstLiDescriptionElementChild));
+ // PDFBOX-5649
+ throw new XmpParsingException(ErrorType.NoType,
+ "Property '" + qName.getLocalPart() + "' not defined in "
+ qName.getNamespaceURI());
}
Types tt = ctype.type();
AbstractStructuredType ast = instanciateStructured(tm, tt,
descriptor.getLocalPart(), firstLiDescriptionElementChild.getNamespaceURI());