diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2021-12-04 19:29:56 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-12-04 19:31:53 +0100 |
commit | 8583b3c56c4bb644ee26436a4a3d867e0fb49202 (patch) | |
tree | d561af7d1f46dfb9b4437f24f605db9025c83803 | |
parent | 684ec2c316efed11023921860b9e039f0023f1b8 (diff) | |
parent | 70b894da19caf1429c00375f8f730725d8958f13 (diff) | |
download | jgit-8583b3c56c4bb644ee26436a4a3d867e0fb49202.tar.gz jgit-8583b3c56c4bb644ee26436a4a3d867e0fb49202.zip |
Merge branch 'stable-5.9' into stable-5.10
* stable-5.9:
Add missing @since tags
Add missing @since tag
Add missing @since tags
Remove unused import in ApacheSshTest
Update maven plugins
Ignore missing javadoc in test bundles
storage: file: De-duplicate File.exists()+File.isFile()
RefDirectory.scanRef: Re-use file existence check done in snapshot creation
FileSnapshot: Lazy load file store attributes cache
Update eclipse-jarsigner-plugin to 1.3.2
Fix p2 repository URLs
Change-Id: I971745b529ff903ea8bf9c3dbbc746fa09f41041
27 files changed, 73 insertions, 32 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java index 1769832fba..0957cc80fa 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java @@ -125,6 +125,7 @@ public class GitFilter extends MetaFilter { * * @param h * A custom error handler for git-upload-pack. + * @since 5.6 */ public void setUploadPackErrorHandler(UploadPackErrorHandler h) { assertNotInitialized(); @@ -163,6 +164,7 @@ public class GitFilter extends MetaFilter { * * @param h * A custom error handler for git-receive-pack. + * @since 5.7 */ public void setReceivePackErrorHandler(ReceivePackErrorHandler h) { assertNotInitialized(); diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackErrorHandler.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackErrorHandler.java index ee66cb102f..a7ca4d0931 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackErrorHandler.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackErrorHandler.java @@ -31,7 +31,7 @@ import org.eclipse.jgit.transport.ServiceMayNotContinueException; * If a custom handler is not specified, JGit will use the default error * handler. * - * @since 5.6 + * @since 5.7 */ public interface ReceivePackErrorHandler { /** diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java index 664615e456..6bfe70659b 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java @@ -80,6 +80,7 @@ public class MockSystemReader extends SystemReader { * @param userGitConfig * set another user-level git config * @return the old user-level git config + * @since 5.1.9 */ public FileBasedConfig setUserGitConfig(FileBasedConfig userGitConfig) { FileBasedConfig old = this.userGitConfig; @@ -92,6 +93,7 @@ public class MockSystemReader extends SystemReader { * * @param jgitConfig * set the jgit configuration + * @since 5.5 */ public void setJGitConfig(FileBasedConfig jgitConfig) { this.jgitConfig = jgitConfig; @@ -103,6 +105,7 @@ public class MockSystemReader extends SystemReader { * @param systemGitConfig * the new system-level git config * @return the old system-level config + * @since 5.1.9 */ public FileBasedConfig setSystemGitConfig(FileBasedConfig systemGitConfig) { FileBasedConfig old = this.systemGitConfig; diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java index 3db3ba90c2..adcc10cad8 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepeatRule.java @@ -60,6 +60,7 @@ public class RepeatRule implements TestRule { * * @param message * the error message + * @since 5.1.9 */ public RepeatedTestException(String message) { super(message); diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java index 64556acc1c..32af08c179 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java @@ -338,6 +338,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { * greater than then the lastmodification time of lastfile. * @throws InterruptedException * @throws IOException + * @since 5.1.9 */ public static Instant fsTick(File lastFile) throws InterruptedException, diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SeparateClassloaderTestRunner.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SeparateClassloaderTestRunner.java index b982787e75..106abf0912 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SeparateClassloaderTestRunner.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/SeparateClassloaderTestRunner.java @@ -21,6 +21,8 @@ import org.junit.runners.model.InitializationError; * This class is used when it's required to load jgit classes in separate * classloader for each test class. It can be needed to isolate static field * initialization between separate tests. + * + * @since 5.5 */ public class SeparateClassloaderTestRunner extends BlockJUnit4ClassRunner { diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java index a5b3b1f3ac..fc19de0bdf 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java @@ -337,6 +337,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable { * zero or more IDs of the commit's parents. * @return the ID of the new commit. * @throws Exception + * @since 5.5 */ public ObjectId unparsedCommit(ObjectId... parents) throws Exception { return unparsedCommit(1, tree(), parents); @@ -429,6 +430,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable { * zero or more IDs of the commit's parents. * @return the ID of the new commit. * @throws Exception + * @since 5.5 */ public ObjectId unparsedCommit(final int secDelta, final RevTree tree, final ObjectId... parents) throws Exception { diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/time/TimeUtil.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/time/TimeUtil.java index 2ebb8e27db..f93ac57f13 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/time/TimeUtil.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/time/TimeUtil.java @@ -20,6 +20,8 @@ import org.eclipse.jgit.util.FS; /** * Utility methods for handling timestamps + * + * @since 5.1.9 */ public class TimeUtil { /** diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target index c72730b337..6a02260ca2 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.10" sequenceNumber="1635976698"> +<target name="jgit-4.10" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd index d84f801877..24a70f4595 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd @@ -6,3 +6,4 @@ include "orbit/R20201130205003-2020-12.tpd" location "https://download.eclipse.org/releases/2018-12/" { org.eclipse.osgi lazy } + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target index 6e8eab0763..a2ae129175 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.11.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.11" sequenceNumber="1635976698"> +<target name="jgit-4.11" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target index f86baf222d..4ca8843033 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.12.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.12" sequenceNumber="1635976698"> +<target name="jgit-4.12" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target index 626fb16108..4367b5fbc5 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.13.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.13" sequenceNumber="1635976698"> +<target name="jgit-4.13" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target index 1a764a447a..32288ce854 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.14" sequenceNumber="1635976698"> +<target name="jgit-4.14" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd index f517ab254c..dfc57fca52 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.14.tpd @@ -6,3 +6,4 @@ include "orbit/R20201130205003-2020-12.tpd" location "https://download.eclipse.org/releases/2019-12/201912181000/" { org.eclipse.osgi lazy } + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target index c1b6f3c165..cd77494b3b 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.15.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.15" sequenceNumber="1635976698"> +<target name="jgit-4.15" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target index a45870d6b8..ec0759cc93 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.16.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.16" sequenceNumber="1635976698"> +<target name="jgit-4.16" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.target index 773db74dd6..e0410874df 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.17.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.17-staging" sequenceNumber="1635976698"> +<target name="jgit-4.17-staging" sequenceNumber="1638642625"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18.target index 1cffcf851e..4362c7c2a6 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.18.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.18-staging" sequenceNumber="1635976698"> +<target name="jgit-4.18-staging" sequenceNumber="1638642639"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target index 16782ac935..210ffe21bf 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.6" sequenceNumber="1635976707"> +<target name="jgit-4.6" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target index cf737546a6..0782ea0fd4 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.7.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.7" sequenceNumber="1635976703"> +<target name="jgit-4.7" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target index 923e238a06..7b7f3c83fc 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.8.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.8" sequenceNumber="1635976698"> +<target name="jgit-4.8" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target index aedc418499..37c17f3557 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.target @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?pde?> <!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl --> -<target name="jgit-4.9" sequenceNumber="1635976698"> +<target name="jgit-4.9" sequenceNumber="1638642627"> <locations> <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit"> <unit id="org.eclipse.jetty.client" version="9.4.30.v20200611"/> diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java index 54ff7d29c6..d7f6ef316d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileSnapshot.java @@ -185,6 +185,12 @@ public class FileSnapshot { private FileStoreAttributes fileStoreAttributeCache; /** + * if {@code true} read filesystem time resolution from configuration file + * otherwise use fallback resolution + */ + private boolean useConfig; + + /** * Object that uniquely identifies the given file, or {@code * null} if a file key is not available */ @@ -220,9 +226,7 @@ public class FileSnapshot { protected FileSnapshot(File file, boolean useConfig) { this.file = file; this.lastRead = Instant.now(); - this.fileStoreAttributeCache = useConfig - ? FS.getFileStoreAttributes(file.toPath().getParent()) - : FALLBACK_FILESTORE_ATTRIBUTES; + this.useConfig = useConfig; BasicFileAttributes fileAttributes = null; try { fileAttributes = FS.DETECTED.fileAttributes(file); @@ -366,7 +370,7 @@ public class FileSnapshot { * if sleep was interrupted */ public void waitUntilNotRacy() throws InterruptedException { - long timestampResolution = fileStoreAttributeCache + long timestampResolution = fileStoreAttributeCache() .getFsTimestampResolution().toNanos(); while (isRacyClean(Instant.now())) { TimeUnit.NANOSECONDS.sleep(timestampResolution); @@ -403,6 +407,15 @@ public class FileSnapshot { return equals(other); } + /** + * Check if the file exists + * + * @return true if the file exists + */ + public boolean fileExists() { + return !MISSING_FILEKEY.equals(this.fileKey); + } + /** {@inheritDoc} */ @Override public int hashCode() { @@ -487,10 +500,10 @@ public class FileSnapshot { } private long getEffectiveRacyThreshold() { - long timestampResolution = fileStoreAttributeCache + long timestampResolution = fileStoreAttributeCache() .getFsTimestampResolution().toNanos(); - long minRacyInterval = fileStoreAttributeCache.getMinimalRacyInterval() - .toNanos(); + long minRacyInterval = fileStoreAttributeCache() + .getMinimalRacyInterval().toNanos(); long max = Math.max(timestampResolution, minRacyInterval); // safety margin: factor 2.5 below 100ms otherwise 1.25 return max < 100_000_000L ? max * 5 / 2 : max * 5 / 4; @@ -550,4 +563,13 @@ public class FileSnapshot { } return changed; } + + private FileStoreAttributes fileStoreAttributeCache() { + if (fileStoreAttributeCache == null) { + fileStoreAttributeCache = useConfig + ? FS.getFileStoreAttributes(file.toPath().getParent()) + : FALLBACK_FILESTORE_ATTRIBUTES; + } + return fileStoreAttributeCache; + } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java index e27518690b..7179d140b4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryPackParser.java @@ -151,7 +151,7 @@ public class ObjectDirectoryPackParser extends PackParser { String p = pack.getAbsolutePath(); String i = p.substring(0, p.length() - ".pack".length()) + ".idx"; //$NON-NLS-1$ //$NON-NLS-2$ File idx = new File(i); - if (idx.exists() && idx.isFile()) + if (idx.isFile()) size += idx.length(); return size; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java index 17a910008c..2167262dd5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java @@ -1092,10 +1092,14 @@ public class RefDirectory extends RefDatabase { final int limit = 4096; final byte[] buf; FileSnapshot otherSnapshot = FileSnapshot.save(path); + if (!otherSnapshot.fileExists()) { + return null; + } + try { buf = IO.readSome(path, limit); } catch (FileNotFoundException noFile) { - if (path.exists() && path.isFile()) { + if (path.isFile()) { throw noFile; } return null; // doesn't exist or no file; not a reference. @@ -168,14 +168,14 @@ <httpcore-version>4.4.12</httpcore-version> <slf4j-version>1.7.30</slf4j-version> <log4j-version>1.2.15</log4j-version> - <maven-javadoc-plugin-version>3.2.0</maven-javadoc-plugin-version> + <maven-javadoc-plugin-version>3.3.1</maven-javadoc-plugin-version> <tycho-extras-version>1.7.0</tycho-extras-version> <gson-version>2.8.2</gson-version> <bouncycastle-version>1.65</bouncycastle-version> - <spotbugs-maven-plugin-version>4.1.3</spotbugs-maven-plugin-version> - <maven-project-info-reports-plugin-version>3.1.1</maven-project-info-reports-plugin-version> - <maven-jxr-plugin-version>3.0.0</maven-jxr-plugin-version> - <maven-surefire-plugin-version>3.0.0-M4</maven-surefire-plugin-version> + <spotbugs-maven-plugin-version>4.3.0</spotbugs-maven-plugin-version> + <maven-project-info-reports-plugin-version>3.1.2</maven-project-info-reports-plugin-version> + <maven-jxr-plugin-version>3.1.1</maven-jxr-plugin-version> + <maven-surefire-plugin-version>3.0.0-M5</maven-surefire-plugin-version> <maven-surefire-report-plugin-version>${maven-surefire-plugin-version}</maven-surefire-report-plugin-version> <maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version> <plexus-compiler-version>2.8.8</plexus-compiler-version> @@ -247,7 +247,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> - <version>3.1.2</version> + <version>3.2.0</version> </plugin> <plugin> @@ -299,7 +299,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> - <version>3.14.0</version> + <version>3.15.0</version> <configuration> <sourceEncoding>utf-8</sourceEncoding> <minimumTokens>100</minimumTokens> @@ -337,7 +337,7 @@ <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> - <version>0.8.6</version> + <version>0.8.7</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -398,7 +398,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-enforcer-plugin</artifactId> - <version>3.0.0-M3</version> + <version>3.0.0</version> <executions> <execution> <id>enforce-maven</id> |