RFR(S) 8227435: Perf::attach() should not throw a java.lang.Exception

David Holmes david.holmes at oracle.com
Thu Jul 18 05:26:05 UTC 2019

On 16/07/2019 9:42 pm, Langer, Christoph wrote:
> Hi Ralf,
> looks good. Prior to pushing you’ll have to take care of the copyright years in the files you touched ��
> cc-ing hotspot-runtime, because I think it affects this area, too.

tl;dr - looks fine. :)

I was in two minds about this. To me this is not an I/O error so the 
current use of Exception rather than IOException seemed more 
appropriate. But the Java code needs to match the VM code and tweaking 
the Java code to allow for the Exception would have a flow-on affect to 
the whole call chain. So overall treating this case as an IOException 
seems far simpler and not terribly wrong.


> Thanks
> Christoph
> From: serviceability-dev <serviceability-dev-bounces at openjdk.java.net> On Behalf Of Schmelter, Ralf
> Sent: Montag, 15. Juli 2019 10:10
> To: OpenJDK Serviceability <serviceability-dev at openjdk.java.net>
> Subject: [CAUTION] RFR(S) 8227435: Perf::attach() should not throw a java.lang.Exception
> Please review this small change. It changes the exception which will be thrown when the perf file has not yet the correct size. Instead of throwing the (not declared) java.lang.Exception, we will now throw java.io.IOException, which is expected by the calling code.
> webrev: http://cr.openjdk.java.net/~rschmelter/webrevs/8227435/webrev.0/
> bugreport: https://bugs.openjdk.java.net/browse/JDK-8227435
> Best regards,
> Ralf

More information about the hotspot-runtime-dev mailing list