{"record":{"id":"ef120cdc95027d32","repo":"apache/maven","slug":"expected-an-xpp3dom-object-but-received-a","errorCode":null,"errorMessage":"Expected an Xpp3Dom object but received a {}: {}","messagePattern":"Expected an Xpp3Dom object but received a (.+?): (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/mdo/model-v3.vm","lineNumber":203,"sourceCode":"        return getDelegate().${pfx}${cap}() != null ? new Xpp3Dom(getDelegate().${pfx}${cap}(), this::replace) : null;\n      #else\n        return getDelegate().${pfx}${cap}();\n      #end\n    }\n\n    public void set${cap}(${type} ${field.name}) {\n      #if ($field.type == \"DOM\")\n        if (${field.name} instanceof Xpp3Dom xpp3Dom) {\n            if (!Objects.equals(xpp3Dom.getDom(), getDelegate().${pfx}${cap}())) {\n                update(getDelegate().with${cap}(xpp3Dom.getDom()));\n                xpp3Dom.setChildrenTracking(this::replace);\n            }\n        } else if (${field.name} == null) {\n            if (getDelegate().${pfx}${cap}() != null) {\n                update(getDelegate().with${cap}(null));\n            }\n        } else {\n            throw new IllegalArgumentException(\"Expected an Xpp3Dom object but received a \" + ${field.name}.getClass() + \": \" + ${field.name});\n        }\n      #elseif( $field.type == \"java.util.Properties\" )\n        LinkedHashMap<String, String> map = new LinkedHashMap<>();\n        ${field.name}.forEach((key, value) -> {\n            if (value != null) {\n                map.put(key.toString(), value.toString());\n            }\n        });\n        if (!Objects.equals(map, getDelegate().get${cap}())) {\n            update(getDelegate().with${cap}(map));\n        }\n      #elseif ( $field.to != \"String\" && $field.type == \"java.util.List\" && $field.multiplicity == \"*\" )\n        if (${field.name} == null) {\n            ${field.name} = Collections.emptyList();\n        }\n        if (!Objects.equals(${field.name}, ${pfx}${cap}())) {\n            update(getDelegate().with${cap}(\n                ${field.name}.stream().map(c -> c.getDelegate()).collect(Collectors.toList())));","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/src/mdo/model-v3.vm#L185-L221","documentation":"Error \"Expected an Xpp3Dom object but received a {}: {}\" thrown in apache/maven.","triggerScenarios":"Thrown at src/mdo/model-v3.vm:203 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}