[JENKINS-73775] Replace deprecated call to JGit setLastModified(long) #2572
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[JENKINS-73775] Replace deprecated call to JGit setLastModified(long)
See JENKINS-73775
JGit 5 deprecated the
DirCacheEntry.setLastModified(long)
method and recommendsDirCacheEntry.setLastModified(Instant)
. JGit 7.0.0 removes DirCacheEntry.setLastModified(long). This change will work with older versions of JGit (like 6.9.0 and 6.10.0) and JGit 7.0.0 because the replacement method is available with older versions and the most recent release.Javadoc for JGit 6.9.0 shows the deprecation.
Without this change, users that try to run a commit from the Git portion of Blue Ocean may see a method not found exception that will fail the operation.
No additional tests because the automated tests running in plugin BOM are what showed the issue.
This needs to be merged and released soon so that users of Jenkins weekly 2.463 and later do not see the method not found exception when they install git client plugin 6.0.0.
I've confirmed that I can see the issue with interactive testing of Jenkins 2.476 using git client plugin 6.0.0. When I replace git client plugin 6.0.0 with git client plugin 5.0.0 the issue does not appear. In order to duplicate it with Jenkins 2.476, I had to use a FreeBSD git server (git.markwaite.net) where I could add the RSA SHA-1 public key that Blue Ocean generates to ~/.ssh/authorized_keys. I can't do that with github.com because they no longer accept RSA SHA-1 public keys.
Submitter checklist
Reviewer checklist