Buggy code:
public class ChooseAddonsViewFragment extends BaseFragment { private View backImageView ; private View backTextView ; private View specialReqeustContainer ; private EditText specialReqeustEditText ; private BookingController bookingController ; private List < AddonServiceAPIObject > addons ; private LinearLayout addonsContainer ; private LinearLayout specialAddonsContainer ; private LinearLayout mainContainer ; private LinearLayout lawnContainer ; private TextView lawnTextView ; private List < AddonServiceAPIObject > selectedAddons ; private LayoutInflater inflater ; private View saveButton ; private int countRooms ; private int countBathRooms ; private boolean isRoomsChecked ; private boolean isBathRoomsChecked ; private SeekBar bathRoomsSeekBar ; private SeekBar roomsSeekBar ; private TextView roomsTextView ; private TextView bathroomsTextView ; public View onCreateView ( LayoutInflater inflater , ViewGroup container , Bundle savedInstanceState ) { } @ Override protected void init ( ) { } protected void clearFields ( ) { } private void updateComponents ( ) { } protected void updateSelectionComponents ( ) { } private void updateRooms ( ) { } private void addRoomsSelector ( ) { } private void addBathRoomsSelector ( ) { final View roomsView = inflater . inflate ( choose_count_rooms_layout , null ) ; bathroomsTextView = ( ( TextView ) ( roomsView . findViewById ( addonTextView ) ) ) ; TextView titleTextView = ( ( TextView ) ( roomsView . findViewById ( titleTextView ) ) ) ; final TextView countTextView = ( ( TextView ) ( roomsView . findViewById ( countTextView ) ) ) ; final ImageView selectImageView = ( ( ImageView ) ( roomsView . findViewById ( selectImageView ) ) ) ; final LinearLayout roomsSeekBarContainer = ( ( LinearLayout ) ( roomsView . findViewById ( roomsSeekBarContainer ) ) ) ; bathRoomsSeekBar = ( ( SeekBar ) ( roomsView . findViewById ( countSeekBar ) ) ) ; titleTextView . setText ( getString ( bathrooms_count ) ) ; bathroomsTextView . setText ( getString ( bathrooms ) ) ; selectImageView . setVisibility ( GONE ) ; <START_BUG> int maxCount = 10 ; <END_BUG> final int minCount = 1 ; bathRoomsSeekBar . setMax ( ( maxCount - minCount ) ) ; bathRoomsSeekBar . setOnSeekBarChangeListener ( new SeekBar . OnSeekBarChangeListener ( ) { @ Override public void onStopTrackingTouch ( SeekBar seekBar ) { } @ Override public void onStartTrackingTouch ( SeekBar seekBar ) { } @ Override public void onProgressChanged ( SeekBar seekBar , int progress , boolean fromUser ) { int offset = minCount ; countBathRooms = progress + offset ; countTextView . setText ( ( ( countBathRooms ) + "" ) ) ; } } ) ; bathroomsTextView . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { if ( ( selectImageView . getVisibility ( ) ) == ( View . GONE ) ) { roomsSeekBarContainer . setVisibility ( VISIBLE ) ; selectImageView . setVisibility ( VISIBLE ) ; isBathRoomsChecked = true ; } else { roomsSeekBarContainer . setVisibility ( GONE ) ; selectImageView . setVisibility ( GONE ) ; isBathRoomsChecked = false ; } } } ) ; bathRoomsSeekBar . setProgress ( minCount ) ; specialAddonsContainer . addView ( roomsView ) ; } private void addLawnMoving ( ) { } private void uncheckedAllLawnMoving ( int filterId ) { } private void updateLawnMoving ( ) { } private LawnMovingType getSelectedLawnMoving ( ) { } protected void addonSelected ( AddonServiceAPIObject addon ) { } @ Override public void onActivityCreated ( Bundle savedInstanceState ) { } private void addListeners ( ) { } No newline ; at end ; of file ; }

Fix:
int maxCount = 5 ;