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

Uwe Schindler commented on SOLR-8330:
-------------------------------------

Hi for the other changes: All fixes are quite easy:
1) maybe we should remove loggers from interfaces, without any static methods 
(in Java 7 there cannot be any), it makes no sense to have them. So put them 
into the impl class
2) The non-nested classes are an anti-pattern from earlier Java 1.0 days. We 
should simply remove them (move the parallel class as static inner class into 
the main class). I did this several times whenever I saw them. Those constructs 
generally have the problem that it does not work with incremental compile 
(javac fails to compile incrementally when you change source files, because it 
cannot corelate the class files to source files). So we should fix them.
3) The tests can get a fake logger or let's exclude them. There is also the 
CheckLoggingConfiguration in servlet package. This should be excluded from 
checks (which is quite easy to do).

If this is fixed we are fine.

> Restrict logger visibility throughout the codebase to private so that only 
> the file that declares it can use it
> ---------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-8330
>                 URL: https://issues.apache.org/jira/browse/SOLR-8330
>             Project: Solr
>          Issue Type: Sub-task
>    Affects Versions: Trunk
>            Reporter: Jason Gerlowski
>            Assignee: Anshum Gupta
>              Labels: logging
>             Fix For: Trunk
>
>         Attachments: SOLR-8330-detector.patch, SOLR-8330-detector.patch, 
> SOLR-8330.patch, SOLR-8330.patch, SOLR-8330.patch, SOLR-8330.patch, 
> SOLR-8330.patch
>
>
> As Mike Drob pointed out in Solr-8324, many loggers in Solr are 
> unintentionally shared between classes.  Many instances of this are caused by 
> overzealous copy-paste.  This can make debugging tougher, as messages appear 
> to come from an incorrect location.
> As discussed in the comments on SOLR-8324, there also might be legitimate 
> reasons for sharing loggers between classes.  Where any ambiguity exists, 
> these instances shouldn't be touched.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to