//TODO improvement: There is a tree field in the doc with the code in it. May be that can be used.
//Be aware that when no constructor is declared a default constructor is created including source code
SourcePosition start = method.position();
ClassDoc classDoc = method.containingClass();
int startline = start.line();
int endline = -1;
boolean foundMethod = false;
for (MethodDoc methoddoc: classDoc.methods()){
if (foundMethod){
endline = methoddoc.position().line();