'i' does not seem to reinitialize itself to 0 when the function gets recalled.
What makes you think that, are you suggesting Java's for loop is broken? Have you added print statements to find out what i's value is and what the flow of execution is?

What sets/changes the contents of the move, pegsLeft and pegsToRemain variables?

BTW why are you encoding int values into a string and then decoding them in the method - why not put them in an instance of a class designed to hold the int 3 values?