File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
connector/src/main/java/io/questdb/kafka Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 7
7
class TimestampParserCompiler {
8
8
private static TimestampFormatCompiler compiler ;
9
9
private static final Object MUTEX = new Object ();
10
- // we assume that there will just a few patterns
10
+ // we assume that there will just a few patterns hence to issue with unbounded cache growth
11
11
private static CharSequenceObjHashMap <DateFormat > cache ;
12
12
13
13
public static DateFormat compilePattern (String timestampPattern ) {
14
14
synchronized (MUTEX ) {
15
15
if (compiler == null ) {
16
16
compiler = new TimestampFormatCompiler ();
17
- }
18
- // DateFormat instances are thread-safe, so we can cache them and use for multiple workers
19
- if (cache == null ) {
17
+ // DateFormat instances are thread-safe, so we can cache them and use for multiple workers
20
18
cache = new CharSequenceObjHashMap <>();
21
19
}
22
20
DateFormat format = cache .get (timestampPattern );
You can’t perform that action at this time.
0 commit comments