On S-RAMP, we prompt for a password with:
Prompt newPrompt = new Prompt(promptString); return this.consoleReader.read(newPrompt,Character.valueOf((char) 0)).getBuffer();
If you start typing a password, make a mistake, and hit the Backspace n+1 times (where n was the # of typed chars), you get this exception:
java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at java.lang.AbstractStringBuilder.insert(AbstractStringBuilder.java:1152) at java.lang.StringBuilder.insert(StringBuilder.java:336) at org.jboss.aesh.console.Buffer.write(Buffer.java:319) at org.jboss.aesh.console.Console.writeChar(Console.java:837) at org.jboss.aesh.console.Console.writeChars(Console.java:832) at org.jboss.aesh.console.Console.parseOperation(Console.java:515) at org.jboss.aesh.console.Console.read(Console.java:452) at org.overlord.sramp.shell.InteractiveShellCommandReader.promptForPassword(InteractiveShellCommandReader.java:161) at org.overlord.sramp.shell.ShellContextImpl.promptForPassword(ShellContextImpl.java:172) at org.overlord.sramp.shell.commands.core.ConnectCommand.promptForPassword(ConnectCommand.java:107) at org.overlord.sramp.shell.commands.core.ConnectCommand.execute(ConnectCommand.java:67) at org.overlord.sramp.shell.SrampShell.run(SrampShell.java:102) at org.overlord.sramp.shell.SrampShell.main(SrampShell.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297) at java.lang.Thread.run(Thread.java:744)