Skip to main content

Code style for the generated files

3 replies [Last post]
kirillcool
Offline
Joined: 2004-11-17
Points: 0

If you compile the code produced by XJC in Eclipse 3.1M6 (with all warnings turned on, except "non-localized strings"), you will see quite a handful of messages.

There are javadoc problems (parameters missing, functions with no comments, malformed link references), unqualified access for return values, undocumented empty blocks, type safety issues in castings and unnecessary castings.

There are projects out there that regularly use tools like jlint, findbugs and pmd to scan their code repositories for problems. In this case, there is nothing to do short of changing the generated files.

You can see the attached screenshot of a generated file strewn with warning messages (20 messages for 105 generated lines).

https://jaxb-workshop.dev.java.net/files/documents/2861/13527/untitled.png

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kohsuke
Offline
Joined: 2003-06-09
Points: 0

We can fix easy ones (like wrong @link). If you could file an issue for this, that would be great.

kirillcool
Offline
Joined: 2004-11-17
Points: 0

Kohsuke,
What is the right project for reporting bugs on JAXB 2.0?

kohsuke
Offline
Joined: 2003-06-09
Points: 0

The 'jaxb' project.