Doxygen: 1.8.15 regression with C# internal modifier

Created on 7 Jan 2019  路  6Comments  路  Source: doxygen/doxygen

I've noticed a regression with how the C# internal modifier is processed in Doxygen 1.8.15. I've attached a minimal reproduction case along with the xml generated from 1.8.14 and 1.8.15. Both use the same config file (can be found in the attached zip).

TL;DR - Internal is now parsed as prot=public rather than prot=package (for compounddef at least)

Example

namespace DoxygenBugRepro
{
    internal class InternalThings
    {
        public static void DoNothing()
        {
        }
    }
}

The regression can be seen the 3rd line of the XML output. In 1.8.14 the prot attribute is set to package, in 1.8.15 the prot attribute is set to public.

Doxygen 1.8.14 XML

<?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.8.14">
  <compounddef id="class_doxygen_bug_repro_1_1_internal_things" kind="class" language="C#" prot="package">
    <compoundname>DoxygenBugRepro::InternalThings</compoundname>
      <sectiondef kind="public-static-func">
      <memberdef kind="function" id="class_doxygen_bug_repro_1_1_internal_things_1a82bd9de60a549b042e5def0cacd288f4" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>static void DoxygenBugRepro.InternalThings.DoNothing</definition>
        <argsstring>()</argsstring>
        <name>DoNothing</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="DoxygenBugRepro/Class1.cs" line="5" column="1" bodyfile="DoxygenBugRepro/Class1.cs" bodystart="5" bodyend="7"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <location file="DoxygenBugRepro/Class1.cs" line="4" column="1" bodyfile="DoxygenBugRepro/Class1.cs" bodystart="3" bodyend="8"/>
    <listofallmembers>
      <member refid="class_doxygen_bug_repro_1_1_internal_things_1a82bd9de60a549b042e5def0cacd288f4" prot="public" virt="non-virtual"><scope>DoxygenBugRepro::InternalThings</scope><name>DoNothing</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>

Doxygen 1.8.15 XML

<?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.8.15">
  <compounddef id="class_doxygen_bug_repro_1_1_internal_things" kind="class" language="C#" prot="public">
    <compoundname>DoxygenBugRepro::InternalThings</compoundname>
      <sectiondef kind="public-static-func">
      <memberdef kind="function" id="class_doxygen_bug_repro_1_1_internal_things_1a82bd9de60a549b042e5def0cacd288f4" prot="public" static="yes" const="no" explicit="no" inline="yes" virt="non-virtual">
        <type>void</type>
        <definition>static void DoxygenBugRepro.InternalThings.DoNothing</definition>
        <argsstring>()</argsstring>
        <name>DoNothing</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="DoxygenBugRepro/Class1.cs" line="5" column="1" bodyfile="DoxygenBugRepro/Class1.cs" bodystart="5" bodyend="7"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <location file="DoxygenBugRepro/Class1.cs" line="4" column="1" bodyfile="DoxygenBugRepro/Class1.cs" bodystart="3" bodyend="8"/>
    <listofallmembers>
      <member refid="class_doxygen_bug_repro_1_1_internal_things_1a82bd9de60a549b042e5def0cacd288f4" prot="public" virt="non-virtual"><scope>DoxygenBugRepro::InternalThings</scope><name>DoNothing</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>
C# bug

All 6 comments

I think the current implementation is correct. In the ECMA-334 5th Edition December 2017 specification I see:

8.4.2 Namespace members
Namespaces and types that have no enclosing namespace are members of the global namespace. This corresponds directly to the names declared in the global declaration space.
Namespaces and types declared within a namespace are members of that namespace. This corresponds directly to the names declared in the declaration space of the namespace.
Namespaces have no access restrictions. It is not possible to declare private, protected, or internal namespaces, and namespace names are always publicly accessible.

So I don't think this is not a doxygen bug but usage / interpretation.

I think it is a case of interpretation :wink:, in my view:

internal class InternalThings is declared in a namespace and so is not in the global namespace.

It is not possible to declare private, protected, or internal namespaces, and namespace names are always publicly accessible.

To me a class != a namespace and so its perfectly valid to declare that a class is not publically acessible.


In any case, this change means that its not possible to discern whether a class is internal from the compounddef node and/or its children.

I think you might be right, I focused a bit to much now on the 'namespace'.

I've just pushed a proposed patch, pull request #6755

Code has been integrated in master on github.

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.8.16.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fakenmc picture fakenmc  路  4Comments

eseiler picture eseiler  路  3Comments

Alphastrick picture Alphastrick  路  6Comments

eseiler picture eseiler  路  3Comments

lrineau picture lrineau  路  7Comments