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

Invalid Javadoc can be generated from SBE xml files for > and < #826

Closed
RichardWarburton opened this issue Dec 16, 2020 · 2 comments
Closed

Comments

@RichardWarburton
Copy link
Contributor

SBE generates javadoc from description tags in SBE xml files. It converts HTML escaped < and > characters &lt; and &gt; into plaintext ones, which then generates invalid javadoc. If the escaped HTML characters were preserved then correct javadoc would be generated. Examples below:

SBE description tag
description="Price of this fill reason or allocation. Required if NoFills(1362) &gt; 0. Same as LastPx(31)"

Currently generated Javadoc
* @return PRICE9Decoder : Price of this fill reason or allocation. Required if NoFills(1362) > 0. Same as LastPx(31)

Javadoc tool error
/path/to/SomeFile.java:2594: error: bad use of '>' * @return PRICE9Encoder : Price of this fill reason or allocation. Required if NoFills(1362) > 0. Same as LastPx(31)

What I would expect for Javadoc
* @return PRICE9Decoder : Price of this fill reason or allocation. Required if NoFills(1362) &gt; 0. Same as LastPx(31)

@mjpt777
Copy link
Contributor

mjpt777 commented Dec 17, 2020

This can bring up a complex topic. How far do we go for all possible formatting in javadoc? Beyond escaping HTML characters there are the special characters in javadoc such as @ and all code formatting combinations. I've done the minimum for now.

@mjpt777 mjpt777 closed this as completed Dec 17, 2020
@RichardWarburton
Copy link
Contributor Author

Thanks Martin. I've just tested this and it works on my example. IMHO just the HTML escape characters is fine. The thing is that &lt and &gt are characters that people do use in SBE protocol documentation - the error was actually generated from an SBE xml file from CME for example. If you do something weird with code formatting - I think it's reasonably to punt that onto the maintainer of the file XML file to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants