Re: jde-usages and Java 1.5 Generics Syntax

"Suraj Acharya" <[email protected]>
Newsgroups gmane.emacs.jdee
Message-ID <[email protected]>
This is fixed in jde-usages CVS. (Yes, I know I should push out a new
release soon.)

I think the following defun should be enough to fix the problem, the old
function is based on regexps. We can use semantic instead now.

(defun jde-parse-get-class-at-point ()
 (mapconcat 'semantic-tag-name (semantic-find-tags-by-class 'type
(semantic-find-tag-by-overlay (point))) "."))


Suraj

On 4/14/06, [email protected] <[email protected]> wrote:
>
> Sorry, neglected to include this info in first message.
>
>     GNU Emacs 21.3.1
>     JDE 2.3.5.1
>     cedet 1.0pre3
>     ECB 2.32
>     jde-usages 0.9.1
>
> Thanks.
>
> --
> Chris Britton
> [email protected]
>
> -----Original Message-----
> From: Chris Britton
> Sent: Friday, April 14, 2006 12:14 PM
> To: [email protected]
> Subject: jde-usages and Java 1.5 Generics Syntax
>
> JDE and jde-usages are both great packages.  Thanks Paul, Suraj, et al,
> for all your hard work on these.
>
> jde-usages seems to work with a great deal of the Java 1.5 generics
> syntax.  For example, if the cursor is on the word "get" in the following
> program, I can use "JDEpi->jde-usages->Usages/Callers for->Method or field
> definition at point" to successfully display the caller tree for that
> method.
>
>     package test;
>
>     import java.util.Vector;
>
>     public class Test {
>
>         private Vector<Integer> get() { return new Vector<Integer>(); }
>
>         private void run() { Vector<Integer> foo = get(); }
>
>         public static void main(String[] args) {
>             Test test = new Test();
>             test.run();
>         }
>     }
>
> However, if I add a type to the class definition so that line reads:
>
>     public class Test<Integer> {
>
> I cannot display the caller tree for the get method.  Instead, I get the
> message:
>
>     Wrong type argument: stringp, nil
>
> The contents of the *Backtrace* buffer are included below.
>
> Is there anything I can do to persuade jde-usages (or semantic, or
> whatever) to work with this syntax?
>
> Thanks in advance for any info.
>
> --
> Chris Britton
> [email protected]
>
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   string-match("[^.]+$" nil)
>   jde-parse-get-unqualified-name(nil)
>   (equal tname (jde-parse-get-unqualified-name class))
>   (or (equal tname (jde-parse-get-unqualified-name class))
> (jde-usages-ends-with class (concat "$" tname)))
>   (if (or (equal tname ...) (jde-usages-ends-with class ...)) "<init>"
> tname)
>   (list tclass class (if (or ... ...) "<init>" tname) (when (eq tclass
> ...) (if ... nil ...)) (cond (... ...) (... nil) (t ...)))
>   (let ((ttype ...) (tclass ...) (tname ...) (tmodifiers ...)) (list
> tclass class (if ... "<init>" tname) (when ... ...) (cond ... ... ...)))
>   jde-usages-class-and-token-to-signature(nil ("get" function (:body (...)
> :type "Vector<Integer>" :typemodifiers ("private")) (reparse-symbol
> method_declaration) #<overlay from 76 to 139 in Test.java>))
>   (let ((nt ...)) (unless (member ... ...) (error "The cursor must be in a
> function or class variable to get the callers"))
> (jde-usages-class-and-token-to-signature (jde-usages-get-current-class)
> nt))
>   jde-usages-get-current-signature()
>   apply(jde-usages-get-current-signature nil)
>   (set --sig--90680 (apply (symbol-value --initial-signature-func--90679)
> nil))
>   (let ((--sig--90680 ...)) (set --sig--90680 (apply ... nil)) (let (...)
> (set --buf-name--90681 "*usages*") (let ... ... ...)))
>   (let ((--initial-signature-func--90679 ...)) (set
> --initial-signature-func--90679 (or initial-signature-func ...)) (let
> (...) (set --sig--90680 ...) (let ... ... ...)))
>   (progn (progn (set --G90606--90607 ...) (set --G90605--90608 ...) (set
> --G90604--90609 ...) (set --G90603--90610 ...)) (let (...) (set
> --initial-signature-func--90679 ...) (let ... ... ...)))
>   (let ((--G90606--90607 ...) (--G90605--90608 ...) (--G90604--90609 ...)
> (--G90603--90610 ...)) (progn (set --G90606--90607 nil) (set
> --G90605--90608 nil) (set --G90604--90609 nil) (set --G90603--90610 nil))
> (progn (progn ... ... ... ...) (let ... ... ...)))
>   (labels ((jde-usages-dct-goto-caller ... ...)
> (jde-usages-dct-tree-get-children-from-tree ... ...)
> (jde-usages-dct-caller-to-sig ... ...) (jde-usages-dct-tree-get-children
> ... ...)) (lexical-let* (... ... ... ... ...) (cond ... ... ...)))
>   jde-usages-display-call-tree(nil)
> * call-interactively(jde-usages-display-call-tree)
>
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.