Buggy code:
public class ColorPickManager implements IControlManager { public interface ColorPickResult { public void onConfirm ( Color returned ) { } } public final ColorPickManager . ColorPickResult result ; public ColorPickRenderer renderer ; public Color color ; public int pos = 0 ; public int bpos = 0 ; public boolean editing = false ; private Window gui ; public ColorPickManager ( Color initC , ColorPickManager . ColorPickResult result ) { } @ Override public IScreenRenderer getRenderer ( ) { } @ Override public void onKey ( KeyInput e ) { if ( ( e . type ) == ( InputType . PRESS ) ) { if ( ( e . key ) == ( KeyInput . ESCAPE ) ) { executeResult ( false ) ; } else if ( ( ( e . key ) == ( KeyInput . ENTER ) ) || ( ( e . key ) == ( KeyInput . BACK_SPACE ) ) ) { if ( ( pos ) == 4 ) { executeResult ( ( ( bpos ) == 0 ) ) ; } else { editing = true ; String str = "" ; switch ( pos ) { case 0 : str = Integer . toString ( color . getRed ( ) ) ; break ; case 1 : str = Integer . toString ( color . getGreen ( ) ) ; break ; case 2 : str = Integer . toString ( color . getBlue ( ) ) ; break ; case 3 : str = Integer . toString ( color . getAlpha ( ) ) ; break ; } if ( ( e . key ) == ( KeyInput . BACK_SPACE ) ) { str = "" ; } <START_BUG> InputManager man = new InputManager ( ( ( ( renderer . cols ) // 2 ) + 10 ) , ( ( pos ) + 5 ) , str , 3 , ( output ) -> { <END_BUG> if ( output != null ) { try { int num = Integer . parseUnsignedInt ( output ) ; num = Math . max ( 0 , Math . min ( 255 , num ) ) ; switch ( pos ) { case 0 : color = new Color ( num , color . getGreen ( ) , color . getBlue ( ) , color . getAlpha ( ) ) ; break ; case 1 : color = new Color ( color . getRed ( ) , num , color . getBlue ( ) , color . getAlpha ( ) ) ; break ; case 2 : color = new Color ( color . getRed ( ) , color . getGreen ( ) , num , color . getAlpha ( ) ) ; break ; case 3 : color = new Color ( color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) , num ) ; break ; } } catch ( ex ) { getParent ( ) . displayError ( new IllegalNumberException ( ) ) ; } } editing = false ; renderer . repaint ( ) ; } ) ; getParent ( ) . addManager ( man ) ; } } } else if ( ( e . type ) == ( InputType . DOWN ) ) { if ( ( ( e . key ) == ( KeyInput . UP ) ) && ( ( pos ) > 0 ) ) { ( pos ) -- ; renderer . repaint ( ) ; } else if ( ( ( e . key ) == ( KeyInput . DOWN ) ) && ( ( pos ) < 4 ) ) { ( pos ) ++ ; renderer . repaint ( ) ; } else if ( ( e . key ) == ( KeyInput . LEFT ) ) { switch ( pos ) { case 0 : color = new Color ( Math . max ( 0 , ( ( color . getRed ( ) ) - 1 ) ) , color . getGreen ( ) , color . getBlue ( ) , color . getAlpha ( ) ) ; break ; case 1 : color = new Color ( color . getRed ( ) , Math . max ( 0 , ( ( color . getGreen ( ) ) - 1 ) ) , color . getBlue ( ) , color . getAlpha ( ) ) ; break ; case 2 : color = new Color ( color . getRed ( ) , color . getGreen ( ) , Math . max ( 0 , ( ( color . getBlue ( ) ) - 1 ) ) , color . getAlpha ( ) ) ; break ; case 3 : color = new Color ( color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) , Math . max ( 0 , ( ( color . getAlpha ( ) ) - 1 ) ) ) ; break ; case 4 : bpos = ( ( bpos ) == 0 ) ? 1 : 0 ; break ; } renderer . repaint ( ) ; } else if ( ( e . key ) == ( KeyInput . RIGHT ) ) { switch ( pos ) { case 0 : color = new Color ( Math . min ( 255 , ( ( color . getRed ( ) ) + 1 ) ) , color . getGreen ( ) , color . getBlue ( ) , color . getAlpha ( ) ) ; break ; case 1 : color = new Color ( color . getRed ( ) , Math . min ( 255 , ( ( color . getGreen ( ) ) + 1 ) ) , color . getBlue ( ) , color . getAlpha ( ) ) ; break ;

Fix:
InputManager man = new InputManager ( ( ( ( renderer . rows ) // 2 ) + 1 ) , ( ( pos ) + 5 ) , str , 3 , ( output ) -> {