File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed
maven/core-unittests/src/test/java/com/codename1/testing Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff line change 6363import java .util .function .Consumer ;
6464import java .util .function .Function ;
6565
66+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
67+
6668/**
6769 * Lightweight {@link CodenameOneImplementation} used by unit tests. It provides deterministic,
6870 * in-memory implementations for the storage, file system, and networking APIs that are required by
@@ -1697,22 +1699,16 @@ public void tapComponent(Component component) {
16971699
16981700 private void sendPointerEventToCurrentForm (final boolean pressed , final int x , final int y ) {
16991701 final Display display = Display .getInstance ();
1700- if (display == null ) {
1701- return ;
1702- }
1702+ assertNotNull (display );
17031703
1704- Runnable r = new Runnable () {
1705- public void run () {
1706- Form current = display .getCurrent ();
1707- if (current == null ) {
1708- return ;
1709- }
1704+ Runnable r = () -> {
1705+ Form current = display .getCurrent ();
1706+ assertNotNull (current );
17101707
1711- if (pressed ) {
1712- current .pointerPressed (x , y );
1713- } else {
1714- current .pointerReleased (x , y );
1715- }
1708+ if (pressed ) {
1709+ super .pointerPressed (x , y );
1710+ } else {
1711+ super .pointerReleased (x , y );
17161712 }
17171713 };
17181714
You can’t perform that action at this time.
0 commit comments