Author: tilman
Date: Sun Nov 30 16:22:56 2025
New Revision: 1930143

Log:
PDFBOX-5660: improve exception message, refactor

Modified:
   
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java

Modified: 
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
==============================================================================
--- 
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
    Sun Nov 30 16:22:52 2025        (r1930142)
+++ 
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
    Sun Nov 30 16:22:56 2025        (r1930143)
@@ -618,11 +618,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());

Reply via email to