Buggy code:
public static synchronized Display getDefault ( ) { } public Object getData ( String key ) { } public Object getData ( ) { } public int getDismissalAlignment ( ) { } public int getDoubleClickTime ( ) { } public Control getFocusControl ( ) { } Control getFocusControl ( int window ) { } public boolean getHighContrast ( ) { } public int getIconDepth ( ) { } public Point [ ] getIconSizes ( ) { } int getLastEventTime ( ) { } Menu [ ] getMenus ( Decorations shell ) { } Menu getMenu ( int id ) { } Menu getMenuBar ( ) { } int getMessageCount ( ) { } public Monitor [ ] getMonitors ( ) { } public Monitor getPrimaryMonitor ( ) { } public Shell [ ] getShells ( ) { } public Thread getSyncThread ( ) { } public Color getSystemColor ( int id ) { } public Cursor getSystemCursor ( int id ) { } public Image getSystemImage ( int id ) { } public Tray getSystemTray ( ) { } public Thread getThread ( ) { } Widget getWidget ( int handle ) { } int helpProc ( int inControl , int inGlobalMouse , int inRequest , int outContentProvided , int ioHelpContent ) { } int hitTestProc ( int browser , int item , int property , int theRect , int mouseRect ) { } protected void init ( ) { } void initializeCallbacks ( ) { } void initializeFonts ( ) { } void initializeInsets ( ) { } void initializeWidgetTable ( ) { } public int internal_new_GC ( GCData data ) { } public void internal_dispose_GC ( int context , GCData data ) { } static boolean isValidClass ( Class clazz ) { } boolean isValidThread ( ) { } int itemCompareProc ( int browser , int itemOne , int itemTwo , int sortProperty ) { } int itemDataProc ( int browser , int item , int property , int itemData , int setValue ) { } int itemNotificationProc ( int browser , int item , int message ) { } int keyboardProc ( int nextHandler , int theEvent , int userData ) { } public boolean post ( Event event ) { } void postEvent ( Event event ) { } public Point map ( Control from , Control to , Point point ) { } public Point map ( Control from , Control to , int x , int y ) { } public Rectangle map ( Control from , Control to , Rectangle rectangle ) { } public Rectangle map ( Control from , Control to , int x , int y , int width , int height ) { } int menuProc ( int nextHandler , int theEvent , int userData ) { } int mouseProc ( int nextHandler , int theEvent , int userData ) { } int mouseHoverProc ( int id , int handle ) { } int [ ] readImageRef ( int path ) { int [ ] image = null ; int url = OS . CFURLCreateFromFileSystemRepresentation ( kCFAllocatorDefault , path , OS . strlen ( path ) , false ) ; if ( url != 0 ) { int extention = OS . CFURLCopyPathExtension ( url ) ; if ( extention != 0 ) { int length = OS . CFStringGetLength ( extention ) ; char [ ] buffer = new char [ length ] ; CFRange range = new CFRange ( ) ; range . length = length ; OS . CFStringGetCharacters ( extention , range , buffer ) ; String ext = new String ( buffer ) ; if ( ext . equalsIgnoreCase ( "png" ) ) { int provider = OS . CGDataProviderCreateWithURL ( url ) ; if ( provider != 0 ) { image = new int [ ] { OS . CGImageCreateWithPNGDataProvider ( provider , null , true , kCGRenderingIntentDefault ) , 0 } ; OS . CGDataProviderRelease ( provider ) ; } } else if ( ( ext . equalsIgnoreCase ( "jpeg" ) ) || ( ext . equals ( "jpg" ) ) ) { int provider = OS . CGDataProviderCreateWithURL ( url ) ; if ( provider != 0 ) { <START_BUG> image = new int [ ] { OS . CGImageCreateWithJPEGDataProvider ( provider , null , true , kCGRenderingIntentDefault ) } ; <END_BUG> OS . CGDataProviderRelease ( provider ) ; } } else if ( ext . equalsIgnoreCase ( "icns" ) ) { byte [ ] fsRef = new byte [ 80 ] ; if ( OS . CFURLGetFSRef ( url , fsRef ) ) { byte [ ] fsSpec = new byte [ 70 ] ; if ( ( OS . FSGetCatalogInfo ( fsRef , 0 , null , null , fsSpec , null ) ) == ( OS . noErr ) ) { int [ ] iconFamily = new int [ 1 ] ; OS . ReadIconFile ( fsSpec , iconFamily ) ; if ( ( iconFamily [ 0 ] ) != 0 ) { image = createImageFromFamily ( iconFamily [ 0 ] ) ; OS . DisposeHandle ( iconFamily [ 0 ] ) ; } } } } OS . CFRelease ( extention ) ; } OS . CFRelease ( url ) ; } return image ; } public boolean readAndDispatch ( ) { } static synchronized void register ( Display display ) { } protected void release ( ) { } void releaseDisplay ( ) { } public void removeFilter ( int eventType , Listener listener ) { } public void removeListener ( int eventType , Listener listener ) { } void removeMenu ( Menu menu ) { } void removePopup ( Menu menu ) { } Widget removeWidget ( int handle ) { } boolean runAsyncMessages ( boolean all ) { } boolean runEnterExit ( ) { } boolean runDeferredEvents ( ) { } boolean runEventLoopTimers ( ) { } boolean runGrabs ( ) { }

Fix:
image = new int [ ] { OS . CGImageCreateWithJPEGDataProvider ( provider , null , true , kCGRenderingIntentDefault ) , 0 } ;