Browse Source

Consistently declare @SuppressWarnings("serial") instead of dummy serialVersionUID

pull/452/head
Juergen Hoeller 12 years ago
parent
commit
56b7d7a94a
  1. 6
      spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java
  2. 6
      spring-aop/src/main/java/org/springframework/aop/target/AbstractPrototypeBasedTargetSource.java
  3. 20
      spring-aop/src/main/java/org/springframework/aop/target/CommonsPoolTargetSource.java
  4. 13
      spring-aop/src/main/java/org/springframework/aop/target/PrototypeTargetSource.java
  5. 18
      spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSource.java
  6. 3
      spring-orm/src/main/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.java
  7. 5
      spring-orm/src/main/java/org/springframework/orm/jpa/LocalEntityManagerFactoryBean.java
  8. 6
      spring-webmvc/src/main/java/org/springframework/web/servlet/FlashMap.java

6
spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -50,12 +50,10 @@ import org.springframework.beans.factory.DisposableBean;
* @see #releaseTarget * @see #releaseTarget
* @see #destroy * @see #destroy
*/ */
@SuppressWarnings("serial")
public abstract class AbstractPoolingTargetSource extends AbstractPrototypeBasedTargetSource public abstract class AbstractPoolingTargetSource extends AbstractPrototypeBasedTargetSource
implements PoolingConfig, DisposableBean { implements PoolingConfig, DisposableBean {
private static final long serialVersionUID = 1L;
/** The maximum size of the pool */ /** The maximum size of the pool */
private int maxSize = -1; private int maxSize = -1;

6
spring-aop/src/main/java/org/springframework/aop/target/AbstractPrototypeBasedTargetSource.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -43,11 +43,9 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
* @see ThreadLocalTargetSource * @see ThreadLocalTargetSource
* @see CommonsPoolTargetSource * @see CommonsPoolTargetSource
*/ */
@SuppressWarnings("serial")
public abstract class AbstractPrototypeBasedTargetSource extends AbstractBeanFactoryBasedTargetSource { public abstract class AbstractPrototypeBasedTargetSource extends AbstractBeanFactoryBasedTargetSource {
private static final long serialVersionUID = 1L;
@Override @Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException { public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
super.setBeanFactory(beanFactory); super.setBeanFactory(beanFactory);

20
spring-aop/src/main/java/org/springframework/aop/target/CommonsPoolTargetSource.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,8 +24,8 @@ import org.springframework.beans.BeansException;
import org.springframework.core.Constants; import org.springframework.core.Constants;
/** /**
* TargetSource implementation that holds objects in a configurable * {@link org.springframework.aop.TargetSource} implementation that holds
* Jakarta Commons Pool. * objects in a configurable Apache Commons Pool.
* *
* <p>By default, an instance of {@code GenericObjectPool} is created. * <p>By default, an instance of {@code GenericObjectPool} is created.
* Subclasses may change the type of {@code ObjectPool} used by * Subclasses may change the type of {@code ObjectPool} used by
@ -40,8 +40,12 @@ import org.springframework.core.Constants;
* <p>The {@code testOnBorrow}, {@code testOnReturn} and {@code testWhileIdle} * <p>The {@code testOnBorrow}, {@code testOnReturn} and {@code testWhileIdle}
* properties are explicitly not mirrored because the implementation of * properties are explicitly not mirrored because the implementation of
* {@code PoolableObjectFactory} used by this class does not implement * {@code PoolableObjectFactory} used by this class does not implement
* meaningful validation. All exposed Commons Pool properties use the corresponding * meaningful validation. All exposed Commons Pool properties use the
* Commons Pool defaults: for example, * corresponding Commons Pool defaults.
*
* <p>Compatible with Apache Commons Pool 1.5.x and 1.6.
* Note that this class doesn't declare Commons Pool 1.6's generic type
* in order to remain compatible with Commons Pool 1.5.x at runtime.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Rob Harrop * @author Rob Harrop
@ -55,10 +59,8 @@ import org.springframework.core.Constants;
* @see #setTimeBetweenEvictionRunsMillis * @see #setTimeBetweenEvictionRunsMillis
* @see #setMinEvictableIdleTimeMillis * @see #setMinEvictableIdleTimeMillis
*/ */
public class CommonsPoolTargetSource extends AbstractPoolingTargetSource @SuppressWarnings({"rawtypes", "unchecked", "serial"})
implements PoolableObjectFactory { public class CommonsPoolTargetSource extends AbstractPoolingTargetSource implements PoolableObjectFactory {
private static final long serialVersionUID = 1L;
private static final Constants constants = new Constants(GenericObjectPool.class); private static final Constants constants = new Constants(GenericObjectPool.class);

13
spring-aop/src/main/java/org/springframework/aop/target/PrototypeTargetSource.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -19,9 +19,11 @@ package org.springframework.aop.target;
import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
/** /**
* TargetSource that creates a new instance of the target bean for each * {@link org.springframework.aop.TargetSource} implementation that
* request, destroying each instance on release (after each request). * creates a new instance of the target bean for each request,
* Obtains bean instances from its containing * destroying each instance on release (after each request).
*
* <p>Obtains bean instances from its containing
* {@link org.springframework.beans.factory.BeanFactory}. * {@link org.springframework.beans.factory.BeanFactory}.
* *
* @author Rod Johnson * @author Rod Johnson
@ -29,10 +31,9 @@ import org.springframework.beans.BeansException;
* @see #setBeanFactory * @see #setBeanFactory
* @see #setTargetBeanName * @see #setTargetBeanName
*/ */
@SuppressWarnings("serial")
public class PrototypeTargetSource extends AbstractPrototypeBasedTargetSource { public class PrototypeTargetSource extends AbstractPrototypeBasedTargetSource {
private static final long serialVersionUID = 1L;
/** /**
* Obtain a new prototype instance for every call. * Obtain a new prototype instance for every call.
* @see #newPrototypeInstance() * @see #newPrototypeInstance()

18
spring-aop/src/main/java/org/springframework/aop/target/ThreadLocalTargetSource.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -27,9 +27,10 @@ import org.springframework.beans.factory.DisposableBean;
import org.springframework.core.NamedThreadLocal; import org.springframework.core.NamedThreadLocal;
/** /**
* Alternative to an object pool. This TargetSource uses a threading model in which * Alternative to an object pool. This {@link org.springframework.aop.TargetSource}
* every thread has its own copy of the target. There's no contention for targets. * uses a threading model in which every thread has its own copy of the target.
* Target object creation is kept to a minimum on the running server. * There's no contention for targets. Target object creation is kept to a minimum
* on the running server.
* *
* <p>Application code is written as to a normal pool; callers can't assume they * <p>Application code is written as to a normal pool; callers can't assume they
* will be dealing with the same instance in invocations in different threads. * will be dealing with the same instance in invocations in different threads.
@ -47,11 +48,10 @@ import org.springframework.core.NamedThreadLocal;
* @see ThreadLocalTargetSourceStats * @see ThreadLocalTargetSourceStats
* @see org.springframework.beans.factory.DisposableBean#destroy() * @see org.springframework.beans.factory.DisposableBean#destroy()
*/ */
@SuppressWarnings("serial")
public class ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource public class ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource
implements ThreadLocalTargetSourceStats, DisposableBean { implements ThreadLocalTargetSourceStats, DisposableBean {
private static final long serialVersionUID = 1L;
/** /**
* ThreadLocal holding the target associated with the current * ThreadLocal holding the target associated with the current
* thread. Unlike most ThreadLocals, which are static, this variable * thread. Unlike most ThreadLocals, which are static, this variable
@ -81,10 +81,8 @@ public class ThreadLocalTargetSource extends AbstractPrototypeBasedTargetSource
Object target = this.targetInThread.get(); Object target = this.targetInThread.get();
if (target == null) { if (target == null) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("No target for prototype '" + getTargetBeanName() + logger.debug("No target for prototype '" + getTargetBeanName() + "' bound to thread: " +
"' bound to thread: " + "creating one and binding it to thread '" + Thread.currentThread().getName() + "'");
"creating one and binding it to thread '" +
Thread.currentThread().getName() + "'");
} }
// Associate target with ThreadLocal. // Associate target with ThreadLocal.
target = newPrototypeInstance(); target = newPrototypeInstance();

3
spring-orm/src/main/java/org/springframework/orm/jpa/LocalContainerEntityManagerFactoryBean.java

@ -83,11 +83,10 @@ import org.springframework.util.ClassUtils;
* @see org.springframework.orm.jpa.support.SharedEntityManagerBean * @see org.springframework.orm.jpa.support.SharedEntityManagerBean
* @see javax.persistence.spi.PersistenceProvider#createContainerEntityManagerFactory * @see javax.persistence.spi.PersistenceProvider#createContainerEntityManagerFactory
*/ */
@SuppressWarnings("serial")
public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManagerFactoryBean public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManagerFactoryBean
implements ResourceLoaderAware, LoadTimeWeaverAware { implements ResourceLoaderAware, LoadTimeWeaverAware {
private static final long serialVersionUID = 1L;
private PersistenceUnitManager persistenceUnitManager; private PersistenceUnitManager persistenceUnitManager;
private final DefaultPersistenceUnitManager internalPersistenceUnitManager = private final DefaultPersistenceUnitManager internalPersistenceUnitManager =

5
spring-orm/src/main/java/org/springframework/orm/jpa/LocalEntityManagerFactoryBean.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -66,10 +66,9 @@ import javax.persistence.spi.PersistenceProvider;
* @see javax.persistence.Persistence#createEntityManagerFactory * @see javax.persistence.Persistence#createEntityManagerFactory
* @see javax.persistence.spi.PersistenceProvider#createEntityManagerFactory * @see javax.persistence.spi.PersistenceProvider#createEntityManagerFactory
*/ */
@SuppressWarnings("serial")
public class LocalEntityManagerFactoryBean extends AbstractEntityManagerFactoryBean { public class LocalEntityManagerFactoryBean extends AbstractEntityManagerFactoryBean {
private static final long serialVersionUID = 1L;
/** /**
* Initialize the EntityManagerFactory for the given configuration. * Initialize the EntityManagerFactory for the given configuration.
* @throws javax.persistence.PersistenceException in case of JPA initialization errors * @throws javax.persistence.PersistenceException in case of JPA initialization errors

6
spring-webmvc/src/main/java/org/springframework/web/servlet/FlashMap.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -42,13 +42,11 @@ import org.springframework.util.StringUtils;
* *
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 3.1 * @since 3.1
*
* @see FlashMapManager * @see FlashMapManager
*/ */
@SuppressWarnings("serial")
public final class FlashMap extends HashMap<String, Object> implements Comparable<FlashMap> { public final class FlashMap extends HashMap<String, Object> implements Comparable<FlashMap> {
private static final long serialVersionUID = 1L;
private String targetRequestPath; private String targetRequestPath;
private final MultiValueMap<String, String> targetRequestParams = new LinkedMultiValueMap<String, String>(); private final MultiValueMap<String, String> targetRequestParams = new LinkedMultiValueMap<String, String>();

Loading…
Cancel
Save