]> source.dussan.org Git - jgit.git/commitdiff
Update dependencies to use the JGit-internal @Nullable 95/59995/2
authorTerry Parker <tparker@google.com>
Mon, 9 Nov 2015 22:19:11 +0000 (14:19 -0800)
committerTerry Parker <tparker@google.com>
Mon, 9 Nov 2015 22:27:52 +0000 (14:27 -0800)
Update the project-specific Eclipse settings to replace the use of the
org.eclipse.jdt.annotation.Nullable class the new JGit-specific
@Nullable annotation. I verified that Eclipse reports errors when the
return value of a method annotated with
@org.eclipse.jgit.annotations.Nullable is dereferenced without a null
check.

Also remove the Maven and MANIFEST.MF dependencies on
org.eclipse.jdt.annotation.

Eclipse null analysis uses three annotations: @Nullable, @NonNull and
@NonNullByDefault. All three are updated in this patch because it is
invalid to set the Eclipse preferences to empty values. So far only
@Nullable has been introduced in org.eclipse.jgit.annotations.

My personal preference is to follow the advice in Effective Java and
avoid the null-return idiom, and to avoid passing null values in
general. This sets the expectation is that arguments and return types
are assumed non-null unless otherwise documented. If that is the
expectation, then consistent application of @NonNull is redundant and
hurts readability by cluttering the code, obscuring the occasional
@Nullable annotation that really requires attention.

If the JGit community decides there is value in using the @NonNull and
@NonNullByDefault annotations we can add them--this change configures
Eclipse to use them.

Change-Id: I9af1b786d1b44b9b0d9c609480dc842df79bf698
Signed-off-by: Terry Parker <tparker@google.com>
org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.archive/META-INF/MANIFEST.MF
org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs
org.eclipse.jgit/META-INF/MANIFEST.MF
org.eclipse.jgit/pom.xml

index 4e28e0b26b97eb637d8ff24b0474a2ff1ef211a0..45d6d2c4c040000c9daae642800cff3449713b8f 100644 (file)
@@ -1,9 +1,9 @@
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jgit.annotations.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jgit.annotations.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jgit.annotations.Nullable
 org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
index e8aad55c03554a4610abb3f27f3e283e82c7d2af..2bd0164225cc73baf2e6262a8cd10b7022d66412 100644 (file)
@@ -24,4 +24,3 @@ Export-Package: org.eclipse.jgit.archive;version="4.2.0";
    org.eclipse.jgit.api,
    org.apache.commons.compress.archivers,
    org.osgi.framework"
-Require-Bundle: org.eclipse.jdt.annotation;bundle-version="[1.1.0,2.0.0)";resolution:=optional
index 4e28e0b26b97eb637d8ff24b0474a2ff1ef211a0..45d6d2c4c040000c9daae642800cff3449713b8f 100644 (file)
@@ -1,9 +1,9 @@
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jgit.annotations.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jgit.annotations.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jgit.annotations.Nullable
 org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
index 1916dec53df7b4ece18234c666c80b442f9d61cf..567fd057507a241cadb7985f35b78c499f745b65 100644 (file)
@@ -63,4 +63,3 @@ Export-Package: org.eclipse.jgit.console;version="4.2.0";
    org.kohsuke.args4j"
 Main-Class: org.eclipse.jgit.pgm.Main
 Implementation-Title: JGit Command Line Interface
-Require-Bundle: org.eclipse.jdt.annotation;bundle-version="[1.1.0,2.0.0)";resolution:=optional
index 4e28e0b26b97eb637d8ff24b0474a2ff1ef211a0..195987db64d60178aa01721eda4add653e8ea116 100644 (file)
@@ -1,9 +1,9 @@
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jgit.annotations.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jgit.annotations.NonByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jgit.annotations.Nullable
 org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
index 4199cc6f937c030d8b272dcad07a2e0d477c44b5..b6899b2801e6e1d3eb603770b7ad0cdd8941785b 100644 (file)
@@ -154,8 +154,7 @@ Export-Package: org.eclipse.jgit.api;version="4.2.0";
    org.ietf.jgss",
  org.eclipse.jgit.util.io;version="4.2.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Require-Bundle: com.jcraft.jsch;bundle-version="[0.1.37,0.2.0)",
- org.eclipse.jdt.annotation;bundle-version="[1.1.0,2.0.0)";resolution:=optional
+Require-Bundle: com.jcraft.jsch;bundle-version="[0.1.37,0.2.0)"
 Import-Package: com.googlecode.javaewah;version="[0.7.9,0.8.0)",
  javax.crypto,
  javax.net.ssl,
index 1eac7e4990c1b026d5d2f9b984eaffc72686f902..4f98323e5d8e860ab66b2b7702a1dc0f6bababd7 100644 (file)
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
-
-       <dependency>
-           <groupId>org.eclipse.jdt</groupId>
-           <artifactId>org.eclipse.jdt.annotation</artifactId>
-           <version>1.1.0</version>
-       </dependency>
   </dependencies>
 
   <build>