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 19
19
import java .util .Collections ;
20
20
import java .util .HashMap ;
21
21
import java .util .Map ;
22
+ import java .util .Optional ;
22
23
23
24
import static java .util .Optional .ofNullable ;
24
25
@@ -83,8 +84,8 @@ public KeyEvent withFlag(KeyEventFlag keyEventFlag) {
83
84
*/
84
85
public Map <String , Object > build () {
85
86
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 );
88
89
ofNullable (this .metaState ).ifPresent (x -> map .put ("metastate" , x ));
89
90
ofNullable (this .flags ).ifPresent (x -> map .put ("flags" , x ));
90
91
return Collections .unmodifiableMap (map );
You can’t perform that action at this time.
0 commit comments