[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gtags bug: java annotations

From: Gordon Grimes
Subject: gtags bug: java annotations
Date: Tue, 8 Apr 2014 07:19:21 -0700


I’ve uncovered a problem with ‘gtags’ when parsing java that include “rich” annotations.

If you run gtags as described on the sample below you’ll see what I mean.






// gtags version: gtags (GNU GLOBAL) 6.2.11


// Shell command: 

// % gtags.exe  -v ; gtags.exe  -v --dump GTAGS | sort -k4n



public class myClass


    // simple annotation; this works as expected: 'doit1' is indexed



    public Something doit1()


            return new Something();



    // The addition of "=" in the annotation _expression_ confuses the parser

    // gtags indexes @myAnnotation, but not 'doit2'

    // (The parser wants to find a closing ";" .... see next)



    public Something doit2()


            return new Something();



    // adding a semicolon allows gtags to find 'doit3', but it still indexes @myAnnotation()

    // (of course we can’t simply add a “;” as the compiler will complain, but it demonstrates what

   //  gtags wants.)


    @myAnnotation(a=b) ;

    public Something doit3()


            return new Something();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]