Skip to content

Commit

Permalink
Make methods static
Browse files Browse the repository at this point in the history
  • Loading branch information
pzygielo committed Dec 21, 2022
1 parent d63fb85 commit 9e0598e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private void log(String message, Throwable t) {
* @param path to be normalized
* @return normalized path or null
*/
protected String normalize(String path) {
protected static String normalize(String path) {
if (path == null) {
return null;
}
Expand Down Expand Up @@ -292,7 +292,7 @@ protected String normalize(String path) {
* @param path to be normalized
* @return normalized path
*/
private String evaluateNormalizedPathWithSinglePoint(String path) {
private static String evaluateNormalizedPathWithSinglePoint(String path) {
// Resolve occurrences of "/./" in the normalized path
while (true) {
int idx = path.indexOf("/./");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ public void normalizeURLTest() {
String path2 = "/app/./some/./something/./my.jsp";
String path3 = "./my.jsp";

String result = standardContextValve.normalize(path1);
String result = StandardContextValve.normalize(path1);
assertEquals("/my.jsp", result);

result = standardContextValve.normalize(path2);
result = StandardContextValve.normalize(path2);
assertEquals("/app/some/something/my.jsp", result);

result = standardContextValve.normalize(path3);
result = StandardContextValve.normalize(path3);
assertEquals("/my.jsp", result);
}
}
}

0 comments on commit 9e0598e

Please sign in to comment.