jde-2.1.6beta21
"GNU Emacs 20.4.1 (i386-*-windows98.2222)
 of Thu Jul 15 1999 on gridlock"

but should be platform independent.

I spent an embarrasingly long time finding this one.  Setting up jde
with either debugger has so many details that it's easy to miss the
elephant in the refrigerator when something goes wrong.

Several debugger commands depend on knowing the class name via
jde-db-get-class which calls jde-parse-get-innermost-class-at-point.
This returns nil when it shouldn't for various valid source formats.

One problem is here:
 (class-re "^[ \t]*\\(public\\|abstract\\|final\\)*[ \t]+class[ \t]+\\([^ 
\t\n{]*\\).*")

The regexp requires a class definition to have whitespace somewhere on
the line before the "class" keyword.  I was testing debuggers with a
trivial class file:

class foo {
 ...
}

which is legal Java but not recognized by the regexp.

Here is a suggested replacement which also tightens the syntax by
requiring whitespace between the other keywords:

 (class-re "^[ \t]*\\(\\(public\\|abstract\\|final\\)[ \t]+\\)*[ \t]*class[ \t]+\\([^ 
\t\n{]*\\).*")

Only scanty testing, so coderead carefully if you adopt this.

A related issue is that functions that require a class name should be
bulletproofed so the user has a useful diagnosis when parse fails.
Perhaps something like this in jde-db jde-db-format-command:

         ((eq key ?c)
          (setq subst
            (concat (jde-db-get-package)                        
>>                  (or
                     (if insource
                         (jde-db-get-class)
                       (save-excursion
                         (set-buffer (gud-find-file (car frame)))
                         (jde-db-get-class)))
>>                   (signal 'error "Could not parse containing class name."))
                    )))

Steven M. Haflich <[EMAIL PROTECTED]>
Franz Inc., Berkeley CA

Reply via email to