Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8217512

Message of LinkageError: use 'class' etc. instead of 'type'

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 13
    • 13
    • hotspot
    • b05

    Description

      This change changes 'type' to 'class', 'interface' etc. in the following exception text:

      short:
      the field's defining type, pkg.Parent --> the field's defining class, pkg.Parent

      the full message:
      old:

      java.lang.LinkageError: loader constraint violation:
       when resolving field "_field1" of type pkg.Foo,
       the class loader pkg.ClassLoaderForChildGrandFoo @42b2e259 of the current class, pkg.Child,
       and the class loader pkg.ClassLoaderForParentFoo @4b55c90f for the field's defining type, pkg.Parent,
       have different Class objects for type pkg.Foo
       (pkg.Child is in unnamed module of loader pkg.ClassLoaderForChildGrandFoo @42b2e259, parent loader 'app';
        pkg.Parent is in unnamed module of loader pkg.ClassLoaderForParentFoo @4b55c90f, parent loader 'app')

      new:

      java.lang.LinkageError: loader constraint violation:
       when resolving field "_field1" of type pkg.Foo,
       the class loader pkg.ClassLoaderForChildGrandFoo @42b2e259 of the current class, pkg.Child,
       and the class loader pkg.ClassLoaderForParentFoo @4b55c90f for the field's defining class, pkg.Parent,
       have different Class objects for type pkg.Foo
       (pkg.Child is in unnamed module of loader pkg.ClassLoaderForChildGrandFoo @42b2e259, parent loader 'app';
        pkg.Parent is in unnamed module of loader pkg.ClassLoaderForParentFoo @4b55c90f, parent loader 'app')

      I think this makes the text better understandable: 'type' is used where the declared type of _field1
      is meant. 'class' is used whenever we address the "defining type", i.e. whenever the class that 'has' the
      field, is meant.

      Attachments

        Issue Links

          Activity

            People

              goetz Goetz Lindenmaier
              goetz Goetz Lindenmaier
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: