RFR: 8332431: NullPointerException in JTable of SwingSet2 [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Tue May 28 02:59:24 UTC 2024


On Mon, 27 May 2024 09:31:51 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Additional null check
>
> src/java.desktop/share/classes/javax/swing/ToolTipManager.java line 273:
> 
>> 271:             GraphicsConfiguration gc = getDrawingGC(toFind);
>> 272:             if (gc == null) {
>> 273:                 if (mouseEvent != null) {
> 
> In the same method **showTipWindow**, mouseEvent's _getLocationOnScreen_ method is accessed at [L268](https://github.com/openjdk/jdk/blame/da3001daf79bf943d6194d9fd60250d519b9680d/src/java.desktop/share/classes/javax/swing/ToolTipManager.java#L268C13-L268C13) and mouseEvent's _getX_ and _getY_ methods are accessed at [L304](https://github.com/openjdk/jdk/blame/da3001daf79bf943d6194d9fd60250d519b9680d/src/java.desktop/share/classes/javax/swing/ToolTipManager.java#L304), guess we should guard them as well with null check.

I had seen it but not sure in which condition it will fail as it had not failed until now in those codepaths..But Anyways, I agree and added the null check..

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19379#discussion_r1616519362


More information about the client-libs-dev mailing list