]> source.dussan.org Git - jgit.git/commitdiff
Revert usage of TYPE_USE in Nullable and NonNull annotations 00/115700/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 19 Jan 2018 13:40:54 +0000 (22:40 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 19 Jan 2018 13:42:38 +0000 (22:42 +0900)
Using TYPE_USE causes compilation errors in Eclipse Neon.3 (JDT 3.12.3)
and Eclipse Oxygen.2 (JDT 3.13.2).

This reverts commit 8e217517e2c515032dd0d661535d2133cd80123a.
This reverts commit 55eba8d0f55464ca84d676828f67a6fe14b2454d.

Reported-by: Thomas Wolf <thomas.wolf@paranor.ch>
Change-Id: I96869f80dd11ee238911706581b224bca4fb12cd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/LargeFileRepository.java
org.eclipse.jgit/src/org/eclipse/jgit/annotations/NonNull.java
org.eclipse.jgit/src/org/eclipse/jgit/annotations/Nullable.java
org.eclipse.jgit/src/org/eclipse/jgit/errors/CorruptObjectException.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/fsck/FsckError.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/TransferConfig.java

index 75bd549dda3f4a7a34bad7fc17bf4a731bfc7d02..cfa53af9cdc7591972a58fa9d5f989534b47937f 100644 (file)
@@ -82,7 +82,7 @@ public interface LargeFileRepository {
         * @return Action for verifying the object, or {@code null} if the server
         *         doesn't support or require verification
         */
-       public Response.@Nullable Action getVerifyAction(AnyLongObjectId id);
+       public @Nullable Response.Action getVerifyAction(AnyLongObjectId id);
 
        /**
         * Get size of an object
index fd5495886845155055583e0c4ed582a18de8a727..1cc65c9f4501075c649c63069401b8ac62d8ca42 100644 (file)
 
 package org.eclipse.jgit.annotations;
 
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
 import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
@@ -59,7 +63,7 @@ import java.lang.annotation.Target;
  */
 @Documented
 @Retention(RetentionPolicy.CLASS)
-@Target(ElementType.TYPE_USE)
+@Target({ FIELD, METHOD, PARAMETER, LOCAL_VARIABLE })
 public @interface NonNull {
        // marker annotation with no members
 }
index e914140ce4746f6cefba1b4074f41bf89f88d4ed..f8a7a366d4fdefbdfa7db091b0e6b7b636319032 100644 (file)
 
 package org.eclipse.jgit.annotations;
 
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.LOCAL_VARIABLE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
 import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
@@ -89,7 +93,7 @@ import java.lang.annotation.Target;
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE_USE)
+@Target({ FIELD, METHOD, PARAMETER, LOCAL_VARIABLE })
 public @interface Nullable {
        // marker annotation with no members
 }
index 314c4e6dae8c260dbb28b0741915804b1bbedf3f..4b503a302d0bb2363ef231571fa9b0374d0fbcf7 100644 (file)
@@ -140,7 +140,8 @@ public class CorruptObjectException extends IOException {
         * @return error condition or null.
         * @since 4.2
         */
-       public ObjectChecker.@Nullable ErrorType getErrorType() {
+       @Nullable
+       public ObjectChecker.ErrorType getErrorType() {
                return errorType;
        }
 }
index 3c6f38efb06fe989a50c702501acb0dcefc66b40..131b0048ae664bfe61be04aa8cc2d2936136b506 100644 (file)
@@ -89,7 +89,8 @@ public class FsckError {
                }
 
                /** @return error type of the corruption. */
-               public ObjectChecker.@Nullable ErrorType getErrorType() {
+               @Nullable
+               public ObjectChecker.ErrorType getErrorType() {
                        return errorType;
                }
        }
index cd03a3d924534ec062ebda88593370c5b597db8a..4c70725e4200c893da18a5fb4b9e56f67608b2f1 100644 (file)
@@ -265,7 +265,8 @@ public class TransferConfig {
                        }
                }
 
-               static ObjectChecker.@Nullable ErrorType parse(String key) {
+               @Nullable
+               static ObjectChecker.ErrorType parse(String key) {
                        return errors.get(toLowerCase(key));
                }