Skip to content

Commit

Permalink
Simplified replace logic in Java and Clojure Snippet. Added attributi…
Browse files Browse the repository at this point in the history
…ons.
  • Loading branch information
aslakhellesoy committed Oct 8, 2012
1 parent edad391 commit ab1f39f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [Git master](https://github.com/cucumber/cucumber-jvm/compare/v1.0.14...master)

* [Core] Added video/ogg mimetype to embedd videos in the HTMLReport ([#390](https://github.com/cucumber/cucumber-jvm/pull/390) Klaus Bayrhammer)
* [Groovy] Generated Groovy step definitions need backslashes to be escaped ([#391](https://github.com/cucumber/cucumber-jvm/issues/391), [#400](https://github.com/cucumber/cucumber-jvm/pull/400), Martin Hauner)
* [Java] The java module (and all other modules) finally compile on JDK 7 and OS X. (David Kowis, Sébastien Le Callonnec, Aslak Hellesøy)
* [Core] The `cucumber.options` System property will no longer completely override all arguments set in `@Cucumber.Options` or
on the command line. Instead, it will keep those and only override those that are specified in `cucumber.options`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public String namedGroupEnd() {

@Override
public String escapePattern(String pattern) {
return pattern.replaceAll("\"", "\\\\\"");
return pattern.replace("\"", "\\\"");
}
}
2 changes: 1 addition & 1 deletion java/src/main/java/cucumber/runtime/java/JavaSnippet.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public String namedGroupEnd() {

@Override
public String escapePattern(String pattern) {
return pattern.replaceAll("\\\\", "\\\\\\\\").replaceAll("\"", "\\\\\"");
return pattern.replace("\\", "\\\\").replace("\"", "\\\"");
}
}

0 comments on commit ab1f39f

Please sign in to comment.