From ab1f39f7e258f15633e8ce671f1ebf30e53a2d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aslak=20Helles=C3=B8y?= Date: Mon, 8 Oct 2012 23:48:50 +0100 Subject: [PATCH] Simplified replace logic in Java and Clojure Snippet. Added attributions. --- History.md | 2 ++ .../src/test/java/cucumber/runtime/clojure/ClojureSnippet.java | 2 +- java/src/main/java/cucumber/runtime/java/JavaSnippet.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/History.md b/History.md index 097baca714..c696f50cbf 100644 --- a/History.md +++ b/History.md @@ -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`. diff --git a/clojure/src/test/java/cucumber/runtime/clojure/ClojureSnippet.java b/clojure/src/test/java/cucumber/runtime/clojure/ClojureSnippet.java index f9195a7c88..fd468ee831 100644 --- a/clojure/src/test/java/cucumber/runtime/clojure/ClojureSnippet.java +++ b/clojure/src/test/java/cucumber/runtime/clojure/ClojureSnippet.java @@ -40,6 +40,6 @@ public String namedGroupEnd() { @Override public String escapePattern(String pattern) { - return pattern.replaceAll("\"", "\\\\\""); + return pattern.replace("\"", "\\\""); } } diff --git a/java/src/main/java/cucumber/runtime/java/JavaSnippet.java b/java/src/main/java/cucumber/runtime/java/JavaSnippet.java index 2b6773522b..d3a264c9b8 100644 --- a/java/src/main/java/cucumber/runtime/java/JavaSnippet.java +++ b/java/src/main/java/cucumber/runtime/java/JavaSnippet.java @@ -45,6 +45,6 @@ public String namedGroupEnd() { @Override public String escapePattern(String pattern) { - return pattern.replaceAll("\\\\", "\\\\\\\\").replaceAll("\"", "\\\\\""); + return pattern.replace("\\", "\\\\").replace("\"", "\\\""); } }