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

groovyc doesn't check final method / class overrides

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-4
    • 1.0-JSR-2
    • None
    • Debian(unstable) linux(2.4.22) on PC(Intel P4)
      Sun JRE 1.4.2

    Description

      If a groovy class overrides a final method then groovyc will compile it fine, but the .class file generated will be invalid: -

      Base.java
      public class Base {
      final int getCount()

      { return 1; }

      }

      MyBase.groovy
      class MyBase extends Base {
      int getCount()

      { return 2; }

      }

      These will both compile with groovyc without error. It's only when you try to compile: -

      MyBaseTest.groovy
      class MyBaseTest extends GroovyTestCase {
      void testBasic()

      { b = new MyBase() assert b.count == 2 }

      }

      ... that groovyc throws a MissingClassException. Running javap on MyBase.class fails (it exposes a bug in javap that I think only happens for invalid class files).

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              jimdowning Jim Downing
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: