Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7514

static final fields on trait aren't final

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.4
    • 2.4.8
    • None
    • None

    Description

      In order to work around the fact that @Slf4j doesn't work on traits, I declared an slf4j logger the traditional way:

      private static final Logger slf4j = LoggerFactory.getLogger(Auditing)
      

      However, the final keyword is ignored when the trait is applied to a class. From javap:

        private static org.slf4j.Logger com_artsquare_studio_audit_api_Auditing__slf4j;
        public static org.slf4j.Logger com_artsquare_studio_audit_api_Auditing__slf4j$get();
        public static org.slf4j.Logger com_artsquare_studio_audit_api_Auditing__slf4j$set(org.slf4j.Logger);
      

      Attachments

        Activity

          People

            paulk Paul King
            chrylis Christopher Smith
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: