]> source.dussan.org Git - jgit.git/commitdiff
Avoid using @Nullable to annotate arrays 14/130714/3
authorJonathan Nieder <jrn@google.com>
Tue, 9 Oct 2018 22:29:00 +0000 (15:29 -0700)
committerJonathan Nieder <jrn@google.com>
Tue, 9 Oct 2018 22:52:54 +0000 (15:52 -0700)
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>
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java

index 8558e3d0b24a064c48871f6d7376550c021859dc..4726975d07822d731e1859f4e0024bf6e1bcae4b 100644 (file)
@@ -62,7 +62,6 @@ import java.util.Set;
 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 @@ public class Config {
         *             if something went wrong while reading the config
         * @since 4.10
         */
-       @Nullable
        protected byte[] readIncludedConfig(String relPath)
                        throws ConfigInvalidException {
                return null;
index 2a2699f906cae757382c36aea750b0698928824f..77d268a3bd5401238f3d9346a0a5ab74cf5f1bbf 100644 (file)
@@ -1981,7 +1981,6 @@ public abstract class Repository implements AutoCloseable {
         *         empty
         * @throws IOException
         */
-       @Nullable
        private byte[] readGitDirectoryFile(String filename) throws IOException {
                File file = new File(getDirectory(), filename);
                try {
index 86ecd8eaee55f9016d22dc77921d86c3f74c25ac..af4ec1f00b9d3ce2fd9dfcd9aac003f2f97681df 100644 (file)
@@ -407,7 +407,7 @@ public class RevCommit extends RevObject {
         * @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);
index 93b3baa61f9f73e4dd78a02d946b6f937fef01f8..2b31ebd8e3cf6d299b6d8fab996daf46b1ca648a 100644 (file)
@@ -57,7 +57,6 @@ import java.io.FileNotFoundException;
 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 class FileBasedConfig extends StoredConfig {
         * @since 4.10
         */
        @Override
-       @Nullable
        protected byte[] readIncludedConfig(String relPath)
                        throws ConfigInvalidException {
                final File file;