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

Fully-qualified Java annotations break parser (Origin: bugzilla #594391) #3508

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity major in component general for ---
Reported in version 1.6.1 on platform Other
Assigned to: Dimitri van Heesch

On 2009-09-07 16:50:44 +0000, Moshe Z. Matitya wrote:

The usage of fully qualified Java annotations causes Doxygen not to recognize class and method definitions.

In this example, a class is annotated with a fully qualified FindBugs @SuppressWarnings annotation:

/**
 * This is the Foo class.
 */
@edu.umd.cs.findbugs.annotations.SuppressWarnings ("HE_EQUALS_USE_HASHCODE")
public class Foo
{
    // ...
}

This is not recognized by Doxygen as a class. If the annotation is removed or commented out, then it is correctly recognized as a class.

In this example, a method is annotated with a fully qualified FindBugs @SuppressWarnings annotation:

    /**
     * This is the bar method.
     */
    @edu.umd.cs.findbugs.annotations.SuppressWarnings ("DLS_DEAD_LOCAL_STORE")
    public void bar()
    {
        // ...
    }

This is misinterpreted by Doxygen as a method named 'SuppressWarnings' with an argument list consisting of '"DLS_DEAD_LOCAL_STORE"' and a return type of '.umd.cs.findbugs.annotations.'. If the annotation is removed or commented out, then it is correctly recognized as a method named 'bar' with an empty argument list and a return type of 'void'.

Using just the annotation name without fully qualifying it is not an option for a workaround, since this would cause the FindBugs @SuppressWarnings annotation [edu.umd.cs.findbugs.annotations.SuppressWarnings] to conflict with the JDK @SuppressWarnings annotation [java.lang.SuppressWarnings].

On 2009-09-08 19:33:33 +0000, Dimitri van Heesch wrote:

Confirmed.

If you want to fix it already look for

"@"{ID}{BN}*"(" {

in scanner.l and replace it by

"@"({ID}"."){ID}{BN}"(" {

On 2009-12-30 13:38:55 +0000, Dimitri van Heesch wrote:

This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.6.2. Please verify if this is indeed the case and reopen the
bug if you think it is not fixed (include any additional information that you
think can be relevant).

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment