Remove Java 17 language features.

Resolves #623.
This commit is contained in:
John Blum
2022-09-14 15:11:50 -07:00
parent 73ec8333ab
commit c73fb1e30b
5 changed files with 15 additions and 13 deletions

View File

@@ -16,7 +16,6 @@
*/
package org.springframework.data.gemfire.client.function;
import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
@@ -35,12 +34,10 @@ import org.springframework.lang.NonNull;
*
* @author David Turanski
* @author John Blum
* @see java.io.Serial
* @see org.apache.geode.cache.execute.Function
*/
public class ListRegionsOnServerFunction implements Function<Object> {
@Serial
private static final long serialVersionUID = 867530169L;
public static final String ID = ListRegionsOnServerFunction.class.getName();

View File

@@ -265,8 +265,8 @@ public class PdxConfiguration extends AbstractAnnotationConfigSupport implements
.map(beanName -> beanFactory.getBean(beanName, PdxSerializer.class))
.orElseGet(this::newPdxSerializer);
if (serializer instanceof MappingPdxSerializer mappingSerializer) {
mappingSerializer.setIncludeTypeFilters(buildIncludeTypeFilters());
if (serializer instanceof MappingPdxSerializer) {
((MappingPdxSerializer) serializer).setIncludeTypeFilters(buildIncludeTypeFilters());
}
return serializer;

View File

@@ -1000,7 +1000,7 @@ public abstract class AbstractAnnotationConfigSupport
.map(BeanDefinition::getBeanClassName)
.filter(StringUtils::hasText);
boolean beanClassNameNotPresent = beanClassName.isEmpty();
boolean beanClassNameNotPresent = !beanClassName.isPresent();
if (beanClassNameNotPresent) {
beanClassName = optionalBeanDefinition

View File

@@ -49,7 +49,7 @@ import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* An abstract base class supporting the configuration of Apache Geode embedded services.
* Abstract base class supporting the configuration of Apache Geode embedded services.
*
* @author John Blum
* @see java.util.Map
@@ -225,7 +225,9 @@ public abstract class EmbeddedServiceConfigurationSupport extends AbstractAnnota
BeanFactory beanFactory = getBeanFactory();
if (beanFactory instanceof AutowireCapableBeanFactory autowiringBeanFactory) {
if (beanFactory instanceof AutowireCapableBeanFactory) {
AutowireCapableBeanFactory autowiringBeanFactory = (AutowireCapableBeanFactory) beanFactory;
NamedBeanHolder<T> beanHolder = autowiringBeanFactory.resolveNamedBean(beanType);
@@ -349,8 +351,11 @@ public abstract class EmbeddedServiceConfigurationSupport extends AbstractAnnota
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof Properties gemfirePropertiesBean && GEMFIRE_PROPERTIES_BEAN_NAME.equals(beanName)) {
gemfirePropertiesBean.putAll(this.gemfireProperties);
if (bean instanceof Properties && GEMFIRE_PROPERTIES_BEAN_NAME.equals(beanName)) {
Properties gemfireProperties = (Properties) bean;
gemfireProperties.putAll(this.gemfireProperties);
}
return bean;

View File

@@ -136,7 +136,7 @@ public class EnableContinuousQueriesConfigurationIntegrationTests extends Forkin
}
}
@ClientCacheApplication(logLevel = "error", subscriptionEnabled = true)
@ClientCacheApplication(subscriptionEnabled = true)
static class GeodeClientConfiguration {
@Bean
@@ -163,7 +163,7 @@ public class EnableContinuousQueriesConfigurationIntegrationTests extends Forkin
private CacheListener<Long, TemperatureReading> temperatureReadingCounterListener() {
return new CacheListenerAdapter<>() {
return new CacheListenerAdapter<Long, TemperatureReading>() {
@Override
public void afterCreate(EntryEvent<Long, TemperatureReading> event) {
@@ -198,7 +198,7 @@ public class EnableContinuousQueriesConfigurationIntegrationTests extends Forkin
private CacheLoader<Long, TemperatureReading> temperatureReadingsLoader() {
return new CacheLoader<>() {
return new CacheLoader<Long, TemperatureReading>() {
@Override
public TemperatureReading load(LoaderHelper<Long, TemperatureReading> helper) throws CacheLoaderException {