jansupol / jsonbapi

0 stars 0 forks source link

Java Bean with one field mark as a JsonbTransient and other field mark as JsonbProperty throws NPW #41

Closed jansupol closed 8 years ago

jansupol commented 8 years ago

In the RI the following mapping works OK.

public class JsonbTransientValue {

    @JsonbTransient
    private String transientProperty;

    public String getTransientProperty() {
        return transientProperty;
    }

    public void setTransientProperty(String transientProperty) {
        this.transientProperty = transientProperty;
    }
}

But, if another property is added like the class below:

public class JsonbTransientValue {

    @JsonbTransient
    private String transientProperty;

    private String property;

    public String getTransientProperty() {
        return transientProperty;
    }

    public void setTransientProperty(String transientProperty) {
        this.transientProperty = transientProperty;
    }

    public String getProperty() {
        return this.property;
    }

    public void setProperty(String property) {
        this.property = property;
    }
}

Test testJsonbTransientProperty at JsonbTransientTest throws NPE in LexicographicalOrderStrategy due to object2.getCustomization().getJsonWriteName() returns null because if the field is transient, jsonWriteName is never fill in PropertyModel:introspectCustomization.

jansupol commented 6 years ago
jansupol commented 8 years ago

@glassfishrobot Commented Reported by eddumelendez

jansupol commented 8 years ago

@glassfishrobot Commented roman.grigoriadi said: Bug did not appeared on current version, modified junit test according to bug input.

jansupol commented 8 years ago

@glassfishrobot Commented Was assigned to roman.grigoriadi

jansupol commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA JSONB_SPEC-41

jansupol commented 8 years ago

@glassfishrobot Commented Marked as fixed on Friday, July 1st 2016, 2:52:00 am