Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JAXB compilation errors #196

Closed
gothub opened this issue Mar 1, 2019 · 1 comment
Closed

JAXB compilation errors #196

gothub opened this issue Mar 1, 2019 · 1 comment
Assignees
Milestone

Comments

@gothub
Copy link
Contributor

gothub commented Mar 1, 2019

The Java class 'models/Suite' uses the JAXB annotation @XmlCdata which instructs the unmarshaller to remove "CDATA" XML directives from XML elements before converting them to Java objects.

The @XmlCdata annotation is now obsolete and is causing compilation errors.

It will be necessary to use another method to remove 'CDATA' from XML elements, such as using the
@XmlJavaTypeAdapter annotation, which allows specifying a home grown marshaller/unmarshaller class.

@gothub gothub added this to the 2.0.2 milestone Mar 1, 2019
@gothub gothub self-assigned this Mar 1, 2019
@gothub gothub changed the title Compilation errors JAXB compilation errors Mar 1, 2019
@gothub
Copy link
Contributor Author

gothub commented Mar 20, 2019

The JAXB marshalling has been refactored to no longer use the '@XmlCdata' annotation. Instead, a '@XmlJavaTypeAdapter' annotation is used, so that CDATA blocks are added during marshalling and removed during unmarshalling.

The problem with JAXB annotations is that it is not possible to control the character escaping, so that during marshalling (java object -> xml), XML character escaping happens (e.g. '<' to '>'), which is not what we want for XML CDATA sections, and in our case, which hold source code for the quality check. To fix this, the entire document is XML 'unescaped' before outputting the quality report (e.g. to save to the db, to print to the screen during debugging).

fixed in commit 355091b

@gothub gothub closed this as completed Mar 20, 2019
gothub added a commit that referenced this issue Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant