Buggy code:
public class PrintDialog extends Dialog { PrinterData printerData = new PrinterData ( ) ; boolean sheet ; int returnCode ; static Callback dialogCallback5 ; static final byte [ ] SWT_OBJECT = new byte [ ] { 'S' , 'W' , 'T' , '_' , 'O' , 'B' , 'J' , 'E' , 'C' , 'T' , '' } ; public PrintDialog ( Shell parent ) { } public PrintDialog ( Shell parent , int style ) { } public void setPrinterData ( PrinterData data ) { } public PrinterData getPrinterData ( ) { } public PrinterData open ( ) { PrinterData data = null ; NSPrintPanel panel = NSPrintPanel . printPanel ( ) ; NSPrintInfo printInfo = new NSPrintInfo ( NSPrintInfo . sharedPrintInfo ( ) . copy ( ) ) ; printInfo . setOrientation ( ( ( printerData . orientation ) == ( PrinterData . LANDSCAPE ) ? OS . NSLandscapeOrientation : OS . NSPortraitOrientation ) ) ; NSMutableDictionary dict = printInfo . dictionary ( ) ; if ( printerData . printToFile ) { dict . setValue ( NSPrintSaveJob , NSPrintJobDisposition ) ; } dict . setValue ( NSNumber . numberWithBool ( ( ( printerData . scope ) == ( PrinterData . ALL_PAGES ) ) ) , NSPrintAllPages ) ; if ( ( printerData . scope ) == ( PrinterData . PAGE_RANGE ) ) { dict . setValue ( NSNumber . numberWithInt ( printerData . startPage ) , NSPrintFirstPage ) ; dict . setValue ( NSNumber . numberWithInt ( printerData . endPage ) , NSPrintLastPage ) ; } panel . setOptions ( ( ( OS . NSPrintPanelShowsPageSetupAccessory ) | ( panel . options ( ) ) ) ) ; int response ; <START_BUG> if ( sheet ) { <END_BUG> initClasses ( ) ; SWTPrintPanelDelegate delegate = ( ( SWTPrintPanelDelegate ) ( new SWTPrintPanelDelegate ( ) . alloc ( ) . init ( ) ) ) ; int jniRef = OS . NewGlobalRef ( this ) ; if ( jniRef == 0 ) SWT . error ( ERROR_NO_HANDLES ) ; OS . object_setInstanceVariable ( delegate . id , PrintDialog . SWT_OBJECT , jniRef ) ; returnCode = - 1 ; Shell parent = getParent ( ) ; panel . beginSheetWithPrintInfo ( printInfo , parent . view . window ( ) , delegate , sel_panelDidEnd_returnCode_contextInfo_ , 0 ) ; NSApplication application = NSApplication . sharedApplication ( ) ; while ( ( returnCode ) == ( - 1 ) ) application . run ( ) ; if ( delegate != null ) delegate . release ( ) ; if ( jniRef != 0 ) OS . DeleteGlobalRef ( jniRef ) ; response = returnCode ; } else { response = ( ( int ) ( panel . runModalWithPrintInfo ( printInfo ) ) ) ; } if ( response != ( OS . NSCancelButton ) ) { NSPrinter printer = printInfo . printer ( ) ; NSString str = printer . name ( ) ; data = new PrinterData ( Printer . DRIVER , str . getString ( ) ) ; data . printToFile = printInfo . jobDisposition ( ) . isEqual ( NSPrintSaveJob ) ; if ( data . printToFile ) { NSString filename = new NSString ( dict . objectForKey ( NSPrintSavePath ) ) ; data . fileName = filename . getString ( ) ; } data . scope = ( ( new NSNumber ( dict . objectForKey ( NSPrintAllPages ) ) . intValue ( ) ) != 0 ) ? PrinterData . ALL_PAGES : PrinterData . PAGE_RANGE ; if ( ( data . scope ) == ( PrinterData . PAGE_RANGE ) ) { data . startPage = new NSNumber ( dict . objectForKey ( NSPrintFirstPage ) ) . intValue ( ) ; data . endPage = new NSNumber ( dict . objectForKey ( NSPrintLastPage ) ) . intValue ( ) ; } data . collate = ( new NSNumber ( dict . objectForKey ( OS . NSPrintMustCollate ) ) . intValue ( ) ) != 0 ; data . copyCount = new NSNumber ( dict . objectForKey ( OS . NSPrintCopies ) ) . intValue ( ) ; data . orientation = ( ( printInfo . orientation ( ) ) == ( OS . NSLandscapeOrientation ) ) ? PrinterData . LANDSCAPE : PrinterData . PORTRAIT ; NSData nsData = NSKeyedArchiver . archivedDataWithRootObject ( printInfo ) ; data . otherData = new byte [ ( ( int ) ( nsData . length ( ) ) ) ] ; OS . memmove ( data . otherData , nsData . bytes ( ) , data . otherData . length ) ; printerData = data ; } printInfo . release ( ) ; return data ; } public int getScope ( ) { } public int getStyle ( ) { } static int dialogProc ( int id , int sel , int arg0 , int arg1 , int arg2 ) { } void initClasses ( ) { } void panelDidEnd_returnCode_contextInfo ( int id , int sel , int alert , int returnCode , int contextInfo ) { } public void setScope ( int scope ) { } public int getStartPage ( ) { } public void setStartPage ( int startPage ) { } public int getEndPage ( ) { } public void setEndPage ( int endPage ) { } public boolean getPrintToFile ( ) { } public void setPrintToFile ( boolean printToFile ) { } protected void checkSubclass ( ) { } }

Fix:
if ( ( ( getStyle ( ) ) & ( SWT . SHEET ) ) != 0 ) {