After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 594391 - Fully-qualified Java annotations break parser
Fully-qualified Java annotations break parser
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.6.1
Other Windows
: Normal major
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2009-09-07 16:50 UTC by Moshe Z. Matitya
Modified: 2009-12-30 13:38 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Moshe Z. Matitya 2009-09-07 16:50:44 UTC
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].
Comment 1 Dimitri van Heesch 2009-09-08 19:33:33 UTC
Confirmed. 

If you want to fix it already look for

<FindMembers>"@"{ID}{BN}*"(" {

in scanner.l and replace it by

<FindMembers>"@"({ID}".")*{ID}{BN}*"(" {
Comment 2 Dimitri van Heesch 2009-12-30 13:38:55 UTC
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).