This test case produces the error for trying to override a final method. In the Java Editor, there is a quick fix provided: "Remove 'final' modifier of 'Foo.meth'(..)"
@Test
public void testOverriding_FinalMethod1() {
runNegativeTest(new String[] {
"Bar.groovy",
"class Bar {\n" +
" final def getFinalProperty() {}\n" +
"}\n",
"Foo.groovy",
"class Foo extends Bar {\n" +
" def getFinalProperty() {}\n" +
"}\n",
},
"----------\n" +
"1. ERROR in Foo.groovy (at line 2)\n" +
"\tdef getFinalProperty() {}\n" +
"\t ^^^^^^^^^^^^^^^^\n" +
"Groovy:You are not allowed to override the final method getFinalProperty() from class 'Bar'.\n" +
"----------\n");
}
This test case produces the error for trying to override a final method. In the Java Editor, there is a quick fix provided: "Remove 'final' modifier of 'Foo.meth'(..)"