What steps will reproduce the problem?
1. enter text '//// comment'
2. open find and replace dialog
3. find string '//'
4. replace string '\'
5. click 'replace all'
What is the expected output? What do you see instead?
expected: string '\\ comment' in editor pane.
actual:
Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException
: String index out of range: 1
at java.lang.String.charAt(Unknown Source)
at java.util.regex.Matcher.appendReplacement(Unknown Source)
at java.util.regex.Matcher.replaceAll(Unknown Source)
at jsyntaxpane.actions.DocumentSearchData.doReplaceAll(DocumentSearchData.java:133)
at jsyntaxpane.actions.gui.ReplaceDialog.jBtnReplaceAllActionPerformed(ReplaceDialog.java:251)
at jsyntaxpane.actions.gui.ReplaceDialog.access$200(ReplaceDialog.java:3
4)
at jsyntaxpane.actions.gui.ReplaceDialog$3.actionPerformed(ReplaceDialog.java:141)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
Solution is probably to call Matcher.quoteReplacement() on the replace string.
What version of the product are you using? On what operating system?
jsyntaxpane-0.9.5-b29.jar
win xp64
Original issue reported on code.google.com by javlo...@gmail.com on 18 Oct 2010 at 10:19
Original issue reported on code.google.com by
javlo...@gmail.com
on 18 Oct 2010 at 10:19