Adopt Spring Java Format

This commit is contained in:
Andy Wilkinson
2018-09-06 14:17:28 +01:00
parent 98bd2db6de
commit 408943fbb5
44 changed files with 159 additions and 205 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import java.util.List;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,16 +18,16 @@ package io.spring.issuebot;
import java.util.List;
import io.spring.issuebot.github.GitHubOperations;
import io.spring.issuebot.github.GitHubTemplate;
import io.spring.issuebot.github.RegexLinkParser;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import io.spring.issuebot.github.GitHubOperations;
import io.spring.issuebot.github.GitHubTemplate;
import io.spring.issuebot.github.RegexLinkParser;
/**
* Main class for launching Issue Bot.
*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@ public interface IssueListener {
/**
* Notification that the given {@code issue} is open.
*
* @param issue the open issue
*/
default void onOpenIssue(Issue issue) {
@@ -36,7 +35,6 @@ public interface IssueListener {
/**
* Notification that the given {@code issue} is being closed.
*
* @param issue the open issue
*/
default void onIssueClosure(Issue issue) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,13 +18,13 @@ package io.spring.issuebot;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import io.spring.issuebot.github.GitHubOperations;
import io.spring.issuebot.github.Issue;
import io.spring.issuebot.github.Page;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
/**
* Central class for monitoring the configured repository.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,14 +18,14 @@ package io.spring.issuebot.feedback;
import java.util.List;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.spring.issuebot.GitHubProperties;
import io.spring.issuebot.IssueListener;
import io.spring.issuebot.github.GitHubOperations;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* Central configuration for the beans involved in managing issues that are waiting for
* feedback.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,6 @@ public interface FeedbackListener {
/**
* Notification that feedback has been provided for the given {@code issue}.
*
* @param issue the issue
*/
void feedbackProvided(Issue issue);
@@ -38,7 +37,6 @@ public interface FeedbackListener {
/**
* Notification that feedback is still required for the given {@code issue} having
* been requested at the given {@code requestTime}.
*
* @param issue the issue
* @param requestTime the time when feedback was requested
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package io.spring.issuebot.feedback;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,7 +37,6 @@ public final class Comment {
/**
* Creates a new comment that was authored by the given {@code user} at the given
* {@code creationTime}.
*
* @param user the user
* @param creationTime the creation time
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,6 @@ public class Event {
/**
* Creates a new {@code Event}.
*
* @param type the type of the event
* @param creationTime the timestamp of when the event was created
* @param label the label associated with the event
@@ -76,7 +75,7 @@ public class Event {
/**
* The actor unsubscribed from receibing notifications for an issue.
*/
*/
UNSUBSCRIBED("unsubscribed"),
/**
@@ -164,6 +163,7 @@ public class Event {
throw new IllegalArgumentException(
"'" + type + "' is not a valid event type");
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@ public interface GitHubOperations {
/**
* Returns the open issues in the {@code repository} owned by the given
* {@code organization}.
*
* @param organization the name of the organization
* @param repository the name of the repository
* @return the issues
@@ -35,7 +34,6 @@ public interface GitHubOperations {
/**
* Returns the comments that have been made on the given {@code issue}.
*
* @param issue the issue
* @return the comments
*/
@@ -43,7 +41,6 @@ public interface GitHubOperations {
/**
* Adds the given {@code label} to the given {@code issue}.
*
* @param issue the issue
* @param label the label
* @return the modified issue
@@ -52,7 +49,6 @@ public interface GitHubOperations {
/**
* Removes the given {@code label} from the given {@code issue}.
*
* @param issue the issue
* @param label the label
* @return the modified issue
@@ -61,7 +57,6 @@ public interface GitHubOperations {
/**
* Adds the given {@code comment} to the given {@code issue}.
*
* @param issue the issue
* @param comment the comment
* @return the added comment
@@ -70,7 +65,6 @@ public interface GitHubOperations {
/**
* Closes the given {@code issue}.
*
* @param issue the issue
* @return the modified issue
*/
@@ -78,7 +72,6 @@ public interface GitHubOperations {
/**
* Returns the events that have occurred on the given {@code issue}.
*
* @param issue the issue
* @return the events
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@ import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpInputMessage;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpRequest;
@@ -66,7 +67,6 @@ public class GitHubTemplate implements GitHubOperations {
* Creates a new {@code GitHubTemplate} that will use the given {@code username} and
* {@code password} to authenticate, and the given {@code linkParser} to parse links
* from responses' {@code Link} header.
*
* @param username the username
* @param password the password
* @param linkParser the link parser
@@ -92,7 +92,7 @@ public class GitHubTemplate implements GitHubOperations {
+ new Date(Long
.valueOf(response.getHeaders()
.getFirst("X-RateLimit-Reset"))
* 1000));
* 1000));
}
}
});
@@ -204,7 +204,7 @@ public class GitHubTemplate implements GitHubOperations {
@Override
public Object read(Type type, Class<?> contextClass,
HttpInputMessage inputMessage)
throws IOException, HttpMessageNotReadableException {
throws IOException, HttpMessageNotReadableException {
try {
return super.read(type, contextClass, inputMessage);
}
@@ -235,7 +235,7 @@ public class GitHubTemplate implements GitHubOperations {
BasicAuthorizationInterceptor(String username, String password) {
this.username = username;
this.password = (password == null ? "" : password);
this.password = (password != null) ? password : "";
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,7 +56,6 @@ public class Issue {
/**
* Creates a new {@code Issue}.
*
* @param url the url of the issue in the GitHub API
* @param commentsUrl the url of the comments on the issue in the GitHub API
* @param eventsUrl the url of the events on the issue in the GitHub API

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@ public class Label {
/**
* Creates a new label with the given {@code name}.
*
* @param name the name of the label
*/
@JsonCreator

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,6 @@ interface LinkParser {
/**
* Parse the given {@code header} into a map of rel:url pairs.
*
* @param header the header to parse
* @return the map of links
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@ public class Milestone {
/**
* Creates a new {@code Milestone} with the given {@code title}.
*
* @param title the title
*/
@JsonCreator

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,14 +28,12 @@ public interface Page<T> {
/**
* Returns the next page, if any.
*
* @return The next page or {@code null}
* @return the next page or {@code null}
*/
Page<T> next();
/**
* Returns the contents of the page.
*
* @return the contents
*/
List<T> getContent();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,7 +35,6 @@ public class StandardPage<T> implements Page<T> {
* Creates a new {@code StandardPage} that has the given {@code content}. The given
* {@code nextSupplier} will be used to obtain the next page {@link #next when
* requested}.
*
* @param content the content
* @param nextSupplier the supplier of the next page
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@ public class User {
/**
* Creates a new {@code User} with the given login.
*
* @param login the login
*/
@JsonCreator

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,7 +34,6 @@ final class LabelApplyingTriageListener implements TriageListener {
* Creates a new {@code LabelApplyingTriageListener} that will use the given
* {@code gitHubOperations} to apply the given {@code label} to any issues that
* require triage.
*
* @param gitHubOperations the GitHubOperations
* @param label the label
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,11 +16,10 @@
package io.spring.issuebot.triage;
import io.spring.issuebot.github.Issue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.spring.issuebot.github.Issue;
/**
* A {@link TriageFilter} that considers an issue as having been triaged if any labels
* have been applied to it.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,11 +16,10 @@
package io.spring.issuebot.triage;
import io.spring.issuebot.github.Issue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.spring.issuebot.github.Issue;
/**
* A {@link TriageFilter} that considers an issue as having been triaged if a milestone
* has been applied to it.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,11 +19,10 @@ package io.spring.issuebot.triage;
import java.util.Collections;
import java.util.List;
import io.spring.issuebot.github.Issue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.spring.issuebot.github.Issue;
/**
* A {@link TriageFilter} that considers an issue as having been triaged if it was opened
* by a collaborator.
@@ -38,8 +37,8 @@ final class OpenedByCollaboratorTriageFilter implements TriageFilter {
private final List<String> collaborators;
OpenedByCollaboratorTriageFilter(List<String> collaborators) {
this.collaborators = collaborators == null ? Collections.emptyList()
: collaborators;
this.collaborators = (collaborators != null) ? collaborators
: Collections.emptyList();
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2017 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,13 +18,13 @@ package io.spring.issuebot.triage;
import java.util.Arrays;
import io.spring.issuebot.GitHubProperties;
import io.spring.issuebot.github.GitHubOperations;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.spring.issuebot.GitHubProperties;
import io.spring.issuebot.github.GitHubOperations;
/**
* Central configuration for the beans involved in identifying issues that require triage.
*
@@ -45,4 +45,5 @@ class TriageConfiguration {
new LabelApplyingTriageListener(gitHubOperations,
triageProperties.getLabel()));
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@ interface TriageFilter {
/**
* Returns {@code true} if the given issue has already been triaged, otherwise
* {@code false}.
*
* @param issue the issue
* @return {@code true} if the issue has been triaged, {@code false} otherwise
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -36,7 +36,6 @@ final class TriageIssueListener implements IssueListener {
* Creates a new {@code TriageIssueListener} that will use the given
* {@code triageFilters} to identify issues that require triage and notify the given
* {@code triageListener} of those that do.
*
* @param triageFilters the triage filters
* @param triageListener the triage listener
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,14 +27,12 @@ interface TriageListener {
/**
* Notification that the given {@code issue} requires triage.
*
* @param issue the issue
*/
void requiresTriage(Issue issue);
/**
* Notification that the given {@code issue} does not require triage.
*
* @param issue the issue
*/
void doesNotRequireTriage(Issue issue);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015 the original author or authors.
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package io.spring.issuebot.triage;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;