Apply appropriate SuppressWarnings anotations for rawtypes usage.

Format source code.

Optimize imports.
This commit is contained in:
John Blum
2020-03-03 01:34:31 +01:00
parent 1243719b48
commit f67ccbc4eb
6 changed files with 11 additions and 14 deletions

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;
import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalStateException;
@@ -748,7 +747,8 @@ public abstract class AbstractGemFireOperationsSessionRepository
* @return a new {@link GemFireSession}.
* @see #isUsingDataSerialization()
*/
@SuppressWarnings("unchecked")
@NonNull
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T extends GemFireSessionAttributes> GemFireSession<T> create() {
return isUsingDataSerialization()
@@ -764,7 +764,8 @@ public abstract class AbstractGemFireOperationsSessionRepository
* @see org.springframework.session.Session
* @see #isUsingDataSerialization()
*/
public static GemFireSession copy(@NonNull Session session) {
@SuppressWarnings("rawtypes")
public static @NonNull GemFireSession copy(@NonNull Session session) {
return isUsingDataSerialization()
? new DeltaCapableGemFireSession(session)
@@ -780,7 +781,8 @@ public abstract class AbstractGemFireOperationsSessionRepository
* or return a copy of the given {@link Session} as a {@link GemFireSession}.
* @see #copy(Session)
*/
public static GemFireSession from(@NonNull Session session) {
@SuppressWarnings("rawtypes")
public static @NonNull GemFireSession from(@NonNull Session session) {
return session instanceof GemFireSession ? (GemFireSession) session : copy(session);
}
@@ -1081,7 +1083,6 @@ public abstract class AbstractGemFireOperationsSessionRepository
return this;
}
@SuppressWarnings("all")
@Override
public int compareTo(Session session) {
return getCreationTime().compareTo(session.getCreationTime());
@@ -1350,7 +1351,6 @@ public abstract class AbstractGemFireOperationsSessionRepository
}
@Override
@SuppressWarnings("all")
public Set<Entry<String, Object>> entrySet() {
synchronized (getLock()) {

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;
import java.util.HashMap;
@@ -193,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

@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.session.data.gemfire.config.annotation.web.http;
import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalStateException;
@@ -29,10 +28,10 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.session.config.annotation.web.http.SpringHttpSessionConfiguration;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.apache.shiro.util.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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.config.annotation.web.http;
import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalArgumentException;
@@ -141,7 +140,7 @@ import org.springframework.util.StringUtils;
* @since 1.1.0
*/
@Configuration
@SuppressWarnings("unused")
@SuppressWarnings({ "rawtypes", "unused" })
public class GemFireHttpSessionConfiguration extends AbstractGemFireHttpSessionConfiguration implements ImportAware {
/**
@@ -625,6 +624,7 @@ public class GemFireHttpSessionConfiguration extends AbstractGemFireHttpSessionC
* @see #applySpringSessionGemFireConfigurer()
* @see #exposeSpringSessionGemFireConfiguration()
*/
@SuppressWarnings("all")
public void setImportMetadata(AnnotationMetadata importMetadata) {
AnnotationAttributes enableGemFireHttpSessionAttributes =
@@ -1071,7 +1071,7 @@ public class GemFireHttpSessionConfiguration extends AbstractGemFireHttpSessionC
* @see #isExpirationAllowed(GemFireCache)
*/
@Bean
@SuppressWarnings({ "unchecked", "deprecation" })
@SuppressWarnings("unchecked")
public RegionAttributesFactoryBean sessionRegionAttributes(GemFireCache gemfireCache) {
RegionAttributesFactoryBean regionAttributes = new RegionAttributesFactoryBean();

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;