Just for fun: Spot the problem

satya - 4/8/2013 10:51:22 AM

Eclipse, rightfully, warns me for the following


private Word getParceledWordFromIntent()
{
    Intent i = this.getIntent();
    if (i == null)        {
        throw new RuntimeException("Sorry no intent found");
    }
    //intent is available
    String wordId = i.getStringExtra(WORD_ID);
    ParseObjectWrapper pow = 
        (ParseObjectWrapper)i.getParcelableExtra(WORD_POW);
    
    Word parceledWord = new Word(pow);
    
    if (parceledWord == null) {
        throw new RuntimeException("ParceledWord not found");
    }
    
    return parceledWord;
}

I was scratching my head for a minute why Eclipse tells me there is dead code. I tell you, the mistakes I make...