Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-13322

Enable checking for System.out references in Solr codebase

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: master (9.0)
    • Fix Version/s: master (9.0)
    • Component/s: Build
    • Labels:
      None

      Description

      This is almost trivial (just delete this line from the solr build.xml):

      <target name="-check-forbidden-sysout"/>

      What that line is doing is overriding the top level target that does the checking and makes it do nothing.

      BUT.... unfortunately the "almost" of this is that that instantly detects a large number of things, many of which are valid usages because they are in command line tools that really do want to report information to system out (I'll attach the output)

      This leaves us with two possibilities:

      1. Add @ SuppressForbidden (though there seem to be two of these)
      2. Convert the CLI oriented code to use logging (probably a custom logging config for this use case with no leading date stamp etc...)

      In the first case there's the additional question of whether or not we can suppress just the one bundle (jdk-system-out) or if we have to suppress all forbidden apis checks (which is a worrisome thought). 

      Also it's worth noting that a there are a couple of other detections relating to eclipse generated try/catch blocks that are triggered by removing the above line from the build.

      Conversation on Slack indicates that [~thetaphi] will likely have some thoughts on this.

        Attachments

        1. sysout-forbidden.txt
          25 kB
          Gus Heck
        2. SOLR-13322.patch
          278 kB
          Gus Heck

          Issue Links

          There are no Sub-Tasks for this issue.

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gus Gus Heck
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: