]> source.dussan.org Git - jgit.git/commit
Format @NonNull on return value as method annotation 16/130716/1
authorJonathan Nieder <jrn@google.com>
Tue, 9 Oct 2018 22:56:55 +0000 (15:56 -0700)
committerJonathan Nieder <jrn@google.com>
Tue, 9 Oct 2018 22:56:55 +0000 (15:56 -0700)
commitb0991ca80530bc6f73fd92ad5e183f434d26da1a
tree24461699e0b33d4447325a71c994e74cb91a4062
parent608b6b03b1182329ae6f76a4c3938874dcc9c210
Format @NonNull on return value as method annotation

For example, instead of using

public @NonNull String getMyFavoriteString() { ... }

use

@NonNull
public String getMyFavoriteString() { ... }

This makes the style more consistent (the existing JGit code base
tends to lean toward the second style) and makes the source code
better reflect how the annotation is parsed, as a METHOD annotation.

Longer term, we should switch to a TYPE_USE annotation and switch to
the first style.

Noticed using a style checker that follows
https://google.github.io/styleguide/javaguide.html#s4.8.5-annotations

Change-Id: I9b9fa08035d805ca660520f812a84d2f47eff507
Reported-by: Ivan Frade <ifrade@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsConnectionFactory.java
org.eclipse.jgit/src/org/eclipse/jgit/events/WorkingTreeModifiedEvent.java
org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/ManifestParser.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java