Buggy code:
public class WebActivity extends BaseActivity { public static final String EXTRA_TITLE = "title" ; public static final String EXTRA_URL = "url" ; public static final String EXTRA_HTTP_HEADERS = "additional_http_headers" ; public static final String EXTRA_ENTER_ANIMATION = "enter_animation" ; public static final String EXTRA_EXIT_ANIMATION = "exit_animation" ; public static final String EXTRA_NONE_ANIMATION = "none_animation" ; private static final String WEBKIT = "webkit" ; private static final String ERROR_HTML = "error.html" ; private static final String DEFAULT_ERROR_PAGE_URL = ( ( "file://////android_asset//" + ( WebActivity . WEBKIT ) ) + "//" ) + ( WebActivity . ERROR_HTML ) ; private static final String TAG = "WebActivity" ; private int enterAnim ; private int exitAnim ; private int noneAnim ; private FrameLayout container ; private WebView browser ; @ Override @ SuppressLint ( "SetJavaScriptEnabled" ) protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; final ActionBar bar = getActionBar ( ) ; if ( bar != null ) { bar . setDisplayHomeAsUpEnabled ( true ) ; } this . browser = new WebView ( this ) ; this . container = new FrameLayout ( this ) ; this . container . addView ( this . browser , new LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . MATCH_PARENT ) ) ; super . setContentView ( this . container , new FrameLayout . LayoutParams ( LayoutParams . MATCH_PARENT , LayoutParams . MATCH_PARENT ) ) ; final WebSettings settings = this . browser . getSettings ( ) ; settings . setDisplayZoomControls ( false ) ; settings . setBuiltInZoomControls ( false ) ; settings . setJavaScriptEnabled ( true ) ; settings . setLoadsImagesAutomatically ( true ) ; settings . setSupportZoom ( false ) ; this . browser . setWebViewClient ( new WebViewClient ( ) { @ Override public boolean shouldOverrideUrlLoading ( WebView view , String url ) { return super . shouldOverrideUrlLoading ( view , url ) ; } @ Override public void onPageStarted ( WebView view , String url , Bitmap favicon ) { Log . v ( WebActivity . TAG , ( "Loading<seq2seq4repair_space>" + url ) ) ; } @ Override public void onPageFinished ( WebView view , String url ) { Log . v ( WebActivity . TAG , ( ( "Loading<seq2seq4repair_space>" + url ) + "<seq2seq4repair_space>complete" ) ) ; } @ Override public void onReceivedError ( WebView view , int errorCode , String description , String failingUrl ) { final AssetManager am = getAssets ( ) ; try { final String [ ] webkit = am . list ( WebActivity . WEBKIT ) ; if ( null == webkit ) return ; for ( int i = 0 ; i < ( webkit . length ) ; i ++ ) { if ( WebActivity . ERROR_HTML . equalsIgnoreCase ( webkit [ i ] ) ) { view . loadUrl ( WebActivity . DEFAULT_ERROR_PAGE_URL ) ; } } } catch ( IOException e ) { Log . e ( WebActivity . TAG , "Default<seq2seq4repair_space>error<seq2seq4repair_space>page<seq2seq4repair_space>not<seq2seq4repair_space>found" , e ) ; } } } ) ; final Intent intent = getIntent ( ) ; if ( null != intent ) { this . enterAnim = intent . getIntExtra ( WebActivity . EXTRA_ENTER_ANIMATION , 0 ) ; this . exitAnim = intent . getIntExtra ( WebActivity . EXTRA_EXIT_ANIMATION , 0 ) ; this . noneAnim = intent . getIntExtra ( WebActivity . EXTRA_NONE_ANIMATION , 0 ) ; super . overridePendingTransition ( this . enterAnim , this . noneAnim ) ; final String title = intent . getStringExtra ( WebActivity . EXTRA_TITLE ) ; if ( ! ( TextUtils . isEmpty ( title ) ) ) { this . setTitle ( title ) ; } final String url = intent . getStringExtra ( WebActivity . EXTRA_URL ) ; if ( ! ( TextUtils . isEmpty ( url ) ) ) { final Map < String , String > headers = new HashMap < String , String > ( ) ; final Bundle bundle = intent . getBundleExtra ( WebActivity . EXTRA_HTTP_HEADERS ) ; if ( ( null != bundle ) && ( ( bundle . size ( ) ) > 0 ) ) { <START_BUG> final Set < String > names = headers . keySet ( ) ; <END_BUG> for ( final String key : names ) { final String value = bundle . getString ( key ) ; if ( ! ( TextUtils . isEmpty ( value ) ) ) { headers . put ( key , bundle . getString ( value ) ) ; } } } this . browser . loadUrl ( url , headers ) ; } } } @ Override public void finish ( ) { } }

Fix:
final Set < String > names = bundle . keySet ( ) ;