From 60d43fa1b2deb752049e393b2c2dac45e709a133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lu=C3=9Fnig?= Date: Thu, 20 Nov 2025 20:21:51 +0100 Subject: [PATCH 1/2] Version Update Prepare for JDK 25 --- .classpath | 37 ++-- build.moxie | 10 +- gitblit.iml | 183 ++++++++---------- .../com/syntevo/bugtraq/BugtraqConfig.java | 2 +- .../com/gitblit/git/GitblitReceivePack.java | 2 + .../gitblit/git/SideBandProgressMonitor.java | 11 +- .../transport/git/GitDaemonClient.java | 6 +- .../java/com/gitblit/utils/JGitUtils.java | 19 +- .../java/com/gitblit/utils/RefLogUtils.java | 2 +- .../com/gitblit/wicket/pages/TicketPage.java | 2 +- .../gitblit/wicket/panels/BranchesPanel.java | 4 +- 11 files changed, 135 insertions(+), 143 deletions(-) diff --git a/.classpath b/.classpath index ed27f4e0b..8d2a64a0d 100644 --- a/.classpath +++ b/.classpath @@ -9,14 +9,15 @@ - - + + - - - + + + + @@ -57,19 +58,14 @@ - - - - - - - - - - - - - + + + + + + + + @@ -81,7 +77,7 @@ - + @@ -107,6 +103,9 @@ + + + diff --git a/build.moxie b/build.moxie index bd1c92880..e1ed562cc 100644 --- a/build.moxie +++ b/build.moxie @@ -109,9 +109,9 @@ properties: { slf4j.version : 1.7.36 wicket.version : 1.4.22 lucene.version : 5.5.2 - jgit.version : 4.11.9.201909030838-r + jgit.version : 6.10.1.202505221210-r groovy.version : 2.4.21 - bouncycastle.version : 1.81 + bouncycastle.version : 1.82 selenium.version : 2.28.0 wikitext.version : 1.4 sshd.version: 1.7.0 @@ -135,7 +135,7 @@ properties: { dependencies: - compile 'com.google.inject:guice:${guice.version}' :war :fedclient - compile 'com.google.inject.extensions:guice-servlet:${guice-servlet.version}' :war -- compile 'com.google.guava:guava:32.1.3-jre' :war :fedclient +- compile 'com.google.guava:guava:33.5.0-jre' :war :fedclient - compile 'com.intellij:annotations:12.0' :war - compile 'ch.qos.reload4j:reload4j:1.2.25' :war :fedclient :manager - compile 'org.slf4j:slf4j-api:${slf4j.version}' :war :fedclient :manager @@ -181,13 +181,13 @@ dependencies: - compile 'org.apache.ivy:ivy:2.5.3' :war - compile 'com.toedter:jcalendar:1.3.2' :authority - compile 'org.apache.commons:commons-compress:1.27.1' :war -- compile 'commons-io:commons-io:2.19.0' :war +- compile 'commons-io:commons-io:2.21.0' :war - compile 'com.force.api:force-partner-api:24.0.0' :war - compile 'org.freemarker:freemarker:2.3.22' :war - compile 'com.github.dblock.waffle:waffle-jna:1.7.3' :war - compile 'org.kohsuke:libpam4j:1.11' :war - compile 'args4j:args4j:2.0.29' :war :fedclient -- compile 'commons-codec:commons-codec:1.9' :war +- compile 'commons-codec:commons-codec:1.15' :war - compile 'redis.clients:jedis:2.6.2' :war - compile 'ro.fortsoft.pf4j:pf4j:0.9.0' :war - compile 'org.apache.tika:tika-core:1.28.5' :war diff --git a/gitblit.iml b/gitblit.iml index 52dc93df4..38974df68 100644 --- a/gitblit.iml +++ b/gitblit.iml @@ -48,24 +48,24 @@ - + - + - + - + - + - + @@ -90,35 +90,35 @@ - + - + - + - + - + - + - + - + - + @@ -133,6 +133,17 @@ + + + + + + + + + + + @@ -572,145 +583,90 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -834,13 +790,13 @@ - + - + - + @@ -1119,6 +1075,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/bugtraq/com/syntevo/bugtraq/BugtraqConfig.java b/src/main/bugtraq/com/syntevo/bugtraq/BugtraqConfig.java index ca0b317f3..57a8a7cd8 100644 --- a/src/main/bugtraq/com/syntevo/bugtraq/BugtraqConfig.java +++ b/src/main/bugtraq/com/syntevo/bugtraq/BugtraqConfig.java @@ -216,7 +216,7 @@ private static Config getBaseConfig(@NotNull Repository repository, @NotNull Str TreeWalk tw = new TreeWalk(repository); tw.setFilter(PathFilterGroup.createFromStrings(configFileName)); try { - final Ref ref = repository.getRef(Constants.HEAD); + final Ref ref = repository.findRef(Constants.HEAD); if (ref == null) { return null; } diff --git a/src/main/java/com/gitblit/git/GitblitReceivePack.java b/src/main/java/com/gitblit/git/GitblitReceivePack.java index f271f6f19..6238cba97 100644 --- a/src/main/java/com/gitblit/git/GitblitReceivePack.java +++ b/src/main/java/com/gitblit/git/GitblitReceivePack.java @@ -502,12 +502,14 @@ protected void executeCommands() { } ProgressMonitor updating = NullProgressMonitor.INSTANCE; + /* boolean sideBand = isCapabilityEnabled(CAPABILITY_SIDE_BAND_64K); if (sideBand) { SideBandProgressMonitor pm = new SideBandProgressMonitor(msgOut); pm.setDelayStart(250, TimeUnit.MILLISECONDS); updating = pm; } + */ BatchRefUpdate batch = getRepository().getRefDatabase().newBatchUpdate(); batch.setAllowNonFastForwards(isAllowNonFastForwards()); diff --git a/src/main/java/com/gitblit/git/SideBandProgressMonitor.java b/src/main/java/com/gitblit/git/SideBandProgressMonitor.java index 0322f180c..e7b4fcfda 100644 --- a/src/main/java/com/gitblit/git/SideBandProgressMonitor.java +++ b/src/main/java/com/gitblit/git/SideBandProgressMonitor.java @@ -45,6 +45,7 @@ import java.io.IOException; import java.io.OutputStream; +import java.time.Duration; import org.eclipse.jgit.lib.BatchingProgressMonitor; import org.eclipse.jgit.lib.Constants; @@ -61,7 +62,7 @@ class SideBandProgressMonitor extends BatchingProgressMonitor { } @Override - protected void onUpdate(String taskName, int workCurr) { + protected void onUpdate(String taskName, int workCurr, Duration dur) { StringBuilder s = new StringBuilder(); format(s, taskName, workCurr); s.append(" \r"); //$NON-NLS-1$ @@ -69,7 +70,7 @@ protected void onUpdate(String taskName, int workCurr) { } @Override - protected void onEndTask(String taskName, int workCurr) { + protected void onEndTask(String taskName, int workCurr, Duration dur) { StringBuilder s = new StringBuilder(); format(s, taskName, workCurr); s.append(", done\n"); //$NON-NLS-1$ @@ -83,7 +84,7 @@ private void format(StringBuilder s, String taskName, int workCurr) { } @Override - protected void onUpdate(String taskName, int cmp, int totalWork, int pcnt) { + protected void onUpdate(String taskName, int cmp, int totalWork, int pcnt, Duration dur) { StringBuilder s = new StringBuilder(); format(s, taskName, cmp, totalWork, pcnt); s.append(" \r"); //$NON-NLS-1$ @@ -91,7 +92,7 @@ protected void onUpdate(String taskName, int cmp, int totalWork, int pcnt) { } @Override - protected void onEndTask(String taskName, int cmp, int totalWork, int pcnt) { + protected void onEndTask(String taskName, int cmp, int totalWork, int pcnt, Duration dur) { StringBuilder s = new StringBuilder(); format(s, taskName, cmp, totalWork, pcnt); s.append("\n"); //$NON-NLS-1$ @@ -124,4 +125,4 @@ private void send(StringBuilder s) { } } } -} \ No newline at end of file +} diff --git a/src/main/java/com/gitblit/transport/git/GitDaemonClient.java b/src/main/java/com/gitblit/transport/git/GitDaemonClient.java index bc3d4cf7d..6c82d43aa 100644 --- a/src/main/java/com/gitblit/transport/git/GitDaemonClient.java +++ b/src/main/java/com/gitblit/transport/git/GitDaemonClient.java @@ -44,6 +44,7 @@ */ import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -54,7 +55,6 @@ import org.eclipse.jgit.transport.PacketLineIn; import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException; import org.eclipse.jgit.transport.resolver.ServiceNotEnabledException; -import org.eclipse.jgit.util.io.SafeBufferedOutputStream; /** Active network client of {@link Daemon}. */ public class GitDaemonClient { @@ -108,7 +108,7 @@ public String getRepositoryName() { void execute(final Socket sock) throws IOException, ServiceNotEnabledException, ServiceNotAuthorizedException { rawIn = new BufferedInputStream(sock.getInputStream()); - rawOut = new SafeBufferedOutputStream(sock.getOutputStream()); + rawOut = new BufferedOutputStream(sock.getOutputStream()); if (0 < daemon.getTimeout()) sock.setSoTimeout(daemon.getTimeout() * 1000); @@ -128,4 +128,4 @@ void execute(final Socket sock) throws IOException, sock.setSoTimeout(0); srv.execute(this, cmd); } -} \ No newline at end of file +} diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java index cd74569b3..cdd7e7363 100644 --- a/src/main/java/com/gitblit/utils/JGitUtils.java +++ b/src/main/java/com/gitblit/utils/JGitUtils.java @@ -2970,18 +2970,19 @@ public static boolean isTip(Repository repository, String commitId) { */ public static long getTicketNumberFromCommitBranch(Repository repository, RevCommit commit) { // try lookup by change ref - Map> map = repository.getAllRefsByPeeledObjectId(); - Set refs = map.get(commit.getId()); - if (!ArrayUtils.isEmpty(refs)) { - for (Ref ref : refs) { - long number = PatchsetCommand.getTicketNumber(ref.getName()); + try { + Map> map = repository.getAllRefsByPeeledObjectId(); + Set refs = map.get(commit.getId()); + if (!ArrayUtils.isEmpty(refs)) { + for (Ref ref : refs) { + long number = PatchsetCommand.getTicketNumber(ref.getName()); - if (number > 0) { - return number; + if (number > 0) { + return number; + } } } - } - + } catch(IOException e) { } return 0; } diff --git a/src/main/java/com/gitblit/utils/RefLogUtils.java b/src/main/java/com/gitblit/utils/RefLogUtils.java index 355c1208d..1af066f38 100644 --- a/src/main/java/com/gitblit/utils/RefLogUtils.java +++ b/src/main/java/com/gitblit/utils/RefLogUtils.java @@ -107,7 +107,7 @@ private static void error(Throwable t, Repository repository, String pattern, Ob */ public static boolean hasRefLogBranch(Repository repository) { try { - return repository.getRef(GB_REFLOG) != null; + return repository.findRef(GB_REFLOG) != null; } catch(Exception e) { LOGGER.error("failed to determine hasRefLogBranch", e); } diff --git a/src/main/java/com/gitblit/wicket/pages/TicketPage.java b/src/main/java/com/gitblit/wicket/pages/TicketPage.java index 54fdf3a38..6f6e7db85 100644 --- a/src/main/java/com/gitblit/wicket/pages/TicketPage.java +++ b/src/main/java/com/gitblit/wicket/pages/TicketPage.java @@ -1688,7 +1688,7 @@ public void onClick() { boolean success = true; try { - ref = r.getRef(refName); + ref = r.findRef(refName); if (ref != null) { success = JGitUtils.deleteBranchRef(r, ref.getName()); diff --git a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java index 7a564aa59..626328212 100644 --- a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java +++ b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java @@ -202,9 +202,9 @@ public void onClick() { final String branch = entry.getName(); Ref ref = null; try { - ref = r.getRef(branch); + ref = r.findRef(branch); if (ref == null && !branch.startsWith(Constants.R_HEADS)) { - ref = r.getRef(Constants.R_HEADS + branch); + ref = r.findRef(Constants.R_HEADS + branch); } } catch (IOException e) { } From 53854feef3057fd277c3d65c80b45d01e9ecda98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lu=C3=9Fnig?= Date: Thu, 20 Nov 2025 20:23:00 +0100 Subject: [PATCH 2/2] Version Update Prepare for JDK 25 --- src/main/java/com/gitblit/git/PatchsetReceivePack.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gitblit/git/PatchsetReceivePack.java b/src/main/java/com/gitblit/git/PatchsetReceivePack.java index c44c95ef7..72fd06f11 100644 --- a/src/main/java/com/gitblit/git/PatchsetReceivePack.java +++ b/src/main/java/com/gitblit/git/PatchsetReceivePack.java @@ -247,6 +247,7 @@ public void onPostReceive(ReceivePack rp, Collection commands) { ticketNotifier.sendAll(); } + /* @Override protected void validateCommands() { // workaround for JGit's awful scoping choices @@ -262,6 +263,7 @@ protected void validateCommands() { super.validateCommands(); } + */ /** Execute commands to update references. */ @Override @@ -295,12 +297,14 @@ protected void executeCommands() { } ProgressMonitor updating = NullProgressMonitor.INSTANCE; + /* boolean sideBand = isCapabilityEnabled(CAPABILITY_SIDE_BAND_64K); if (sideBand) { SideBandProgressMonitor pm = new SideBandProgressMonitor(msgOut); pm.setDelayStart(250, TimeUnit.MILLISECONDS); updating = pm; } + */ BatchRefUpdate batch = getRepository().getRefDatabase().newBatchUpdate(); batch.setAllowNonFastForwards(isAllowNonFastForwards()); @@ -1272,7 +1276,7 @@ public MergeStatus merge(TicketModel ticket) { String message = MessageFormat.format("Merged #{0,number,0} \"{1}\"", ticket.number, ticket.title); Ref oldRef = null; try { - oldRef = getRepository().getRef(ticket.mergeTo); + oldRef = getRepository().findRef(ticket.mergeTo); } catch (IOException e) { LOGGER.error("failed to get ref for " + ticket.mergeTo, e); }