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 307685 - bug in the treatment of java generics
bug in the treatment of java generics
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.4.x
Other All
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2005-06-14 21:45 UTC by Hans Horn
Modified: 2009-02-08 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
zip file containing test.java, the cfg file used, a log of the doxygen run and three html files produced (18.04 KB, application/x-zip-compressed)
2005-06-14 21:47 UTC, Hans Horn
Details
Test case for Java generics type parameters. (746 bytes, application/zip)
2008-10-24 12:14 UTC, RLV-J
Details

Description Hans Horn 2005-06-14 21:45:08 UTC
There is a bug in the treatment of java generics. This happens with 1.4.2 as 
well as with 1.4.3 (didn't try other versions).

the following java code (test1) produces no member/function doc at all, 
while test2 does.
test3 still produces no docs, but emits a non-sensical warning at line 43:
C:/Projects/test/test.java:43: Warning: documented function `test3::Map' was 
not defined.

test3 is a stripped down version of some real world java code.
It has been stripped down as much as possible. Further stripping makes the 
warning go away!

 1  import java.util.*;
 2
 3  public class test1 {
 4    private Map<String,ArrayList<String>> hash;
 5    public void clear () {
 6      hash.clear();
 7    }
 8  }
 9
10  class test2 {
11   private Map<String,Object> hash;
12   public void clear () {
13     hash.clear();
14   }
15 }
16
17 class test3 {
18   private Map<String,ArrayList<String>> hash = new 
HashMap<String,ArrayList<String>>();
19
20   private String     tag;
21
22   public void parseFile (String fileName) throws Exception {
23     BufferedReader in = new BufferedReader(new FileReader(fileName));
24     String line;
25     while ((line = in.readLine()) != null) {
26       if (line.length() > 0 && !line.startsWith("#")) {
27         int bra = line.indexOf("<"), ket = line.indexOf(">");
28         if (bra >= 0 && ket > 0 && bra < ket) {
29           tag = line.substring(bra+1, ket);
30         }
31       }
32     }
33     in.close();
34   }
35
36   private void update (String param) {
37     ArrayList<String> list = hash.get(tag);
38     if (list == null) hash.put(tag, list = new ArrayList<String>());
39     if (param != null && param.length() > 0) list.add(param);
40   }
41
42   public boolean hasParam (String aTag) {
43     ArrayList<String> list = hash.get(aTag);
44     return (list != null && list.size() > 0);
45   }
46 }

I'll attach a zip file containing test.java, the cfg file used, a log of 
the doxygen run and three html files produced.
Comment 1 Hans Horn 2005-06-14 21:47:55 UTC
Created attachment 47769 [details]
zip file containing test.java, the cfg file used, a log of the doxygen run and three html files produced
Comment 2 Dimitri van Heesch 2005-06-18 16:20:59 UTC
Support for java generics has not been explicitly added, so it is not too
strange if something is not yet working. I guess it now somewhat works because
it looks a lot like C++ templates.
Comment 3 RLV-J 2008-10-24 12:14:26 UTC
Created attachment 121263 [details]
Test case for Java generics type parameters.
Comment 4 Dimitri van Heesch 2009-02-08 16:17:31 UTC
I've tried both example with doxygen 1.5.8, but didn't see any problems anymore.
So I'm closing this bug report. Please reopen it if you can attach a related example that does not work with the latest release.