Author: tilman
Date: Mon Dec 29 13:57:08 2025
New Revision: 1930967

Log:
PDFBOX-5660: 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
    Mon Dec 29 13:57:00 2025        (r1930966)
+++ 
pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
    Mon Dec 29 13:57:08 2025        (r1930967)
@@ -672,7 +672,7 @@ public class DomXmpParser
         else
         {
             // PDFBOX-4325: assume it is structured
-            AbstractField af;
+            AbstractStructuredType af;
             try
             {
                 af = tm.instanciateStructuredType(type, 
descriptor.getLocalPart());
@@ -682,20 +682,16 @@ public class DomXmpParser
                 throw new XmpParsingException(ErrorType.InvalidType, "Parsing 
of structured type failed", ex);
             }
             loadAttributes(af, liElement);
-            if (af instanceof AbstractStructuredType)
+            PropertiesDescription pm;
+            if (type.isStructured())
             {
-                PropertiesDescription pm;
-                if (type.isStructured())
-                {
-                    pm = tm.getStructuredPropMapping(type);
-                }
-                else
-                {
-                    pm = 
tm.getDefinedDescriptionByNamespace(liElement.getNamespaceURI(), 
liElement.getLocalName());
-                }
-                af = tryParseAttributesAsProperties(tm, liElement, 
(AbstractStructuredType) af, pm, null);
+                pm = tm.getStructuredPropMapping(type);
             }
-            return af;
+            else
+            {
+                pm = 
tm.getDefinedDescriptionByNamespace(liElement.getNamespaceURI(), 
liElement.getLocalName());
+            }
+            return tryParseAttributesAsProperties(tm, liElement, af, pm, null);
         }
     }
 

Reply via email to