[ 
https://issues.apache.org/jira/browse/GROOVY-8188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16016421#comment-16016421
 ] 

Jochen Theodorou commented on GROOVY-8188:
------------------------------------------

frankly I do not understand the javac behaviour here either. javac creates Foo 
returning bridge method if foo() in FooImpl is not final, but does not do it if 
is final. It does never create a bridge method for foo():FooImpl. Maybe that is 
actually a javac bug.... So let us look at a slightly different example:

{code:Java}
interface A<T> {
  T foo();
}
abstract class AI<X extends Number> implements A<X>{
   public X foo() {return null;}
}
public class Main extends AI<Integer> implements A<Integer>{
  public void bar() {
   Integer m = foo();
}
} 
{code}
In this example Java will not create a bridge method in Main. Now... the 
question is how to put that into logic... since A<Integer> is not A<X>, with X 
extends Number.


> Unpredictable behavior - Compiler error: groovyc: You are not allowed to 
> override the final method
> --------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-8188
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8188
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.11
>         Environment: Windows
>            Reporter: Abbas Gadhia
>         Attachments: groovyc.7z
>
>
> I'm trying to extend from an abstract class and override one of its abstract 
> methods. Another "final" concrete method of the same name exists in the 
> abstract class.
> When I compile, it complains that i cannot override the method marked as 
> final, however i've only overriden the abstract method, and not the "final" 
> one.
> This issue is sporadic. The error pops up and goes after several retries
> I've attached a simple project that reproduces this issue. The error may or 
> may not happen the first time. Tweaking the code here and there, gets the 
> issue to pop up
> Here's a sample of the error message
> bq. Error:Groovyc: You are not allowed to override the final method 
> copy(org.apache.calcite.plan.RelTraitSet -> 
> org.apache.calcite.plan.RelTraitSet,java.util.List -> java.util.List <E 
> extends java.lang.Object>) from class 'org.apache.calcite.rel.core.Join'.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to