[ 
https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234881#comment-13234881
 ] 

Dawid Weiss commented on LUCENE-3877:
-------------------------------------

You can just as well substitute your own implementation of PrintStream using 
System.setOut/setErr and check stacks on printlns... But I agree with Benson 
that a static analysis approach is much cleaner. Don't know if there's anything 
out of the box in findbugs/ pmd, but even if not then this can be done as a 
10-liner by applying an aspect to classes via aspectj and parsing the output 
logs detecting if an aspect has been applied (it shouldn't match anywhere). 
                
> Lucene should not call System.out.println
> -----------------------------------------
>
>                 Key: LUCENE-3877
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3877
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Michael McCandless
>             Fix For: 3.6, 4.0
>
>         Attachments: IllegalSystemTest.java, IllegalSystemTest.java
>
>
> We seem to have accumulated a few random sops...
> Eg, PairOutputs.java (oal.util.fst) and MultiDocValues.java, at least.
> Can we somehow detect (eg, have a test failure) if we accidentally leave 
> errant System.out.println's (leftover from debugging)...?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to