Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.8.8, 2.0.4
-
Fix Version/s: None
-
Component/s: Compiler
-
Labels:None
-
Environment:HideEclipse 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.6ShowEclipse 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
-
Number of attachments :
Description
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:
/* (non-Javadoc) * @see java.lang.Object#finalize() */ @Override protected void finalize() throws Throwable { // Some behavior... super.finalize(); }
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.
Issue Links
- is duplicated by
-
GROOVY-5993
Compiler fails on valid override of Object#finalize(), incorrectly reporting vsibility
-
Screenshot of problem. The screen is showing the location where the probem shows up, and the error in the Problems view. This has occured sometime in the last hour or so as I haev been editing and updating the code. This included creating a new class file