Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6.3
-
None
-
All
-
Patch
Description
I'm trying to read the source code out of a SourceUnit. The API has this method declared:
org.codehaus.groovy.control.io.ReaderSource.getLine( int lineNumber, Janitor janitor );
Which is implemented in AbstractReaderSource.
The API/doc says that Janitor is optional, and the code does let you pass a null.
However, if you do pass a null janitor then the function always returns null.
The method is trying to return a field named 'line', but if the janitor is null then cleanup() is called, and line is set to null, so the method always returns null.
I'll submit a patch myself in the next few days. It is easy to write a test for.