From 52dc2a16d4d1232820be893a3208d9f0be2b40e7 Mon Sep 17 00:00:00 2001 From: John Blum Date: Tue, 20 Aug 2019 19:04:20 -0700 Subject: [PATCH] SGF-875 - Remove unnecessary use of Apache Shiro API. --- .../client/support/DefaultableDelegatingPoolAdapter.java | 4 ++-- .../config/annotation/ApacheShiroSecurityConfiguration.java | 3 ++- .../gemfire/config/annotation/CacheServerConfiguration.java | 2 +- .../annotation/ClusterDefinedRegionsConfiguration.java | 4 ++-- .../support/AutoConfiguredAuthenticationInitializer.java | 3 ++- .../function/execution/GemfireOnServerFunctionTemplate.java | 4 ++-- .../gemfire/function/execution/ServerFunctionExecution.java | 4 ++-- .../data/gemfire/listener/ContinuousQueryDefinition.java | 4 ++-- .../data/gemfire/support/WiringDeclarableSupport.java | 4 ++-- .../data/gemfire/wan/GatewaySenderFactoryBean.java | 2 +- .../cache/config/EnableGemfireCachingIntegrationTests.java | 5 +++-- ...eIndexRegionBeanFactoryPostProcessorIntegrationTests.java | 5 +++-- 12 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/springframework/data/gemfire/client/support/DefaultableDelegatingPoolAdapter.java b/src/main/java/org/springframework/data/gemfire/client/support/DefaultableDelegatingPoolAdapter.java index 76ef9335..2f03608a 100644 --- a/src/main/java/org/springframework/data/gemfire/client/support/DefaultableDelegatingPoolAdapter.java +++ b/src/main/java/org/springframework/data/gemfire/client/support/DefaultableDelegatingPoolAdapter.java @@ -14,7 +14,6 @@ * limitations under the License. * */ - package org.springframework.data.gemfire.client.support; import java.net.InetSocketAddress; @@ -24,7 +23,8 @@ import java.util.function.Supplier; import org.apache.geode.cache.client.Pool; import org.apache.geode.cache.query.QueryService; -import org.apache.shiro.util.CollectionUtils; + +import org.springframework.data.gemfire.util.CollectionUtils; import org.springframework.data.gemfire.util.SpringUtils; import org.springframework.util.Assert; diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/ApacheShiroSecurityConfiguration.java b/src/main/java/org/springframework/data/gemfire/config/annotation/ApacheShiroSecurityConfiguration.java index bbfc2e6f..467a0c56 100644 --- a/src/main/java/org/springframework/data/gemfire/config/annotation/ApacheShiroSecurityConfiguration.java +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/ApacheShiroSecurityConfiguration.java @@ -14,7 +14,6 @@ * limitations under the License. * */ - package org.springframework.data.gemfire.config.annotation; import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalArgumentException; @@ -27,10 +26,12 @@ import java.util.Map; import java.util.Optional; import org.apache.geode.cache.GemFireCache; + import org.apache.shiro.SecurityUtils; import org.apache.shiro.mgt.DefaultSecurityManager; import org.apache.shiro.realm.Realm; import org.apache.shiro.spring.LifecycleBeanPostProcessor; + import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.ListableBeanFactory; diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/CacheServerConfiguration.java b/src/main/java/org/springframework/data/gemfire/config/annotation/CacheServerConfiguration.java index 431135d1..7a0d9f88 100644 --- a/src/main/java/org/springframework/data/gemfire/config/annotation/CacheServerConfiguration.java +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/CacheServerConfiguration.java @@ -31,7 +31,6 @@ import org.apache.geode.cache.client.ClientCache; import org.apache.geode.cache.server.CacheServer; import org.apache.geode.cache.server.ClientSubscriptionConfig; import org.apache.geode.cache.server.ServerLoadProbe; -import org.apache.shiro.util.Assert; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; @@ -40,6 +39,7 @@ import org.springframework.core.annotation.AnnotationAttributes; import org.springframework.core.type.AnnotationMetadata; import org.springframework.data.gemfire.server.CacheServerFactoryBean; import org.springframework.data.gemfire.server.SubscriptionEvictionPolicy; +import org.springframework.util.Assert; import org.springframework.util.StringUtils; /** diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/ClusterDefinedRegionsConfiguration.java b/src/main/java/org/springframework/data/gemfire/config/annotation/ClusterDefinedRegionsConfiguration.java index 23134da6..0695b08c 100644 --- a/src/main/java/org/springframework/data/gemfire/config/annotation/ClusterDefinedRegionsConfiguration.java +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/ClusterDefinedRegionsConfiguration.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire.config.annotation; import java.lang.annotation.Annotation; @@ -23,7 +22,7 @@ import org.apache.geode.cache.GemFireCache; import org.apache.geode.cache.Region; import org.apache.geode.cache.client.ClientCache; import org.apache.geode.cache.client.ClientRegionShortcut; -import org.apache.shiro.util.Assert; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportAware; @@ -32,6 +31,7 @@ import org.springframework.core.type.AnnotationMetadata; import org.springframework.data.gemfire.client.GemfireDataSourcePostProcessor; import org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport; import org.springframework.data.gemfire.util.CacheUtils; +import org.springframework.util.Assert; /** * The {@link ClusterDefinedRegionsConfiguration} class configures client Proxy-based {@link Region Regions} diff --git a/src/main/java/org/springframework/data/gemfire/config/annotation/support/AutoConfiguredAuthenticationInitializer.java b/src/main/java/org/springframework/data/gemfire/config/annotation/support/AutoConfiguredAuthenticationInitializer.java index ebed4863..62177bc7 100644 --- a/src/main/java/org/springframework/data/gemfire/config/annotation/support/AutoConfiguredAuthenticationInitializer.java +++ b/src/main/java/org/springframework/data/gemfire/config/annotation/support/AutoConfiguredAuthenticationInitializer.java @@ -18,7 +18,8 @@ package org.springframework.data.gemfire.config.annotation.support; import java.util.Properties; import org.apache.geode.security.AuthInitialize; -import org.apache.shiro.util.StringUtils; + +import org.springframework.util.StringUtils; /** * The {@link AutoConfiguredAuthenticationInitializer} class is an {@link AuthInitialize} implementation, diff --git a/src/main/java/org/springframework/data/gemfire/function/execution/GemfireOnServerFunctionTemplate.java b/src/main/java/org/springframework/data/gemfire/function/execution/GemfireOnServerFunctionTemplate.java index df22a053..f9296526 100644 --- a/src/main/java/org/springframework/data/gemfire/function/execution/GemfireOnServerFunctionTemplate.java +++ b/src/main/java/org/springframework/data/gemfire/function/execution/GemfireOnServerFunctionTemplate.java @@ -12,7 +12,6 @@ */ package org.springframework.data.gemfire.function.execution; - import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalStateException; import java.util.Optional; @@ -23,9 +22,10 @@ import org.apache.geode.cache.client.Pool; import org.apache.geode.cache.client.PoolManager; import org.apache.geode.cache.execute.Execution; import org.apache.geode.cache.execute.Function; -import org.apache.shiro.util.Assert; + import org.springframework.data.gemfire.GemfireUtils; import org.springframework.data.gemfire.util.CacheUtils; +import org.springframework.util.Assert; import org.springframework.util.StringUtils; /** diff --git a/src/main/java/org/springframework/data/gemfire/function/execution/ServerFunctionExecution.java b/src/main/java/org/springframework/data/gemfire/function/execution/ServerFunctionExecution.java index 05764c16..dcdf97a6 100644 --- a/src/main/java/org/springframework/data/gemfire/function/execution/ServerFunctionExecution.java +++ b/src/main/java/org/springframework/data/gemfire/function/execution/ServerFunctionExecution.java @@ -10,13 +10,13 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ - package org.springframework.data.gemfire.function.execution; import org.apache.geode.cache.RegionService; import org.apache.geode.cache.execute.Execution; import org.apache.geode.cache.execute.FunctionService; -import org.apache.shiro.util.Assert; + +import org.springframework.util.Assert; /** * Constructs an {@link Execution} using {@link FunctionService#onServer(RegionService)}. diff --git a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java index da8ae1fe..dce766d9 100644 --- a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java +++ b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire.listener; import java.lang.reflect.Method; @@ -24,11 +23,12 @@ import org.apache.geode.cache.query.CqAttributes; import org.apache.geode.cache.query.CqAttributesFactory; import org.apache.geode.cache.query.CqListener; import org.apache.geode.cache.query.CqQuery; -import org.apache.shiro.util.StringUtils; + import org.springframework.beans.factory.InitializingBean; import org.springframework.data.gemfire.listener.adapter.ContinuousQueryListenerAdapter; import org.springframework.data.gemfire.listener.annotation.ContinuousQuery; import org.springframework.util.Assert; +import org.springframework.util.StringUtils; /** * Class type for defining a {@link CqQuery}. diff --git a/src/main/java/org/springframework/data/gemfire/support/WiringDeclarableSupport.java b/src/main/java/org/springframework/data/gemfire/support/WiringDeclarableSupport.java index 59b9037a..c2b3089e 100644 --- a/src/main/java/org/springframework/data/gemfire/support/WiringDeclarableSupport.java +++ b/src/main/java/org/springframework/data/gemfire/support/WiringDeclarableSupport.java @@ -14,16 +14,16 @@ * limitations under the License. * */ - package org.springframework.data.gemfire.support; import java.util.Properties; import org.apache.geode.cache.Declarable; -import org.apache.shiro.util.Assert; + import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.wiring.BeanConfigurerSupport; import org.springframework.beans.factory.wiring.BeanWiringInfo; +import org.springframework.util.Assert; import org.springframework.util.StringUtils; /** diff --git a/src/main/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBean.java b/src/main/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBean.java index ae44c9bb..cc808978 100644 --- a/src/main/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/wan/GatewaySenderFactoryBean.java @@ -24,10 +24,10 @@ import org.apache.geode.cache.wan.GatewayEventSubstitutionFilter; import org.apache.geode.cache.wan.GatewaySender; import org.apache.geode.cache.wan.GatewaySenderFactory; import org.apache.geode.cache.wan.GatewayTransportFilter; -import org.apache.shiro.util.StringUtils; import org.springframework.beans.factory.FactoryBean; import org.springframework.data.gemfire.util.CollectionUtils; +import org.springframework.util.StringUtils; /** * Spring {@link FactoryBean} for creating a parallel or serial Pivotal GemFire {@link GatewaySender}. diff --git a/src/test/java/org/springframework/data/gemfire/cache/config/EnableGemfireCachingIntegrationTests.java b/src/test/java/org/springframework/data/gemfire/cache/config/EnableGemfireCachingIntegrationTests.java index 7771db3a..47449532 100644 --- a/src/test/java/org/springframework/data/gemfire/cache/config/EnableGemfireCachingIntegrationTests.java +++ b/src/test/java/org/springframework/data/gemfire/cache/config/EnableGemfireCachingIntegrationTests.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire.cache.config; import static org.assertj.core.api.Java6Assertions.assertThat; @@ -22,9 +21,10 @@ import javax.annotation.Resource; import org.apache.geode.cache.GemFireCache; import org.apache.geode.cache.Region; -import org.apache.shiro.util.Assert; + import org.junit.Test; import org.junit.runner.RunWith; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.Cacheable; import org.springframework.context.annotation.Bean; @@ -34,6 +34,7 @@ import org.springframework.data.gemfire.config.annotation.PeerCacheApplication; import org.springframework.stereotype.Service; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.util.Assert; /** * Integration tests for {@link EnableGemfireCaching} and {@link GemfireCachingConfiguration}. diff --git a/src/test/java/org/springframework/data/gemfire/config/support/LuceneIndexRegionBeanFactoryPostProcessorIntegrationTests.java b/src/test/java/org/springframework/data/gemfire/config/support/LuceneIndexRegionBeanFactoryPostProcessorIntegrationTests.java index 966fb736..423cb705 100644 --- a/src/test/java/org/springframework/data/gemfire/config/support/LuceneIndexRegionBeanFactoryPostProcessorIntegrationTests.java +++ b/src/test/java/org/springframework/data/gemfire/config/support/LuceneIndexRegionBeanFactoryPostProcessorIntegrationTests.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.data.gemfire.config.support; import static org.assertj.core.api.Assertions.assertThat; @@ -24,9 +23,10 @@ import java.util.Optional; import java.util.concurrent.CopyOnWriteArrayList; import org.apache.geode.cache.Region; -import org.apache.shiro.util.Assert; + import org.junit.Test; import org.junit.runner.RunWith; + import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanDefinition; @@ -38,6 +38,7 @@ import org.springframework.data.gemfire.test.mock.context.GemFireMockObjectsAppl import org.springframework.lang.Nullable; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.util.Assert; /** * Unit tests for {@link LuceneIndexRegionBeanFactoryPostProcessor}.