[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-serviceability-dev
Subject: Re: RFR: JDK-8164012: com/sun/jdi/CatchPatternTest.sh fails on jdk9/hs with Required output "Excepti
From: Staffan Larsen <staffan.larsen () oracle ! com>
Date: 2016-08-16 7:53:56
Message-ID: 249550CE-5EF4-42AE-BE26-3D2F19A14329 () oracle ! com
[Download RAW message or body]
Thanks David!
The matching logic is not that complicated (but it took me the better part of a day \
to figure all of this out.) The debugger sets a filter for which exceptions should be \
reported. Part of that filter includes a class reference. If the exception class \
IsInstanceOf() the class in the filter, the exception is reported to the debugger. \
When using patterns for matching, the debugger sets up such filters for all classes \
that match the pattern (this does sound a bit inefficient).
/Staffan
> On 15 aug. 2016, at 22:46, David Holmes <david.holmes@oracle.com> wrote:
>
> Hi Staffan,
>
> Looks good.
>
> Though I do wonder how the matching logic works such that the superclass is \
> considered. I suppose it is a "feature" to match on X and all subclasses of X, but \
> probably should be a way to match on exactly X not subclasses. Anyway just idle \
> thoughts. :)
> Thanks,
> David
>
> On 16/08/2016 4:15 AM, Staffan Larsen wrote:
> > All,
> >
> > Please review this fix for a test that starting failing after recent changes to \
> > java.lang.invoke.
> > The test instructs jdb to break on all exceptions matching "java.lang.I*" (that's \
> > a capital 'i'). The semantics of that operation actually means "break on all \
> > exceptions which have a class name or superclass name matching this string".
> > Some of the recent changes in java.lang.invoke now causes the code to throw \
> > numerous java.lang.NoSuchMethodErrors. This is a subclass of \
> > java.lang.IncompatibleClassChangeError, which matches "java.lang.I*".
> > The net result is that jdb will break on a lot more places (all the \
> > NoSuchMethodError exceptions) than the test expects and the test fails.
> > We can work around this in the test by changing this line:
> >
> > cmd catch all java.lang.I*
> >
> > to the following two lines:
> >
> > cmd catch all java.lang.Il*
> > cmd catch all java.lang.Ind*
> >
> > This will still match the exception types the test is looking for \
> > (IllegalArgumentException, IllegalMonitorStateException, and \
> > IndexOutOfBoundsException), but it will not match IncompatibleClassChangeError.
> > Thanks,
> > /Staffan
> >
> >
> > diff --git a/test/com/sun/jdi/CatchPatternTest.sh \
> > b/test/com/sun/jdi/CatchPatternTest.sh
> > --- a/test/com/sun/jdi/CatchPatternTest.sh
> > +++ b/test/com/sun/jdi/CatchPatternTest.sh
> > @@ -87,7 +87,12 @@
> > cmd stop in ${classname}.partTwo
> > runToBkpt
> > cmd ignore uncaught java.lang.Throwable
> > - cmd catch all java.lang.I*
> > + # Instead of matching java.lang.I* we use two more specific
> > + # patterns here. The reason is to avoid matching IncompatibleClassChangeError
> > + # (or the subclass NoSuchMethodError) thrown by the
> > + # java.lang.invoke infrastructure.
> > + cmd catch all java.lang.Il*
> > + cmd catch all java.lang.Ind*
> > cmd cont
> > cmd cont
> > cmd cont
> >
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic