Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-10842

Some loggers not declared static final

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.98.1, 0.96.1.1
    • Fix Version/s: 0.99.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In a few of source files, the logger is defined as

      private final Log LOG = LogFactory.getLog(MyClass.class);
      

      This should be changed to static final.

      One question is about the following declaration:

      private final Log LOG = LogFactory.getLog(this.getClass());
      

      In this form, the logger can be shared by derived classes. But one will get NPE when logging in methods that are invoked inside the constructors.

        Attachments

        1. HBASE-10842.patch
          7 kB
          Richard Ding
        2. HBASE-10842.patch
          6 kB
          Richard Ding

          Activity

            People

            • Assignee:
              rding Richard Ding
              Reporter:
              rding Richard Ding
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: