RFR: [8218152] javac fails and exits with no error if a bad annotation processor is on the classpath
Jan Lahoda
jan.lahoda at oracle.com
Tue Apr 30 08:41:43 UTC 2019
Hi Steve, pushed to jdk/jdk:
http://hg.openjdk.java.net/jdk/jdk/rev/d9208a660094
Jan
On 26. 04. 19 10:44, Steve Groeger wrote:
> Hi Guys,
>
> Sorry to keep hassling you, but is there any chance we can get this
> change merged.
> I would like to get this merged before I propose a backport to JDK11 and
> JDK8.
>
> Thanks
> Steve Groeger
> IBM Runtime Technologies
> Hursley, Winchester
> Tel: (44) 1962 816911 Mobex: 279990 Mobile: 07718 517 129
> Fax (44) 1962 816800
> Lotus Notes: Steve Groeger/UK/IBM
> Internet: groeges at uk.ibm.com
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
> From: Steve Groeger <GROEGES at uk.ibm.com>
> To: Jan Lahoda <jan.lahoda at oracle.com>
> Cc: compiler-dev at openjdk.java.net
> Date: 18/04/2019 10:00
> Subject: Re: RFR: [8218152] javac fails and exits with no error if a bad
> annotation processor is on the classpath
> Sent by: "compiler-dev" <compiler-dev-bounces at openjdk.java.net>
> ------------------------------------------------------------------------
>
>
>
> Hi Jan & Jonathan,
>
> Thanks for saying the change now looks good.
> Any update on getting this sponsored and then merged?
> Once it is in the jdk repo I would like to go through the process of
> getting this into jdk8u.
>
> Thanks
> Steve Groeger
> IBM Runtime Technologies
> Hursley, Winchester
> Tel: (44) 1962 816911 Mobex: 279990 Mobile: 07718 517 129
> Fax (44) 1962 816800
> Lotus Notes: Steve Groeger/UK/IBM
> Internet: groeges at uk.ibm.com
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
> From: Jan Lahoda <jan.lahoda at oracle.com>
> To: Steve Groeger <GROEGES at uk.ibm.com>, Jonathan Gibbons
> <jonathan.gibbons at oracle.com>
> Cc: compiler-dev at openjdk.java.net
> Date: 12/04/2019 14:31
> Subject: Re: RFR: [8218152] javac fails and exits with no error if a bad
> annotation processor is on the classpath
> ------------------------------------------------------------------------
>
>
>
> On 12. 04. 19 12:37, Steve Groeger wrote:
>> Hi Jan,
>>
>> I didn't know that the
>> /home/jlahoda/src/jdk/jdk/test/langtools/tools/javac/diags/CheckExamples.java
>> test is effected by updates to the diagnostic messages. So thatnks for
>> letting me know. I ran this test and it did fail as you expected. Have
>> added the message to the
>> test/langtools/tools/javac/diags/examples.not-yet.txt files, as that was
>> where the others were.
>>
>> I can't run the tests via:
>> __https://wiki.openjdk.java.net/display/Build/Submit+Repo_as_I dont have
>> authority (i'm not a committer)
>> I have run the test/langtools tests with and without my chnages and the
>> test results are the same, so I can assume that my changes havent broken
>> anything.
>>
>> I made the similar changes on jdk8u to the examples.not-yet.txt file but
>> the CheckExamples.java fails anyway, even without my changes, but making
>> that chnage give it one less error.
>>
>> I have updated the webrevs for jdk [1] and for jdk8u [2]
>>
>> Will follow the jdk8u update process that you mentioned to get those
>> changes updated, but anything you can do for jdk would be great. Thanks
>>
>> [1] __http://cr.openjdk.java.net/~sgroeger/8218152/jdk/webrev.04/__
>
> I think this looks fine, thanks.
>
> Jon, do you want to take a look and/or sponsor the change, or should I?
>
> Thanks,
> Jan
>
>> [2] __http://cr.openjdk.java.net/~sgroeger/8218152/jdk8u/webrev.04/__
>>
>> Thanks
>> Steve Groeger
>> IBM Runtime Technologies
>> Hursley, Winchester
>> Tel: (44) 1962 816911 Mobex: 279990 Mobile: 07718 517 129
>> Fax (44) 1962 816800
>> Lotus Notes: Steve Groeger/UK/IBM
>> Internet: groeges at uk.ibm.com
>>
>> Unless stated otherwise above:
>> IBM United Kingdom Limited - Registered in England and Wales with number
>> 741598.
>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>>
>>
>>
>> From: Jan Lahoda <jan.lahoda at oracle.com>
>> To: Steve Groeger <GROEGES at uk.ibm.com>
>> Cc: compiler-dev at openjdk.java.net
>> Date: 10/04/2019 16:13
>> Subject: Re: RFR: [8218152] javac fails and exits with no error if a bad
>> annotation processor is on the classpath
>> ------------------------------------------------------------------------
>>
>>
>>
>> Hi Steve,
>>
>> One more question - do tests pass with this patch, at least the
>> test/langtools tests, or jdk/submit?
>> _https://wiki.openjdk.java.net/display/Build/Submit+Repo_
>>
>> (adding new diagnostic messages often need adjustments to
>> /home/jlahoda/src/jdk/jdk/test/langtools/tools/javac/diags/CheckExamples.java
>> )
>>
>> Regarding JDK 8 updates, please note there's a separate for that:
>> _https://wiki.openjdk.java.net/display/jdk8u/Main_
>>
>> Jan
>>
>> On 10. 04. 19 14:43, Steve Groeger wrote:
>>> Hi Jan,
>>>
>>> I have made the change to throw the same error as when we get the
>>> ServiceConfigurationError and removed the call the FatalError.
>>> I have created 2 new webrevs for jdk [1] and for jdk8u [2].
>>> Hopefully these are now OK and in a suitable state to be able to be
>>> re-reviewed and then merged.
>>> If there is anything else that is needed please do not hesitate to
>>> contact me.
>>>
>>> [1] __http://cr.openjdk.java.net/~sgroeger/8218152/jdk/webrev.03/__
>>> [2] __http://cr.openjdk.java.net/~sgroeger/8218152/jdk8u/webrev.03/__
>>>
>>> Thanks
>>> Steve Groeger
>>> IBM Runtime Technologies
>>> Hursley, Winchester
>>> Tel: (44) 1962 816911 Mobex: 279990 Mobile: 07718 517 129
>>> Fax (44) 1962 816800
>>> Lotus Notes: Steve Groeger/UK/IBM
>>> Internet: groeges at uk.ibm.com
>>>
>>> Unless stated otherwise above:
>>> IBM United Kingdom Limited - Registered in England and Wales with number
>>> 741598.
>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>>>
>>>
>>>
>>> From: Steve Groeger <GROEGES at uk.ibm.com>
>>> To: Jan Lahoda <jan.lahoda at oracle.com>
>>> Cc: compiler-dev at openjdk.java.net
>>> Date: 10/04/2019 10:59
>>> Subject: Re: RFR: [8218152] javac fails and exits with no error if a bad
>>> annotation processor is on the classpath
>>> Sent by: "compiler-dev" <compiler-dev-bounces at openjdk.java.net>
>>> ------------------------------------------------------------------------
>>>
>>>
>>>
>>> Hi Jan,
>>>
>>> Thanks for responding.
>>>
>>> I don't think you are missing anything with regards to the use of this:
>>>> public FatalError(JCDiagnostic d, Throwable t) {}
>>>
>>> I think that was me missing the fact this would cause NPE and mask the
>>> actual issue.
>>>
>>> I will probably go with your original suggestion:
>>>> Would there be an issue with simply changing the "catch
>>>> (Throwable)" to also report the same error as
>>>> "catch (ServiceConfigurationError)"?
>>>
>>> Will make these changes and generate some new webrevs for this and post
>>> again when they are available.
>>>
>>> Thanks
>>> Steve Groeger
>>> IBM Runtime Technologies
>>> Hursley, Winchester
>>> Tel: (44) 1962 816911 Mobex: 279990 Mobile: 07718 517 129
>>> Fax (44) 1962 816800
>>> Lotus Notes: Steve Groeger/UK/IBM
>>> Internet: groeges at uk.ibm.com
>>>
>>> Unless stated otherwise above:
>>> IBM United Kingdom Limited - Registered in England and Wales with number
>>> 741598.
>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>>>
>>>
>>>
>>> From: Jan Lahoda <jan.lahoda at oracle.com>
>>> To: Steve Groeger <GROEGES at uk.ibm.com>
>>> Cc: compiler-dev at openjdk.java.net, Jonathan Gibbons
>>> <jonathan.gibbons at oracle.com>
>>> Date: 10/04/2019 09:51
>>> Subject: Re: RFR: [8218152] javac fails and exits with no error if a bad
>>> annotation processor is on the classpath
>>> ------------------------------------------------------------------------
>>>
>>>
>>>
>>> Hi Steve,
>>>
>>> I apologize for a late reply. For the FatalError, seems that this
>>> constructor is being called there:
>>> public FatalError(JCDiagnostic d, Throwable t) {
>>> super(d.toString(), t);
>>> }
>>>
>>> with "d == null". That, I think, will lead to an immediate NPE, which I
>>> don't think is desirable, as it will hide the actual exception that was
>>> thrown. Or do I miss something?
>>>
>>> Thanks,
>>> Jan
>>>
>>> On 09. 04. 19 11:02, Steve Groeger wrote:
>>>> Hi Jan,
>>>>
>>>> I sent the post below about a month ago but didn't get a response from
>>>> you as to the review of the new webrevs.
>>>> Not sure whether you got it or not but I would be grateful if you could
>>>> take a look at these webrevs and let me know whether they are OK now.
>>>> If they are OK, please let me know the next steps needed to get these
>>>> merged into the code base.
>>>>
>>>> Thanks
>>>> Steve Groeger
>>>> IBM Runtime Technologies
>>>> Hursley, Winchester
>>>> Tel: (44) 1962 816911 Mobex: 279990 Mobile: 07718 517 129
>>>> Fax (44) 1962 816800
>>>> Lotus Notes: Steve Groeger/UK/IBM
>>>> Internet: groeges at uk.ibm.com
>>>>
>>>> Unless stated otherwise above:
>>>> IBM United Kingdom Limited - Registered in England and Wales with number
>>>> 741598.
>>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>>>>
>>>>
>>>>
>>>> From: Steve Groeger <GROEGES at uk.ibm.com>
>>>> To: Jan Lahoda <jan.lahoda at oracle.com>
>>>> Cc: compiler-dev at openjdk.java.net
>>>> Date: 07/03/2019 09:57
>>>> Subject: Re: RFR: [8218152] javac fails and exits with no error if a bad
>>>> annotation processor is on the classpath
>>>> Sent by: "compiler-dev" <compiler-dev-bounces at openjdk.java.net>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>>
>>>> Hi Jan,
>>>>
>>>> Thanks for providing a possible test for the malformed Annotation Processor.
>>>> I have taken the code you provided and tweaked it a bit (for jdk) and
>>>> had to
>>>> write a similar thing for jdk8u as some of the functionality in the test
>>>> is not
>>>> available in the same form in jdk8u (well, not that I could find!!!)
>>>>
>>>> I would be grateful if you could review to code in the new webrevs.
>>>> _
>>>> ____http://cr.openjdk.java.net/~sgroeger/8218152/jdk/webrev.02/____
>>>> ____http://cr.openjdk.java.net/~sgroeger/8218152/jdk8u/webrev.02/___
>>>>
>>>> Any issues please let me know.
>>>>
>>>> PS. I left the FatalErorr in JavacProcessingEnvironment.javaas we
>>>> wanted Jon to comment on whether this is what is required or whether
>>>> we go with your previous suggestion.
>>>>
>>>> Thanks
>>>> Steve Groeger
>>>> IBM Runtime Technologies
>>>> Hursley, Winchester
>>>> Tel: (44) 1962 816911 Mobex: 279990 Mobile: 07718 517 129
>>>> Fax (44) 1962 816800
>>>> Lotus Notes: Steve Groeger/UK/IBM
>>>> Internet: groeges at uk.ibm.com
>>>>
>>>> Unless stated otherwise above:
>>>> IBM United Kingdom Limited - Registered in England and Wales with number
>>>> 741598.
>>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>>>> Unless stated otherwise above:
>>>> IBM United Kingdom Limited - Registered in England and Wales with number
>>>> 741598.
>>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>>>>
>>>>
>>>> Unless stated otherwise above:
>>>> IBM United Kingdom Limited - Registered in England and Wales with number
>>>> 741598.
>>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>>>
>>>
>>>
>>>
>>> Unless stated otherwise above:
>>> IBM United Kingdom Limited - Registered in England and Wales with number
>>> 741598.
>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>>>
>>>
>>> Unless stated otherwise above:
>>> IBM United Kingdom Limited - Registered in England and Wales with number
>>> 741598.
>>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>>
>>
>>
>>
>> Unless stated otherwise above:
>> IBM United Kingdom Limited - Registered in England and Wales with number
>> 741598.
>> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with number
> 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
More information about the compiler-dev
mailing list