Skip to content

Javadoc: strange issue with @verbatim ... @endverbatim #8552

@Stewori

Description

@Stewori

Describe the bug
Processing Java code

/**
 * @verbatim {\f} @code @endverbatim
 */
public class Test {}

results in classTest.xml not being created. The same happens if we use @verbatim \f} @code @endverbatim. The pattern may be embedded into a larger doc; as soon as it is present, Doxygen won't create the class' xml file. It's like a cheat code to let Doxygen crash (with the crash limited to that particular file). Changing a tiny thing may or may not let it work again. E.g. we can insert text at various places, e.g. @verbatim {\f} blah @code blah @endverbatim and it still crashes. On the other hand, changing the f to a different letter, and it works again.

Expected behavior
I expect the xml output to be much the same as e.g. for @verbatim {\h} @code @endverbatim, just with f. Precisely, I expect classTest.xml to be created properly and have the following content:

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.9.2" xml:lang="en-US">
  <compounddef id="classTest" kind="class" language="Java" prot="public">
    <compoundname>Test</compoundname>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
<para><verbatim>{\f} blah @code blah </verbatim> </para>
    </detaileddescription>
    <location file="Test.java" line="4" column="7" bodyfile="Test.java" bodystart="4" bodyend="4"/>
    <listofallmembers>
    </listofallmembers>
  </compounddef>
</doxygen>

To Reproduce
Find a Java file and doxygen config attached. The issue is demonstrated like mentioned above.
After running doxygen on the example, the files in the subfolder xml contain the snippet shown above.

issue_Java_verbatim.zip

Version
Tested with doxygen clone from 2021-05-12:

/blah/doxygen/build/bin/doxygen -v
1.9.2 (cd998a7164e30cee896cccd190846b79ebb4355f)

lsb_release -a:

LSB Version:	core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID:	LinuxMint
Description:	Linux Mint 18 Sarah
Release:	18
Codename:	sarah

Additional context
I found the pattern because for a larger file with complex Javadoc Doxygen failed to create the corresponding xml file. I narrowed it down to the example presented here. I know it is somewhat unconventional to use the Doxygen-specific @verbatim ... @endverbatim in Javadoc, but as I understand it, that should be supported by Doxygen. I am using it to encapsulate certain html that would not be properly parsed by Doxygen or where custom classes would be stripped away. Later I can extract it from the verbatim node in xml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions