From 4e4ed2fc3861f957959a0d80f7f49c6cf904cc58 Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Sun, 6 Sep 2020 09:45:07 +0100 Subject: [PATCH] Polish --- .../statemachine/StateMachineContextRepository.java | 4 +--- .../DefaultTransitionSecurityExpressionHandler.java | 6 ++---- .../transition/AbstractExternalTransition.java | 4 ++-- .../transition/AbstractInternalTransition.java | 4 ++-- .../transition/AbstractLocalTransition.java | 4 ++-- .../statemachine/transition/InitialTransition.java | 5 ++--- .../MongoDbPersistingStateMachineInterceptor.java | 4 +--- .../data/mongodb/MongoDbRepositoryTests.java | 4 +--- .../statemachine/data/mongodb/MongoDbRule.java | 5 ++--- .../redis/RedisPersistingStateMachineInterceptor.java | 4 +--- .../data/RepositoryStateMachineModelFactory.java | 11 +++++------ .../statemachine/uml/UmlStateMachineModelFactory.java | 5 ++--- 12 files changed, 23 insertions(+), 37 deletions(-) diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/StateMachineContextRepository.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/StateMachineContextRepository.java index e549563d..996354dc 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/StateMachineContextRepository.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/StateMachineContextRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2020 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. @@ -15,8 +15,6 @@ */ package org.springframework.statemachine; -import org.springframework.statemachine.StateMachineContext; - /** * Repository interface for saving and retrieving {@link StateMachineContext} objects. * diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/security/DefaultTransitionSecurityExpressionHandler.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/security/DefaultTransitionSecurityExpressionHandler.java index 0749ee9e..492980f7 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/security/DefaultTransitionSecurityExpressionHandler.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/security/DefaultTransitionSecurityExpressionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2020 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,7 +16,6 @@ package org.springframework.statemachine.security; import org.springframework.security.access.expression.AbstractSecurityExpressionHandler; -import org.springframework.security.access.expression.SecurityExpressionHandler; import org.springframework.security.access.expression.SecurityExpressionOperations; import org.springframework.security.authentication.AuthenticationTrustResolver; import org.springframework.security.authentication.AuthenticationTrustResolverImpl; @@ -24,8 +23,7 @@ import org.springframework.security.core.Authentication; import org.springframework.statemachine.transition.Transition; import org.springframework.util.Assert; -public class DefaultTransitionSecurityExpressionHandler extends AbstractSecurityExpressionHandler> - implements SecurityExpressionHandler> { +public class DefaultTransitionSecurityExpressionHandler extends AbstractSecurityExpressionHandler> { private AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl(); private String defaultRolePrefix = "ROLE_"; diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractExternalTransition.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractExternalTransition.java index 1b0509cf..44b2d24a 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractExternalTransition.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractExternalTransition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2020 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. @@ -25,7 +25,7 @@ import org.springframework.statemachine.trigger.Trigger; import reactor.core.publisher.Mono; -public abstract class AbstractExternalTransition extends AbstractTransition implements Transition { +public abstract class AbstractExternalTransition extends AbstractTransition { /** * Instantiates a new abstract external transition. diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractInternalTransition.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractInternalTransition.java index 811d3aac..2fb48c75 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractInternalTransition.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractInternalTransition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2020 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. @@ -25,7 +25,7 @@ import org.springframework.statemachine.trigger.Trigger; import reactor.core.publisher.Mono; -public class AbstractInternalTransition extends AbstractTransition implements Transition { +public class AbstractInternalTransition extends AbstractTransition { /** * Instantiates a new abstract internal transition. diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractLocalTransition.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractLocalTransition.java index 2a121e37..159a63e8 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractLocalTransition.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/AbstractLocalTransition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2020 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. @@ -25,7 +25,7 @@ import org.springframework.statemachine.trigger.Trigger; import reactor.core.publisher.Mono; -public class AbstractLocalTransition extends AbstractTransition implements Transition { +public class AbstractLocalTransition extends AbstractTransition { /** * Instantiates a new abstract local transition. diff --git a/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/InitialTransition.java b/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/InitialTransition.java index d7bd3ee6..d9138f1a 100644 --- a/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/InitialTransition.java +++ b/spring-statemachine-core/src/main/java/org/springframework/statemachine/transition/InitialTransition.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 the original author or authors. + * Copyright 2015-2020 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,8 +32,7 @@ import reactor.core.publisher.Mono; * @param the type of state * @param the type of event */ -public class InitialTransition extends AbstractTransition - implements Transition { +public class InitialTransition extends AbstractTransition { /** * Instantiates a new initial transition. diff --git a/spring-statemachine-data/mongodb/src/main/java/org/springframework/statemachine/data/mongodb/MongoDbPersistingStateMachineInterceptor.java b/spring-statemachine-data/mongodb/src/main/java/org/springframework/statemachine/data/mongodb/MongoDbPersistingStateMachineInterceptor.java index f0fb9ebe..8c78a519 100644 --- a/spring-statemachine-data/mongodb/src/main/java/org/springframework/statemachine/data/mongodb/MongoDbPersistingStateMachineInterceptor.java +++ b/spring-statemachine-data/mongodb/src/main/java/org/springframework/statemachine/data/mongodb/MongoDbPersistingStateMachineInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2020 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,8 +16,6 @@ package org.springframework.statemachine.data.mongodb; import org.springframework.statemachine.StateMachineContext; -import org.springframework.statemachine.data.mongodb.MongoDbRepositoryStateMachinePersist; -import org.springframework.statemachine.data.mongodb.MongoDbStateMachineRepository; import org.springframework.statemachine.persist.AbstractPersistingStateMachineInterceptor; import org.springframework.statemachine.persist.StateMachineRuntimePersister; import org.springframework.statemachine.support.StateMachineInterceptor; diff --git a/spring-statemachine-data/mongodb/src/test/java/org/springframework/statemachine/data/mongodb/MongoDbRepositoryTests.java b/spring-statemachine-data/mongodb/src/test/java/org/springframework/statemachine/data/mongodb/MongoDbRepositoryTests.java index cb4d4a1b..128cbc65 100644 --- a/spring-statemachine-data/mongodb/src/test/java/org/springframework/statemachine/data/mongodb/MongoDbRepositoryTests.java +++ b/spring-statemachine-data/mongodb/src/test/java/org/springframework/statemachine/data/mongodb/MongoDbRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2020 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. @@ -39,8 +39,6 @@ import org.springframework.statemachine.config.builders.StateMachineConfiguratio import org.springframework.statemachine.config.builders.StateMachineStateConfigurer; import org.springframework.statemachine.config.builders.StateMachineTransitionConfigurer; import org.springframework.statemachine.data.AbstractRepositoryTests; -import org.springframework.statemachine.data.mongodb.MongoDbPersistingStateMachineInterceptor; -import org.springframework.statemachine.data.mongodb.MongoDbStateMachineRepository; import org.springframework.statemachine.persist.StateMachineRuntimePersister; import org.springframework.statemachine.transition.TransitionKind; diff --git a/spring-statemachine-data/mongodb/src/test/java/org/springframework/statemachine/data/mongodb/MongoDbRule.java b/spring-statemachine-data/mongodb/src/test/java/org/springframework/statemachine/data/mongodb/MongoDbRule.java index 6c639e04..eb6d24e7 100644 --- a/spring-statemachine-data/mongodb/src/test/java/org/springframework/statemachine/data/mongodb/MongoDbRule.java +++ b/spring-statemachine-data/mongodb/src/test/java/org/springframework/statemachine/data/mongodb/MongoDbRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2020 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. @@ -15,7 +15,6 @@ */ package org.springframework.statemachine.data.mongodb; -import org.junit.rules.TestRule; import org.junit.rules.TestWatcher; import org.junit.runner.Description; import org.junit.runners.model.Statement; @@ -28,7 +27,7 @@ import org.springframework.util.SocketUtils; * @author Janne Valkealahti * */ -public class MongoDbRule extends TestWatcher implements TestRule { +public class MongoDbRule extends TestWatcher { @Override public Statement apply(Statement base, Description description) { diff --git a/spring-statemachine-data/redis/src/main/java/org/springframework/statemachine/data/redis/RedisPersistingStateMachineInterceptor.java b/spring-statemachine-data/redis/src/main/java/org/springframework/statemachine/data/redis/RedisPersistingStateMachineInterceptor.java index 1f8bfb63..9ec3761a 100644 --- a/spring-statemachine-data/redis/src/main/java/org/springframework/statemachine/data/redis/RedisPersistingStateMachineInterceptor.java +++ b/spring-statemachine-data/redis/src/main/java/org/springframework/statemachine/data/redis/RedisPersistingStateMachineInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2017 the original author or authors. + * Copyright 2017-2020 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,8 +16,6 @@ package org.springframework.statemachine.data.redis; import org.springframework.statemachine.StateMachineContext; -import org.springframework.statemachine.data.redis.RedisRepositoryStateMachinePersist; -import org.springframework.statemachine.data.redis.RedisStateMachineRepository; import org.springframework.statemachine.persist.AbstractPersistingStateMachineInterceptor; import org.springframework.statemachine.persist.StateMachineRuntimePersister; import org.springframework.statemachine.support.StateMachineInterceptor; diff --git a/spring-statemachine-data/src/main/java/org/springframework/statemachine/data/RepositoryStateMachineModelFactory.java b/spring-statemachine-data/src/main/java/org/springframework/statemachine/data/RepositoryStateMachineModelFactory.java index 23dc16e0..a9b5f4f7 100644 --- a/spring-statemachine-data/src/main/java/org/springframework/statemachine/data/RepositoryStateMachineModelFactory.java +++ b/spring-statemachine-data/src/main/java/org/springframework/statemachine/data/RepositoryStateMachineModelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * Copyright 2016-2020 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. @@ -60,8 +60,7 @@ import reactor.core.publisher.Mono; * @author Janne Valkealahti * */ -public class RepositoryStateMachineModelFactory extends AbstractStateMachineModelFactory - implements StateMachineModelFactory { +public class RepositoryStateMachineModelFactory extends AbstractStateMachineModelFactory { private final StateRepository stateRepository; private final TransitionRepository transitionRepository; @@ -95,13 +94,13 @@ public class RepositoryStateMachineModelFactory extends AbstractStateMachineMode subStateMachineModel = build(submachineId); } - Collection, Mono>> stateActions = + Collection, Mono>> stateActions = loadStateActionsFromRepositoryState(s.getStateActions()); - Collection, Mono>> entryActions = + Collection, Mono>> entryActions = loadStateActionsFromRepositoryState(s.getEntryActions()); - Collection, Mono>> exitActions = + Collection, Mono>> exitActions = loadStateActionsFromRepositoryState(s.getExitActions()); RepositoryState parentState = s.getParentState(); diff --git a/spring-statemachine-uml/src/main/java/org/springframework/statemachine/uml/UmlStateMachineModelFactory.java b/spring-statemachine-uml/src/main/java/org/springframework/statemachine/uml/UmlStateMachineModelFactory.java index 94501396..46c748d6 100644 --- a/spring-statemachine-uml/src/main/java/org/springframework/statemachine/uml/UmlStateMachineModelFactory.java +++ b/spring-statemachine-uml/src/main/java/org/springframework/statemachine/uml/UmlStateMachineModelFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2018 the original author or authors. + * Copyright 2016-2020 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. @@ -41,8 +41,7 @@ import org.springframework.util.FileCopyUtils; * * @author Janne Valkealahti */ -public class UmlStateMachineModelFactory extends AbstractStateMachineModelFactory - implements StateMachineModelFactory { +public class UmlStateMachineModelFactory extends AbstractStateMachineModelFactory { private Resource resource; private String location;