Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13411

Checkstyle suppression by annotation or comment

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0-alpha2
    • 2.9.0, 3.0.0-alpha2
    • None
    • None

    Description

      Suppress checkstyle audit events in a method or a section of code by annotation or comment. This can be achieved by checkstyle module SuppressWarningsFilter, SuppressionCommentFilter, and SuppressWithNearbyCommentFilter.

      Examples:

        @SuppressWarnings("checkstyle:parameternumber")
        // More than 7 parameters
        public Response putRoot(p1, p2, p3, p4, p5, p6, p7, p8)  {
          ...
        }
      
        // CHECKSTYLE:OFF:ParameterNumber
        // More than 7 parameters
        private Response put(p1, p2, p3, p4, p5, p6, p7, p8)  {
          ...
        }
        // CHECKSTYLE:ON:ParameterNumber
      
      private int [] array; // SUPPRESS CHECKSTYLE
      

      Attachments

        1. HADOOP-13411.001.patch
          2 kB
          John Zhuge

        Activity

          People

            jzhuge John Zhuge
            jzhuge John Zhuge
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: