diff --git a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs index 2ca78ff2d..d4751b535 100644 --- a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs @@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private diff --git a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs index 2ca78ff2d..d4751b535 100644 --- a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs @@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private diff --git a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs index 2ca78ff2d..d4751b535 100644 --- a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs @@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private diff --git a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs index 2ca78ff2d..d4751b535 100644 --- a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs @@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10-staging.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target similarity index 95% rename from org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10-staging.target rename to org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target index 55e44b8f7..268fbc757 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10-staging.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.target @@ -1,7 +1,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -80,7 +80,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10-staging.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd similarity index 72% rename from org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10-staging.tpd rename to org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd index 98bbc2d8c..71230d705 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10-staging.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.10.tpd @@ -3,6 +3,6 @@ target "jgit-4.9-staging" with source configurePhase include "projects/jetty-9.4.11.tpd" include "orbit/R20190602212107-2019-06.tpd" -location "http://download.eclipse.org/staging/2018-12/" { +location "http://download.eclipse.org/releases/2018-12/" { org.eclipse.osgi lazy } \ No newline at end of file diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target index 7820a1358..15ee44680 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.5.target @@ -1,7 +1,7 @@ - + @@ -20,7 +20,7 @@ - + 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 997d9c983..bc1c54f52 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 @@ - + @@ -20,7 +20,7 @@ - + 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 03c9a8b52..596e3c4d0 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 @@ - + @@ -20,7 +20,7 @@ - + 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 e29620cc1..a0e094860 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 @@ - + @@ -20,7 +20,7 @@ - + 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 82a64ce3d..a4dd92c88 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 @@ - + @@ -20,7 +20,7 @@ - + @@ -80,7 +80,7 @@ - + diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd index d5beea361..6ee4c6a84 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.9.tpd @@ -3,6 +3,6 @@ target "jgit-4.9" with source configurePhase include "projects/jetty-9.4.11.tpd" include "orbit/R20190602212107-2019-06.tpd" -location "http://download.eclipse.org/releases/2018-09/" { +location "https://download.eclipse.org/releases/2018-09/" { org.eclipse.osgi lazy } \ No newline at end of file diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.4.11.tpd b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.4.11.tpd index d2fd9017b..4b4612147 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.4.11.tpd +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/projects/jetty-9.4.11.tpd @@ -1,6 +1,6 @@ target "jetty-9.4.11" with source configurePhase -location jetty-9.4.11 "http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.11.v20180605" { +location jetty-9.4.11 "https://archive.eclipse.org/jetty/updates/jetty-bundles-9.x/jetty-bundles-9.x/9.4.11.v20180605/" { org.eclipse.jetty.client [9.4.11.v20180605,9.4.11.v20180605] org.eclipse.jetty.client.source [9.4.11.v20180605,9.4.11.v20180605] org.eclipse.jetty.continuation [9.4.11.v20180605,9.4.11.v20180605] diff --git a/org.eclipse.jgit.packaging/pom.xml b/org.eclipse.jgit.packaging/pom.xml index d8d061e36..35fa738c7 100644 --- a/org.eclipse.jgit.packaging/pom.xml +++ b/org.eclipse.jgit.packaging/pom.xml @@ -55,7 +55,7 @@ JGit Tycho Parent - 1.3.0 + 1.7.0 ${tycho-version} jgit-4.6 @@ -255,7 +255,7 @@ org.eclipse.cbi.maven.plugins eclipse-jarsigner-plugin - 1.1.5 + 1.3.2 org.codehaus.mojo diff --git a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs index 2ca78ff2d..d4751b535 100644 --- a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs @@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private diff --git a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs index 2ca78ff2d..d4751b535 100644 --- a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs @@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private 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 976f946e5..654e98d81 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 @@ -217,6 +217,12 @@ public static FileSnapshot save(Instant modified) { /** measured FileStore attributes */ 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 @@ -253,9 +259,7 @@ protected FileSnapshot(File file) { 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); @@ -399,7 +403,7 @@ public void setClean(FileSnapshot other) { * 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); @@ -435,6 +439,15 @@ public boolean equals(Object obj) { 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() { @@ -519,10 +532,10 @@ private boolean isRacyClean(Instant read) { } 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; @@ -582,4 +595,13 @@ private boolean isSizeChanged(long currSize) { } 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 6e8a15e86..889a5108d 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 @@ -184,7 +184,7 @@ public long getPackSize() { 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 f7a52a54b..c34be9cc0 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 @@ -1103,10 +1103,14 @@ LooseRef scanRef(LooseRef ref, String name) throws IOException { 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. diff --git a/pom.xml b/pom.xml index b0fc1e738..df604a6ed 100644 --- a/pom.xml +++ b/pom.xml @@ -199,13 +199,13 @@ 4.4.10 1.7.2 1.2.15 - 3.1.0 - 1.3.0 + 3.3.1 + 1.7.0 2.8.2 - 3.0.0 - 3.0.0 - 3.1.12 - 3.0.0-M3 + 3.1.2 + 3.1.1 + 4.3.0 + 3.0.0-M5 ${maven-surefire-plugin-version} 3.8.1 @@ -239,7 +239,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.1.2 + 3.2.0 @@ -264,25 +264,25 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.1 + 3.2.4 org.apache.maven.plugins maven-antrun-plugin - 1.8 + 3.0.0 org.apache.maven.plugins maven-dependency-plugin - 3.1.1 + 3.2.0 org.apache.maven.plugins maven-source-plugin - 3.1.0 + 3.2.1 @@ -304,7 +304,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.0.0 + 3.2.0 @@ -327,7 +327,7 @@ org.apache.maven.plugins maven-pmd-plugin - 3.12.0 + 3.15.0 utf-8 100 @@ -350,7 +350,7 @@ org.eclipse.cbi.maven.plugins eclipse-jarsigner-plugin - 1.1.5 + 1.3.2 org.eclipse.tycho.extras @@ -365,12 +365,12 @@ org.jacoco jacoco-maven-plugin - 0.8.4 + 0.8.7 org.apache.maven.plugins maven-site-plugin - 3.7.1 + 3.9.1 org.apache.maven.wagon @@ -412,7 +412,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.1.0 + 3.2.0 @@ -421,7 +421,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M2 + 3.0.0 enforce-maven