Buggy code:
public class BloodBowlProbability extends Activity implements OnClickListener { private Dialog dialog ; private AlertDialog alterDialog ; private int blockDieLikehood = 0 ; private int blockDiceNumber = 0 ; private int blockDiePowPushed ; private int blockDieStumblesPushed ; private int blockDiePushedPushed ; private int blockDieBothdownPushed ; private int blockDieSkullPushed ; private BloodBowlDieReroll required_roll = new BloodBowlDieReroll ( 0 ) ; private Button twoPlusButton ; private Button threePlusButton ; private Button fourPlusButton ; private Button fivePlusButton ; private Button sixPlusButton ; private ImageButton blockDiceTwoDown ; private ImageButton blockDiceOneDown ; private ImageButton blockDiceOne ; private ImageButton blockDiceTwo ; private ImageButton blockDiceThree ; private Button twoDSixButton ; private Button dSixtyEigthButton ; private Button dThreeButton ; private String selectedButtonHack ; private Button rerollOneButton ; private Button rerollTwoButton ; private Button rerollThreeButton ; private Button rerollFourButton ; private ImageButton blockDiePow ; private ImageButton blockDieStumbles ; private ImageButton blockDiePushed ; private ImageButton blockDieBothdown ; private ImageButton blockDieSkull ; private Button blockDiceAccept ; private Button blockDiceCancel ; private Button clearButton ; private TextView sequenceViewer ; private TextView probabilityResult ; private LinkedList < DieRoll > numberSequence = new LinkedList < DieRoll > ( ) ; private LinkedList < DieRoll > numberSequenceTeamReroll = new LinkedList < DieRoll > ( ) ; private BloodBowlDieReroll [ ] rerollList = new BloodBowlDieReroll [ ] { new BloodBowlDieReroll ( 1 ) , new BloodBowlDieReroll ( 1 ) , new BloodBowlDieReroll ( 1 ) , new BloodBowlDieReroll ( 1 ) } ; private BloodBowlDieReroll [ ] rerollListTeam = new BloodBowlDieReroll [ ] { new BloodBowlDieReroll ( 1 ) , new BloodBowlDieReroll ( 1 ) , new BloodBowlDieReroll ( 1 ) , new BloodBowlDieReroll ( 1 ) } ; @ Override public void onCreate ( Bundle savedInstanceState ) { } private void restoreState ( DataTransporter dt ) { } @ Override public Object onRetainNonConfigurationInstance ( ) { } @ Override public void onClick ( View v ) { } private int updateBlockDie ( ImageButton blockDie , int blockDiePushed , int value ) { } private void chooseNumber ( int upperLimit ) { LinkedList < String > numbers = new LinkedList < String > ( ) ; <START_BUG> int lowerLimit = 2 ; <END_BUG> for ( Integer i = upperLimit ; i >= lowerLimit ; i -- ) numbers . add ( i . toString ( ) ) ; final CharSequence [ ] items = numbers . toArray ( new CharSequence [ numbers . size ( ) ] ) ; AlertDialog . Builder builder = new AlertDialog . Builder ( this ) ; builder . setTitle ( "Pick<seq2seq4repair_space>a<seq2seq4repair_space>required<seq2seq4repair_space>roll" ) ; builder . setItems ( items , new DialogInterface . OnClickListener ( ) { public void onClick ( DialogInterface dialog , int item ) { int minRoll = Integer . parseInt ( items [ item ] . toString ( ) ) ; DieRoll dr = null ; String buttonHack = BloodBowlProbability . this . selectedButtonHack ; if ( buttonHack == "12" ) { dr = new TwoDSix ( minRoll , new BloodBowlDieReroll ( 0 ) ) ; } else if ( buttonHack == "68" ) { dr = new DSixtyEigth ( minRoll , new BloodBowlDieReroll ( 0 ) ) ; } else { dr = new DThree ( minRoll , new BloodBowlDieReroll ( 0 ) ) ; } BloodBowlProbability . this . updateSequence ( dr ) ; BloodBowlProbability . this . calculateProbability ( ) ; } } ) ; this . alterDialog = builder . create ( ) ; this . alterDialog . show ( ) ; } private void chooseBlockDice ( int blockDiceNumber ) { } void updateSequence ( DieRoll dieRoll ) { } private void updateSequenceDisplay ( ) { } private void addPersistingReroll ( BloodBowlDieReroll r , BloodBowlDieReroll rTeam ) { } private void colorButton ( Button b , int color ) { } private void colorButton ( ImageButton b , int color ) { } private Spanned buildSequenceString ( ) { } private void appendColoredRoll ( StringBuilder s , String r , String c ) { } private void resetBlockDieButtons ( ) { } private void calculateProbability ( ) { } No newline ; at end ; of file ; }

Fix:
int lowerLimit = ( upperLimit == 12 ) ? 3 : 2 ;