Commit Graph

95 Commits

Author SHA1 Message Date
David Ostrovsky 6672bacca4 Activate additional error prone checks
Change-Id: I1b351e04da9f08681f08aae9ce984c3d3285e88e
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2023-09-25 22:06:13 +02:00
Matthias Sohn d65170603f tools/BUILD: Sort errorprone rules alphabetically
Change-Id: I006940eb8a7710d5b8ea66c6f805f0dd08e62a31
2023-09-22 17:04:19 +02:00
David Ostrovsky a80130d655 Bazel: Fix remote build execution for Java 17
Bazel build and test with remote17 configuration was actually executed
locally, and not remotely.

Rename remote configuration setting for Java 11 from remote to remote11
and derive the common remote configuration settings for remote11 and
remote17 configurations.

Also remove deprecated --host_javabase and --javabase options.

Test Plan:

Verify that the remote build for Java 17 is actually executed remotely:

  $ bazel test --config=remote17 --remote_instance_name=$PROJECT_NAME \
    org.eclipse.jgit.test/...

Change-Id: I10ad8c1d28c92fed9e465c2d36770ed4fb2940c3
2023-05-31 00:31:46 -04:00
David Ostrovsky f4eb38f9fe Bump bazel vesion to 6.2.0
Also demote severity level for bug pattern: PreferredInterfaceType, aka
MutableConstantField: [1] from error to warning.

Also fix DoubleBraceInitialization error prone bug pattern [2].

[1] https://errorprone.info/bugpattern/PreferredInterfaceType
[2] https://errorprone.info/bugpattern/DoubleBraceInitialization

Change-Id: I04b7d0792e67cbc51e3939bd47c2ea13a685cf0d
(cherry picked from commit 0f071a7bce)
2023-05-31 00:30:02 -04:00
Matthias Sohn 6082ae25dd Merge branch 'stable-6.0' into stable-6.1
* stable-6.0:
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings
  UploadPack: Fix NPE when traversing a tag chain

Change-Id: I5e13d5b5414aef97e518898166bfa166c692e60f
2023-04-26 21:55:16 +02:00
Matthias Sohn 9445e42b7a Merge branch 'stable-5.13' into stable-6.0
* stable-5.13:
  [bazel] Skip ConfigTest#testCommitTemplatePathInHomeDirecory
  Demote severity of some error prone bug patterns to warnings

Change-Id: I63b9adc22e1e1d9a9c754fe070ddfe21a52446c7
2023-04-26 21:40:22 +02:00
David Ostrovsky f3a3a2e877 Demote severity of some error prone bug patterns to warnings
The code is not violation free, so demote the severity of these bug
patterns to warning:

o DefaultCharset
o FutureReturnValueIgnored
o UnusedException

Change-Id: Ie886a4a247770a74953385f018498ac2515ed209
2023-04-26 21:07:41 +02:00
David Ostrovsky 969601c742 Bazel: Add RBE support
The Bazel build can be used with Google's Remote Build Execution.

This needs the following setup steps:

  $ gcloud auth application-default login
  $ gcloud services enable remotebuildexecution.googleapis.com  --project=${PROJECT}

Create a worker pool. The instances should have at least 4 CPUs each
for adequate performance.

  $ gcloud alpha remote-build-execution worker-pools create default \
    --project=${PROJECT} \
    --instance=default_instance \
    --worker-count=50 \
    --machine-type=e2-standard-4 \
    --disk-size=200

To use RBE, execute

  $ bazel test --config=remote \
    --remote_instance_name=projects/${PROJECT}/instances/default_instance \
    //...

Change-Id: I988f61e342dab2136d8752ace945a4ed91a4189a
2022-01-20 06:43:13 -04:00
David Ostrovsky be732c16ab Bazel: Switch to using toolchain resolution for java rules
Bump Bazel version to release 5.0.0. In this new Bazel release,
--incompatible_use_toolchain_resolution_for_java_rules is flipped, that
means that the build must be adapted to toolchain resolution.

Specification toolchain resolution for java rules is here: [1]. Main
tracking Bazel issue is here: [2].

Given that new Bazel release also added support for remote JDK 17, add
experimental support for building with remote JDK 17 to produce major
byte code version 61.

Test Plan:

To build with remote JDK 11 run:

  $ bazel build :all

To build with remote JDK 17 run:

  $ bazel build --config java17 :all

[1] https://docs.google.com/document/d/1MVbBxbKVKRJJY7DnkptHpvz7ROhyAYy4a-TZ-n7Q0r4/edit?usp=sharing
[2] https://github.com/bazelbuild/bazel/issues/7849

Change-Id: I8d26dff722c6677ea7642913b61e416b23ea9041
2022-01-20 06:40:51 -04:00
David Ostrovsky c812947962 Bazel: Simplify java 11 toolchain definition
Also remove unused JDK9_JVM_OPTS constant.

Change-Id: I0f45ca8312a2a8c3aee3855e3ef3afa95808b4ad
2022-01-20 00:54:15 -05:00
David Ostrovsky 8227098d7d Bazel: Remove version check
Recent Bazel releases perform Bazel version check, based on
.bazelversion file.

Change-Id: I92d5daaef8ecbd011517d314564c0f5492c8ea75
2022-01-20 00:53:42 -05:00
David Ostrovsky f8a96e1a0b Bazel: Add missing java packages to error_prone package group
Change-Id: I709a3cd2639e9209b2c92c700e04ab4c90ed0524
2022-01-20 06:49:25 +01:00
Matthias Sohn fb684a3821 Add o.e.j.ssh.apache.agent to maven central deployment scripts
Change-Id: I3310eacafa83482191021beddd376d50c0a72775
2021-11-29 21:14:25 +01:00
Thomas Wolf 634302d2da sshd: add support for ssh-agent
Add a simple SSH agent connector using JNA. Include com.sum.jna and
com.sun.jna.platform in the target platform.

JNA is used to communicate through Unix domain sockets with ssh-agent,
and if on Windows, to communicate via shared memory with Pageant.

The new bundle o.e.j.ssh.apache.agent is an OSGi fragment so that
the java.util.ServiceLoader can find the provided factory without
further ado in OSGi environments.

Adapt both maven and bazel builds to include the new bundle.

Manually tested on OS X, CentOS 7, and Win10 with Pageant 0.76. Tested
by installing JGit built from this change into freshly downloaded
Eclipse 2021-12 M1, and then doing git fetches via SSH with different
~/.ssh/config settings (explicit IdentityFile, without any but a key in
the agent, with no keys and a key in the agent and IdentitiesOnly=yes
(must fail)).

Bug: 541274
Bug: 541275
Change-Id: I34e85467293707dbad1eb44d1f40fc2e70ba3622
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-03 23:46:54 +01:00
Thomas Wolf c04884fc91 [releng] bazel: Enable errorprone on o.e.j.ssh.apache
Fix the few issues reported. (None serious.)

Change-Id: I8d72ef7d425ab61f4c27b657c92fc021850730d6
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-03 23:45:32 +01:00
Thomas Wolf 4184ff0953 [releng] Make the bazel build use Java 11
Make the default toolchain use Java 11, and fix two errorprone findings
introduced recently.

Change-Id: Iff51206fe8bdf096cb7d88cb1a499002550766cd
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-11-03 23:45:32 +01:00
Matthias Sohn 1d280db147 Enable compiler option --release
This ensures the compiler compiles against the public, supported and
documented API for a specific VM version (here 11) [1]. This also means
that
we don't need EE descriptors in Eclipse anymore in order to ensure that
only supported APIs of the selected Java version can be used.

According to [2] if option --release is used --source and --target
options can't be used.

While we are at it also add default value for all new jdt core options
added in Eclipse 4.21.

[1] https://docs.oracle.com/en/java/javase/11/tools/javac.html
[2] https://docs.oracle.com/en/java/javase/14/docs/specs/man/javac.html#option-release

Change-Id: I852a5d7b0a3210751c15d79ec91915b4c01c41e2
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-29 17:13:01 +02:00
Matthias Sohn f81a3fc91a Bump minimum required Java version to 11
Bug: 569917
Change-Id: Ifdcdb022a3f29321b4d10da1cc34acca68ed7b03
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2021-09-29 17:12:12 +02:00
David Ostrovsky d35f0ffb7c Bazel: Add workspace status command to stamp final artifact
Include implementation version in jgit library. This version is used
by other products that depend on JGit, and built using Bazel and not
consume officially released artifact from Central or Eclipse own Maven
repository.

Most notably, in Gerrit Code Review JGit agent that was previously
reported as "unknown", is now reported as:

  JGit/v5.8.0.202006091008-r-16-g14c43828d

using this change [1].

[1] https://gerrit-review.googlesource.com/c/gerrit/+/272505

Change-Id: Ia50de9ac35b8dbe9e92d8ad7d0d14cd00f057863
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2020-07-17 01:10:15 +02:00
Matthias Sohn f2bfaca084 Add new osgi fragments to maven-central deploy scripts
Change-Id: I075b539fcc72f7492573426247134aed7a545fe9
2020-06-20 09:25:06 +02:00
Matthias Sohn 4475a55f84 Handle Fragment-Host declaration when updating version
Change-Id: If7ad9c4b26025e4358e3b4228dda43fdf93d2978
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit a51b440840)
2020-06-09 16:45:19 +02:00
David Pursehouse 4cc13297cc ErrorProne: Enable and fix UnusedException check
Enable UnusedException at ERROR level which causes the build to fail
in many places with:

  [UnusedException] This catch block catches an symbol and re-throws
  another, but swallows the caught symbol rather than setting it as a
  cause. This can make debugging harder.

Fix it by setting the caught exception as cause on the subsequently
thrown exception.

Note: The grammatically incorrect error message is copy-pasted as-is
from the version of ErrorProne currently used in Bazel; it has been
fixed by [1] in the latest version.

[1] https://github.com/google/error-prone/commit/d57a39c

Change-Id: I11ed38243091fc12f64f1b2db404ba3f1d2e98b5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-27 14:40:08 +01:00
David Pursehouse 8fa3594565 Remove Error-Prone ExpectedExceptionChecker
The checker only checks for misuse of ExpectedException. Since we've
moved to JUnit 4.13 and assertThrows, ExpectedException won't be used
at all, so now we can get rid of that setting.

Change-Id: Ia9189936ae215110f1f5fc6459c5dbc944404ade
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2020-01-24 16:49:14 +09:00
Matthias Sohn 5c5f7c6b14 Update EDL 1.0 license headers to new short SPDX compliant format
This is the format given by the Eclipse legal doc generator [1].

[1] https://www.eclipse.org/projects/tools/documentation.php?id=technology.jgit

Bug: 548298
Change-Id: I8d8cabc998ba1b083e3f0906a8d558d391ffb6c4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2020-01-04 01:10:05 +01:00
David Pursehouse e9d728ceb7 Merge branch 'stable-5.5'
* stable-5.5:
  Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl
  Bazel: Add missing newlines at end of BUILD files

Change-Id: Ie32c3bae056fb0745892e6c20ad37d4994542d96
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-26 17:44:56 +09:00
David Pursehouse 3c78d6237f Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl
  Bazel: Add missing newlines at end of BUILD files

Change-Id: I21878c42fd9abf7d858b534300df0fffe4bad431
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-26 17:43:24 +09:00
David Pursehouse 839359425d Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl
  Bazel: Add missing newlines at end of BUILD files

Change-Id: Ie5e66f2e26c057c81101b0d110f91ea479eb362d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-26 17:42:14 +09:00
David Pursehouse da06f23c92 Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl
  Bazel: Add missing newlines at end of BUILD files

Change-Id: Ic1dc84a6c4a1cf430d329627642583fd6e0d0eaa
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-26 17:41:10 +09:00
David Pursehouse 7554bdfad5 Bazel: Use java_plugin and java_binary from @rules_java in jmh.bzl
Change-Id: I80456f74bc17a1ebb0248fce8050a4cb07bf18f1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-11-26 08:43:34 +01:00
Matthias Sohn abecc9587f Merge branch 'stable-5.5'
* stable-5.5:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: If87a13d0f809d9968ad2921b786f4b18e1b494d0
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 16:31:58 +01:00
Matthias Sohn e85664e3f8 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: Ib735c4039e24ec8b045ae2cc81df1e9e5c9fa996
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 15:54:48 +01:00
Matthias Sohn cbdb5e7750 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Update API problem filters
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: I00615958ab6fbdff601e87a9792aba5606cda12a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 15:25:08 +01:00
Matthias Sohn 29a429c29a Merge branch 'stable-5.1' into stable-5.2
* stable-5.1:
  Run JMH benchmarks using bazel
  Benchmark for creating files and FileSnapshots
  Implement benchmark for looking up FileStore of a given Path
  JMH benchmark for SimpleLruCache
  Remove unused API problem filters
  Silence API errors for new API added since 5.1.0

Change-Id: If91c55a192d3b2c441d9c8d414f2e24a7261b1b6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 15:18:45 +01:00
Matthias Sohn 452c38cd22 Run JMH benchmarks using bazel
The benchmarks can be built and run using bazel by running:

$ bazel run //org.eclipse.jgit.benchmarks:benchmarks

Change-Id: I6679750eaa0f2be30ed9d45036e013b0ea4fcc86
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-11-05 14:59:50 +01:00
David Ostrovsky 5caa951515 Bazel: Reuse version from .bazelversion for minimum used version check
Bazel is still supported in addition to the Bazel wrapper Bazelisk,
that is recommended, as it would automatically switch to the right
Bazel version on stable branches (like it was the case with Buck).

That why minimum used Bazel version check is still needed in WORKSPACE
file in addition to the .bazelversion used by Bazelisk. That means that
currently, bazel version is maintained in two places:

* .bazelversion
* WORKSPACE

This change introduces the repository rule to read the bazel version
from the .bazelversion file and perform the minimum version check.

Change-Id: Ib9c1382935ded7bcd322ed0122838c40ba2faa6c
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
2019-09-23 09:23:21 +02:00
Matthias Sohn 80fd4cb075 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Format BUILD files with buildifier
  [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache
  Bazel: Format BUILD files with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Fix warning about deprecated lib.bzl
  Format lib/BUILD with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Bump minimum supported version to 0.29.0
  Bazel: Bump skylib library version to 0.8.0
  Use bazelisk to switch between used bazel version
  Bazel: Require minimum bazel version 0.17.1
  Fix wrong placeholder index in error message packInaccessible
  JGitText: Remove unused externalized strings
  RepoText: Remove unused externalized string
  CLI: Remove unused externalized strings

Change-Id: Iaea77a89fcd821df5dbb24f5e3e39e6d1dfc0bd4
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-08 15:05:19 +02:00
Matthias Sohn 22973d13ea Format BUILD files with buildifier
Using buildifier from master branch and the command:
$ buildifier -r -lint fix -warnings all .

Change-Id: I52a18c09a1f192e2141f4156f9c1aabbbdbc910a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-08 14:59:29 +02:00
Matthias Sohn 82badd0a87 Merge branch 'stable-5.2' into stable-5.3
* stable-5.2:
  [error prone] Suppress NonAtomicVolatileUpdate in SimpleLruCache
  Bazel: Format BUILD files with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Fix warning about deprecated lib.bzl
  Format lib/BUILD with buildifier
  Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
  Bazel: Bump minimum supported version to 0.29.0
  Bazel: Bump skylib library version to 0.8.0
  Use bazelisk to switch between used bazel version
  Bazel: Require minimum bazel version 0.17.1
  Fix wrong placeholder index in error message packInaccessible
  JGitText: Remove unused externalized strings
  RepoText: Remove unused externalized string
  CLI: Remove unused externalized strings

Change-Id: I0d8b7f79177a20dc00c89e2cf0005eb3d3039532
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-09-08 11:17:32 +02:00
David Pursehouse 40ba12f3ac Bazel: Add fixes for --incompatible_load_java_rules_from_bzl
Change-Id: Ifc47ae22209fdb7a5d7bede4da002640ed26a43a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-09-08 10:08:39 +09:00
David Pursehouse 40f6c92c5c Increase severity of AmbiguousMethodReference to ERROR
All instances of this problem have been fixed. Increase its severity
to ERROR to prevent reoccurrences.

Change-Id: I42d41a7c32b43d1ba59a28cd2f5a7d0ad315d8d9
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-08-09 16:09:04 +09:00
David Pursehouse 72ae089206 Fix NarrowingCompoundAssignment warnings from Error Prone
Error Prone reports:

  [NarrowingCompoundAssignment] Compound assignments from long to int
  hide lossy casts

and

  [NarrowingCompoundAssignment] Compound assignments from int to byte
  hide lossy casts

  See https://errorprone.info/bugpattern/NarrowingCompoundAssignment

Fix the warnings by adding explicit casts or changing types as
necessary.

Now that all occurrences of the warning are fixed, increase its
severity to ERROR.

Change-Id: Idb3670e6047b146ae37daee07212ff9455512623
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-08-08 14:28:27 +02:00
David Pursehouse dad9e1ff95 GlobalBundleCache: Fix ClassNewInstance warning from Error Prone
Error Prone reports:

  [ClassNewInstance] Class.newInstance() bypasses exception checking;
  prefer getDeclaredConstructor().newInstance()

  See https://errorprone.info/bugpattern/ClassNewInstance

This was the only occurrence of the warning in the code base; now it's
fixed, increase the severity to ERROR to prevent future occurrences.

Change-Id: Ic04d1c5d2bd458bbb4bb399d6ce9d147bd48d0b1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-06-22 18:44:23 +09:00
David Pursehouse 430be89307 Error Prone: Increase severity of NonOverridingEquals to ERROR
Error Prone reports the warning on several classes:

   [NonOverridingEquals] equals method doesn't override Object.equals;
   if this is a type-specific helper for a method that does override
   Object.equals, either inline it into the callers or rename it to
   avoid ambiguity.

   See https://errorprone.info/bugpattern/NonOverridingEquals

Most of these are in the public API, so we can't rename or inline them
without breaking the API. FileSnapshot is not part of the public API,
but clients may be using it anyway, so we also shouldn't change that.

Suppress all the warnings instead. Having the check at severity ERROR
will at least make sure we don't introduce any new occurrences.

Change-Id: I92345c11256f06b4fa03ccc13337f72af5a43591
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-06-17 09:40:11 +09:00
David Pursehouse 13696b8d8c Error Prone: Increase severity of ImmutableEnumChecker to ERROR
Change-Id: I846b6d99867767409536e7c9bd0cbd11d9236074
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-06-17 08:18:12 +09:00
David Pursehouse 4fe4b0a6bf Error Prone: Increase severity of ShortCircuitBoolean to ERROR
Change-Id: Ib3f1b8b37160e2bd715dfc81a845e4c6fcfea2c5
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-06-15 21:55:39 +02:00
David Pursehouse 0f4554f126 Increase severity of OperatorPrecedence to ERROR, and fix instances
Fix all remaining instances of the OperatorPrededence warning, by adding
parentheses to make the precedence explicit.

Change-Id: Ib296dfed09f9be042d0ff0f7fad8214e4dd766b4
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-06-12 09:28:54 +09:00
Matthias Sohn c177c6f4c5 Merge branch 'master' into stable-5.4
* master:
  Handle missing "ours" stage in WorkingTreeIterator.hasCrLfInIndex()
  Config: Add helper method to check for empty value
  ErrorProne: Increase severity of FutureReturnValueIgnored to ERROR
  FS_Win32: Add missing parentheses on if-blocks
  Upgrade spotbugs to 3.1.12
  Abbreviated{Long}ObjectId: Make operator precedence explicit
  GC: Update TODO comments
  FS_POSIX: Fix reference comparison of Boolean.FALSE
  Increase bazel timeout for long running tests
  Use bazelisk to switch between used bazel version
  Bump minimum Bazel version to 0.26.1
  Bazel: Bump skylib library version to 0.8.0
  Retry loading config when locked by another process
  Make pull --rebase on an unborn branch do a checkout
  Warn if configured cookie file is missing
  Handle escaped CR-LF in git config files
  DescribeCommand: use glob match instead of path match
  Fix off-by-one error in RebaseTodoFile when reading a todo file
  Consistently use "!isEmpty()" to detect non-empty list
  TransportHttp: Check for non-empty list with "!isEmpty()" rather than
    "size() > 0"
  TransportHttp: Fix comparison of size with ">= 0"
  NetscapeCookieFileTest: Split HttpCookiesMatcher to own class
  Bazel: Add missing dependency on mockito for TransportHttpTest
  Determine hard-linking and nlink support per FileStore
  Support reading and writing cookies.
  Repository: Add getIdentifier() method to avoid instanceof operator
  Update to Orbit R20190602212107
  PacketLineIn: Deprecate the END constant
  PacketLineIn: Add an iterator over strings in the input stream
  Replace most usages of PacketLineIn.END with PacketLineIn.end()
  PacketLineIn: Deprecate DELIM constant
  Replace trivial reference comparison of PacketLineIn.{DELIM,END}
  PacketLineIn: Rename isDelim to isDelimiter
  ProtocolV2ParserTest: Fix typo in comment
  Upgrade Bouncy Castle to 1.61
  Update to Orbit R20190531194818 and rollback update to Ant 1.10.6
  cli: Add the --always option to describe
  DescribeCommand: Support the "always" option
  cli: Add the --tags option to describe
  DescribeCommand: Consistenly omit the default value
  Remove excess blank line in FileUtilsTest
  PacketLineIn: Add helper methods to check for END and DELIM
  UploadPackTest: Rename variable to avoid hiding class member
  UploadPackTest: Add missing <> operator on instantiation of ArrayList
  BitmapCalculator: javadoc fixes
  RevWalkUtils: add progress callback to findBranchesReachableFrom
  Upgrade maven-source-plugin to 3.1.0
  Upgrade maven-jar-plugin to 3.1.2
  Upgrade jacoco-maven-plugin to 0.8.4
  BitmapCalculator and its test: add missing license header
  RevWalk: new method createReachabilityChecker()

Change-Id: I4d76c7c0dbe6411c842f3468b709f7df51789c08
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-11 23:30:26 +02:00
David Pursehouse 8bd0ba0f15 ErrorProne: Increase severity of FutureReturnValueIgnored to ERROR
The only remaining code where the return value is ignored is in tests.
Update them to store the value and perform a basic assertion.

Change-Id: I29ef5bd5dd0648aac3490f9e47ecc74544109652
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-06-11 10:51:30 +09:00
Matthias Sohn d9c569b747 Merge branch 'stable-5.3' into stable-5.4
* stable-5.3:
  Prepare 5.3.3-SNAPSHOT builds
  JGit v5.3.2.201906051522-r
  Prepare 5.1.9-SNAPSHOT builds
  JGit v5.1.8.201906050907-r
  Test detecting modified packfiles
  Enhance fsTick() to use filesystem timer resolution
  Add debug trace to measure time needed to open pack index
  Extend FileSnapshot for packfiles to also use checksum to detect changes
  Wait opening new packfile until it can't be racy anymore
  Avoid null PackConfig in GC
  Add FileSnapshot test testing recognition of file size changes
  Capture reason for result of FileSnapshot#isModified
  Skip FileSnapshotTest#testSimulatePackfileReplacement on Windows
  Tune max heap size for tests
  Fix FileSnapshotTest.testNewFileNoWait() to match its javadoc
  ObjectDirectory: fix closing of obsolete packs
  Update API filters for methods added to fix bugs
  Bazel: Increase severity of most error-prone checks to ERROR
  Enable error-prone checks by default
  Add bazel options to align with gerrit's
  Include filekey file attribute when comparing FileSnapshots
  Measure file timestamp resolution used in FileSnapshot
  Fix FileSnapshot's consideration of file size
  Fix API problem filters
  Fix API problem filters

Change-Id: Ie1c7e4752661aec9e1754660934921224e2408eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2019-06-06 17:14:31 +02:00
David Pursehouse 245c2c09a0 Bazel: Increase severity of most error-prone checks to ERROR
Most of the checks can be increased to ERROR because there is no
code in the project that triggers them.

There are still several that are triggered, and these are left
at the WARN severity:

  https://errorprone.info/bugpattern/AmbiguousMethodReference
  https://errorprone.info/bugpattern/BadComparable
  https://errorprone.info/bugpattern/ClassNewInstance
  https://errorprone.info/bugpattern/Finally
  https://errorprone.info/bugpattern/FutureReturnValueIgnored
  https://errorprone.info/bugpattern/ImmutableEnumChecker
  https://errorprone.info/bugpattern/NarrowingCompoundAssignment
  https://errorprone.info/bugpattern/NonOverridingEquals
  https://errorprone.info/bugpattern/OperatorPrecedence
  https://errorprone.info/bugpattern/ReferenceEquality
  https://errorprone.info/bugpattern/ShortCircuitBoolean
  https://errorprone.info/bugpattern/StringEquality
  https://errorprone.info/bugpattern/TypeParameterUnusedInFormals

These can be cleaned up and increased to ERROR in follow-up
commits.

Change-Id: Icfc3b3163e129e504f10b3fc856aef262f723f99
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2019-05-26 18:03:07 +09:00