You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (Created) (JIRA)" <ji...@apache.org> on 2012/03/16 11:41:43 UTC

[jira] [Created] (LUCENE-3877) Lucene should not call System.out.println

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


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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Michael McCandless (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231090#comment-13231090 ] 

Michael McCandless commented on LUCENE-3877:
--------------------------------------------

I think it's fine if tests write to the std streams, but not core Lucene code (lucene/core/src/java/*)?
                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Assigned] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Hoss Man (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man reassigned LUCENE-3877:
--------------------------------

    Assignee: Michael McCandless

Issue is marked 3.6 and actively being discussed but has no assignee - assigning to most active committer contributing patches/discussion so far to triage wether this can/should be pushed to 4.0 or not.
                
> 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
>            Assignee: Michael McCandless
>             Fix For: 3.6, 4.0
>
>         Attachments: IllegalSystemTest.java, IllegalSystemTest.java, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231272#comment-13231272 ] 

Robert Muir commented on LUCENE-3877:
-------------------------------------

IndexUpgrader is another example. I think if the args are invalid it should be printing to System.err ?
{code}
} else if ("-dir-impl".equals(arg)) {
  if (i == args.length - 1) {
    System.out.println("ERROR: missing value for -dir-impl option");
    System.exit(1);
  }
{code}
                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Greg Bowyer (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Bowyer updated LUCENE-3877:
--------------------------------

    Attachment: IllegalSystemTest.java
                IllegalSystemTest.java

I took a guess that one way would be to replace the System IO streams with ones that will throw exceptions.

It requires cglib, and might (due to the abuse of sun.reflect.Reflection to get the callee efficiently) be sun hotspot specific.

I guess this is not perfect, it would only error out if the code is called

If there is thought to this being a good thing I could look into how to wire it up to the unit-tests 
                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Greg Bowyer (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235090#comment-13235090 ] 

Greg Bowyer commented on LUCENE-3877:
-------------------------------------

Interesting I didnt look at PMD although that is more down to my personal dislike of code lint tools that do source code analysis

*shrugs* It was a fun distraction anyhow
                
> 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, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235422#comment-13235422 ] 

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

bq. I have seen it not work in the past for obscure reasons

Most likely the "reasons" were incorrect pointcut definitions? These can be tricky, I agree. Nonetheless, I've been using AspectJ for a long time and it always fits my needs and expectations. I'm not saying it doesn't have any bugs -- I'm sure it has. But the right tool for the right job; it took me about 5 mins to write and apply that aspect (with follow ups, I sent an e-mail to the mailing list, JIRA didn't work at the time).

I'm not advocating for any tool, really. To me aspectj is a fast tool for expressing where I want a given snippet of code to be injected (or what I want excluded) and for such tasks I don't see a faster or more pleasant to use alternative. Oh, I've been using asmlib too; extensively in fact; so it's not lack of knowledge about the tool itself.




                
> 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, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13237117#comment-13237117 ] 

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

I'd push it to 4.0 (automation in whatever form).
                
> 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
>            Assignee: Michael McCandless
>             Fix For: 3.6, 4.0
>
>         Attachments: IllegalSystemTest.java, IllegalSystemTest.java, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13237479#comment-13237479 ] 

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

No worries Greg, really. For 3.x I think manual check will do (or what I've done above with AspectJ). For 4.x it'd be nice to have findbugs lint anyway (for this and other issues). It'll most likely require some rules tuning too, so it can be a separate issue.
                
> 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
>            Assignee: Michael McCandless
>             Fix For: 4.0
>
>         Attachments: IllegalSystemTest.java, IllegalSystemTest.java, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235424#comment-13235424 ] 

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

My aspectj experiments from yesterday when JIRA was dead.

I applied that aspect just to see what happens.
{noformat}
ajc -sourceroots aspects \
   -inpath lucene-core-3.6-SNAPSHOT.jar \
   -d none \
   -cp aspectjrt.jar \
   -showWeaveInfo
{noformat}
Here's what I got:
{noformat}
Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.analysis.PorterStemmer'
(PorterStemmer.java:529) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.analysis.PorterStemmer'
(PorterStemmer.java:534) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.analysis.PorterStemmer'
(PorterStemmer.java:542) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:989)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:996)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1003)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1012)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1013)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1038)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1043)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1047)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1056)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1057)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1062)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1071)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1073)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1074)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1077)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1079)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1081)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1082)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.CheckIndex' (CheckIndex.java:1085)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:55)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:56)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:57)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:58)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:59)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:60)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:61)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:62)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:65)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:81)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:86)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.queryParser.FastCharStream'
(FastCharStream.java:102) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.queryParser.QueryParser'
(QueryParser.java:1159) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.queryParser.QueryParser'
(QueryParser.java:1165) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.queryParser.QueryParserTokenManager'
(QueryParserTokenManager.java:42) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.store.LockStressTest' (LockStressTest.java:37)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.store.LockStressTest' (LockStressTest.java:58)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.store.LockStressTest'
(LockStressTest.java:100) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.store.LockStressTest'
(LockStressTest.java:104) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.store.LockVerifyServer'
(LockVerifyServer.java:45) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.store.LockVerifyServer'
(LockVerifyServer.java:53) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.store.LockVerifyServer'
(LockVerifyServer.java:72) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.store.LockVerifyServer'
(LockVerifyServer.java:78) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.store.LockVerifyServer'
(LockVerifyServer.java:84) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:6)
{noformat}
Many of these are in static main methods and here's where
aspectj-based solution can be superior to handcoding; because we can
do this:
{code}
   pointcut ignored():
       withincode(public static void main(String[]));

   before(): within(org.apache.lucene..*) &&
             get(static PrintStream System.*) &&
             !ignored()
   {
       throw new RuntimeException("Attempted sysout/syserr/sysin access.");
   }
{code}
applied again:
{noformat}
Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:55)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:56)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:57)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:58)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:59)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:60)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:61)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:62)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.index.IndexUpgrader' (IndexUpgrader.java:65)
advised by before advice from 'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.queryParser.FastCharStream'
(FastCharStream.java:102) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:16)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.queryParser.QueryParserTokenManager'
(QueryParserTokenManager.java:42) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:16)
{noformat}
IndexUpgrader has a printUsage() method so we can exclude these by
name only (no access/ static restriction):
{code}
   pointcut ignored():
       withincode(public static void main(String[])) ||
       withincode(              void printUsage(..));
{code}
and then we're left with:
{noformat}
Join point 'field-get(java.io.PrintStream java.lang.System.err)' in
Type 'org.apache.lucene.queryParser.FastCharStream'
(FastCharStream.java:102) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:17)

Join point 'field-get(java.io.PrintStream java.lang.System.out)' in
Type 'org.apache.lucene.queryParser.QueryParserTokenManager'
(QueryParserTokenManager.java:42) advised by before advice from
'spikes.NoSysOuts' (NoSysOuts.aj:17)
{noformat}
and these are:
{code}
   } catch (IOException e) {
     System.err.println("Caught: " + e + "; ignoring.");
   }
{code}
and:
{code}
 /** Debug output. */
 public  java.io.PrintStream debugStream = System.out;
{code}
This is perhaps the worst cast as it assigns System.out to another
field and then uses that to call printlns.

Both of which can be excluded, of course. AspectJ is fun. It's a pity
it never gained more traction.
                
> 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, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Benson Margulies (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231098#comment-13231098 ] 

Benson Margulies commented on LUCENE-3877:
------------------------------------------

findbugs? checkstyle?
                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235428#comment-13235428 ] 

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

Oh, btw. I think a FindBugs rule for detecting sysouts/syserrs would be a great addition to FindBugs -- you should definitely file it as an improvement there. In reality at least class-level exclusions will be needed to avoid legitimate matches like the ones shown above (main methods, exception handlers), but these can be lived with.
                
> 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, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Greg Bowyer (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235196#comment-13235196 ] 

Greg Bowyer commented on LUCENE-3877:
-------------------------------------

Well would it sway the argument if I said that the ASM code near directly translates into a findbugs rule (I have done this before)

I was also not wanting to suggest findbug custom rules at the start because thats a bigger change in including an entire code lint tool (unless its included with lucene already, in which case forgive my stupidity I am still finding my way around)

Something doesn't fit right in my mind with the AspectJ approach, I have seen it not work in the past for obscure reasons and it feels that running the weaving in pretend to check the verbose output is not much further on from checking the source code in the first place.
                
> 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, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Greg Bowyer (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Bowyer updated LUCENE-3877:
--------------------------------

    Attachment: IllegalSystemTest.java

Helps if I upload the right version
                
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235087#comment-13235087 ] 

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

fyi. PMD has a rule for this -- SystemPrintln.
http://pmd.sourceforge.net/rules/index.html

Didn't check the details though.
                
> 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, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231053#comment-13231053 ] 

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

Lots of tests write to std streams currently (solr). We could do that fairly easily (in a number of ways) but it'll break a number of tests.
                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Greg Bowyer (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Bowyer updated LUCENE-3877:
--------------------------------

    Attachment:     (was: IllegalSystemTest.java)
    
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Greg Bowyer (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Greg Bowyer updated LUCENE-3877:
--------------------------------

    Attachment: SystemPrintCheck.java

ASM static test version that dislikes System.out / System.err
                
> 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, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Luca Cavanna (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231286#comment-13231286 ] 

Luca Cavanna commented on LUCENE-3877:
--------------------------------------

I feel guilty...maybe because I wrote that code :) yeah, that one should be System.err.
I thought at least the command line tool usage could be System.out, but that's already System.err for example in IndexUpgrader, so... looks like everything should be System.err. But that's the behaviour for command line tools. "Normal" classes shouldn't have System.err either I guess. Maybe we should mark command line tools as special classes in some way in order to give them more freedom?

                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Mark Miller (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231176#comment-13231176 ] 

Mark Miller commented on LUCENE-3877:
-------------------------------------

Don't we now fail if there is a noncommit in the src? Can't we use the same mechanism?
                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231263#comment-13231263 ] 

Robert Muir commented on LUCENE-3877:
-------------------------------------

Some core code legitimately uses System.out.println, e.g. CheckIndex.

However on review, some of its use cases should actually be System.err...
                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Michael McCandless (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231307#comment-13231307 ] 

Michael McCandless commented on LUCENE-3877:
--------------------------------------------

I removed the std prints in lucene/core/src/java that I could find on quick grepping.

I'll leave this open so we can somehow automatically catch this...

                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231095#comment-13231095 ] 

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

This is possible by verifying where System.out takes place at runtime via stack analysis. Alternatively a bytecode woven aspect. But at the same time it could also be a find-and-grep over sources? Comments would have to be removed in the pipeline prior to grepping for sysouts.

Checking all sysouts/syserrs and verifying stack traces there seems like an overkill compared to the above.
                
> 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
>
>
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Issue Comment Edited] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Greg Bowyer (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235065#comment-13235065 ] 

Greg Bowyer edited comment on LUCENE-3877 at 3/21/12 9:51 PM:
--------------------------------------------------------------

Thats a good point and started bugging me last night when I was thinking about it.

As as result attached is a static analysis version that will hate any GETSTATIC java/lang/System::(err|out) (I briefly looked at findbugs and did not find a working version for this idea) 

This one uses ASM 3.3

Its dumb output looks like 

/opt/sun-jdk-1.7.0/bin/java -classpath /tmp/test.jar:/tmp/out/production:/tmp/asm-all-3.2.jar SystemPrintCheck /tmp/test.jar

SystemPrintCheck$SystemOutMethodVisitor.visitMethodInsn @ SystemPrintCheck.java +42
SystemPrintCheck.main @ SystemPrintCheck.java +102

Process finished with exit code 1

                
      was (Author: gbowyer@fastmail.co.uk):
    Thats a good point and started bugging me last night when I was thinking about it.

As as result attached is a static analysis version that will hate any GETSTATIC java/lang/System::(err|out) (I briefly looked at findbugs and did not find a working version for this idea) 

This one uses ASM 3.3
                  
> 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, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Greg Bowyer (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235065#comment-13235065 ] 

Greg Bowyer commented on LUCENE-3877:
-------------------------------------

Thats a good point and started bugging me last night when I was thinking about it.

As as result attached is a static analysis version that will hate any GETSTATIC java/lang/System::(err|out) (I briefly looked at findbugs and did not find a working version for this idea) 

This one uses ASM 3.3
                
> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Greg Bowyer (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13237380#comment-13237380 ] 

Greg Bowyer commented on LUCENE-3877:
-------------------------------------

Yeah sorry I have been busy at work for a spell, I was going to craft it into a findbugs rule and see if I can get accepted into the findbugs project,

Just been a bit tied up thats all
                
> 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
>            Assignee: Michael McCandless
>             Fix For: 4.0
>
>         Attachments: IllegalSystemTest.java, IllegalSystemTest.java, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Dawid Weiss (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13235112#comment-13235112 ] 

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

I don't like PMD that much either, I'm just saying it seems to have it. If I were to choose though, I'd use aspectj rather than asm-based code. It just seems cleaner to me.
{code}
public aspect NoSysOuts {
    before(): within(org.apache.lucene..*) && 
              get(static PrintStream System.*) {
        throw new RuntimeException("Attempted sysout/syserr/sysin access.");
    }
}
{code}
You don't even need to run it, just weave with verbose output and see if the aspect matched 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, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (LUCENE-3877) Lucene should not call System.out.println

Posted by "Michael McCandless (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-3877:
---------------------------------------

    Fix Version/s:     (was: 3.6)
    
> 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
>            Assignee: Michael McCandless
>             Fix For: 4.0
>
>         Attachments: IllegalSystemTest.java, IllegalSystemTest.java, SystemPrintCheck.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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org