aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.packaging/pom.xml13
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableDatabase.java10
-rw-r--r--pom.xml13
3 files changed, 34 insertions, 2 deletions
diff --git a/org.eclipse.jgit.packaging/pom.xml b/org.eclipse.jgit.packaging/pom.xml
index 6a37f0adf7..068712868a 100644
--- a/org.eclipse.jgit.packaging/pom.xml
+++ b/org.eclipse.jgit.packaging/pom.xml
@@ -189,6 +189,19 @@
</rules>
</configuration>
</execution>
+ <execution>
+ <id>enforce-java</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>17</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableDatabase.java
index 559d5a4339..64f8c9b0e3 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableDatabase.java
@@ -264,8 +264,14 @@ public class FileReftableDatabase extends RefDatabase {
public void refresh() {
try {
if (!reftableStack.isUpToDate()) {
- reftableDatabase.clearCache();
- reftableStack.reload();
+ ReentrantLock lock = getLock();
+ lock.lock();
+ try {
+ reftableDatabase.clearCache();
+ reftableStack.reload();
+ } finally {
+ lock.unlock();
+ }
}
} catch (IOException e) {
throw new UncheckedIOException(e);
diff --git a/pom.xml b/pom.xml
index cb848bfed8..b0c12d7ad7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -404,6 +404,19 @@
</rules>
</configuration>
</execution>
+ <execution>
+ <id>enforce-java</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>17</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
</executions>
</plugin>