Buggy code:
public class Desktop_Server { private static String musicDirectoryPath ; private static String ffmpegEXElocation ; private static String iTunesDataLibraryFile ; private static String convertMusicTo ; private static String ffmpegCommand ; public static void main ( String [ ] args ) throws IOException { try { Desktop_Server . loadIniFile ( ) ; } catch ( IOException e1 ) { System . err . println ( "Ini<seq2seq4repair_space>file<seq2seq4repair_space>is<seq2seq4repair_space>invalid<seq2seq4repair_space>or<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>exist." ) ; System . exit ( 0 ) ; } boolean useiTunesDataLibraryFile = false ; RandomAccessFile readituneslibrary = null ; if ( ( ( Desktop_Server . iTunesDataLibraryFile ) != null ) && ( ! ( Desktop_Server . iTunesDataLibraryFile . equals ( "" ) ) ) ) { useiTunesDataLibraryFile = true ; try { readituneslibrary = new RandomAccessFile ( Desktop_Server . iTunesDataLibraryFile , "r" ) ; } catch ( FileNotFoundException e ) { System . err . println ( "Invalid<seq2seq4repair_space>iTunes<seq2seq4repair_space>library<seq2seq4repair_space>location" ) ; System . exit ( 0 ) ; } } ServerSocket androidConnection = new ServerSocket ( 9091 ) ; System . out . println ( ( ( ( "Listening<seq2seq4repair_space>on<seq2seq4repair_space>port<seq2seq4repair_space>" + ( androidConnection . getLocalPort ( ) ) ) + "<seq2seq4repair_space>at<seq2seq4repair_space>host<seq2seq4repair_space>" ) + ( androidConnection . getInetAddress ( ) . getHostName ( ) ) ) ) ; while ( true ) { Socket phone = androidConnection . accept ( ) ; System . out . println ( "Connection<seq2seq4repair_space>get!" ) ; ArrayList < String > songs = new ArrayList < String > ( ) ; Desktop_Server . generateList ( songs , Desktop_Server . musicDirectoryPath ) ; PrintWriter out = new PrintWriter ( new OutputStreamWriter ( phone . getOutputStream ( ) , "utf-8" ) , true ) ; out . println ( Desktop_Server . convertMusicTo ) ; for ( String song : songs ) { out . println ( song ) ; } out . println ( "ENDOFLIST" ) ; BufferedReader in = new BufferedReader ( new InputStreamReader ( phone . getInputStream ( ) , "utf-8" ) ) ; BufferedOutputStream pout = new BufferedOutputStream ( phone . getOutputStream ( ) ) ; String request = in . readLine ( ) ; while ( ( request != null ) && ( ! ( request . equals ( "END<seq2seq4repair_space>OF<seq2seq4repair_space>SONG<seq2seq4repair_space>DOWNLOADS" ) ) ) ) { String songpath = ( Desktop_Server . musicDirectoryPath ) + request ; System . out . println ( ( "got<seq2seq4repair_space>request<seq2seq4repair_space>for<seq2seq4repair_space>" + request ) ) ; String filetype = songpath . substring ( songpath . lastIndexOf ( "." ) ) ; if ( ( ! ( filetype . equals ( Desktop_Server . convertMusicTo ) ) ) || useiTunesDataLibraryFile ) { String metadata = "" ; if ( useiTunesDataLibraryFile ) { <START_BUG> metadata = iTunesInterface . scanForitunesMetadata ( request , readituneslibrary , Desktop_Server . musicDirectoryPath ) ; <END_BUG> } try { Desktop_Server . conversion ( songpath , metadata ) ; } catch ( IOException e ) { System . err . println ( "FFmpeg<seq2seq4repair_space>command<seq2seq4repair_space>is<seq2seq4repair_space>invalid//malformed.<seq2seq4repair_space>Aborting<seq2seq4repair_space>sync." ) ; out . close ( ) ; in . close ( ) ; pout . close ( ) ; phone . close ( ) ; System . exit ( 0 ) ; } songpath = "tempout.mp3" ; } byte [ ] songinbyte = new byte [ ( ( int ) ( new File ( songpath ) . length ( ) ) ) ] ; BufferedInputStream bis = new BufferedInputStream ( new FileInputStream ( songpath ) ) ; bis . read ( songinbyte , 0 , songinbyte . length ) ; bis . close ( ) ; out . println ( String . valueOf ( songinbyte . length ) ) ; String confirm = in . readLine ( ) ; if ( confirm . equals ( "READY" ) ) { pout . write ( songinbyte , 0 , songinbyte . length ) ; System . out . println ( "Wrote<seq2seq4repair_space>song" ) ; pout . flush ( ) ; } request = in . readLine ( ) ; } ArrayList < Pair < String , ArrayList < String > > > playlists = iTunesInterface . generateM3UPlaylists ( readituneslibrary ) ; for ( Pair < String , ArrayList < String > > playlist : playlists ) { out . println ( playlist . getValue0 ( ) ) ; for ( String song : playlist . getValue1 ( ) ) { out . println ( song ) ; } out . println ( "NEW<seq2seq4repair_space>LIST" ) ; } out . println ( "NO<seq2seq4repair_space>MORE<seq2seq4repair_space>PLAYLISTS" ) ; out . close ( ) ; in . close ( ) ; pout . close ( ) ; phone . close ( ) ; System . out . println ( "Sync<seq2seq4repair_space>finished" ) ; } } private static void loadIniFile ( ) throws IOException { } private static void conversion ( String song , String metadata ) throws IOException { } private static void wait_for_ffmpeg ( Process p ) throws IOException { } private static void generateList ( ArrayList < String > songfilenames , String locationpath ) { } }

Fix:
metadata = iTunesInterface . scanForitunesMetadata ( request , readituneslibrary , Desktop_Server . iTunesDataLibraryFile ) ;