> Test fails with NPE citing
> 
> java.lang.NullPointerException: Cannot invoke "Object.getClass()" because 
> "<local0>" is null
> at Test6505027.validate(Test6505027.java:108)
> at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> at java.base/java.lang.reflect.Method.invoke(Method.java:583)
> at SwingTest.run(SwingTest.java:96)
> at SwingTest.start(SwingTest.java:131)
> at SwingTest.start(SwingTest.java:54)
> at Test6505027.main(Test6505027.java:67) 
> 
> 
> which can happen when the internal frame has not received native focus yet, 
> or the Robot click’s focus transfer has not completed. The test validates 
> focus owner immediately after clicking cell (1,1).
> Robot `waitForIdle` and `delay `is added after cell click to give time before 
> current focus owner check is called. 
> Also, explicitly activated the internal frame after it has been added to the 
> desktop pane:
> Also, `instanceof` check is used instead of 
> `component.getClass().equals(JComboBox.class)` because it handles null 
> cleanly and does not reject a valid subclass
> 
> Additionally, `press()` and `validate() `was called in separate EDT and main 
> thread respectively which can cause issues like this, so made sure they are 
> called in same thread as SwingTest calls static methods in main thread.
> 
> 
> Recurrent CI test execution is found to be ok.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Prasanta Sadhukhan has updated the pull request incrementally with one 
additional commit since the last revision:

  Error->RuntimeException

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/32019/files
  - new: https://git.openjdk.org/jdk/pull/32019/files/d77c65d3..5554d723

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=32019&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=32019&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/32019.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32019/head:pull/32019

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

Reply via email to