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

View File

@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.session.data.gemfire; package org.springframework.session.data.gemfire;
import java.util.HashMap; 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.data.gemfire.AbstractGemFireOperationsSessionRepository.GemFireSession#hasDelta()
* @see org.springframework.session.Session * @see org.springframework.session.Session
*/ */
@SuppressWarnings("rawtypes")
private boolean isDirty(@NonNull Session session) { private boolean isDirty(@NonNull Session session) {
return !(session instanceof GemFireSession) || ((GemFireSession) session).hasDelta(); return !(session instanceof GemFireSession) || ((GemFireSession) session).hasDelta();
} }

View File

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

View File

@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.springframework.session.data.gemfire.config.annotation.web.http; package org.springframework.session.data.gemfire.config.annotation.web.http;
import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalArgumentException; import static org.springframework.data.gemfire.util.RuntimeExceptionFactory.newIllegalArgumentException;
@@ -141,7 +140,7 @@ import org.springframework.util.StringUtils;
* @since 1.1.0 * @since 1.1.0
*/ */
@Configuration @Configuration
@SuppressWarnings("unused") @SuppressWarnings({ "rawtypes", "unused" })
public class GemFireHttpSessionConfiguration extends AbstractGemFireHttpSessionConfiguration implements ImportAware { public class GemFireHttpSessionConfiguration extends AbstractGemFireHttpSessionConfiguration implements ImportAware {
/** /**
@@ -625,6 +624,7 @@ public class GemFireHttpSessionConfiguration extends AbstractGemFireHttpSessionC
* @see #applySpringSessionGemFireConfigurer() * @see #applySpringSessionGemFireConfigurer()
* @see #exposeSpringSessionGemFireConfiguration() * @see #exposeSpringSessionGemFireConfiguration()
*/ */
@SuppressWarnings("all")
public void setImportMetadata(AnnotationMetadata importMetadata) { public void setImportMetadata(AnnotationMetadata importMetadata) {
AnnotationAttributes enableGemFireHttpSessionAttributes = AnnotationAttributes enableGemFireHttpSessionAttributes =
@@ -1071,7 +1071,7 @@ public class GemFireHttpSessionConfiguration extends AbstractGemFireHttpSessionC
* @see #isExpirationAllowed(GemFireCache) * @see #isExpirationAllowed(GemFireCache)
*/ */
@Bean @Bean
@SuppressWarnings({ "unchecked", "deprecation" }) @SuppressWarnings("unchecked")
public RegionAttributesFactoryBean sessionRegionAttributes(GemFireCache gemfireCache) { public RegionAttributesFactoryBean sessionRegionAttributes(GemFireCache gemfireCache) {
RegionAttributesFactoryBean regionAttributes = new RegionAttributesFactoryBean(); RegionAttributesFactoryBean regionAttributes = new RegionAttributesFactoryBean();

View File

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

View File

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