<Swing Dev> Remove System.out.println from ImageIcon.loadImage
Volodin, Vladislav
vladislav.volodin at sap.com
Thu Jan 16 15:05:43 UTC 2020
Hello Jason (and everyone),
I have studied the code a little, and found out that this logging doesn't give any significant benefits to the functionality. It seems that either it can be removed, or replaced with a better logging handling.
I went through different parts in the code, and I found out that there is AbstractButton, where InterruptedException is handled silently. Nothing is logged anywhere.
On the opposite side, there are classes where PlatformLogger is used for logging.
If people in this distribution list agree, I can start working on a simple fix and either remove the logging (System.out.println), or replace it with PlatformLogger. I guess the second solution sounds better, but I don't know what is the better way to write a test-case for it.
Kind regards,
Vlad
-----Original Message-----
From: swing-dev <swing-dev-bounces at openjdk.java.net> On Behalf Of Jason Mehrens
Sent: Dienstag, 14. Januar 2020 21:59
To: Sergey Bylokhov <Sergey.Bylokhov at oracle.com>; swing-dev at openjdk.java.net
Subject: Re: <Swing Dev> Remove System.out.println from ImageIcon.loadImage
This was the bug id when I reported it: https://bugs.openjdk.java.net/browse/JDK-6421373
Notice it was closed as will not fix. I think that is incorrect but, I'm biased :)
Jason
________________________________________
From: swing-dev <swing-dev-bounces at openjdk.java.net> on behalf of Sergey Bylokhov <Sergey.Bylokhov at oracle.com>
Sent: Sunday, January 5, 2020 7:33 AM
To: swing-dev at openjdk.java.net
Subject: Re: <Swing Dev> Remove System.out.println from ImageIcon.loadImage
Hi, Matthias.
I suggest to create a bug report for this issue:
https://bugs.java.com/bugdatabase
On 1/5/20 11:53 am, Matthias Perktold - ASA wrote:
> Hi all,
>
> In javax.swing.ImageIcon.loadImage(), there is a call to System.out.println() when loading the Image has been interrupted.
>
> In our system, this is a problem because redirect System.out to be displayed to the user to make sure no errors remain unnoticed.
>
> But in this case, the message does not really represent an error, so we should not display a message.
>
> Instead, I propose to restore the interrupt status.
>
> Best regards,
>
> Matthias Perktold
>
--
Best regards, Sergey.
More information about the swing-dev
mailing list