diff --git a/scm-core/src/main/java/sonia/scm/ScmConstraintViolationException.java b/scm-core/src/main/java/sonia/scm/ScmConstraintViolationException.java index c6aebc05f6..02e69c12d9 100644 --- a/scm-core/src/main/java/sonia/scm/ScmConstraintViolationException.java +++ b/scm-core/src/main/java/sonia/scm/ScmConstraintViolationException.java @@ -39,10 +39,10 @@ import static java.util.Collections.unmodifiableCollection; * .doThrow() * .violation("name or alias must not be empty if not anonymous", "myParameter", "name") * .violation("name or alias must not be empty if not anonymous", "myParameter", "alias") - * .when(myParameter.getName() == null && myParameter.getAlias() == null && !myParameter.isAnonymous()) + * .when(myParameter.getName() == null && myParameter.getAlias() == null && !myParameter.isAnonymous()) * .andThrow() * .violation("name must be empty if anonymous", "myParameter", "name") - * .when(myParameter.getName() != null && myParameter.isAnonymous()); + * .when(myParameter.getName() != null && myParameter.isAnonymous()); * * Mind that using this way you do not have to use if-else constructs. */ diff --git a/scm-core/src/main/java/sonia/scm/ServletContainer.java b/scm-core/src/main/java/sonia/scm/ServletContainer.java index 84fded9da7..57a671f283 100644 --- a/scm-core/src/main/java/sonia/scm/ServletContainer.java +++ b/scm-core/src/main/java/sonia/scm/ServletContainer.java @@ -32,9 +32,9 @@ package sonia.scm; public enum ServletContainer { SCM_SERVER, - /** Jetty version <= 6 */ + /** Jetty version <= 6 */ JETTY, - /** Jetty version >= 7 */ + /** Jetty version >= 7 */ ECLIPSE_JETTY, TOMCAT, GLASSFISH, diff --git a/scm-core/src/main/java/sonia/scm/config/ScmConfiguration.java b/scm-core/src/main/java/sonia/scm/config/ScmConfiguration.java index 910fec675c..f719a3f951 100644 --- a/scm-core/src/main/java/sonia/scm/config/ScmConfiguration.java +++ b/scm-core/src/main/java/sonia/scm/config/ScmConfiguration.java @@ -207,8 +207,7 @@ public class ScmConfiguration implements Configuration { private String mailDomainName = DEFAULT_MAIL_DOMAIN_NAME; /** - * Calls the {@link sonia.scm.ConfigChangedListener#configChanged(Object)} - * method of all registered listeners. + * Fires the {@link ScmConfigurationChangedEvent}. */ public void fireChangeEvent() { if (logger.isDebugEnabled()) { @@ -294,7 +293,7 @@ public class ScmConfiguration implements Configuration { *
@@ -62,36 +61,30 @@ import java.io.IOException; * * * @author Sebastian Sdorra - * @since 1.46 - * * @apiviz.landmark + * @since 1.46 */ -public abstract class AdvancedHttpClient -{ +public abstract class AdvancedHttpClient { /** * Creates a {@link ContentTransformer} for the given Content-Type. * - * @param type object type + * @param type object type * @param contentType content-type - * @throws ContentTransformerNotFoundException if no - * {@link ContentTransformer} could be found for the content-type - * * @return {@link ContentTransformer} + * @throws ContentTransformerNotFoundException if no + * {@link ContentTransformer} could be found for the content-type */ protected abstract ContentTransformer createTransformer(Class> type, - String contentType); + String contentType); /** * Executes the given request and returns the http response. Implementation * have to check, if the instance if from type * {@link AdvancedHttpRequestWithBody} in order to handle request contents. * - * * @param request request to execute - * * @return http response - * * @throws IOException */ protected abstract AdvancedHttpResponse request(BaseHttpRequest> request) @@ -100,26 +93,20 @@ public abstract class AdvancedHttpClient /** * Returns a builder for a DELETE request. * - * * @param url request url - * * @return request builder */ - public AdvancedHttpRequestWithBody delete(String url) - { + public AdvancedHttpRequestWithBody delete(String url) { return new AdvancedHttpRequestWithBody(this, HttpMethod.DELETE, url); } /** * Returns a builder for a HEAD request. * - * * @param url request url - * * @return request builder */ - public AdvancedHttpRequest head(String url) - { + public AdvancedHttpRequest head(String url) { return new AdvancedHttpRequest(this, HttpMethod.HEAD, url); } @@ -128,53 +115,41 @@ public abstract class AdvancedHttpClient * every method is supported by the underlying implementation of the http * client. * - * * @param method http method - * @param url request url - * + * @param url request url * @return request builder */ - public AdvancedHttpRequestWithBody method(String method, String url) - { + public AdvancedHttpRequestWithBody method(String method, String url) { return new AdvancedHttpRequestWithBody(this, method, url); } /** * Returns a builder for a OPTIONS request. * - * * @param url request url - * * @return request builder */ - public AdvancedHttpRequestWithBody options(String url) - { + public AdvancedHttpRequestWithBody options(String url) { return new AdvancedHttpRequestWithBody(this, HttpMethod.OPTIONS, url); } /** * Returns a builder for a POST request. * - * * @param url request url - * * @return request builder */ - public AdvancedHttpRequestWithBody post(String url) - { + public AdvancedHttpRequestWithBody post(String url) { return new AdvancedHttpRequestWithBody(this, HttpMethod.POST, url); } /** * Returns a builder for a PUT request. * - * * @param url request url - * * @return request builder */ - public AdvancedHttpRequestWithBody put(String url) - { + public AdvancedHttpRequestWithBody put(String url) { return new AdvancedHttpRequestWithBody(this, HttpMethod.PUT, url); } @@ -183,13 +158,10 @@ public abstract class AdvancedHttpClient /** * Returns a builder for a GET request. * - * * @param url request url - * * @return request builder */ - public AdvancedHttpRequest get(String url) - { + public AdvancedHttpRequest get(String url) { return new AdvancedHttpRequest(this, HttpMethod.GET, url); } } diff --git a/scm-core/src/main/java/sonia/scm/net/ahc/ContentTransformer.java b/scm-core/src/main/java/sonia/scm/net/ahc/ContentTransformer.java index e501352fae..2ea132d011 100644 --- a/scm-core/src/main/java/sonia/scm/net/ahc/ContentTransformer.java +++ b/scm-core/src/main/java/sonia/scm/net/ahc/ContentTransformer.java @@ -31,7 +31,7 @@ import sonia.scm.plugin.ExtensionPoint; * Transforms {@link ByteSource} content to an object and vice versa. This class * is an extension point, this means that plugins can define their own * {@link ContentTransformer} implementations by implementing the interface and - * annotate the implementation with the {@link sonia.scm.plugin.ext.Extension} + * annotate the implementation with the {@link sonia.scm.plugin.Extension} * annotation. * * @author Sebastian Sdorra diff --git a/scm-core/src/main/java/sonia/scm/repository/AbstractRepositoryManager.java b/scm-core/src/main/java/sonia/scm/repository/AbstractRepositoryManager.java index 0d7463fd9d..96b60cfd82 100644 --- a/scm-core/src/main/java/sonia/scm/repository/AbstractRepositoryManager.java +++ b/scm-core/src/main/java/sonia/scm/repository/AbstractRepositoryManager.java @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - + package sonia.scm.repository; //~--- non-JDK imports -------------------------------------------------------- @@ -37,19 +37,15 @@ import sonia.scm.util.AssertUtil; * * @author Sebastian Sdorra */ -public abstract class AbstractRepositoryManager implements RepositoryManager -{ +public abstract class AbstractRepositoryManager implements RepositoryManager { /** - * Sends a {@link RepositoryHookEvent} to each registered - * {@link RepositoryHook} and sends the {@link RepositoryHookEvent} to - * the {@link ScmEventBus}. + * Sends the {@link RepositoryHookEvent} to the {@link ScmEventBus}. * * @param event event to be fired */ @Override - public void fireHookEvent(RepositoryHookEvent event) - { + public void fireHookEvent(RepositoryHookEvent event) { AssertUtil.assertIsNotNull(event); AssertUtil.assertIsNotNull(event.getRepository()); AssertUtil.assertIsNotNull(event.getType()); @@ -64,13 +60,12 @@ public abstract class AbstractRepositoryManager implements RepositoryManager /** * Send a {@link RepositoryEvent} to the {@link ScmEventBus}. * - * @param event type of change event - * @param repository repository that has changed + * @param event type of change event + * @param repository repository that has changed * @param oldRepository old repository */ protected void fireEvent(HandlerEventType event, Repository repository, - Repository oldRepository) - { + Repository oldRepository) { ScmEventBus.getInstance().post(new RepositoryModificationEvent(event, repository, oldRepository)); } @@ -78,25 +73,21 @@ public abstract class AbstractRepositoryManager implements RepositoryManager /** * Send a {@link RepositoryEvent} to the {@link ScmEventBus}. * - * @param event type of change event + * @param event type of change event * @param repository repository that has changed */ - protected void fireEvent(HandlerEventType event, Repository repository) - { + protected void fireEvent(HandlerEventType event, Repository repository) { ScmEventBus.getInstance().post(new RepositoryEvent(event, repository)); } /** * Prepare a hook event before it is fired to the event system of SCM-Manager. * - * * @param event hook event - * @since 1.26 - * * @return + * @since 1.26 */ - protected RepositoryHookEvent prepareHookEvent(RepositoryHookEvent event) - { + protected RepositoryHookEvent prepareHookEvent(RepositoryHookEvent event) { return event; } } diff --git a/scm-core/src/main/java/sonia/scm/repository/Added.java b/scm-core/src/main/java/sonia/scm/repository/Added.java index c61c82fd03..94d6107e72 100644 --- a/scm-core/src/main/java/sonia/scm/repository/Added.java +++ b/scm-core/src/main/java/sonia/scm/repository/Added.java @@ -24,6 +24,7 @@ package sonia.scm.repository; +import lombok.EqualsAndHashCode; import lombok.Value; import java.util.stream.Stream; @@ -31,8 +32,9 @@ import java.util.stream.Stream; import static java.util.stream.Stream.of; @Value +@EqualsAndHashCode(callSuper=false) public class Added extends Modification { - private final String path; + String path; @Override Stream
- * O <- Merge result (new head of integration_branch)
- * |\
- * | \
- * old integration_branch -> O O <- feature_branch
- * | |
- * O O
+ * O <- Merge result (new head of integration_branch)
+ * |\
+ * | \
+ * old integration_branch -> O O <- feature_branch
+ * | |
+ * O O
*
*
* To check whether they can be merged without conflicts beforehand do this:
diff --git a/scm-core/src/main/java/sonia/scm/repository/work/SimpleWorkingCopyFactory.java b/scm-core/src/main/java/sonia/scm/repository/work/SimpleWorkingCopyFactory.java
index 0905ce1081..a62869d740 100644
--- a/scm-core/src/main/java/sonia/scm/repository/work/SimpleWorkingCopyFactory.java
+++ b/scm-core/src/main/java/sonia/scm/repository/work/SimpleWorkingCopyFactory.java
@@ -41,18 +41,18 @@ import java.io.File;
* implemented:
*
*
* Archives.addPathToTar(Paths.get("some/dir"), Files.newOutputStream("my.tar"))
- * .filter(path -> !path.toString().endsWith("~"))
+ * .filter(path -> !path.toString().endsWith("~"))
* .run();
*
* @param path The path containing the files to be added to the tar.
diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/api/v2/resources/GitRepositoryConfigMapper.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/api/v2/resources/GitRepositoryConfigMapper.java
index 5fe725ffc3..94f74902e8 100644
--- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/api/v2/resources/GitRepositoryConfigMapper.java
+++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/api/v2/resources/GitRepositoryConfigMapper.java
@@ -28,6 +28,7 @@ import de.otto.edison.hal.Links;
import org.mapstruct.AfterMapping;
import org.mapstruct.Context;
import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;
import sonia.scm.repository.GitRepositoryConfig;
import sonia.scm.repository.Repository;
@@ -46,6 +47,7 @@ public abstract class GitRepositoryConfigMapper {
@Inject
private ScmPathInfoStore scmPathInfoStore;
+ @Mapping(target = "attributes", ignore = true) // We do not map HAL attributes
public abstract GitRepositoryConfigDto map(GitRepositoryConfig config, @Context Repository repository);
public abstract GitRepositoryConfig map(GitRepositoryConfigDto dto);
diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitUtil.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitUtil.java
index ba7733a5a4..0127b0f75a 100644
--- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitUtil.java
+++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitUtil.java
@@ -496,7 +496,7 @@ public final class GitUtil {
* Returns the name of the tag or {@code null} if the the ref is not a tag.
*
* @param refName ref name
- * @return name of tag or {@link null}
+ * @return name of tag or null
* @since 1.50
*/
public static String getTagName(String refName) {
diff --git a/scm-plugins/scm-svn-plugin/src/test/java/sonia/scm/repository/spi/SvnLookupCommandTest.java b/scm-plugins/scm-svn-plugin/src/test/java/sonia/scm/repository/spi/SvnLookupCommandTest.java
index df4fedae92..14004265bc 100644
--- a/scm-plugins/scm-svn-plugin/src/test/java/sonia/scm/repository/spi/SvnLookupCommandTest.java
+++ b/scm-plugins/scm-svn-plugin/src/test/java/sonia/scm/repository/spi/SvnLookupCommandTest.java
@@ -51,11 +51,11 @@ class SvnLookupCommandTest {
@Test
void shouldReturnEmptyOptional() {
- LookupCommandRequest request = new LookupCommandRequest();
+ LookupCommandRequest