aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/BenchmarkReftable.java6
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java19
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java6
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java7
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadChangedPathFilter.java83
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadDirCache.java5
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadReftable.java1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java6
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java7
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java7
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowDirCache.java5
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java7
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java11
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/VerifyReftable.java1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteDirCache.java1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteReftable.java8
16 files changed, 118 insertions, 62 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/BenchmarkReftable.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/BenchmarkReftable.java
index f23f4cf0ea..b7a7ec2feb 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/BenchmarkReftable.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/BenchmarkReftable.java
@@ -70,7 +70,6 @@ class BenchmarkReftable extends TextBuiltin {
@Argument(index = 1)
private String reftablePath;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
switch (test) {
@@ -108,13 +107,12 @@ class BenchmarkReftable extends TextBuiltin {
@SuppressWarnings({ "nls", "boxing" })
private void writeStack() throws Exception {
File dir = new File(reftablePath);
- File stackFile = new File(reftablePath + ".stack");
dir.mkdirs();
long start = System.currentTimeMillis();
- try (FileReftableStack stack = new FileReftableStack(stackFile, dir,
- null, () -> new Config())) {
+ try (FileReftableStack stack = new FileReftableStack(dir, null,
+ () -> new Config())) {
List<Ref> refs = readLsRemote().asList();
for (Ref r : refs) {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
index a63387c24c..2bdca24336 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java
@@ -10,9 +10,6 @@
package org.eclipse.jgit.pgm.debug;
-import static java.lang.Integer.valueOf;
-import static java.lang.Long.valueOf;
-
import java.io.File;
import java.lang.management.ManagementFactory;
import java.lang.management.ThreadMXBean;
@@ -96,13 +93,11 @@ class DiffAlgorithms extends TextBuiltin {
private ThreadMXBean mxBean;
- /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
mxBean = ManagementFactory.getThreadMXBean();
@@ -218,10 +213,10 @@ class DiffAlgorithms extends TextBuiltin {
outw.println(name + ": start at " + startId.name()); //$NON-NLS-1$
}
- outw.format(" %12d files, %8d commits\n", valueOf(files), //$NON-NLS-1$
- valueOf(commits));
- outw.format(" N=%10d min lines, %8d max lines\n", valueOf(minN), //$NON-NLS-1$
- valueOf(maxN));
+ outw.format(" %12d files, %8d commits\n", Long.valueOf(files), //$NON-NLS-1$
+ Integer.valueOf(commits));
+ outw.format(" N=%10d min lines, %8d max lines\n", //$NON-NLS-1$
+ Integer.valueOf(minN), Integer.valueOf(maxN));
outw.format("%-25s %12s ( %12s %12s )\n", //$NON-NLS-1$
"Algorithm", "Time(ns)", "Time(ns) on", "Time(ns) on"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
@@ -233,9 +228,9 @@ class DiffAlgorithms extends TextBuiltin {
for (Test test : all) {
outw.format("%-25s %12d ( %12d %12d )", // //$NON-NLS-1$
test.algorithm.name, //
- valueOf(test.runningTimeNanos), //
- valueOf(test.minN.runningTimeNanos), //
- valueOf(test.maxN.runningTimeNanos));
+ Long.valueOf(test.runningTimeNanos), //
+ Long.valueOf(test.minN.runningTimeNanos), //
+ Long.valueOf(test.maxN.runningTimeNanos));
outw.println();
}
outw.println();
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java
index 9c0ced5c1e..757c435722 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java
@@ -26,8 +26,8 @@ import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
+import org.eclipse.jetty.ee10.servlet.ServletHolder;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lfs.server.LargeFileRepository;
import org.eclipse.jgit.lfs.server.LfsProtocolServlet;
@@ -181,13 +181,11 @@ class LfsStore extends TextBuiltin {
String secretKey;
- /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
AppServer server = new AppServer(port);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java
index 63897a3891..eec10c774f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/MakeCacheTree.java
@@ -11,8 +11,6 @@
package org.eclipse.jgit.pgm.debug;
-import static java.lang.Integer.valueOf;
-
import java.io.IOException;
import java.text.MessageFormat;
@@ -24,7 +22,6 @@ import org.eclipse.jgit.pgm.internal.CLIText;
@Command(usage = "usage_MakeCacheTree")
class MakeCacheTree extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DirCache cache = db.readDirCache();
@@ -34,8 +31,8 @@ class MakeCacheTree extends TextBuiltin {
private void show(DirCacheTree tree) throws IOException {
outw.println(MessageFormat.format(CLIText.get().cacheTreePathInfo,
- tree.getPathString(), valueOf(tree.getEntrySpan()),
- valueOf(tree.getChildCount())));
+ tree.getPathString(), Integer.valueOf(tree.getEntrySpan()),
+ Integer.valueOf(tree.getChildCount())));
for (int i = 0; i < tree.getChildCount(); i++)
show(tree.getChild(i));
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadChangedPathFilter.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadChangedPathFilter.java
new file mode 100644
index 0000000000..1414165e54
--- /dev/null
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadChangedPathFilter.java
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2023, Google LLC
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0 which is available at
+ * https://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package org.eclipse.jgit.pgm.debug;
+
+import java.io.FileInputStream;
+import java.util.HashSet;
+
+import org.eclipse.jgit.pgm.Command;
+import org.eclipse.jgit.pgm.TextBuiltin;
+import org.eclipse.jgit.util.NB;
+import org.kohsuke.args4j.Argument;
+
+/**
+ * Prints the contents of the BDAT chunk from commit-graph file.
+ * <p>
+ * This is a debugging tool for changed path filter development.
+ */
+@Command
+class ReadChangedPathFilter extends TextBuiltin {
+
+ static final int CHUNK_ID_OID_FANOUT = 0x4f494446; /* "OIDF" */
+
+ static final int CHUNK_ID_BLOOM_FILTER_INDEX = 0x42494458; /* "BIDX" */
+
+ static final int CHUNK_ID_BLOOM_FILTER_DATA = 0x42444154; /* "BDAT" */
+
+ @Argument(index = 0)
+ private String input;
+
+ static HashSet<String> changedPathStrings(byte[] data) {
+ int oidf_offset = -1;
+ int bidx_offset = -1;
+ int bdat_offset = -1;
+ for (int i = 8; i < data.length - 4; i += 12) {
+ switch (NB.decodeInt32(data, i)) {
+ case CHUNK_ID_OID_FANOUT:
+ oidf_offset = (int) NB.decodeInt64(data, i + 4);
+ break;
+ case CHUNK_ID_BLOOM_FILTER_INDEX:
+ bidx_offset = (int) NB.decodeInt64(data, i + 4);
+ break;
+ case CHUNK_ID_BLOOM_FILTER_DATA:
+ bdat_offset = (int) NB.decodeInt64(data, i + 4);
+ break;
+ }
+ }
+ bdat_offset += 12; // skip version, hash count, bits per entry
+ int commit_count = NB.decodeInt32(data, oidf_offset + 255 * 4);
+ int[] changed_path_length_cumuls = new int[commit_count];
+ for (int i = 0; i < commit_count; i++) {
+ changed_path_length_cumuls[i] = NB.decodeInt32(data,
+ bidx_offset + i * 4);
+ }
+ HashSet<String> changed_paths = new HashSet<>();
+ for (int i = 0; i < commit_count; i++) {
+ int prior_cumul = i == 0 ? 0 : changed_path_length_cumuls[i - 1];
+ String changed_path = ""; //$NON-NLS-1$
+ for (int j = prior_cumul; j < changed_path_length_cumuls[i]; j++) {
+ changed_path += data[bdat_offset + j] + ","; //$NON-NLS-1$
+ }
+ changed_paths.add(changed_path);
+ }
+ return changed_paths;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ protected void run() throws Exception {
+ try (FileInputStream in = new FileInputStream(input)
+ ) {
+ byte[] data = in.readAllBytes();
+ outw.println(changedPathStrings(data).toString());
+ }
+ }
+}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadDirCache.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadDirCache.java
index 33d1059911..3d20e01d3c 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadDirCache.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadDirCache.java
@@ -11,8 +11,6 @@
package org.eclipse.jgit.pgm.debug;
-import static java.lang.Long.valueOf;
-
import java.text.MessageFormat;
import org.eclipse.jgit.pgm.Command;
@@ -21,7 +19,6 @@ import org.eclipse.jgit.pgm.internal.CLIText;
@Command(usage = "usage_ReadDirCache")
class ReadDirCache extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final int cnt = 100;
@@ -31,6 +28,6 @@ class ReadDirCache extends TextBuiltin {
final long end = System.currentTimeMillis();
outw.print(" "); //$NON-NLS-1$
outw.println(MessageFormat.format(CLIText.get().averageMSPerRead,
- valueOf((end - start) / cnt)));
+ Long.valueOf((end - start) / cnt)));
}
}
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadReftable.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadReftable.java
index 6dace841ea..a2443d315f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadReftable.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ReadReftable.java
@@ -30,7 +30,6 @@ class ReadReftable extends TextBuiltin {
@Argument(index = 1, required = false)
private String ref;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
try (FileInputStream in = new FileInputStream(input);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
index 8d884c12db..22d9e3440a 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java
@@ -18,8 +18,8 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.MessageFormat;
+import java.time.Instant;
import java.util.ArrayList;
-import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.ListIterator;
@@ -81,7 +81,6 @@ class RebuildCommitGraph extends TextBuiltin {
private Map<ObjectId, ObjectId> rewrites = new HashMap<>();
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (!really && db.getRefDatabase().hasRefs()) {
@@ -167,7 +166,8 @@ class RebuildCommitGraph extends TextBuiltin {
final CommitBuilder newc = new CommitBuilder();
newc.setTreeId(emptyTree);
- newc.setAuthor(new PersonIdent(me, new Date(t.commitTime)));
+ newc.setAuthor(new PersonIdent(me,
+ Instant.ofEpochSecond(t.commitTime)));
newc.setCommitter(newc.getAuthor());
newc.setParentIds(newParents);
newc.setMessage("ORIGINAL " + t.oldId.name() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java
index 28a8d8634a..da16b33701 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCacheTree.java
@@ -11,8 +11,6 @@
package org.eclipse.jgit.pgm.debug;
-import static java.lang.Integer.valueOf;
-
import java.io.IOException;
import java.text.MessageFormat;
@@ -24,7 +22,6 @@ import org.eclipse.jgit.pgm.internal.CLIText;
@Command(usage = "usage_ShowCacheTree")
class ShowCacheTree extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DirCache cache = db.readDirCache();
@@ -36,8 +33,8 @@ class ShowCacheTree extends TextBuiltin {
private void show(DirCacheTree tree) throws IOException {
outw.println(MessageFormat.format(CLIText.get().cacheTreePathInfo,
- tree.getPathString(), valueOf(tree.getEntrySpan()),
- valueOf(tree.getChildCount())));
+ tree.getPathString(), Integer.valueOf(tree.getEntrySpan()),
+ Integer.valueOf(tree.getChildCount())));
for (int i = 0; i < tree.getChildCount(); i++)
show(tree.getChild(i));
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java
index 9e61357da8..e46d703592 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java
@@ -26,7 +26,6 @@ class ShowCommands extends TextBuiltin {
@Option(name = "--pretty", metaVar = "metaVar_commandDetail", usage = "usage_alterTheDetailShown")
private Format pretty = Format.USAGE;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final CommandRef[] list = CommandCatalog.all();
@@ -51,7 +50,7 @@ class ShowCommands extends TextBuiltin {
}
enum Format {
- /** */
+ /** Get usage */
USAGE {
@Override
void print(ThrowingPrintWriter err, CommandRef c) throws IOException {
@@ -61,7 +60,7 @@ class ShowCommands extends TextBuiltin {
}
},
- /** */
+ /** Get implementation class name */
CLASSES {
@Override
void print(ThrowingPrintWriter err, CommandRef c) throws IOException {
@@ -69,7 +68,7 @@ class ShowCommands extends TextBuiltin {
}
},
- /** */
+ /** Get URL of implementation class */
URLS {
@Override
void print(ThrowingPrintWriter err, CommandRef c) throws IOException {
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowDirCache.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowDirCache.java
index 1f4733f792..96add0f188 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowDirCache.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowDirCache.java
@@ -13,8 +13,6 @@
package org.eclipse.jgit.pgm.debug;
-import static java.lang.Integer.valueOf;
-
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
@@ -33,7 +31,6 @@ class ShowDirCache extends TextBuiltin {
@Option(name = "--millis", aliases = { "-m" }, usage = "usage_showTimeInMilliseconds")
private boolean millis = false;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DateTimeFormatter fmt = DateTimeFormatter
@@ -50,7 +47,7 @@ class ShowDirCache extends TextBuiltin {
final int stage = ent.getStage();
outw.print(mode);
- outw.format(" %6d", valueOf(len)); //$NON-NLS-1$
+ outw.format(" %6d", Integer.valueOf(len)); //$NON-NLS-1$
outw.print(' ');
if (millis) {
outw.print(mtime.toEpochMilli());
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java
index 49f7ada457..80d3503851 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowPackDelta.java
@@ -31,6 +31,7 @@ import org.eclipse.jgit.pgm.Command;
import org.eclipse.jgit.pgm.TextBuiltin;
import org.eclipse.jgit.revwalk.RevObject;
import org.eclipse.jgit.revwalk.RevWalk;
+import org.eclipse.jgit.storage.pack.PackConfig;
import org.eclipse.jgit.util.TemporaryBuffer;
import org.kohsuke.args4j.Argument;
@@ -39,7 +40,6 @@ class ShowPackDelta extends TextBuiltin {
@Argument(index = 0)
private ObjectId objectId;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
ObjectReader reader = db.newObjectReader();
@@ -69,10 +69,11 @@ class ShowPackDelta extends TextBuiltin {
ObjectReuseAsIs asis = (ObjectReuseAsIs) reader;
ObjectToPack target = asis.newObjectToPack(obj, obj.getType());
- PackWriter pw = new PackWriter(reader) {
+ PackWriter pw = new PackWriter(new PackConfig(), reader) {
@Override
- public void select(ObjectToPack otp, StoredObjectRepresentation next) {
+ public boolean select(ObjectToPack otp, StoredObjectRepresentation next) {
otp.select(next);
+ return true;
}
};
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
index 1ca3034f4f..2ce1711404 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/TextHashFunctions.java
@@ -10,9 +10,6 @@
package org.eclipse.jgit.pgm.debug;
-import static java.lang.Integer.valueOf;
-import static java.lang.Long.valueOf;
-
import java.io.File;
import java.lang.reflect.Field;
import java.security.MessageDigest;
@@ -228,13 +225,11 @@ class TextHashFunctions extends TextBuiltin {
@Option(name = "--repository", aliases = { "-r" }, metaVar = "GIT_DIR", usage = "Repository to scan")
List<File> gitDirs = new ArrayList<>();
- /** {@inheritDoc} */
@Override
protected boolean requiresRepository() {
return false;
}
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (gitDirs.isEmpty()) {
@@ -315,8 +310,8 @@ class TextHashFunctions extends TextBuiltin {
outw.println(name + ":"); //$NON-NLS-1$
}
outw.format(" %6d files; %5d avg. unique lines/file\n", //$NON-NLS-1$
- valueOf(fileCnt), //
- valueOf(lineCnt / fileCnt));
+ Long.valueOf(fileCnt), //
+ Long.valueOf(lineCnt / fileCnt));
outw.format("%-20s %-15s %9s\n", "Hash", "Fold", "Max Len"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
outw.println("-----------------------------------------------"); //$NON-NLS-1$
String lastHashName = null;
@@ -327,7 +322,7 @@ class TextHashFunctions extends TextBuiltin {
outw.format("%-20s %-15s %9d\n", // //$NON-NLS-1$
hashName, //
fun.fold.name, //
- valueOf(fun.maxChainLength));
+ Integer.valueOf(fun.maxChainLength));
lastHashName = fun.hash.name;
}
outw.println();
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/VerifyReftable.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/VerifyReftable.java
index 16a4c9f333..aa1b81f2b6 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/VerifyReftable.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/VerifyReftable.java
@@ -42,7 +42,6 @@ class VerifyReftable extends TextBuiltin {
@Argument(index = 1)
private String reftablePath;
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
List<Ref> refs = WriteReftable.readRefs(lsRemotePath);
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteDirCache.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteDirCache.java
index 44836ec0dc..d367f02497 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteDirCache.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteDirCache.java
@@ -18,7 +18,6 @@ import org.eclipse.jgit.pgm.internal.CLIText;
@Command(usage = "usage_WriteDirCache")
class WriteDirCache extends TextBuiltin {
- /** {@inheritDoc} */
@Override
protected void run() throws Exception {
final DirCache cache = db.readDirCache();
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteReftable.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteReftable.java
index 80d2f763f1..7aff2dd9cd 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteReftable.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteReftable.java
@@ -24,6 +24,8 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
+import java.time.Instant;
+import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -71,7 +73,6 @@ class WriteReftable extends TextBuiltin {
@Argument(index = 1)
private String out;
- /** {@inheritDoc} */
@SuppressWarnings({ "nls", "boxing" })
@Override
protected void run() throws Exception {
@@ -210,14 +211,15 @@ class WriteReftable extends TextBuiltin {
}
String ref = m.group(1);
double t = Double.parseDouble(m.group(2));
- long time = ((long) t) * 1000L;
+ Instant time = Instant.ofEpochSecond((long) t);
long index = (long) (t * 1e6);
String user = m.group(3);
ObjectId oldId = parseId(m.group(4));
ObjectId newId = parseId(m.group(5));
String msg = m.group(6);
String email = user + "@gerrit"; //$NON-NLS-1$
- PersonIdent who = new PersonIdent(user, email, time, -480);
+ PersonIdent who = new PersonIdent(user, email, time,
+ ZoneOffset.ofHours(-8));
log.add(new LogEntry(ref, index, who, oldId, newId, msg));
}
}