https://bz.apache.org/bugzilla/show_bug.cgi?id=61105

--- Comment #9 from Konstantin Kolinko <knst.koli...@gmail.com> ---
(In reply to Violeta Georgieva from comment #8)
> Any comments?

Generally: I like it.

1. Typo in method name: obtainDateFormPath  s/Form/From/

2. Building a pattern,

> pattern = Pattern.compile("^(" + prefix + ")\\d{4}-\\d{1,2}-\\d{1,2}(" + 
> suffix + ")$");

This should use  (Pattern.quote(prefix) + "..." + Pattern.quote(suffix))

Prefix and suffix can contain special characters, e.g. '.' = any character.
Wrapping them with Pattern.quote() solves this issue.

3. Temporary directory handling in unit test

There is a base Test class that provides support for temporary directories,

https://github.com/apache/tomcat/blob/trunk/test/org/apache/catalina/startup/LoggingBaseTest.java

Differences:
- It respects system property "tomcat.test.temp"
- It uses creates a random directory for the test, to allow running several
tests in parallel
tempDir = Files.createTempDirectory(tempBasePath, "test").toFile();

Maybe it is not a good idea to use LoggingBaseTest directly as a base class,
as it initializes logging and this test tests logging, but it can be used to
copy some code.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to