261

When I used Eclipse to add unimplemented methods to a Java class to fix an error, methods were auto-generated and include // TODO Auto-generated method stub

Is there an easy way to view all methods which contain this comment? Some sort of menu option?

6 Answers 6

399

Is there an easy way to view all methods which contain this comment? Some sort of menu option?

Yes, choose one of the following:

  1. Go to Window → Show View → Tasks (Not TaskList). The new view will show up where the "Console" and "Problems" tabs are by default.

  2. As mentioned elsewhere, you can see them next to the scroll bar as little blue rectangles if you have the source file in question open.

  3. If you just want the // TODO Auto-generated method stub messages (rather than all // TODO messages) you should use the search function (Ctrl-F for ones in this file Search → Java Search → Search string for the ability to specify this workspace, that file, this project, etc.)

9
  • I opened that window, and nothing shows. Any hints as to why this could be?
    – KPrince36
    Jun 3, 2013 at 18:15
  • Yes. The project is open. All I see if the Find search bar, and an activate link. I was able to find the tasks under "Marker-> Java Task", but still no luck with that window.
    – KPrince36
    Jun 3, 2013 at 18:23
  • The "Task List" tab is open, but it's not showing anything. I'll just use the markers for now, and troubleshoot later. Thank you.
    – KPrince36
    Jun 3, 2013 at 18:32
  • 1
    but, but, "ignore the problem" goes against the code of the computer geek section 1.4.5.b-436
    – Andrew W
    Jun 3, 2013 at 18:33
  • 66
    I encountered the same problem mentioned here. The problem is that there are two view in the window menu, "Task List" and "Tasks". TODO tasks show in the "Tasks" view, not the "Task List" view.
    – Alex N.
    Oct 21, 2013 at 20:28
44

Go TO Window>Show View >Markers

than you will get java task .

java task have all TODOs of your project

1
  • 3
    I found this to be the best answer. Actual Eclipse "Tasks" seem to be linked to an external system. Oct 11, 2017 at 15:25
18

Tasks view, under Window -> Show View -> Tasks

15

Sometimes Window → Show View does not show the Tasks. Just go to Window → Show View -> Others and type Tasks in the dialog box.

2

In adition to the other answers mentioning the Tasks view:

It is also possible to filter the Tasks that are listed to only show the TODOs that contain the text // TODO Auto-generated method stub.

To achieve this you can click on the Filters... button in the top right of the Tasks View and define custom filters like this:

enter image description here

This way it's a bit easier and faster to find only some of the TODOs in the project in the Tasks View, and you don't have to search for the text in all files using the eclipse search tool (which can take quite some time).

0
  1. Push Ctrl+H
  2. Got to File Search tab
  3. Enter "// TODO Auto-generated method stub" in Containing Text field
  4. Enter "*.java" in Filename patterns field
  5. Select proper scope
3
  • 5
    Just curious, why is this answer downvoted so much? It solves the problem (altough not in the best way) and was posted at the same time as the accepted answer.
    – hamena314
    Aug 17, 2016 at 11:58
  • I think the reason is the answer was so obvious.
    – furkan
    May 31, 2017 at 11:09
  • It is being downvoted so that it can be deleted. It needs to be deleted because it is redundant. We don't need multiple answers saying essentially the same thing. And as you acknowledge, there are better ways to do this.
    – Stephen C
    May 19, 2019 at 12:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.