Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34599

Static initializers not allowed to set final fields

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The following code causes the script security plugin to fail with an ExceptionInInitializerError:

      class C {
          private final static boolean initialized;
          static { initialized = true }
      }
      

      The attached patch file adds testcases to SandboxInterceptorTest that shows this failure (and that setting the field using a field initializer and setting a non-final field via a static initalizer works)

        Attachments

          Issue Links

            Activity

            magnusr Magnus Reftel created issue -
            rtyler R. Tyler Croy made changes -
            Field Original Value New Value
            Workflow JNJira [ 170760 ] JNJira + In-Review [ 184026 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 132 (Web Link)" [ 17238 ]
            jglick Jesse Glick made changes -
            Link This issue is duplicated by JENKINS-45446 [ JENKINS-45446 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "groovy-sandbox PR 33 (Web Link)" [ 17243 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "workflow-cps PR 157 (Web Link)" [ 17259 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-45629 [ JENKINS-45629 ]
            jglick Jesse Glick made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            john_fo John Forrest made changes -
            Link This issue relates to JENKINS-45483 [ JENKINS-45483 ]

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                magnusr Magnus Reftel
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: