Buggy code:
private static final String PARAM_INC_ATTACHMENTS = "include_attachments" ; private static final String PARAM_MODE = "mode" ; private static final String PARAM_FIELD = "field" ; private static final String PARAM_IS_CAT = "is_cat" ; private static final String PARAM_PREF = "pref_name" ; private static final String PARAM_OUTPUT_MODE = "output_mode" ; private static final String VALUE_LOGIN = "login" ; private static final String VALUE_GET_CATEGORIES = "getCategories" ; private static final String VALUE_GET_FEEDS = "getFeeds" ; private static final String VALUE_GET_HEADLINES = "getHeadlines" ; private static final String VALUE_UPDATE_ARTICLE = "updateArticle" ; private static final String VALUE_CATCHUP = "catchupFeed" ; private static final String VALUE_GET_PREF = "getPref" ; private static final String VALUE_GET_VERSION = "getVersion" ; private static final String VALUE_GET_COUNTERS = "getCounters" ; private static final String VALUE_OUTPUT_MODE = "flc" ; private static final String ERROR = "error" ; private static final String NOT_LOGGED_IN = "NOT_LOGGED_IN" ; private static final String API_DISABLED = "API_DISABLED" ; private static final String API_DISABLED_MESSAGE = "Please<seq2seq4repair_space>enable<seq2seq4repair_space>API<seq2seq4repair_space>for<seq2seq4repair_space>the<seq2seq4repair_space>user<seq2seq4repair_space>\"%s\"<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>preferences<seq2seq4repair_space>of<seq2seq4repair_space>this<seq2seq4repair_space>user<seq2seq4repair_space>on<seq2seq4repair_space>the<seq2seq4repair_space>Server." ; private static final String STATUS = "status" ; private static final String OK = "OK" ; private static final String SESSION_ID = "session_id" ; private static final String ID = "id" ; private static final String TITLE = "title" ; private static final String UNREAD = "unread" ; private static final String CAT_ID = "cat_id" ; private static final String FEED_ID = "feed_id" ; private static final String UPDATED = "updated" ; private static final String CONTENT = "content" ; private static final String URL = "link" ; private static final String FEED_URL = "feed_url" ; private static final String COMMENT_URL = "comments" ; private static final String ATTACHMENTS = "attachments" ; private static final String CONTENT_URL = "content_url" ; private static final String STARRED = "marked" ; private static final String PUBLISHED = "published" ; private static final String VALUE = "value" ; private static final String VERSION = "version" ; private static final String COUNTER_KIND = "kind" ; private static final String COUNTER_CAT = "cat" ; private static final String COUNTER_ID = "id" ; private static final String COUNTER_COUNTER = "counter" ; private String httpUsername ; private String httpPassword ; private String sessionId ; private String loginLock = "" ; private CredentialsProvider credProvider = null ; private DefaultHttpClient client ; public JSONConnector ( ) { } private void refreshHTTPAuth ( ) { } private InputStream doRequest ( Map < String , String > params , boolean firstCall ) { } private String readResult ( Map < String , String > params , boolean login , boolean firstCall ) throws IOException { } private JsonReader prepareReader ( Map < String , String > params ) throws IOException { } private JsonReader prepareReader ( Map < String , String > params , boolean firstCall ) throws IOException { } private boolean sessionAlive ( ) { } private String doRequestNoAnswer ( Map < String , String > params ) { } private boolean login ( ) { } private void parseCounter ( JsonReader reader ) { SQLiteDatabase db = DBHelper . getInstance ( ) . db ; synchronized ( DBHelper . TABLE_ARTICLES ) { db . beginTransaction ( ) ; try { reader . beginArray ( ) ; while ( reader . hasNext ( ) ) { boolean cat = false ; int id = 0 ; int counter = 0 ; reader . beginObject ( ) ; while ( reader . hasNext ( ) ) { String name = reader . nextName ( ) ; if ( name . equals ( JSONConnector . COUNTER_KIND ) ) { cat = reader . nextString ( ) . equals ( JSONConnector . COUNTER_CAT ) ; } else if ( name . equals ( JSONConnector . COUNTER_ID ) ) { String value = reader . nextString ( ) ; if ( ( value . equals ( "global-unread" ) ) || ( value . equals ( "subscribed-feeds" ) ) ) continue ; id = Integer . parseInt ( value ) ; } else if ( name . equals ( JSONConnector . COUNTER_COUNTER ) ) { String value = reader . nextString ( ) ; <START_BUG> if ( value . equals ( "null" ) ) <END_BUG> counter = Integer . parseInt ( value ) ; } else { reader . skipValue ( ) ; } } reader . endObject ( ) ; ContentValues cv = new ContentValues ( ) ; cv . put ( "unread" , counter ) ; if ( cat && ( id >= 0 ) ) { db . update ( TABLE_CATEGORIES , cv , "id=?" , new String [ ] { id + "" } ) ; } else if ( ( ( ! cat ) && ( id < 0 ) ) && ( id >= ( - 4 ) ) ) { db . update ( TABLE_CATEGORIES , cv , "id=?" , new String [ ] { id + "" } ) ; } else if ( ( ! cat ) && ( id > 0 ) ) { db . update ( TABLE_FEEDS , cv , "id=?" , new String [ ] { id + "" } ) ; } else if ( ( ! cat ) && ( id < ( - 10 ) ) ) { db . update ( TABLE_FEEDS , cv , "id=?" , new String [ ] { id + "" } ) ; } } reader . endArray ( ) ; db . setTransactionSuccessful ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } finally { db . endTransaction ( ) ; DBHelper . getInstance ( ) . purgeArticlesNumber ( ) ; } } } private Set < String > parseAttachments ( JsonReader reader ) throws IOException { } private void parseArticle ( JsonReader reader , int labelId ) { } @ Override public void getCounters ( ) { } @ Override public Set < Category > getCategories ( ) { } @ Override public Set < Feed > getFeeds ( ) { }

Fix:
if ( ! ( value . equals ( "null" ) ) )