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 77class TimestampParserCompiler {
88 private static TimestampFormatCompiler compiler ;
99 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
1111 private static CharSequenceObjHashMap <DateFormat > cache ;
1212
1313 public static DateFormat compilePattern (String timestampPattern ) {
1414 synchronized (MUTEX ) {
1515 if (compiler == null ) {
1616 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
2018 cache = new CharSequenceObjHashMap <>();
2119 }
2220 DateFormat format = cache .get (timestampPattern );
You can’t perform that action at this time.
0 commit comments