Change [1] set refs to null at the beggining of sendPack claiming they
are not needed anymore, but they are still used few lines below to
hoist referenced objects to the front of the pack. With refs nullified,
the hoist doesn't happened. This hasn't caused any problem so far,
probably because it is just an optimization and the objects are in the
pack anyway.
Move the nullification after the hoisting to keep the optimization and
save the memory.
[1] https://git.eclipse.org/r/c/jgit/jgit/+/161341
Change-Id: I8455249d8482f616af362d3912b718064d473b49
This way we can avoid to access the byte buffers backing array.
Implement a ByteBufferInputStream to wrap a byte buffer which we can use
to expose the filter result as an input stream.
Change-Id: I461c82090de2562ea9b649b3f953aad4571e3d25
Renaming this class is a breaking change. Add a todo to rename it in
next major release.
See https://errorprone.info/bugpattern/JavaLangClash
Change-Id: I3528fd654e30d98f4ea43e71107d83324942141c
instead of saving it in a lambda. Prefer to implement the functional
interface method directly and use a method reference instead.
See https://errorprone.info/bugpattern/UnnecessaryLambda
Change-Id: I7f7ebd27cd6354545c157960718d9845882e1732
Instead of overriding #toString provide getter for additional
information so that code handling the exception can access it.
See https://errorprone.info/bugpattern/OverrideThrowableToString
Change-Id: Ie577ae9327e0234d55481253f2604b1644ea3f01
[JdkObsolete] It is very rare for LinkedList to out-perform ArrayList or
ArrayDeque.
see https://errorprone.info/bugpattern/JdkObsolete
Change-Id: I13fb953f55fc7b6e007d6fd6a6a1bfd377773588
Variable type can use a more specific type to convey more information to
callers.
private Collection<String> filepatterns;
^
(see https://errorprone.info/bugpattern/PreferredInterfaceType)
Change-Id: I68b74de65aba3bb849ef508d7dcdd8b85b0ab100
The public stats object is created only to be populated by the computation of
bloom filters.
Make the computation return its numbers with the results and copy them
to the stats when needed. This eliminates the side effects from the
computation and makes it easier to add more data to the stats later.
Change-Id: I7a5e55fc3a17f5a294edf3a3b725b2d9c0280a5a
It looks confusing that the createChunks method calculates bloom
filters.
Make the calculations before and pass the result to the method.
Change-Id: If6e3c0e644f7f940f268ca7266f577f012278ff3
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/GraphObjectIndex.java:59:
error: [ComparisonOutOfRange] ints may have a value in the range
-2147483648 to 2147483647; therefore, this comparison to
Integer.MAX_VALUE will always evaluate to false
if (table[k] > Integer.MAX_VALUE) {
^
See https://errorprone.info/bugpattern/ComparisonOutOfRange
We need to check if variable `uint` of type `long` exceeds the maximum
possible int value before casting it to `int` below.
This was introduced in Ib5c0d6678cb242870a0f5841bd413ad3885e95f6
Change-Id: I675d594f523084be4c1678328cc343065e32d998
Raised by errorprone:
org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitConfig.java:406: error:
[ComparisonOutOfRange] chars may have a value in the range 0 to 65535;
therefore, this comparison to 0 will always evaluate to true
if (ch >= 0 && ch < inUse.length) {
^
see https://errorprone.info/bugpattern/ComparisonOutOfRange
Change-Id: I9625aa7894a34dbffd77d39a40c6e285c86b56d5
Here we use enum to implement a singleton. Hence suppress the errorprone
error ImmutableEnumChecker.
Change-Id: I21f6ed83c08936dfc9aa591af809e69f3053a050
in all classes which already registered their own shutdown hook
- CloneCommand
- GC#PidLock
- FS#FileStoreAttributes
- LocalDiskRepositoryTestCase#Cleanup
Change-Id: I3efc1f83f3cbbf43eeeaaedcd2bee1ef31971a72
This should avoid stale lock files if the JVM is terminated gracefully.
Implement a ShutdownHook which can register/unregister listeners which
need to do some cleanup during graceful JVM shutdown. This hook is
registered as a Java shutdown hook and when the JVM shuts down
calls #onShutdown of registered listeners using a parallel stream
to let them run concurrently.
See https://docs.oracle.com/javase/8/docs/technotes/guides/lang/hook-design.html
Bug: 582379
Change-Id: I1621dc5f7d9a8c832b6d1b74cbc47578b1c2f0b8