Skip to content

Commit

Permalink
eliminate duplicate string literal
Browse files Browse the repository at this point in the history
  • Loading branch information
hansenmc committed Jul 25, 2016
1 parent a38d1df commit 82a77c8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public final class StringUtils {

public static final String EMPTY = "";
public static final String SLASH = "/";
public static final String XQUERY_EXTENSION = ".xqy";
private static final String ADHOC_PATTERN = "(?i).*\\|ADHOC";
private static final String JAVASCRIPT_MODULE_FILENAME_PATTERN = "(?i).*\\.s?js(\\|ADHOC)?$";
private static final String INLINE_MODULE_PATTERN = "(?i)INLINE-(JAVASCRIPT|XQUERY)\\|(.*?)(\\|ADHOC)?$";
Expand Down Expand Up @@ -120,7 +121,7 @@ public static String getPathExtension(String path) {
* @return
*/
public static String buildModulePath(Class<?> clazz) {
return SLASH + clazz.getName().replace('.', '/') + ".xqy";
return SLASH + clazz.getName().replace('.', '/') + XQUERY_EXTENSION;
}

/**
Expand All @@ -130,7 +131,7 @@ public static String buildModulePath(Class<?> clazz) {
* @return
*/
public static String buildModulePath(Package modulePackage, String name) {
return SLASH + modulePackage.getName().replace('.', '/') + SLASH + name + (name.endsWith(".xqy") ? "" : ".xqy");
return SLASH + modulePackage.getName().replace('.', '/') + SLASH + name + (name.endsWith(XQUERY_EXTENSION) ? "" : XQUERY_EXTENSION);
}

public static String buildModulePath(String root, String module) {
Expand Down

0 comments on commit 82a77c8

Please sign in to comment.