Menu

#15 ReflectionUtilities.getSourceCodeLine is fragile

open
Cascade (5)
5
2007-08-07
2007-08-07
No

The getSourceCodeLine helper method in ReflectionUtilities works for the common case but may fail for certain method declarations. For example, it will return an incorrect value for empty methods written like this:

void method() {}

as well as one-line methods like this:

void method(int i) { return i * i; }

Other (pathological) styles of defining a method may also cause getSourceCodeLine to fail.

Discussion


Log in to post a comment.