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>
* @throws IOException
* in case of any error.
*/
- public static @NonNull HttpConnection getLfsContentConnection(
+ @NonNull
+ public static HttpConnection getLfsContentConnection(
Repository repo, Protocol.Action action, String method)
throws IOException {
URL contentUrl = new URL(action.href);
*
* @return the set
*/
- public @NonNull Collection<String> getModified() {
+ @NonNull
+ public Collection<String> getModified() {
Collection<String> result = modified;
if (result == null) {
result = Collections.emptyList();
*
* @return the set
*/
- public @NonNull Collection<String> getDeleted() {
+ @NonNull
+ public Collection<String> getDeleted() {
Collection<String> result = deleted;
if (result == null) {
result = Collections.emptyList();
*
* @return filtered projects list reference, never null
*/
- public @NonNull List<RepoProject> getFilteredProjects() {
+ @NonNull
+ public List<RepoProject> getFilteredProjects() {
return filteredProjects;
}
/** {@inheritDoc} */
@Override
- public @NonNull List<RefSpec> getRefSpecs(Config config, String section,
+ @NonNull
+ public List<RefSpec> getRefSpecs(Config config, String section,
String subsection, String name) {
String[] values = config.getStringList(section, subsection, name);
List<RefSpec> result = new ArrayList<>(values.length);