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

Compile bug with @Synchronized("lockname") and undefined lockname

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.1, 2.3.6
    • 2.3.7, 2.4.0-beta-3
    • None
    • None

    Description

      When using @Synchronized('mylock'), but failing to declare mylock in class, compile fails with bug.

          import groovy.transform.*
      
          @CompileStatic
          class A {
              @Synchronized("mylock")
              void sync() {
              }
             
          }
      
          def a = new A()
      

      Typical error :

      BUG! exception in phase 'canonicalization' in source unit '/path/to/test.groovy' unexpected NullpointerException

      Attachments

        Activity

          People

            paulk Paul King
            ysb33r Schalk W. Cronjé
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: