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

Unable to access static interface fields from classes annotated with @CompileStatic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.1.3
    • 2.1.4
    • Static compilation
    • None
    • Oracle JDK 1.6u43
      Linux OpenSUSE 12.2 x86_64
      Groovy 2.1.3

    Description

      Any class that extends a class that implements an interface with a final static field cannot access it.

      Example:

      import java.awt.*;
      import javax.swing.*;
      
      import groovy.transform.*;
      
      @CompileStatic
      class MyFrame extends JFrame {
          MyFrame() {
              super("My Frame");
              defaultCloseOperation = DISPOSE_ON_CLOSE;
              preferredSize = new Dimension(800, 600);
              pack();
              locationRelativeTo = null;
          }
      }
      
      EventQueue.invokeLater {
          new MyFrame().visible = true;
      }
      

      Attachments

        1. csbug.groovy
          0.4 kB
          Dmitry Ovchinnikov

        Activity

          People

            melix Cédric Champeau
            dmovchinn Dmitry Ovchinnikov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: