Buggy code:
public class MovieManager { private Context context ; public MovieManager ( Context context ) { } public static Genre extractGenre ( Cursor cursor ) { } public Movie fetchMovie ( long _id ) { } public List < Movie > fetchMovies ( ) { } public List < Movie > fetchMovies ( Genre g ) { } public Genre fetchGenre ( String name ) { } public List < Genre > fetchGenres ( ) { } public boolean addMovie ( Movie newMovie ) { <START_BUG> if ( ( ( ! ( newMovie . getTitle ( ) . isEmpty ( ) ) ) && ( ( newMovie . getRented ( ) ) >= 0 ) ) && ( ( newMovie . getStock ( ) ) >= 0 ) ) { <END_BUG> ArrayList < ContentProviderOperation > operations = new ArrayList < > ( ) ; Uri uriMovie = MoviesContentProvider . CONTENT_URI ; Uri uriKind = Uri . parse ( ( ( MoviesContentProvider . CONTENT_URI ) + "//KINDS" ) ) ; ContentValues valuesMovie = new ContentValues ( ) ; valuesMovie . put ( COLUMN_TITLE , newMovie . getTitle ( ) ) ; valuesMovie . put ( COLUMN_YEAR , ( ( newMovie . getYear ( ) ) == ( - 1 ) ? null : newMovie . getYear ( ) ) ) ; valuesMovie . put ( COLUMN_RATED , newMovie . getRated ( ) ) ; valuesMovie . put ( COLUMN_RELEASED , ( ( newMovie . getReleased ( ) ) != null ? newMovie . getReleased ( ) . getTime ( ) : null ) ) ; valuesMovie . put ( COLUMN_RUNTIME , newMovie . getRuntime ( ) ) ; valuesMovie . put ( COLUMN_DIRECTOR , newMovie . getDirector ( ) ) ; valuesMovie . put ( COLUMN_WRITER , newMovie . getWriter ( ) ) ; valuesMovie . put ( COLUMN_PLOT , newMovie . getPlot ( ) ) ; valuesMovie . put ( COLUMN_LANGUAGE , newMovie . getLanguage ( ) ) ; valuesMovie . put ( COLUMN_COUNTRY , newMovie . getCountry ( ) ) ; valuesMovie . put ( COLUMN_AWARDS , newMovie . getAwards ( ) ) ; valuesMovie . put ( COLUMN_POSTER , ( ( newMovie . getPoster ( ) ) != null ? newMovie . getPoster ( ) . toString ( ) : null ) ) ; valuesMovie . put ( COLUMN_METASCORE , ( ( newMovie . getMetascore ( ) ) == ( - 1 ) ? null : newMovie . getMetascore ( ) ) ) ; valuesMovie . put ( COLUMN_IMDB_RATING , ( ( newMovie . getImdbRating ( ) ) == ( - 1 ) ? null : newMovie . getImdbRating ( ) ) ) ; valuesMovie . put ( COLUMN_IMDB_VOTES , ( ( newMovie . getImdbVotes ( ) ) == ( - 1 ) ? null : newMovie . getImdbVotes ( ) ) ) ; valuesMovie . put ( COLUMN_IMDB_ID , newMovie . getImdbID ( ) ) ; ContentProviderOperation movieAddition = ContentProviderOperation . newInsert ( uriMovie ) . withValues ( valuesMovie ) . build ( ) ; operations . add ( movieAddition ) ; for ( Genre g : newMovie . getGenres ( ) ) { ContentProviderOperation kindAddition = ContentProviderOperation . newInsert ( uriKind ) . withValue ( COLUMN_GENRE_ID , g . get_id ( ) ) . withValueBackReference ( COLUMN_MOVIE_ID , 0 ) . build ( ) ; operations . add ( kindAddition ) ; } try { context . getContentResolver ( ) . applyBatch ( AUTHORITY , operations ) ; } catch ( SQLiteConstraintException e ) { Log . d ( e . getMessage ( ) , e . toString ( ) , e ) ; return false ; } catch ( RemoteException | OperationApplicationException e ) { Log . e ( e . getMessage ( ) , e . toString ( ) , e ) ; return false ; } return true ; } else { return false ; } } public boolean deleteMovie ( Movie m ) { } public boolean updateMovie ( Movie newMovie ) { } private Movie extractMovie ( Cursor cursor ) { } No newline ; at end ; of file ; }

Fix:
if ( ! ( newMovie . getTitle ( ) . isEmpty ( ) ) ) {