Apply appropriate SuppressWarnings annotations for rawtypes usage.

Format source code.

Optimize imports.
This commit is contained in:
John Blum
2020-03-03 02:41:03 +01:00
parent 0989bb048e
commit bb8ec272d4
6 changed files with 11 additions and 14 deletions

View File

@@ -48,9 +48,6 @@ import org.apache.geode.cache.client.Pool;
import org.apache.geode.cache.client.PoolManager;
import org.apache.geode.cache.util.CacheListenerAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
@@ -77,6 +74,9 @@ import org.springframework.session.events.SessionExpiredEvent;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* {@link AbstractGemFireOperationsSessionRepository} is an abstract base class encapsulating functionality
* common to all implementations that support {@link SessionRepository} operations backed by Apache Geode.
@@ -748,7 +748,7 @@ public abstract class AbstractGemFireOperationsSessionRepository
* @return a new {@link GemFireSession}.
* @see #isUsingDataSerialization()
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T extends GemFireSessionAttributes> GemFireSession<T> create() {
return isUsingDataSerialization()
@@ -764,6 +764,7 @@ public abstract class AbstractGemFireOperationsSessionRepository
* @see org.springframework.session.Session
* @see #isUsingDataSerialization()
*/
@SuppressWarnings("rawtypes")
public static GemFireSession copy(@NonNull Session session) {
return isUsingDataSerialization()
@@ -780,6 +781,7 @@ public abstract class AbstractGemFireOperationsSessionRepository
* or return a copy of the given {@link Session} as a {@link GemFireSession}.
* @see #copy(Session)
*/
@SuppressWarnings("rawtypes")
public static GemFireSession from(@NonNull Session session) {
return session instanceof GemFireSession ? (GemFireSession) session : copy(session);
}
@@ -1349,7 +1351,6 @@ public abstract class AbstractGemFireOperationsSessionRepository
}
@Override
@SuppressWarnings("all")
public Set<Entry<String, Object>> entrySet() {
synchronized (getLock()) {

View File

@@ -69,7 +69,6 @@ public class GemFireOperationsSessionRepository extends AbstractGemFireOperation
* @see #configure(Session)
*/
@NonNull
@SuppressWarnings("all")
public Session createSession() {
return configure(GemFireSession.create());
}
@@ -161,7 +160,6 @@ public class GemFireOperationsSessionRepository extends AbstractGemFireOperation
* @see #commit(Session)
* @see #touch(Session)
*/
@SuppressWarnings("all")
private Session prepare(Session session) {
return touch(commit(registerInterest(configure(session))));
}
@@ -179,7 +177,6 @@ public class GemFireOperationsSessionRepository extends AbstractGemFireOperation
* @see #isNonNullAndDirty(Session)
* @see #doSave(Session)
*/
@SuppressWarnings("all")
public void save(@Nullable Session session) {
if (isNonNullAndDirty(session)) {
@@ -195,6 +192,7 @@ public class GemFireOperationsSessionRepository extends AbstractGemFireOperation
* @see org.springframework.session.data.gemfire.AbstractGemFireOperationsSessionRepository.GemFireSession#hasDelta()
* @see org.springframework.session.Session
*/
@SuppressWarnings("rawtypes")
private boolean isDirty(@NonNull Session session) {
return !(session instanceof GemFireSession) || ((GemFireSession) session).hasDelta();
}

View File

@@ -20,9 +20,6 @@ import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newI
import java.util.Objects;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
@@ -35,6 +32,9 @@ import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The {@link AbstractGemFireHttpSessionConfiguration} class is an abstract base class containing configuration logic
* common to Apache Geode and Pivotal GemFire in order to manage {@link javax.servlet.http.HttpSession} state.

View File

@@ -141,7 +141,7 @@ import org.springframework.util.StringUtils;
* @since 1.1.0
*/
@Configuration
@SuppressWarnings("unused")
@SuppressWarnings({ "rawtypes", "unused" })
public class GemFireHttpSessionConfiguration extends AbstractGemFireHttpSessionConfiguration implements ImportAware {
/**

View File

@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.session.data.gemfire.expiration;
import java.time.Duration;

View File

@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.session.data.gemfire.serialization;
import java.util.Optional;