<AWT Dev> RFR: [12] JDK-8196681: Java Access Bridge logging and debug flags dynamically controlled

Krishna Addepalli krishna.addepalli at oracle.com
Tue Dec 11 11:44:00 UTC 2018

Hi Sergey,

I understand about the UB, but currently just including <string> is causing this warning to appear, and there doesn't seem to be a way without doing irrelevant changes, so somewhat reluctantly I'm proposing plain C changes.

Regarding the questions:
1. Currently, we expect that the user provides us the file name with the path. The only correction we are doing is that, if there is no explicit mention of extension, we add ".log". We donot expect to read a path and create a file (if that is what you meant by handling the absent slash at the end of the path).
2. I made all the declarations auto. Here is the new webrev: http://cr.openjdk.java.net/~kaddepalli/8196681/webrev09


-----Original Message-----
From: Sergey Bylokhov 
Sent: Tuesday, December 11, 2018 2:37 AM
To: Krishna Addepalli <krishna.addepalli at oracle.com>; Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah at oracle.com>
Cc: Prasanta Sadhukhan <prasanta.sadhukhan at oracle.com>; awt-dev at openjdk.java.net
Subject: Re: <AWT Dev> RFR: [12] JDK-8196681: Java Access Bridge logging and debug flags dynamically controlled

Hi, Krishna.

On 10/12/2018 06:38, Krishna Addepalli wrote:
> The only way to avoid changes to make file is by using C string manipulation API.
> Here is the webrev: http://cr.openjdk.java.net/~kaddepalli/8196681/webrev08 , although I would personally prefer using the C++ api.

Throwing a c++ exception out of "extern C", when the method is called from the other language is UB, so we should not throw any exception and use c++, or use plain c.

Comment about the current version:
  - Do we handle the absent of the slash at the end of the path in "JAVA_ACCESSBRIDGE_LOGFILE"?
  - in some place you use auto and in another same situation you use "size_t", please unify.

Best regards, Sergey.

More information about the awt-dev mailing list