Skip to content

Empty Groovy file generating linkage errors on Object's finalize() method #2177

Closed

Description

@suztomo

A user reported that an empty Groovy file generates linkage errors.

Activity

  1. suztomo commented on Aug 11, 2021

    @suztomo
    ContributorAuthor

    The error is more easily reproducible by declaring org.codehaus.groovy:groovy-all:2.3.6.

    java.lang.Object's method finalize() is not accessible;
      referenced by 6 class files
        groovy.lang.GroovyLogTestCase (org.codehaus.groovy:groovy-all:2.3.6)
        groovy.util.GroovyShellTestCase (org.codehaus.groovy:groovy-all:2.3.6)
        groovy.util.JavadocAssertionTestSuite (org.codehaus.groovy:groovy-all:2.3.6)
        org.codehaus.groovy.tools.shell.CommandsMultiCompleter (org.codehaus.groovy:groovy-all:2.3.6)
    
    

    https://gist.github.com/suztomo/e351da7047bfb65505efb0fcb26b42b6

  2. suztomo commented on Aug 12, 2021

    @suztomo
    ContributorAuthor

    The class file of groovy.lang.GroovyLogTestCase does have a reference to finalize().

    https://gist.github.com/suztomo/018723de5f806c7f10f0aefff81a4373#file-gistfile1-txt-L387

    https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize-- shows protected void finalize() throws Throwable. Therefore it shouldn't be a problem to call it from any objects because all objects are subclasses of java.lang.Object. This is the same for the following methods shown in the output:

    • finalize()
    • clone()

    There are other references to JVM classes such as ClassLoader.addClass but these methods are not found in their Javadoc. So Linkage Checker is working correctly.

    Memo: branch object_methods

  3. changed the title [-]Empty Groovy file generating Linkage Error?[/-] [+]Empty Groovy file generating linkage errors on Objects' finalize()[/+] on Aug 12, 2021
  4. changed the title [-]Empty Groovy file generating linkage errors on Objects' finalize()[/-] [+]Empty Groovy file generating linkage errors on Object's finalize() method[/+] on Aug 12, 2021
  5. added 2 commits that reference this issue on Aug 12, 2021
    1ba46d2
    fa78897
  6. added a commit that references this issue on Aug 12, 2021
    61b2ab6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions