File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/io/appium/java_client/android/nativekey Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1919import java .util .Collections ;
2020import java .util .HashMap ;
2121import java .util .Map ;
22+ import java .util .Optional ;
2223
2324import static java .util .Optional .ofNullable ;
2425
@@ -83,8 +84,8 @@ public KeyEvent withFlag(KeyEventFlag keyEventFlag) {
8384 */
8485 public Map <String , Object > build () {
8586 var map = new HashMap <String , Object >();
86- ofNullable (this .keyCode ).map ( x -> map . put ( "keycode" , x )). orElseThrow (() -> new IllegalStateException (
87- "The key code must be set" ) );
87+ Integer keyCode = ofNullable (this .keyCode ).orElseThrow (() -> new IllegalStateException ("The key code must be set" ));
88+ map . put ( "keycode" , keyCode );
8889 ofNullable (this .metaState ).ifPresent (x -> map .put ("metastate" , x ));
8990 ofNullable (this .flags ).ifPresent (x -> map .put ("flags" , x ));
9091 return Collections .unmodifiableMap (map );
You can’t perform that action at this time.
0 commit comments