From 2ec6a6d45d020ed3b9bbcbb812ddc27ecfa3969e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 28 Jul 2016 21:24:55 +0300 Subject: [PATCH] Fix JDBCSequentialFileFactory build on 1.7 --- .../artemis/jdbc/store/file/JDBCSequentialFileFactory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java index 34547578ad..cf45a8a5c5 100644 --- a/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java +++ b/artemis-jdbc-store/src/main/java/org/apache/activemq/artemis/jdbc/store/file/JDBCSequentialFileFactory.java @@ -81,7 +81,9 @@ public class JDBCSequentialFileFactory implements SequentialFileFactory, ActiveM @Override public SequentialFile createSequentialFile(String fileName) { try { - fileLocks.putIfAbsent(fileName, new Object()); + if (fileLocks.get(fileName) == null) { + fileLocks.put(fileName, new Object()); + } JDBCSequentialFile file = new JDBCSequentialFile(this, fileName, executor, dbDriver, fileLocks.get(fileName)); files.add(file); return file;