Menu

#4 Add method declaration line as class file attribute

open
Compiler (2)
5
2007-04-11
2007-04-11
No

A more elegant (and foolproof) way of implementing ReflectionUtilities.getSourceCodeLine() is to modify javac to write the line number of the method to a custom attribute. The getSourceCodeLine() method would then simply read the attribute.

This has the added benefit of eliminating the sourceCode parameter from getSourceCodeLine() and the eraseComments function from ReflectionUtilities.

Discussion


Log in to post a comment.