@@ -5988,9 +5988,10 @@ static long dialogProc(long id, long sel, long arg0) {
59885988
59895989 switch (Selector .valueOf (sel )) {
59905990 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+ }
59945995 return 0 ;
59955996 }
59965997 case sel_changeFont_ : {
@@ -6012,10 +6013,10 @@ static long dialogProc(long id, long sel, long arg0) {
60126013 }
60136014 case sel_windowWillClose_ : {
60146015 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 );
60196020 }
60206021 return 0 ;
60216022 }
0 commit comments