[ 
https://issues.apache.org/jira/browse/GROOVY-5992?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Pascal Schumacher updated GROOVY-5992:
--------------------------------------
    Affects Version/s:     (was: 2.4.0-rc-1)
                       2.4.5

> Compiler report finalize() override declaration as error
> --------------------------------------------------------
>
>                 Key: GROOVY-5992
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5992
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 1.8.8, 2.0.4, 2.4.5
>         Environment: Eclipse 3.6 SR2, Mac OS X 10.6.8, Mac Java  version 
> "1.6.0_31" (Java(TM) SE Runtime Environment (build 1.6.0_31-b04-415-10M3635), 
> Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01-415, mixed mode)
> The error also occurs under Windows 7 with Oracle Java 1.6
>            Reporter: Paul Bennett
>         Attachments: FinalizeProblem.zip, screenshot-1.jpg
>
>
> Under indeterminate conditions, but often on:
> * Eclipse start-up
> * code edit
> * class creation,
> with auto-build enabled, the compiler reports that an override of the 
> protected method _finalize()_ on Object declared:
> {code}
> /* (non-Javadoc)
>  * @see java.lang.Object#finalize()
>  */
> @Override
> protected void finalize() throws Throwable {
>         // Some behavior...
>       super.finalize();
> }
> {code}
> is incorrectly declared, and should be declared public to match that declared 
> on Object. That declaration (on Object) is declared as *protected*, not 
> *public* (as implied by the error message), showing that the compiler is 
> incorrect, not the code. Also, the error is reported on an unrelated script 
> file in the project, not the location where it was found.
> I have tried to reproduce in a small project, to no success. The zip of this 
> is attached, and reproduces the inheritance and implementation hierarchy of 
> the original.
> The error can be resolved my commenting out the overriding definition, 
> cleaning and rebuilding. The error then goes away, and restoring the 
> overriding definition (by e.g. restoring from a VC system) does *NOT* make 
> the error re-appear.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to