highsource / highsource/jaxb2-basics

Element with null parent

Open
#80 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
119
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Just wondering if this method of adding the property to the ClassInfo will construct a valid ElementProperty?

https://github.com/highsource/jaxb2-basics/blob/master/basic/src/main/java/org/jvnet/jaxb2_commons/plugin/simplify/SimplifyPlugin.java#L167

The source of `com.sun.tools.xjc.model.CClassInfo` suggests that one should call `addProperty` for it to be setup correctly. The `setParent` method on `CPropertyInfo` is package scoped and hence cannot be called outside.

```java
public void addProperty(CPropertyInfo prop) {
if(prop.ref().isEmpty())
// this property isn't contributing anything
// this happens when you try to map an empty sequence to a property
return;
prop.setParent(this);
properties.add(prop);
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.