Skip to content

Commit

Permalink
[Core] inline PACKAGE_PATTERN in MethodFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
lsuski authored and mpkorstanje committed Jan 11, 2019
1 parent 3c8b456 commit f6743cd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/main/java/cucumber/runtime/MethodFormat.java
Expand Up @@ -11,8 +11,7 @@
*/ */
public class MethodFormat { public class MethodFormat {
private static final Pattern METHOD_PATTERN = Pattern.compile("((?:static\\s|public\\s)+)([^\\s]*)\\s\\.?(.*)\\.([^\\(]*)\\(([^\\)]*)\\)(?: throws )?(.*)"); private static final Pattern METHOD_PATTERN = Pattern.compile("((?:static\\s|public\\s)+)([^\\s]*)\\s\\.?(.*)\\.([^\\(]*)\\(([^\\)]*)\\)(?: throws )?(.*)");
private static final String PACKAGE_PATTERN = "[^,]*\\."; private static final Pattern PACKAGE_PATTERN = Pattern.compile("[^,]*\\.");
private static final Pattern COMPILED_PACKAGE_PATTERN = Pattern.compile(PACKAGE_PATTERN);
private final MessageFormat format; private final MessageFormat format;


public static final MethodFormat SHORT = new MethodFormat("%c.%m(%a)"); public static final MethodFormat SHORT = new MethodFormat("%c.%m(%a)");
Expand Down Expand Up @@ -82,7 +81,7 @@ public String format(Method method) {
} }


private static String removePackage(String qc) { private static String removePackage(String qc) {
return COMPILED_PACKAGE_PATTERN.matcher(qc).replaceAll(""); return PACKAGE_PATTERN.matcher(qc).replaceAll("");
} }


private String getCodeSource(Method method) { private String getCodeSource(Method method) {
Expand Down

0 comments on commit f6743cd

Please sign in to comment.