<Swing Dev> [10] RFR JDK-6267105:UIDefaults.getUIError dumps error message to System.err and also throws Error.

Sergey Bylokhov sergey.bylokhov at oracle.com
Fri Jun 16 19:52:02 UTC 2017


Hi, Shashi.
Can you please clarify the purpose of this fix, because the bug states that the code prints traceback to the system.err, even if the user tries to catch/suppress an exception.
The current fix removed the system.err logging but the code which print trace still there:
    protected void getUIError(String msg) {
        try {
            throw new Error(msg);
        }
        catch (Throwable e) {
            e.printStackTrace();
        }
    }
>> Through catching the error, the user can perform necessary recovery actions without cluttering the system.err

I am not sure that the user is able to catch this error. So what is the difference when we had an additional message before and after the fix?

> 
> +1
> 
> --Semyon
> 
> 
> On 06/12/2017 03:54 AM, Shashidhara Veerabhadraiah wrote:
>> Hi All,
>> 	Please review the code bug fix for JDK-6267105:UIDefaults.getUIError dumps error message to System.err and also throws Error.
>> 
>> Issue:
>>      Error message was getting dumped to the system.err even though the recovery actions were performed leading to unnecessary confusion regarding the actual behavior.
>> 
>> Fix:
>>     This fix removes the call which prints the message to the system.err and stores the message in the Error class. This same message can be retrieved after we catch the error and calling getMessage() of the Error class. Through catching the error, the user can perform necessary recovery actions without cluttering the system.err. This fix does not modifies the 'user effect' as the user would still get the same error as they were getting before this fix.
>> 
>> Test:
>>     Now the system.err does not get cluttered though we performed the necessary recovery actions. The error message string can be recovered by calling getMessage() if needed.
>>    Bug:
>> https://bugs.openjdk.java.net/browse/JDK-6267105
>> 
>> Webrev:
>> http://cr.openjdk.java.net/~aghaisas/shashi/6267105/webrev_00/
>> 
>> Thanks and regards,
>> Shashi
> 




More information about the swing-dev mailing list