Question

I was wondering whether Eclipse supports some sort of identification (number or name) for TODO tags? Concretely I want to be able refer to other TODO's.

Example (freely invented example of why this would be useful and how it could work):

Original code

private int someInt;
[...]
public MyClass() {
    someInt = 0;
}

Edited code

// private int someInt; // TODO(1) discuss if really necessary
[...]
public MyClass() {
    // someInt = 0; >TODO(1)
}

Additionally it would be nice to assign people to TODO tags, to mark that TODO for a certain person.

Was it helpful?

Solution

No. But if you put the TODO tag into a JavaDoc comment, then you could easily use normal JavaDoc references to point to classes, members and methods, which should be enough to have a reference at all.

If you are now saying that you cannot refer to the 27th line of a method with that, right. Just extract the code of the 27th line into a new method and you can. :)

Regarding your second question: I recommend to not litter code with project management related information. Code becomes highly unreadable, if you add task assignments, all fixed bug numbers and other things into the code. That being said, if you really want to, you could easily define yourself a Java annotation type and mark arbitrary pieces of your code with those annotations. They might even have different optional fields for the person, the priority, or whatever else you imagine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top