xrefdb/semantic overlay bug

vedm <[email protected]>
Newsgroups gmane.emacs.jdee
Message-ID <[email protected]>
If you have a java method taking an array argument in the form
"aMethod(String args[])" - instead of "aMethod(String[] args)" - then
the the function jde-xref-display-call-tree is confused and thinks that
the method takes an argument named "args[]" of type String, rather than
an argument named "args" of type String[], as it does in reality.

Therefore the call tree does not display a correct result.

Here is a simple test class:

=====================
package xref.tests;

public  class XrefTest {
    public static void main(String[] args) {
        new XrefTest().run(args);
    }
    public void run(String args[]) {
        System.out.println("Runing, argument:" + args[0]);
    }
}
=====================

If I build the xref db for the above class, put the cursor inside the
"run" method and invoke function jde-xref-display-call-tree, it shows
this:

[X] void xref.tests.XrefTest.run(String)

i.e. it tells me that the "run(String) method is not called at all -
which is to be expected, as there is no "run(String)" method in the
code: instead the method is "run(String[])";

You can see the root cause if you copy the following in your *scratch*
buffer and execute it, after putting the cursor in the "run" method:

===================
(let ((overlays (save-excursion
                  (set-buffer (get-buffer "XrefTest.java"))
                  (overlays-at (point)))))
  (print (overlay-get (car (cdr overlays)) 'semantic)))
===================

When I do this I see something like this in the minibuffer:

======
("run" function (:typemodifiers ("public") :arguments (("args[]"
variable (:type "String").... 
======

i.e the "semantic" overlay says that the run method takes an argument
named "args[]" of type "String", which is wrong.


-- 
vedm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.