@@ -5988,9 +5988,10 @@ static long dialogProc(long id, long sel, long arg0) {
5988
5988
5989
5989
switch (Selector .valueOf (sel )) {
5990
5990
case sel_changeColor_ : {
5991
- ColorDialog dialog = (ColorDialog )OS .JNIGetObject (jniRef [0 ]);
5992
- if (dialog == null ) return 0 ;
5993
- dialog .changeColor (id , sel , arg0 );
5991
+ Object object = OS .JNIGetObject (jniRef [0 ]);
5992
+ if (object instanceof ColorDialog colorDialog ) {
5993
+ colorDialog .changeColor (id , sel , arg0 );
5994
+ }
5994
5995
return 0 ;
5995
5996
}
5996
5997
case sel_changeFont_ : {
@@ -6012,10 +6013,10 @@ static long dialogProc(long id, long sel, long arg0) {
6012
6013
}
6013
6014
case sel_windowWillClose_ : {
6014
6015
Object object = OS .JNIGetObject (jniRef [0 ]);
6015
- if (object instanceof FontDialog ) {
6016
- (( FontDialog ) object ) .windowWillClose (id , sel , arg0 );
6017
- } else if (object instanceof ColorDialog ) {
6018
- (( ColorDialog ) object ) .windowWillClose (id , sel , arg0 );
6016
+ if (object instanceof FontDialog fontDialog ) {
6017
+ fontDialog .windowWillClose (id , sel , arg0 );
6018
+ } else if (object instanceof ColorDialog colorDialog ) {
6019
+ colorDialog .windowWillClose (id , sel , arg0 );
6019
6020
}
6020
6021
return 0 ;
6021
6022
}
0 commit comments