On Thu, 21 Aug 2025 02:30:11 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

> The `ImageIcon(Image)` constructor sets the description field to the value of 
> "comment" property if it's a string. The `ImageIcon(Image, String)` 
> constructor calls ImageIcon(Image). Since the two-parameter constructor 
> explicitly provides the value for the description field, the implicitly set 
> value for description is immediately overwritten, which is wasted work. 
> 
> Fix is to let `ImageIcon(Image, String) `constructor do the actual work of 
> setting the fields and loading the image

This pull request has now been integrated.

Changeset: e5077660
Author:    Prasanta Sadhukhan <psadhuk...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/e5077660c4e66decc9291b09cb2efaf2f5ae982f
Stats:     15 lines in 1 file changed: 7 ins; 0 del; 8 mod

8361610: Avoid wasted work in ImageIcon(Image) for setting description

Reviewed-by: kizune, aivanov

-------------

PR: https://git.openjdk.org/jdk/pull/26873

Reply via email to