Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I debug generic methods in Eclipse?

I'm in a generic method, debugging, but i get no information about variables, can't execute statements using ctrl-shift-i, eclipse tells the that the method ... isn't available on the type T.

I can't believe it's meant to (not) work like this ...

[edit]

I'm using the eclipse that's part of RAD 7.5.4

[another edit]

Here's some code but I doubt you'll get any info from this

   public abstract class GenericGroupController<T extends Group> {
   ...

    public String addUser(final Model model, final Long id, final WebRequest request) {

        T group = groupManager.loadGroup(id);

        ...
        // this method will fail if i highlight and click ctr-shift-i
        // but it will work otherwise (actually so will the method above
        // because that's generic as well)
        Long groupId =  group.getId(); 
        ...

        return getAddUserView();
    }

}
like image 266
blank Avatar asked Nov 13 '22 20:11

blank


1 Answers

If you are able to debug, as in see a stack trace, you can always see the variables in the variables window if not in the code. A lot of places where the code isn't available you can do the same. It isn't nice, but, it gets the job done.

like image 193
Farhan Syed Avatar answered Dec 10 '22 04:12

Farhan Syed