RFR(S): 8217512: Message of LinkageError: use 'class' etc. instead of 'type'

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Tue Jan 22 13:01:26 UTC 2019


Hi David, 

thanks for looking at this.

> That detail wasn't clear from the bug report. :)
I made the bug report more precise.

I grepped all test for substrings of the message, also I 
ran it through our nighty tests which executes most
of jdk and hotspot jtreg tests, but could not find
any other tests.

Best regards,
  Goetz.



> -----Original Message-----
> From: David Holmes <david.holmes at oracle.com>
> Sent: Dienstag, 22. Januar 2019 13:14
> To: Lindenmaier, Goetz <goetz.lindenmaier at sap.com>; hotspot-runtime-
> dev at openjdk.java.net
> Subject: Re: RFR(S): 8217512: Message of LinkageError: use 'class' etc. instead
> of 'type'
> 
> Hi Goetz,
> 
> On 22/01/2019 9:59 pm, Lindenmaier, Goetz wrote:
> > Hi,
> >
> > I would like to change 'type' to 'class' in the following exception text:
> > (class will be replaced by 'interface' ... etc depending on the actual type).
> 
> That detail wasn't clear from the bug report. :)
> 
> Replacing "type" with the actual type seems fine. I'm a little surprised
> only one test needs adjusting though.
> 
> Thanks,
> David
> 
> > 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. the
> class that 'has' the
> > field, is meant.
> >
> > Please review:
> > http://cr.openjdk.java.net/~goetz/wr19/8217512-LinkageE_tiny/01/
> >
> > Best regards,
> >    Goetz.
> >


More information about the hotspot-runtime-dev mailing list