Commons Logging
  1. Commons Logging
  2. LOGGING-64

Wrong sample code in org/apache/commons/logging/package.html (using static and this.class)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: 1.0.4
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      In the org/apache/commons/logging/package.html file, there is sample code:

      public class Foo

      { static Log log = LogFactory.getLog(this.class); ... }

      This code cannot be compiled because of using "static" and "this.class" in the
      same statement. Should be change to Foo.class.

        Activity

        Hide
        Mohan Kishore added a comment -

        In diff -u format:
        Index: package.html
        ===================================================================
        RCS file: /home/cvspublic/jakarta-
        commons/logging/src/java/org/apache/commons/logging/package.html,v
        retrieving revision 1.9
        diff -u -r1.9 package.html
        — package.html 30 Mar 2003 23:42:36 -0000 1.9
        +++ package.html 10 Apr 2003 04:24:47 -0000
        @@ -38,7 +38,7 @@

        public class Foo {

        • static Log log = LogFactory.getLog(this.class);
          + static Log log = LogFactory.getLog(Foo.class);

        public void foo() {
        ...

        Show
        Mohan Kishore added a comment - In diff -u format: Index: package.html =================================================================== RCS file: /home/cvspublic/jakarta- commons/logging/src/java/org/apache/commons/logging/package.html,v retrieving revision 1.9 diff -u -r1.9 package.html — package.html 30 Mar 2003 23:42:36 -0000 1.9 +++ package.html 10 Apr 2003 04:24:47 -0000 @@ -38,7 +38,7 @@ public class Foo { static Log log = LogFactory.getLog(this.class); + static Log log = LogFactory.getLog(Foo.class); public void foo() { ...
        Hide
        Craig McClanahan added a comment -

        Fixed in nightly build 20030817.

        Show
        Craig McClanahan added a comment - Fixed in nightly build 20030817.
        Hide
        Dennis Lundberg added a comment -
            • COM-982 has been marked as a duplicate of this bug. ***
        Show
        Dennis Lundberg added a comment - COM-982 has been marked as a duplicate of this bug. ***

          People

          • Assignee:
            Unassigned
            Reporter:
            Thai Ha
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development