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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1, 2.3.6
    • Fix Version/s: 2.3.7, 2.4.0-beta-3
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: