Avoid using @Nullable to annotate arrays

As described in the javadoc for org.eclipse.jgit.annotations.Nullable:

  Warning: Please do not use this annotation on arrays. Different
  annotation processors treat `@Nullable Object[]` differently: some
  treat it as an array of nullable objects, for consistency with
  versions of `Nullable` defined with `@Target TYPE_USE`, while others
  treat it as a nullable array of objects. JGit therefore avoids using
  this annotation on arrays altogether.

  See the checker-framework manual[1] for details.

  [1] http://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html#faq-array-syntax-meaning

Change-Id: I14ffcf80adbb8145d797998de2f2fa6ab84c3ae3
Signed-off-by: Jonathan Nieder <jrn@google.com>
This commit is contained in:
Jonathan Nieder 2018-10-09 15:29:00 -07:00
parent 81b7f0e835
commit c58362c174
4 changed files with 1 additions and 6 deletions

View File

@ -62,7 +62,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.jgit.annotations.Nullable;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.events.ConfigChangedEvent;
import org.eclipse.jgit.events.ConfigChangedListener;
@ -1158,7 +1157,6 @@ private List<ConfigLine> fromTextRecurse(String text, int depth,
* if something went wrong while reading the config
* @since 4.10
*/
@Nullable
protected byte[] readIncludedConfig(String relPath)
throws ConfigInvalidException {
return null;

View File

@ -1981,7 +1981,6 @@ private void writeCommitMsg(File msgFile, String msg) throws IOException {
* empty
* @throws IOException
*/
@Nullable
private byte[] readGitDirectoryFile(String filename) throws IOException {
File file = new File(getDirectory(), filename);
try {

View File

@ -407,7 +407,7 @@ public final byte[] getRawBuffer() {
* @return contents of the gpg signature; null if the commit was not signed.
* @since 5.1
*/
public final @Nullable byte[] getRawGpgSignature() {
public final byte[] getRawGpgSignature() {
final byte[] raw = buffer;
final byte[] header = {'g', 'p', 'g', 's', 'i', 'g'};
final int start = RawParseUtils.headerStart(header, raw, 0);

View File

@ -57,7 +57,6 @@
import java.io.IOException;
import java.text.MessageFormat;
import org.eclipse.jgit.annotations.Nullable;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.errors.LockFailedException;
import org.eclipse.jgit.internal.JGitText;
@ -281,7 +280,6 @@ public boolean isOutdated() {
* @since 4.10
*/
@Override
@Nullable
protected byte[] readIncludedConfig(String relPath)
throws ConfigInvalidException {
final File file;