language stringclasses 1
value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2
classes |
|---|---|---|---|---|---|---|---|
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java | @@ -54,7 +54,7 @@ public abstract class AopConfigUtils {
/**
* Stores the auto proxy creator classes in escalation order.
*/
- private static final List<Class> APC_PRIORITY_LIST = new ArrayList<Class>();
+ private static final List<Class<?>> APC_PRIORITY_LIST = new ArrayList<Class<?>>();
/**
* Setup the escalation list.
@@ -105,7 +105,7 @@ static void forceAutoProxyCreatorToExposeProxy(BeanDefinitionRegistry registry)
}
- private static BeanDefinition registerOrEscalateApcAsRequired(Class cls, BeanDefinitionRegistry registry, Object source) {
+ private static BeanDefinition registerOrEscalateApcAsRequired(Class<?> cls, BeanDefinitionRegistry registry, Object source) {
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
if (registry.containsBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME)) {
BeanDefinition apcDefinition = registry.getBeanDefinition(AUTO_PROXY_CREATOR_BEAN_NAME);
@@ -126,13 +126,13 @@ private static BeanDefinition registerOrEscalateApcAsRequired(Class cls, BeanDef
return beanDefinition;
}
- private static int findPriorityForClass(Class clazz) {
+ private static int findPriorityForClass(Class<?> clazz) {
return APC_PRIORITY_LIST.indexOf(clazz);
}
private static int findPriorityForClass(String className) {
for (int i = 0; i < APC_PRIORITY_LIST.size(); i++) {
- Class clazz = APC_PRIORITY_LIST.get(i);
+ Class<?> clazz = APC_PRIORITY_LIST.get(i);
if (clazz.getName().equals(className)) {
return i;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java | @@ -405,7 +405,7 @@ else if (pointcut instanceof String) {
/**
* Gets the advice implementation class corresponding to the supplied {@link Element}.
*/
- private Class getAdviceClass(Element adviceElement, ParserContext parserContext) {
+ private Class<?> getAdviceClass(Element adviceElement, ParserContext parserContext) {
String elementName = parserContext.getDelegate().getLocalName(adviceElement);
if (BEFORE.equals(elementName)) {
return AspectJMethodBeforeAdvice.class; | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/config/MethodLocatingFactoryBean.java | @@ -66,7 +66,7 @@ public void setBeanFactory(BeanFactory beanFactory) {
throw new IllegalArgumentException("Property 'methodName' is required");
}
- Class beanClass = beanFactory.getType(this.targetBeanName);
+ Class<?> beanClass = beanFactory.getType(this.targetBeanName);
if (beanClass == null) {
throw new IllegalArgumentException("Can't determine type of bean with name '" + this.targetBeanName + "'");
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java | @@ -49,7 +49,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
*/
private int order = Ordered.LOWEST_PRECEDENCE;
- private final Map<Class, Boolean> eligibleBeans = new ConcurrentHashMap<Class, Boolean>(64);
+ private final Map<Class<?>, Boolean> eligibleBeans = new ConcurrentHashMap<Class<?>, Boolean>(64);
/** | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java | @@ -58,7 +58,6 @@
* @author Juergen Hoeller
* @see org.springframework.aop.framework.AopProxy
*/
-@SuppressWarnings("unchecked")
public class AdvisedSupport extends ProxyConfig implements Advised {
/** use serialVersionUID from Spring 2.0 for interoperability */
@@ -88,7 +87,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
* Interfaces to be implemented by the proxy. Held in List to keep the order
* of registration, to create JDK proxy with specified order of interfaces.
*/
- private List<Class> interfaces = new ArrayList<Class>();
+ private List<Class<?>> interfaces = new ArrayList<Class<?>>();
/**
* List of Advisors. If an Advice is added, it will be wrapped
@@ -114,7 +113,7 @@ public AdvisedSupport() {
* Create a AdvisedSupport instance with the given parameters.
* @param interfaces the proxied interfaces
*/
- public AdvisedSupport(Class[] interfaces) {
+ public AdvisedSupport(Class<?>[] interfaces) {
this();
setInterfaces(interfaces);
}
@@ -202,7 +201,7 @@ public AdvisorChainFactory getAdvisorChainFactory() {
public void setInterfaces(Class<?>... interfaces) {
Assert.notNull(interfaces, "Interfaces must not be null");
this.interfaces.clear();
- for (Class ifc : interfaces) {
+ for (Class<?> ifc : interfaces) {
addInterface(ifc);
}
}
@@ -235,12 +234,12 @@ public boolean removeInterface(Class<?> intf) {
@Override
public Class<?>[] getProxiedInterfaces() {
- return this.interfaces.toArray(new Class[this.interfaces.size()]);
+ return this.interfaces.toArray(new Class<?>[this.interfaces.size()]);
}
@Override
public boolean isInterfaceProxied(Class<?> intf) {
- for (Class proxyIntf : this.interfaces) {
+ for (Class<?> proxyIntf : this.interfaces) {
if (intf.isAssignableFrom(proxyIntf)) {
return true;
}
@@ -355,8 +354,8 @@ public void addAdvisors(Collection<Advisor> advisors) {
private void validateIntroductionAdvisor(IntroductionAdvisor advisor) {
advisor.validateInterfaces();
// If the advisor passed validation, we can make the change.
- Class[] ifcs = advisor.getInterfaces();
- for (Class ifc : ifcs) {
+ Class<?>[] ifcs = advisor.getInterfaces();
+ for (Class<?> ifc : ifcs) {
addInterface(ifc);
}
}
@@ -463,7 +462,7 @@ public boolean adviceIncluded(Advice advice) {
* @param adviceClass the advice class to check
* @return the count of the interceptors of this class or subclasses
*/
- public int countAdvicesOfType(Class adviceClass) {
+ public int countAdvicesOfType(Class<?> adviceClass) {
int count = 0;
if (adviceClass != null) {
for (Advisor advisor : this.advisors) {
@@ -483,7 +482,7 @@ public int countAdvicesOfType(Class adviceClass) {
* @param targetClass the target class
* @return List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)
*/
- public List<Object> getInterceptorsAndDynamicInterceptionAdvice(Method method, Class targetClass) {
+ public List<Object> getInterceptorsAndDynamicInterceptionAdvice(Method method, Class<?> targetClass) {
MethodCacheKey cacheKey = new MethodCacheKey(method);
List<Object> cached = this.methodCache.get(cacheKey);
if (cached == null) {
@@ -521,7 +520,7 @@ protected void copyConfigurationFrom(AdvisedSupport other, TargetSource targetSo
copyFrom(other);
this.targetSource = targetSource;
this.advisorChainFactory = other.advisorChainFactory;
- this.interfaces = new ArrayList<Class>(other.interfaces);
+ this.interfaces = new ArrayList<Class<?>>(other.interfaces);
for (Advisor advisor : advisors) {
if (advisor instanceof IntroductionAdvisor) {
validateIntroductionAdvisor((IntroductionAdvisor) advisor); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/AdvisorChainFactory.java | @@ -36,6 +36,6 @@ public interface AdvisorChainFactory {
* @return List of MethodInterceptors (may also include InterceptorAndDynamicMethodMatchers)
*/
List<Object> getInterceptorsAndDynamicInterceptionAdvice(
- Advised config, Method method, Class targetClass);
+ Advised config, Method method, Class<?> targetClass);
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java | @@ -78,13 +78,13 @@ public static Class<?> ultimateTargetClass(Object candidate) {
* @see Advised
* @see org.springframework.aop.SpringProxy
*/
- public static Class[] completeProxiedInterfaces(AdvisedSupport advised) {
- Class[] specifiedInterfaces = advised.getProxiedInterfaces();
+ public static Class<?>[] completeProxiedInterfaces(AdvisedSupport advised) {
+ Class<?>[] specifiedInterfaces = advised.getProxiedInterfaces();
if (specifiedInterfaces.length == 0) {
// No user-specified interfaces: check whether target class is an interface.
- Class targetClass = advised.getTargetClass();
+ Class<?> targetClass = advised.getTargetClass();
if (targetClass != null && targetClass.isInterface()) {
- specifiedInterfaces = new Class[] {targetClass};
+ specifiedInterfaces = new Class<?>[] {targetClass};
}
}
boolean addSpringProxy = !advised.isInterfaceProxied(SpringProxy.class);
@@ -96,7 +96,7 @@ public static Class[] completeProxiedInterfaces(AdvisedSupport advised) {
if (addAdvised) {
nonUserIfcCount++;
}
- Class[] proxiedInterfaces = new Class[specifiedInterfaces.length + nonUserIfcCount];
+ Class<?>[] proxiedInterfaces = new Class<?>[specifiedInterfaces.length + nonUserIfcCount];
System.arraycopy(specifiedInterfaces, 0, proxiedInterfaces, 0, specifiedInterfaces.length);
if (addSpringProxy) {
proxiedInterfaces[specifiedInterfaces.length] = SpringProxy.class;
@@ -115,16 +115,16 @@ public static Class[] completeProxiedInterfaces(AdvisedSupport advised) {
* in the original order (never {@code null} or empty)
* @see Advised
*/
- public static Class[] proxiedUserInterfaces(Object proxy) {
- Class[] proxyInterfaces = proxy.getClass().getInterfaces();
+ public static Class<?>[] proxiedUserInterfaces(Object proxy) {
+ Class<?>[] proxyInterfaces = proxy.getClass().getInterfaces();
int nonUserIfcCount = 0;
if (proxy instanceof SpringProxy) {
nonUserIfcCount++;
}
if (proxy instanceof Advised) {
nonUserIfcCount++;
}
- Class[] userInterfaces = new Class[proxyInterfaces.length - nonUserIfcCount];
+ Class<?>[] userInterfaces = new Class<?>[proxyInterfaces.length - nonUserIfcCount];
System.arraycopy(proxyInterfaces, 0, userInterfaces, 0, userInterfaces.length);
Assert.notEmpty(userInterfaces, "JDK proxy must implement one or more interfaces");
return userInterfaces; | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java | @@ -187,7 +187,7 @@ public Object getProxy(ClassLoader classLoader) {
enhancer.setInterfaces(AopProxyUtils.completeProxiedInterfaces(this.advised));
Callback[] callbacks = getCallbacks(rootClass);
- Class<?>[] types = new Class[callbacks.length];
+ Class<?>[] types = new Class<?>[callbacks.length];
for (int x = 0; x < types.length; x++) {
types[x] = callbacks[x].getClass(); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java | @@ -48,7 +48,7 @@ public class DefaultAdvisorChainFactory implements AdvisorChainFactory, Serializ
@Override
public List<Object> getInterceptorsAndDynamicInterceptionAdvice(
- Advised config, Method method, Class targetClass) {
+ Advised config, Method method, Class<?> targetClass) {
// This is somewhat tricky... we have to process introductions first,
// but we need to preserve order in the ultimate list.
@@ -94,7 +94,7 @@ else if (advisor instanceof IntroductionAdvisor) {
/**
* Determine whether the Advisors contain matching introductions.
*/
- private static boolean hasMatchingIntroductions(Advised config, Class targetClass) {
+ private static boolean hasMatchingIntroductions(Advised config, Class<?> targetClass) {
for (int i = 0; i < config.getAdvisors().length; i++) {
Advisor advisor = config.getAdvisors()[i];
if (advisor instanceof IntroductionAdvisor) { | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/DefaultAopProxyFactory.java | @@ -51,7 +51,7 @@ public class DefaultAopProxyFactory implements AopProxyFactory, Serializable {
@Override
public AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException {
if (config.isOptimize() || config.isProxyTargetClass() || hasNoUserSuppliedProxyInterfaces(config)) {
- Class targetClass = config.getTargetClass();
+ Class<?> targetClass = config.getTargetClass();
if (targetClass == null) {
throw new AopConfigException("TargetSource cannot determine target class: " +
"Either an interface or a target is required for proxy creation.");
@@ -72,7 +72,7 @@ public AopProxy createAopProxy(AdvisedSupport config) throws AopConfigException
* (or no proxy interfaces specified at all).
*/
private boolean hasNoUserSuppliedProxyInterfaces(AdvisedSupport config) {
- Class[] interfaces = config.getProxiedInterfaces();
+ Class<?>[] interfaces = config.getProxiedInterfaces();
return (interfaces.length == 0 || (interfaces.length == 1 && SpringProxy.class.equals(interfaces[0])));
}
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/JdkDynamicAopProxy.java | @@ -116,7 +116,7 @@ public Object getProxy(ClassLoader classLoader) {
if (logger.isDebugEnabled()) {
logger.debug("Creating JDK dynamic proxy: target source is " + this.advised.getTargetSource());
}
- Class[] proxiedInterfaces = AopProxyUtils.completeProxiedInterfaces(this.advised);
+ Class<?>[] proxiedInterfaces = AopProxyUtils.completeProxiedInterfaces(this.advised);
findDefinedEqualsAndHashCodeMethods(proxiedInterfaces);
return Proxy.newProxyInstance(classLoader, proxiedInterfaces, this);
}
@@ -126,8 +126,8 @@ public Object getProxy(ClassLoader classLoader) {
* on the supplied set of interfaces.
* @param proxiedInterfaces the interfaces to introspect
*/
- private void findDefinedEqualsAndHashCodeMethods(Class[] proxiedInterfaces) {
- for (Class proxiedInterface : proxiedInterfaces) {
+ private void findDefinedEqualsAndHashCodeMethods(Class<?>[] proxiedInterfaces) {
+ for (Class<?> proxiedInterface : proxiedInterfaces) {
Method[] methods = proxiedInterface.getDeclaredMethods();
for (Method method : methods) {
if (AopUtils.isEqualsMethod(method)) {
@@ -156,7 +156,7 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
boolean setProxyContext = false;
TargetSource targetSource = this.advised.targetSource;
- Class targetClass = null;
+ Class<?> targetClass = null;
Object target = null;
try { | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/ObjenesisCglibAopProxy.java | @@ -32,6 +32,7 @@
* @author Oliver Gierke
* @since 4.0
*/
+@SuppressWarnings("serial")
class ObjenesisCglibAopProxy extends CglibAopProxy {
private static final Log logger = LogFactory.getLog(ObjenesisCglibAopProxy.class); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java | @@ -133,7 +133,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
* @see #setInterfaces
* @see AbstractSingletonProxyFactoryBean#setProxyInterfaces
*/
- public void setProxyInterfaces(Class[] proxyInterfaces) throws ClassNotFoundException {
+ public void setProxyInterfaces(Class<?>[] proxyInterfaces) throws ClassNotFoundException {
setInterfaces(proxyInterfaces);
}
@@ -267,7 +267,7 @@ public Class<?> getObjectType() {
return this.singletonInstance.getClass();
}
}
- Class[] ifcs = getProxiedInterfaces();
+ Class<?>[] ifcs = getProxiedInterfaces();
if (ifcs.length == 1) {
return ifcs[0];
}
@@ -297,7 +297,7 @@ public boolean isSingleton() {
* @return the merged interface as Class
* @see java.lang.reflect.Proxy#getProxyClass
*/
- protected Class createCompositeInterface(Class[] interfaces) {
+ protected Class<?> createCompositeInterface(Class<?>[] interfaces) {
return ClassUtils.createCompositeInterface(interfaces, this.proxyClassLoader);
}
@@ -311,7 +311,7 @@ private synchronized Object getSingletonInstance() {
this.targetSource = freshTargetSource();
if (this.autodetectInterfaces && getProxiedInterfaces().length == 0 && !isProxyTargetClass()) {
// Rely on AOP infrastructure to tell us what interfaces to proxy.
- Class targetClass = getTargetClass();
+ Class<?> targetClass = getTargetClass();
if (targetClass == null) {
throw new FactoryBeanNotInitializedException("Cannot determine target class for proxy");
}
@@ -401,7 +401,7 @@ private void checkInterceptorNames() {
* @return {@code true} if it's an Advisor or Advice
*/
private boolean isNamedBeanAnAdvisorOrAdvice(String beanName) {
- Class namedBeanClass = this.beanFactory.getType(beanName);
+ Class<?> namedBeanClass = this.beanFactory.getType(beanName);
if (namedBeanClass != null) {
return (Advisor.class.isAssignableFrom(namedBeanClass) || Advice.class.isAssignableFrom(namedBeanClass));
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/ReflectiveMethodInvocation.java | @@ -68,7 +68,7 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
protected Object[] arguments;
- private final Class targetClass;
+ private final Class<?> targetClass;
/**
* Lazily initialized map of user-specific attributes for this invocation.
@@ -79,7 +79,7 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
* List of MethodInterceptor and InterceptorAndDynamicMethodMatcher
* that need dynamic checks.
*/
- protected final List interceptorsAndDynamicMethodMatchers;
+ protected final List<?> interceptorsAndDynamicMethodMatchers;
/**
* Index from 0 of the current interceptor we're invoking.
@@ -103,7 +103,7 @@ public class ReflectiveMethodInvocation implements ProxyMethodInvocation, Clonea
*/
protected ReflectiveMethodInvocation(
Object proxy, Object target, Method method, Object[] arguments,
- Class targetClass, List<Object> interceptorsAndDynamicMethodMatchers) {
+ Class<?> targetClass, List<Object> interceptorsAndDynamicMethodMatchers) {
this.proxy = proxy;
this.target = target; | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptor.java | @@ -61,7 +61,7 @@ public class ThrowsAdviceInterceptor implements MethodInterceptor, AfterAdvice {
private final Object throwsAdvice;
/** Methods on throws advice, keyed by exception class */
- private final Map<Class, Method> exceptionHandlerMap = new HashMap<Class, Method>();
+ private final Map<Class<?>, Method> exceptionHandlerMap = new HashMap<Class<?>, Method>();
/**
@@ -104,7 +104,7 @@ public int getHandlerMethodCount() {
* @return a handler for the given exception type
*/
private Method getExceptionHandler(Throwable exception) {
- Class exceptionClass = exception.getClass();
+ Class<?> exceptionClass = exception.getClass();
if (logger.isTraceEnabled()) {
logger.trace("Trying to find handler for exception of type [" + exceptionClass.getName() + "]");
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAdvisorAutoProxyCreator.java | @@ -65,8 +65,8 @@ protected void initBeanFactory(ConfigurableListableBeanFactory beanFactory) {
@Override
- protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass, String beanName, TargetSource targetSource) {
- List advisors = findEligibleAdvisors(beanClass, beanName);
+ protected Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, TargetSource targetSource) {
+ List<Advisor> advisors = findEligibleAdvisors(beanClass, beanName);
if (advisors.isEmpty()) {
return DO_NOT_PROXY;
}
@@ -83,7 +83,7 @@ protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass, String beanName
* @see #sortAdvisors
* @see #extendAdvisors
*/
- protected List<Advisor> findEligibleAdvisors(Class beanClass, String beanName) {
+ protected List<Advisor> findEligibleAdvisors(Class<?> beanClass, String beanName) {
List<Advisor> candidateAdvisors = findCandidateAdvisors();
List<Advisor> eligibleAdvisors = findAdvisorsThatCanApply(candidateAdvisors, beanClass, beanName);
extendAdvisors(eligibleAdvisors);
@@ -111,7 +111,7 @@ protected List<Advisor> findCandidateAdvisors() {
* @see ProxyCreationContext#getCurrentProxiedBeanName()
*/
protected List<Advisor> findAdvisorsThatCanApply(
- List<Advisor> candidateAdvisors, Class beanClass, String beanName) {
+ List<Advisor> candidateAdvisors, Class<?> beanClass, String beanName) {
ProxyCreationContext.setCurrentProxiedBeanName(beanName);
try { | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/BeanNameAutoProxyCreator.java | @@ -73,7 +73,7 @@ public void setBeanNames(String[] beanNames) {
* Identify as bean to proxy if the bean name is in the configured list of names.
*/
@Override
- protected Object[] getAdvicesAndAdvisorsForBean(Class beanClass, String beanName, TargetSource targetSource) {
+ protected Object[] getAdvicesAndAdvisorsForBean(Class<?> beanClass, String beanName, TargetSource targetSource) {
if (this.beanNames != null) {
for (String mappedName : this.beanNames) {
if (FactoryBean.class.isAssignableFrom(beanClass)) { | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/LazyInitTargetSourceCreator.java | @@ -60,7 +60,7 @@ protected boolean isPrototypeBased() {
@Override
protected AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(
- Class beanClass, String beanName) {
+ Class<?> beanClass, String beanName) {
if (getBeanFactory() instanceof ConfigurableListableBeanFactory) {
BeanDefinition definition = | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/target/QuickTargetSourceCreator.java | @@ -41,7 +41,7 @@ public class QuickTargetSourceCreator extends AbstractBeanFactoryBasedTargetSour
@Override
protected final AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(
- Class beanClass, String beanName) {
+ Class<?> beanClass, String beanName) {
if (beanName.startsWith(PREFIX_COMMONS_POOL)) {
CommonsPoolTargetSource cpts = new CommonsPoolTargetSource(); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractMonitoringInterceptor.java | @@ -98,7 +98,7 @@ public void setLogTargetClassInvocation(boolean logTargetClassInvocation) {
protected String createInvocationTraceName(MethodInvocation invocation) {
StringBuilder sb = new StringBuilder(getPrefix());
Method method = invocation.getMethod();
- Class clazz = method.getDeclaringClass();
+ Class<?> clazz = method.getDeclaringClass();
if (this.logTargetClassInvocation && clazz.isInstance(invocation.getThis())) {
clazz = invocation.getThis().getClass();
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/interceptor/AbstractTraceInterceptor.java | @@ -142,7 +142,7 @@ protected Log getLoggerForInvocation(MethodInvocation invocation) {
* @return the target class for the given object
* @see #setHideProxyClassNames
*/
- protected Class getClassForLogging(Object target) {
+ protected Class<?> getClassForLogging(Object target) {
return (this.hideProxyClassNames ? AopUtils.getTargetClass(target) : target.getClass());
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/interceptor/CustomizableTraceInterceptor.java | @@ -151,7 +151,7 @@ public class CustomizableTraceInterceptor extends AbstractTraceInterceptor {
/**
* The {@code Set} of allowed placeholders.
*/
- private static final Set ALLOWED_PLACEHOLDERS =
+ private static final Set<Object> ALLOWED_PLACEHOLDERS =
new Constants(CustomizableTraceInterceptor.class).getValues("PLACEHOLDER_");
@@ -395,7 +395,7 @@ else if (returnValue == null) {
* @param output the {@code StringBuffer} containing the output
*/
private void appendArgumentTypes(MethodInvocation methodInvocation, Matcher matcher, StringBuffer output) {
- Class[] argumentTypes = methodInvocation.getMethod().getParameterTypes();
+ Class<?>[] argumentTypes = methodInvocation.getMethod().getParameterTypes();
String[] argumentTypeShortNames = new String[argumentTypes.length];
for (int i = 0; i < argumentTypeShortNames.length; i++) {
argumentTypeShortNames[i] = ClassUtils.getShortName(argumentTypes[i]); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/scope/ScopedProxyFactoryBean.java | @@ -91,7 +91,7 @@ public void setBeanFactory(BeanFactory beanFactory) {
pf.copyFrom(this);
pf.setTargetSource(this.scopedTargetSource);
- Class beanType = beanFactory.getType(this.targetBeanName);
+ Class<?> beanType = beanFactory.getType(this.targetBeanName);
if (beanType == null) {
throw new IllegalStateException("Cannot create scoped proxy for bean '" + this.targetBeanName +
"': Target type could not be determined at the time of proxy creation."); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/AbstractRegexpMethodPointcut.java | @@ -125,7 +125,7 @@ public String[] getExcludedPatterns() {
* plus the name of the method.
*/
@Override
- public boolean matches(Method method, Class targetClass) {
+ public boolean matches(Method method, Class<?> targetClass) {
return ((targetClass != null && matchesPattern(targetClass.getName() + "." + method.getName())) ||
matchesPattern(method.getDeclaringClass().getName() + "." + method.getName()));
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/AopUtils.java | @@ -215,7 +215,7 @@ public static boolean canApply(Pointcut pc, Class<?> targetClass, boolean hasInt
introductionAwareMethodMatcher = (IntroductionAwareMethodMatcher) methodMatcher;
}
- Set<Class> classes = new HashSet<Class>(ClassUtils.getAllInterfacesForClassAsSet(targetClass));
+ Set<Class<?>> classes = new HashSet<Class<?>>(ClassUtils.getAllInterfacesForClassAsSet(targetClass));
classes.add(targetClass);
for (Class<?> clazz : classes) {
Method[] methods = clazz.getMethods(); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/ClassFilters.java | @@ -97,7 +97,7 @@ public UnionClassFilter(ClassFilter[] filters) {
}
@Override
- public boolean matches(Class clazz) {
+ public boolean matches(Class<?> clazz) {
for (int i = 0; i < this.filters.length; i++) {
if (this.filters[i].matches(clazz)) {
return true;
@@ -132,7 +132,7 @@ public IntersectionClassFilter(ClassFilter[] filters) {
}
@Override
- public boolean matches(Class clazz) {
+ public boolean matches(Class<?> clazz) {
for (int i = 0; i < this.filters.length; i++) {
if (!this.filters[i].matches(clazz)) {
return false; | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/ControlFlowPointcut.java | @@ -39,7 +39,7 @@
@SuppressWarnings("serial")
public class ControlFlowPointcut implements Pointcut, ClassFilter, MethodMatcher, Serializable {
- private Class clazz;
+ private Class<?> clazz;
private String methodName;
@@ -50,7 +50,7 @@ public class ControlFlowPointcut implements Pointcut, ClassFilter, MethodMatcher
* Construct a new pointcut that matches all control flows below that class.
* @param clazz the clazz
*/
- public ControlFlowPointcut(Class clazz) {
+ public ControlFlowPointcut(Class<?> clazz) {
this(clazz, null);
}
@@ -61,7 +61,7 @@ public ControlFlowPointcut(Class clazz) {
* @param clazz the clazz
* @param methodName the name of the method
*/
- public ControlFlowPointcut(Class clazz, String methodName) {
+ public ControlFlowPointcut(Class<?> clazz, String methodName) {
Assert.notNull(clazz, "Class must not be null");
this.clazz = clazz;
this.methodName = methodName;
@@ -72,7 +72,7 @@ public ControlFlowPointcut(Class clazz, String methodName) {
* Subclasses can override this for greater filtering (and performance).
*/
@Override
- public boolean matches(Class clazz) {
+ public boolean matches(Class<?> clazz) {
return true;
}
@@ -81,7 +81,7 @@ public boolean matches(Class clazz) {
* some candidate classes.
*/
@Override
- public boolean matches(Method method, Class targetClass) {
+ public boolean matches(Method method, Class<?> targetClass) {
return true;
}
@@ -91,7 +91,7 @@ public boolean isRuntime() {
}
@Override
- public boolean matches(Method method, Class targetClass, Object[] args) {
+ public boolean matches(Method method, Class<?> targetClass, Object[] args) {
++this.evaluations;
ControlFlow cflow = ControlFlowFactory.createControlFlow();
return (this.methodName != null) ? cflow.under(this.clazz, this.methodName) : cflow.under(this.clazz); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/DefaultIntroductionAdvisor.java | @@ -43,7 +43,7 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
private final Advice advice;
- private final Set<Class> interfaces = new HashSet<Class>();
+ private final Set<Class<?>> interfaces = new HashSet<Class<?>>();
private int order = Integer.MAX_VALUE;
@@ -68,11 +68,11 @@ public DefaultIntroductionAdvisor(Advice advice, IntroductionInfo introductionIn
Assert.notNull(advice, "Advice must not be null");
this.advice = advice;
if (introductionInfo != null) {
- Class[] introducedInterfaces = introductionInfo.getInterfaces();
+ Class<?>[] introducedInterfaces = introductionInfo.getInterfaces();
if (introducedInterfaces.length == 0) {
throw new IllegalArgumentException("IntroductionAdviceSupport implements no interfaces");
}
- for (Class ifc : introducedInterfaces) {
+ for (Class<?> ifc : introducedInterfaces) {
addInterface(ifc);
}
}
@@ -83,7 +83,7 @@ public DefaultIntroductionAdvisor(Advice advice, IntroductionInfo introductionIn
* @param advice the Advice to apply
* @param intf the interface to introduce
*/
- public DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class intf) {
+ public DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class<?> intf) {
Assert.notNull(advice, "Advice must not be null");
this.advice = advice;
addInterface(intf);
@@ -94,7 +94,7 @@ public DefaultIntroductionAdvisor(DynamicIntroductionAdvice advice, Class intf)
* Add the specified interface to the list of interfaces to introduce.
* @param intf the interface to introduce
*/
- public void addInterface(Class intf) {
+ public void addInterface(Class<?> intf) {
Assert.notNull(intf, "Interface must not be null");
if (!intf.isInterface()) {
throw new IllegalArgumentException("Specified class [" + intf.getName() + "] must be an interface");
@@ -103,13 +103,13 @@ public void addInterface(Class intf) {
}
@Override
- public Class[] getInterfaces() {
- return this.interfaces.toArray(new Class[this.interfaces.size()]);
+ public Class<?>[] getInterfaces() {
+ return this.interfaces.toArray(new Class<?>[this.interfaces.size()]);
}
@Override
public void validateInterfaces() throws IllegalArgumentException {
- for (Class ifc : this.interfaces) {
+ for (Class<?> ifc : this.interfaces) {
if (this.advice instanceof DynamicIntroductionAdvice &&
!((DynamicIntroductionAdvice) this.advice).implementsInterface(ifc)) {
throw new IllegalArgumentException("DynamicIntroductionAdvice [" + this.advice + "] " +
@@ -145,7 +145,7 @@ public ClassFilter getClassFilter() {
}
@Override
- public boolean matches(Class clazz) {
+ public boolean matches(Class<?> clazz) {
return true;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/DelegatePerTargetObjectIntroductionInterceptor.java | @@ -59,12 +59,12 @@ public class DelegatePerTargetObjectIntroductionInterceptor extends Introduction
*/
private final Map<Object, Object> delegateMap = new WeakHashMap<Object, Object>();
- private Class defaultImplType;
+ private Class<?> defaultImplType;
- private Class interfaceType;
+ private Class<?> interfaceType;
- public DelegatePerTargetObjectIntroductionInterceptor(Class defaultImplType, Class interfaceType) {
+ public DelegatePerTargetObjectIntroductionInterceptor(Class<?> defaultImplType, Class<?> interfaceType) {
this.defaultImplType = defaultImplType;
this.interfaceType = interfaceType;
// cCeate a new delegate now (but don't store it in the map). | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/IntroductionInfoSupport.java | @@ -43,7 +43,7 @@
@SuppressWarnings("serial")
public class IntroductionInfoSupport implements IntroductionInfo, Serializable {
- protected final Set<Class> publishedInterfaces = new HashSet<Class>();
+ protected final Set<Class<?>> publishedInterfaces = new HashSet<Class<?>>();
private transient Map<Method, Boolean> rememberedMethods = new ConcurrentHashMap<Method, Boolean>(32);
@@ -55,22 +55,22 @@ public class IntroductionInfoSupport implements IntroductionInfo, Serializable {
* <p>Does nothing if the interface is not implemented by the delegate.
* @param intf the interface to suppress
*/
- public void suppressInterface(Class intf) {
+ public void suppressInterface(Class<?> intf) {
this.publishedInterfaces.remove(intf);
}
@Override
- public Class[] getInterfaces() {
- return this.publishedInterfaces.toArray(new Class[this.publishedInterfaces.size()]);
+ public Class<?>[] getInterfaces() {
+ return this.publishedInterfaces.toArray(new Class<?>[this.publishedInterfaces.size()]);
}
/**
* Check whether the specified interfaces is a published introduction interface.
* @param ifc the interface to check
* @return whether the interface is part of this introduction
*/
- public boolean implementsInterface(Class ifc) {
- for (Class pubIfc : this.publishedInterfaces) {
+ public boolean implementsInterface(Class<?> ifc) {
+ for (Class<?> pubIfc : this.publishedInterfaces) {
if (ifc.isInterface() && ifc.isAssignableFrom(pubIfc)) {
return true;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/MethodMatchers.java | @@ -88,7 +88,7 @@ public static MethodMatcher intersection(MethodMatcher mm1, MethodMatcher mm2) {
* asking is the subject on one or more introductions; {@code false} otherwise
* @return whether or not this method matches statically
*/
- public static boolean matches(MethodMatcher mm, Method method, Class targetClass, boolean hasIntroductions) {
+ public static boolean matches(MethodMatcher mm, Method method, Class<?> targetClass, boolean hasIntroductions) {
Assert.notNull(mm, "MethodMatcher must not be null");
return ((mm instanceof IntroductionAwareMethodMatcher &&
((IntroductionAwareMethodMatcher) mm).matches(method, targetClass, hasIntroductions)) ||
@@ -114,22 +114,22 @@ public UnionMethodMatcher(MethodMatcher mm1, MethodMatcher mm2) {
}
@Override
- public boolean matches(Method method, Class targetClass, boolean hasIntroductions) {
+ public boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions) {
return (matchesClass1(targetClass) && MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions)) ||
(matchesClass2(targetClass) && MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions));
}
@Override
- public boolean matches(Method method, Class targetClass) {
+ public boolean matches(Method method, Class<?> targetClass) {
return (matchesClass1(targetClass) && this.mm1.matches(method, targetClass)) ||
(matchesClass2(targetClass) && this.mm2.matches(method, targetClass));
}
- protected boolean matchesClass1(Class targetClass) {
+ protected boolean matchesClass1(Class<?> targetClass) {
return true;
}
- protected boolean matchesClass2(Class targetClass) {
+ protected boolean matchesClass2(Class<?> targetClass) {
return true;
}
@@ -139,7 +139,7 @@ public boolean isRuntime() {
}
@Override
- public boolean matches(Method method, Class targetClass, Object[] args) {
+ public boolean matches(Method method, Class<?> targetClass, Object[] args) {
return this.mm1.matches(method, targetClass, args) || this.mm2.matches(method, targetClass, args);
}
@@ -183,12 +183,12 @@ public ClassFilterAwareUnionMethodMatcher(MethodMatcher mm1, ClassFilter cf1, Me
}
@Override
- protected boolean matchesClass1(Class targetClass) {
+ protected boolean matchesClass1(Class<?> targetClass) {
return this.cf1.matches(targetClass);
}
@Override
- protected boolean matchesClass2(Class targetClass) {
+ protected boolean matchesClass2(Class<?> targetClass) {
return this.cf2.matches(targetClass);
}
@@ -230,13 +230,13 @@ public IntersectionMethodMatcher(MethodMatcher mm1, MethodMatcher mm2) {
}
@Override
- public boolean matches(Method method, Class targetClass, boolean hasIntroductions) {
+ public boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions) {
return MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions) &&
MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions);
}
@Override
- public boolean matches(Method method, Class targetClass) {
+ public boolean matches(Method method, Class<?> targetClass) {
return this.mm1.matches(method, targetClass) && this.mm2.matches(method, targetClass);
}
@@ -246,7 +246,7 @@ public boolean isRuntime() {
}
@Override
- public boolean matches(Method method, Class targetClass, Object[] args) {
+ public boolean matches(Method method, Class<?> targetClass, Object[] args) {
// Because a dynamic intersection may be composed of a static and dynamic part,
// we must avoid calling the 3-arg matches method on a dynamic matcher, as
// it will probably be an unsupported operation. | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/NameMatchMethodPointcut.java | @@ -78,7 +78,7 @@ public NameMatchMethodPointcut addMethodName(String name) {
@Override
- public boolean matches(Method method, Class targetClass) {
+ public boolean matches(Method method, Class<?> targetClass) {
for (String mappedName : this.mappedNames) {
if (mappedName.equals(method.getName()) || isMatch(method.getName(), mappedName)) {
return true; | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/Pointcuts.java | @@ -71,7 +71,7 @@ public static Pointcut intersection(Pointcut pc1, Pointcut pc2) {
* @param args arguments to the method
* @return whether there's a runtime match
*/
- public static boolean matches(Pointcut pointcut, Method method, Class targetClass, Object[] args) {
+ public static boolean matches(Pointcut pointcut, Method method, Class<?> targetClass, Object[] args) {
Assert.notNull(pointcut, "Pointcut must not be null");
if (pointcut == Pointcut.TRUE) {
return true;
@@ -97,7 +97,7 @@ private static class SetterPointcut extends StaticMethodMatcherPointcut implemen
public static SetterPointcut INSTANCE = new SetterPointcut();
@Override
- public boolean matches(Method method, Class targetClass) {
+ public boolean matches(Method method, Class<?> targetClass) {
return method.getName().startsWith("set") &&
method.getParameterTypes().length == 1 &&
method.getReturnType() == Void.TYPE;
@@ -118,7 +118,7 @@ private static class GetterPointcut extends StaticMethodMatcherPointcut implemen
public static GetterPointcut INSTANCE = new GetterPointcut();
@Override
- public boolean matches(Method method, Class targetClass) {
+ public boolean matches(Method method, Class<?> targetClass) {
return method.getName().startsWith("get") &&
method.getParameterTypes().length == 0;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/RootClassFilter.java | @@ -27,16 +27,16 @@
@SuppressWarnings("serial")
public class RootClassFilter implements ClassFilter, Serializable {
- private Class clazz;
+ private Class<?> clazz;
- // TODO inheritance
- public RootClassFilter(Class clazz) {
+ public RootClassFilter(Class<?> clazz) {
this.clazz = clazz;
}
+
@Override
- public boolean matches(Class candidate) {
+ public boolean matches(Class<?> candidate) {
return clazz.isAssignableFrom(candidate);
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationClassFilter.java | @@ -60,7 +60,7 @@ public AnnotationClassFilter(Class<? extends Annotation> annotationType, boolean
@Override
- public boolean matches(Class clazz) {
+ public boolean matches(Class<?> clazz) {
return (this.checkInherited ?
(AnnotationUtils.findAnnotation(clazz, this.annotationType) != null) :
clazz.isAnnotationPresent(this.annotationType)); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/support/annotation/AnnotationMethodMatcher.java | @@ -48,7 +48,7 @@ public AnnotationMethodMatcher(Class<? extends Annotation> annotationType) {
@Override
- public boolean matches(Method method, Class targetClass) {
+ public boolean matches(Method method, Class<?> targetClass) {
if (method.isAnnotationPresent(this.annotationType)) {
return true;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/target/AbstractBeanFactoryBasedTargetSource.java | @@ -97,7 +97,7 @@ public String getTargetBeanName() {
* <p>Default is to detect the type automatically, through a {@code getType}
* call on the BeanFactory (or even a full {@code getBean} call as fallback).
*/
- public void setTargetClass(Class targetClass) {
+ public void setTargetClass(Class<?> targetClass) {
this.targetClass = targetClass;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/target/AbstractPoolingTargetSource.java | @@ -53,6 +53,9 @@
public abstract class AbstractPoolingTargetSource extends AbstractPrototypeBasedTargetSource
implements PoolingConfig, DisposableBean {
+ private static final long serialVersionUID = 1L;
+
+
/** The maximum size of the pool */
private int maxSize = -1;
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/target/AbstractPrototypeBasedTargetSource.java | @@ -45,6 +45,9 @@
*/
public abstract class AbstractPrototypeBasedTargetSource extends AbstractBeanFactoryBasedTargetSource {
+ private static final long serialVersionUID = 1L;
+
+
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
super.setBeanFactory(beanFactory); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/main/java/org/springframework/aop/target/EmptyTargetSource.java | @@ -50,7 +50,7 @@ public class EmptyTargetSource implements TargetSource, Serializable {
* @param targetClass the target Class (may be {@code null})
* @see #getTargetClass()
*/
- public static EmptyTargetSource forClass(Class targetClass) {
+ public static EmptyTargetSource forClass(Class<?> targetClass) {
return forClass(targetClass, true);
}
@@ -60,7 +60,7 @@ public static EmptyTargetSource forClass(Class targetClass) {
* @param isStatic whether the TargetSource should be marked as static
* @see #getTargetClass()
*/
- public static EmptyTargetSource forClass(Class targetClass, boolean isStatic) {
+ public static EmptyTargetSource forClass(Class<?> targetClass, boolean isStatic) {
return (targetClass == null && isStatic ? INSTANCE : new EmptyTargetSource(targetClass, isStatic));
}
@@ -69,7 +69,7 @@ public static EmptyTargetSource forClass(Class targetClass, boolean isStatic) {
// Instance implementation
//---------------------------------------------------------------------
- private final Class targetClass;
+ private final Class<?> targetClass;
private final boolean isStatic;
@@ -81,7 +81,7 @@ public static EmptyTargetSource forClass(Class targetClass, boolean isStatic) {
* @param targetClass the target class to expose (may be {@code null})
* @param isStatic whether the TargetSource is marked as static
*/
- private EmptyTargetSource(Class targetClass, boolean isStatic) {
+ private EmptyTargetSource(Class<?> targetClass, boolean isStatic) {
this.targetClass = targetClass;
this.isStatic = isStatic;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/test/java/org/springframework/tests/aop/interceptor/NopInterceptor.java | @@ -46,6 +46,11 @@ protected void increment() {
++count;
}
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
@Override
public boolean equals(Object other) {
if (!(other instanceof NopInterceptor)) {
@@ -57,4 +62,5 @@ public boolean equals(Object other) {
return this.count == ((NopInterceptor) other).count;
}
+
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-aop/src/test/java/org/springframework/tests/sample/beans/SerializablePerson.java | @@ -28,7 +28,11 @@
@SuppressWarnings("serial")
public class SerializablePerson implements Person, Serializable {
+ private static final long serialVersionUID = 1L;
+
+
private String name;
+
private int age;
@Override
@@ -59,6 +63,11 @@ public Object echo(Object o) throws Throwable {
return o;
}
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
@Override
public boolean equals(Object other) {
if (!(other instanceof SerializablePerson)) { | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/AbstractPropertyAccessor.java | @@ -112,7 +112,7 @@ public void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean
// Redefined with public visibility.
@Override
- public Class getPropertyType(String propertyPath) {
+ public Class<?> getPropertyType(String propertyPath) {
return null;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/BeanInstantiationException.java | @@ -26,15 +26,15 @@
@SuppressWarnings("serial")
public class BeanInstantiationException extends FatalBeanException {
- private Class beanClass;
+ private Class<?> beanClass;
/**
* Create a new BeanInstantiationException.
* @param beanClass the offending bean class
* @param msg the detail message
*/
- public BeanInstantiationException(Class beanClass, String msg) {
+ public BeanInstantiationException(Class<?> beanClass, String msg) {
this(beanClass, msg, null);
}
@@ -44,15 +44,15 @@ public BeanInstantiationException(Class beanClass, String msg) {
* @param msg the detail message
* @param cause the root cause
*/
- public BeanInstantiationException(Class beanClass, String msg, Throwable cause) {
+ public BeanInstantiationException(Class<?> beanClass, String msg, Throwable cause) {
super("Could not instantiate bean class [" + beanClass.getName() + "]: " + msg, cause);
this.beanClass = beanClass;
}
/**
* Return the offending bean class.
*/
- public Class getBeanClass() {
+ public Class<?> getBeanClass() {
return beanClass;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/BeanUtils.java | @@ -336,7 +336,7 @@ else if (firstParen == -1 && lastParen == -1) {
String methodName = signature.substring(0, firstParen);
String[] parameterTypeNames =
StringUtils.commaDelimitedListToStringArray(signature.substring(firstParen + 1, lastParen));
- Class<?>[] parameterTypes = new Class[parameterTypeNames.length];
+ Class<?>[] parameterTypes = new Class<?>[parameterTypeNames.length];
for (int i = 0; i < parameterTypeNames.length; i++) {
String parameterTypeName = parameterTypeNames[i].trim();
try { | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/BeanWrapper.java | @@ -59,7 +59,7 @@ public interface BeanWrapper extends ConfigurablePropertyAccessor {
* @return the type of the wrapped bean instance,
* or {@code null} if no wrapped object has been set
*/
- Class getWrappedClass();
+ Class<?> getWrappedClass();
/**
* Obtain the PropertyDescriptors for the wrapped object | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java | @@ -37,7 +37,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
import org.springframework.core.CollectionFactory;
import org.springframework.core.GenericCollectionTypeResolver;
import org.springframework.core.convert.ConversionException;
@@ -225,7 +224,7 @@ public final Object getWrappedInstance() {
}
@Override
- public final Class getWrappedClass() {
+ public final Class<?> getWrappedClass() {
return (this.object != null ? this.object.getClass() : null);
}
@@ -248,7 +247,7 @@ public final Object getRootInstance() {
* Return the class of the root object at the top of the path of this BeanWrapper.
* @see #getNestedPath
*/
- public final Class getRootClass() {
+ public final Class<?> getRootClass() {
return (this.rootObject != null ? this.rootObject.getClass() : null);
}
@@ -310,7 +309,7 @@ public AccessControlContext getSecurityContext() {
* Needs to be called when the target object changes.
* @param clazz the class to introspect
*/
- protected void setIntrospectionClass(Class clazz) {
+ protected void setIntrospectionClass(Class<?> clazz) {
if (this.cachedIntrospectionResults != null &&
!clazz.equals(this.cachedIntrospectionResults.getBeanClass())) {
this.cachedIntrospectionResults = null;
@@ -360,7 +359,7 @@ protected PropertyDescriptor getPropertyDescriptorInternal(String propertyName)
}
@Override
- public Class getPropertyType(String propertyName) throws BeansException {
+ public Class<?> getPropertyType(String propertyName) throws BeansException {
try {
PropertyDescriptor pd = getPropertyDescriptorInternal(propertyName);
if (pd != null) {
@@ -374,7 +373,7 @@ public Class getPropertyType(String propertyName) throws BeansException {
}
// Check to see if there is a custom editor,
// which might give an indication on the desired target type.
- Class editorType = guessPropertyTypeFromEditors(propertyName);
+ Class<?> editorType = guessPropertyTypeFromEditors(propertyName);
if (editorType != null) {
return editorType;
}
@@ -710,7 +709,8 @@ public Object getPropertyValue(String propertyName) throws BeansException {
return nestedBw.getPropertyValue(tokens);
}
- private Object getPropertyValue(PropertyTokenHolder tokens) throws BeansException {
+ @SuppressWarnings("unchecked")
+ private Object getPropertyValue(PropertyTokenHolder tokens) throws BeansException {
String propertyName = tokens.canonicalName;
String actualName = tokens.actualName;
PropertyDescriptor pd = getCachedIntrospectionResults().getPropertyDescriptor(actualName);
@@ -779,20 +779,20 @@ else if (value.getClass().isArray()) {
}
else if (value instanceof List) {
int index = Integer.parseInt(key);
- List list = (List) value;
+ List<Object> list = (List<Object>) value;
growCollectionIfNecessary(list, index, indexedPropertyName, pd, i + 1);
value = list.get(index);
}
else if (value instanceof Set) {
// Apply index to Iterator in case of a Set.
- Set set = (Set) value;
+ Set<Object> set = (Set<Object>) value;
int index = Integer.parseInt(key);
if (index < 0 || index >= set.size()) {
throw new InvalidPropertyException(getRootClass(), this.nestedPath + propertyName,
"Cannot get element with index " + index + " from Set of size " +
set.size() + ", accessed using property path '" + propertyName + "'");
}
- Iterator it = set.iterator();
+ Iterator<Object> it = set.iterator();
for (int j = 0; it.hasNext(); j++) {
Object elem = it.next();
if (j == index) {
@@ -802,7 +802,7 @@ else if (value instanceof Set) {
}
}
else if (value instanceof Map) {
- Map map = (Map) value;
+ Map<Object, Object> map = (Map<Object, Object>) value;
Class<?> mapKeyType = GenericCollectionTypeResolver.getMapKeyReturnType(pd.getReadMethod(), i + 1);
// IMPORTANT: Do not pass full property name in here - property editors
// must not kick in for map keys but rather only for map values.
@@ -863,16 +863,14 @@ private Object growArrayIfNecessary(Object array, int index, String name) {
}
}
- @SuppressWarnings("unchecked")
- private void growCollectionIfNecessary(
- Collection collection, int index, String name, PropertyDescriptor pd, int nestingLevel) {
-
+ private void growCollectionIfNecessary(Collection<Object> collection, int index,
+ String name, PropertyDescriptor pd, int nestingLevel) {
if (!this.autoGrowNestedPaths) {
return;
}
int size = collection.size();
if (index >= size && index < this.autoGrowCollectionLimit) {
- Class elementType = GenericCollectionTypeResolver.getCollectionReturnType(pd.getReadMethod(), nestingLevel);
+ Class<?> elementType = GenericCollectionTypeResolver.getCollectionReturnType(pd.getReadMethod(), nestingLevel);
if (elementType != null) {
for (int i = collection.size(); i < index + 1; i++) {
collection.add(newValue(elementType, name));
@@ -958,7 +956,7 @@ private void setPropertyValue(PropertyTokenHolder tokens, PropertyValue pv) thro
}
if (propValue.getClass().isArray()) {
PropertyDescriptor pd = getCachedIntrospectionResults().getPropertyDescriptor(actualName);
- Class requiredType = propValue.getClass().getComponentType();
+ Class<?> requiredType = propValue.getClass().getComponentType();
int arrayIndex = Integer.parseInt(key);
Object oldValue = null;
try {
@@ -976,9 +974,9 @@ private void setPropertyValue(PropertyTokenHolder tokens, PropertyValue pv) thro
}
else if (propValue instanceof List) {
PropertyDescriptor pd = getCachedIntrospectionResults().getPropertyDescriptor(actualName);
- Class requiredType = GenericCollectionTypeResolver.getCollectionReturnType(
+ Class<?> requiredType = GenericCollectionTypeResolver.getCollectionReturnType(
pd.getReadMethod(), tokens.keys.length);
- List list = (List) propValue;
+ List<Object> list = (List<Object>) propValue;
int index = Integer.parseInt(key);
Object oldValue = null;
if (isExtractOldValueForEditor() && index < list.size()) {
@@ -1013,11 +1011,11 @@ else if (propValue instanceof List) {
}
else if (propValue instanceof Map) {
PropertyDescriptor pd = getCachedIntrospectionResults().getPropertyDescriptor(actualName);
- Class mapKeyType = GenericCollectionTypeResolver.getMapKeyReturnType(
+ Class<?> mapKeyType = GenericCollectionTypeResolver.getMapKeyReturnType(
pd.getReadMethod(), tokens.keys.length);
- Class mapValueType = GenericCollectionTypeResolver.getMapValueReturnType(
+ Class<?> mapValueType = GenericCollectionTypeResolver.getMapValueReturnType(
pd.getReadMethod(), tokens.keys.length);
- Map map = (Map) propValue;
+ Map<Object, Object> map = (Map<Object, Object>) propValue;
// IMPORTANT: Do not pass full property name in here - property editors
// must not kick in for map keys but rather only for map values.
TypeDescriptor typeDescriptor = (mapKeyType != null ? | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java | @@ -32,7 +32,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
import org.springframework.core.io.support.SpringFactoriesLoader;
import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
@@ -76,7 +75,7 @@ public class CachedIntrospectionResults {
* Needs to be a WeakHashMap with WeakReferences as values to allow
* for proper garbage collection in case of multiple class loaders.
*/
- static final Map<Class, Object> classCache = new WeakHashMap<Class, Object>();
+ static final Map<Class<?>, Object> classCache = new WeakHashMap<Class<?>, Object>();
/**
@@ -107,7 +106,7 @@ public static void acceptClassLoader(ClassLoader classLoader) {
*/
public static void clearClassLoader(ClassLoader classLoader) {
synchronized (classCache) {
- for (Iterator<Class> it = classCache.keySet().iterator(); it.hasNext();) {
+ for (Iterator<Class<?>> it = classCache.keySet().iterator(); it.hasNext();) {
Class<?> beanClass = it.next();
if (isUnderneathClassLoader(beanClass.getClassLoader(), classLoader)) {
it.remove();
@@ -130,15 +129,16 @@ public static void clearClassLoader(ClassLoader classLoader) {
* @return the corresponding CachedIntrospectionResults
* @throws BeansException in case of introspection failure
*/
+ @SuppressWarnings("unchecked")
static CachedIntrospectionResults forClass(Class<?> beanClass) throws BeansException {
CachedIntrospectionResults results;
Object value;
synchronized (classCache) {
value = classCache.get(beanClass);
}
if (value instanceof Reference) {
- Reference ref = (Reference) value;
- results = (CachedIntrospectionResults) ref.get();
+ Reference<CachedIntrospectionResults> ref = (Reference<CachedIntrospectionResults>) value;
+ results = ref.get();
}
else {
results = (CachedIntrospectionResults) value; | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/ConversionNotSupportedException.java | @@ -34,7 +34,8 @@ public class ConversionNotSupportedException extends TypeMismatchException {
* @param requiredType the required target type (or {@code null} if not known)
* @param cause the root cause (may be {@code null})
*/
- public ConversionNotSupportedException(PropertyChangeEvent propertyChangeEvent, Class requiredType, Throwable cause) {
+ public ConversionNotSupportedException(PropertyChangeEvent propertyChangeEvent,
+ Class<?> requiredType, Throwable cause) {
super(propertyChangeEvent, requiredType, cause);
}
@@ -44,7 +45,7 @@ public ConversionNotSupportedException(PropertyChangeEvent propertyChangeEvent,
* @param requiredType the required target type (or {@code null} if not known)
* @param cause the root cause (may be {@code null})
*/
- public ConversionNotSupportedException(Object value, Class requiredType, Throwable cause) {
+ public ConversionNotSupportedException(Object value, Class<?> requiredType, Throwable cause) {
super(value, requiredType, cause);
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/InvalidPropertyException.java | @@ -26,7 +26,7 @@
@SuppressWarnings("serial")
public class InvalidPropertyException extends FatalBeanException {
- private Class beanClass;
+ private Class<?> beanClass;
private String propertyName;
@@ -37,7 +37,7 @@ public class InvalidPropertyException extends FatalBeanException {
* @param propertyName the offending property
* @param msg the detail message
*/
- public InvalidPropertyException(Class beanClass, String propertyName, String msg) {
+ public InvalidPropertyException(Class<?> beanClass, String propertyName, String msg) {
this(beanClass, propertyName, msg, null);
}
@@ -48,7 +48,7 @@ public InvalidPropertyException(Class beanClass, String propertyName, String msg
* @param msg the detail message
* @param cause the root cause
*/
- public InvalidPropertyException(Class beanClass, String propertyName, String msg, Throwable cause) {
+ public InvalidPropertyException(Class<?> beanClass, String propertyName, String msg, Throwable cause) {
super("Invalid property '" + propertyName + "' of bean class [" + beanClass.getName() + "]: " + msg, cause);
this.beanClass = beanClass;
this.propertyName = propertyName;
@@ -57,7 +57,7 @@ public InvalidPropertyException(Class beanClass, String propertyName, String msg
/**
* Return the offending bean class.
*/
- public Class getBeanClass() {
+ public Class<?> getBeanClass() {
return beanClass;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/MutablePropertyValues.java | @@ -86,7 +86,7 @@ public MutablePropertyValues(Map<?, ?> original) {
// There is no replacement of existing property values.
if (original != null) {
this.propertyValueList = new ArrayList<PropertyValue>(original.size());
- for (Map.Entry entry : original.entrySet()) {
+ for (Map.Entry<?, ?> entry : original.entrySet()) {
this.propertyValueList.add(new PropertyValue(entry.getKey().toString(), entry.getValue()));
}
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/NotReadablePropertyException.java | @@ -31,7 +31,7 @@ public class NotReadablePropertyException extends InvalidPropertyException {
* @param beanClass the offending bean class
* @param propertyName the offending property
*/
- public NotReadablePropertyException(Class beanClass, String propertyName) {
+ public NotReadablePropertyException(Class<?> beanClass, String propertyName) {
super(beanClass, propertyName,
"Bean property '" + propertyName + "' is not readable or has an invalid getter method: " +
"Does the return type of the getter match the parameter type of the setter?");
@@ -43,7 +43,7 @@ public NotReadablePropertyException(Class beanClass, String propertyName) {
* @param propertyName the offending property
* @param msg the detail message
*/
- public NotReadablePropertyException(Class beanClass, String propertyName, String msg) {
+ public NotReadablePropertyException(Class<?> beanClass, String propertyName, String msg) {
super(beanClass, propertyName, msg);
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/NotWritablePropertyException.java | @@ -35,7 +35,7 @@ public class NotWritablePropertyException extends InvalidPropertyException {
* @param beanClass the offending bean class
* @param propertyName the offending property name
*/
- public NotWritablePropertyException(Class beanClass, String propertyName) {
+ public NotWritablePropertyException(Class<?> beanClass, String propertyName) {
super(beanClass, propertyName,
"Bean property '" + propertyName + "' is not writable or has an invalid setter method: " +
"Does the return type of the getter match the parameter type of the setter?");
@@ -47,7 +47,7 @@ public NotWritablePropertyException(Class beanClass, String propertyName) {
* @param propertyName the offending property name
* @param msg the detail message
*/
- public NotWritablePropertyException(Class beanClass, String propertyName, String msg) {
+ public NotWritablePropertyException(Class<?> beanClass, String propertyName, String msg) {
super(beanClass, propertyName, msg);
}
@@ -58,7 +58,7 @@ public NotWritablePropertyException(Class beanClass, String propertyName, String
* @param msg the detail message
* @param cause the root cause
*/
- public NotWritablePropertyException(Class beanClass, String propertyName, String msg, Throwable cause) {
+ public NotWritablePropertyException(Class<?> beanClass, String propertyName, String msg, Throwable cause) {
super(beanClass, propertyName, msg, cause);
}
@@ -70,7 +70,7 @@ public NotWritablePropertyException(Class beanClass, String propertyName, String
* @param possibleMatches suggestions for actual bean property names
* that closely match the invalid property name
*/
- public NotWritablePropertyException(Class beanClass, String propertyName, String msg, String[] possibleMatches) {
+ public NotWritablePropertyException(Class<?> beanClass, String propertyName, String msg, String[] possibleMatches) {
super(beanClass, propertyName, msg);
this.possibleMatches = possibleMatches;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/NullValueInNestedPathException.java | @@ -33,7 +33,7 @@ public class NullValueInNestedPathException extends InvalidPropertyException {
* @param beanClass the offending bean class
* @param propertyName the offending property
*/
- public NullValueInNestedPathException(Class beanClass, String propertyName) {
+ public NullValueInNestedPathException(Class<?> beanClass, String propertyName) {
super(beanClass, propertyName, "Value of nested property '" + propertyName + "' is null");
}
@@ -43,7 +43,7 @@ public NullValueInNestedPathException(Class beanClass, String propertyName) {
* @param propertyName the offending property
* @param msg the detail message
*/
- public NullValueInNestedPathException(Class beanClass, String propertyName, String msg) {
+ public NullValueInNestedPathException(Class<?> beanClass, String propertyName, String msg) {
super(beanClass, propertyName, msg);
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/PropertyAccessor.java | @@ -86,7 +86,7 @@ public interface PropertyAccessor {
* @throws PropertyAccessException if the property was valid but the
* accessor method failed
*/
- Class getPropertyType(String propertyName) throws BeansException;
+ Class<?> getPropertyType(String propertyName) throws BeansException;
/**
* Return a type descriptor for the specified property: | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/PropertyBatchUpdateException.java | @@ -130,7 +130,7 @@ public void printStackTrace(PrintWriter pw) {
}
@Override
- public boolean contains(Class exType) {
+ public boolean contains(Class<?> exType) {
if (exType == null) {
return false;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/PropertyMatches.java | @@ -49,7 +49,7 @@ final class PropertyMatches {
* @param propertyName the name of the property to find possible matches for
* @param beanClass the bean class to search for matches
*/
- public static PropertyMatches forProperty(String propertyName, Class beanClass) {
+ public static PropertyMatches forProperty(String propertyName, Class<?> beanClass) {
return forProperty(propertyName, beanClass, DEFAULT_MAX_DISTANCE);
}
@@ -59,7 +59,7 @@ public static PropertyMatches forProperty(String propertyName, Class beanClass)
* @param beanClass the bean class to search for matches
* @param maxDistance the maximum property distance allowed for matches
*/
- public static PropertyMatches forProperty(String propertyName, Class beanClass, int maxDistance) {
+ public static PropertyMatches forProperty(String propertyName, Class<?> beanClass, int maxDistance) {
return new PropertyMatches(propertyName, beanClass, maxDistance);
}
@@ -76,7 +76,7 @@ public static PropertyMatches forProperty(String propertyName, Class beanClass,
/**
* Create a new PropertyMatches instance for the given property.
*/
- private PropertyMatches(String propertyName, Class beanClass, int maxDistance) {
+ private PropertyMatches(String propertyName, Class<?> beanClass, int maxDistance) {
this.propertyName = propertyName;
this.possibleMatches = calculateMatches(BeanUtils.getPropertyDescriptors(beanClass), maxDistance);
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/TypeConverterDelegate.java | @@ -200,13 +200,13 @@ public <T> T convertIfNecessary(String propertyName, Object oldValue, Object new
else if (convertedValue instanceof Collection) {
// Convert elements to target type, if determined.
convertedValue = convertToTypedCollection(
- (Collection) convertedValue, propertyName, requiredType, typeDescriptor);
+ (Collection<?>) convertedValue, propertyName, requiredType, typeDescriptor);
standardConversion = true;
}
else if (convertedValue instanceof Map) {
// Convert keys and values to respective target type, if determined.
convertedValue = convertToTypedMap(
- (Map) convertedValue, propertyName, requiredType, typeDescriptor);
+ (Map<?, ?>) convertedValue, propertyName, requiredType, typeDescriptor);
standardConversion = true;
}
if (convertedValue.getClass().isArray() && Array.getLength(convertedValue) == 1) {
@@ -220,8 +220,8 @@ else if (convertedValue instanceof Map) {
else if (convertedValue instanceof String && !requiredType.isInstance(convertedValue)) {
if (firstAttemptEx == null && !requiredType.isInterface() && !requiredType.isEnum()) {
try {
- Constructor strCtor = requiredType.getConstructor(String.class);
- return (T) BeanUtils.instantiateClass(strCtor, convertedValue);
+ Constructor<T> strCtor = requiredType.getConstructor(String.class);
+ return BeanUtils.instantiateClass(strCtor, convertedValue);
}
catch (NoSuchMethodException ex) {
// proceed with field lookup
@@ -331,7 +331,7 @@ private Object attemptToConvertStringToEnum(Class<?> requiredType, String trimme
* @param requiredType the type to find an editor for
* @return the corresponding editor, or {@code null} if none
*/
- private PropertyEditor findDefaultEditor(Class requiredType) {
+ private PropertyEditor findDefaultEditor(Class<?> requiredType) {
PropertyEditor editor = null;
if (requiredType != null) {
// No custom editor -> check BeanWrapperImpl's default editors.
@@ -434,10 +434,10 @@ private Object doConvertTextValue(Object oldValue, String newTextValue, Property
private Object convertToTypedArray(Object input, String propertyName, Class<?> componentType) {
if (input instanceof Collection) {
// Convert Collection elements to array elements.
- Collection coll = (Collection) input;
+ Collection<?> coll = (Collection<?>) input;
Object result = Array.newInstance(componentType, coll.size());
int i = 0;
- for (Iterator it = coll.iterator(); it.hasNext(); i++) {
+ for (Iterator<?> it = coll.iterator(); it.hasNext(); i++) {
Object value = convertIfNecessary(
buildIndexedPropertyName(propertyName, i), null, it.next(), componentType);
Array.set(result, i, value);
@@ -470,8 +470,8 @@ else if (input.getClass().isArray()) {
}
@SuppressWarnings("unchecked")
- private Collection convertToTypedCollection(
- Collection original, String propertyName, Class requiredType, TypeDescriptor typeDescriptor) {
+ private Collection<?> convertToTypedCollection(
+ Collection<?> original, String propertyName, Class<?> requiredType, TypeDescriptor typeDescriptor) {
if (!Collection.class.isAssignableFrom(requiredType)) {
return original;
@@ -494,7 +494,7 @@ private Collection convertToTypedCollection(
return original;
}
- Iterator it;
+ Iterator<?> it;
try {
it = original.iterator();
if (it == null) {
@@ -513,13 +513,13 @@ private Collection convertToTypedCollection(
return original;
}
- Collection convertedCopy;
+ Collection<Object> convertedCopy;
try {
if (approximable) {
convertedCopy = CollectionFactory.createApproximateCollection(original, original.size());
}
else {
- convertedCopy = (Collection) requiredType.newInstance();
+ convertedCopy = (Collection<Object>) requiredType.newInstance();
}
}
catch (Throwable ex) {
@@ -552,8 +552,8 @@ private Collection convertToTypedCollection(
}
@SuppressWarnings("unchecked")
- private Map convertToTypedMap(
- Map original, String propertyName, Class requiredType, TypeDescriptor typeDescriptor) {
+ private Map<?, ?> convertToTypedMap(
+ Map<?, ?> original, String propertyName, Class<?> requiredType, TypeDescriptor typeDescriptor) {
if (!Map.class.isAssignableFrom(requiredType)) {
return original;
@@ -577,7 +577,7 @@ private Map convertToTypedMap(
return original;
}
- Iterator it;
+ Iterator<?> it;
try {
it = original.entrySet().iterator();
if (it == null) {
@@ -596,13 +596,13 @@ private Map convertToTypedMap(
return original;
}
- Map convertedCopy;
+ Map<Object, Object> convertedCopy;
try {
if (approximable) {
convertedCopy = CollectionFactory.createApproximateMap(original, original.size());
}
else {
- convertedCopy = (Map) requiredType.newInstance();
+ convertedCopy = (Map<Object, Object>) requiredType.newInstance();
}
}
catch (Throwable ex) {
@@ -614,7 +614,7 @@ private Map convertToTypedMap(
}
while (it.hasNext()) {
- Map.Entry entry = (Map.Entry) it.next();
+ Map.Entry<?, ?> entry = (Map.Entry<?, ?>) it.next();
Object key = entry.getKey();
Object value = entry.getValue();
String keyedPropertyName = buildKeyedPropertyName(propertyName, key);
@@ -649,7 +649,7 @@ private String buildKeyedPropertyName(String propertyName, Object key) {
null);
}
- private boolean canCreateCopy(Class requiredType) {
+ private boolean canCreateCopy(Class<?> requiredType) {
return (!requiredType.isInterface() && !Modifier.isAbstract(requiredType.getModifiers()) &&
Modifier.isPublic(requiredType.getModifiers()) && ClassUtils.hasConstructor(requiredType));
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/TypeMismatchException.java | @@ -37,15 +37,15 @@ public class TypeMismatchException extends PropertyAccessException {
private transient Object value;
- private Class requiredType;
+ private Class<?> requiredType;
/**
* Create a new TypeMismatchException.
* @param propertyChangeEvent the PropertyChangeEvent that resulted in the problem
* @param requiredType the required target type
*/
- public TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class requiredType) {
+ public TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class<?> requiredType) {
this(propertyChangeEvent, requiredType, null);
}
@@ -55,7 +55,7 @@ public TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class requ
* @param requiredType the required target type (or {@code null} if not known)
* @param cause the root cause (may be {@code null})
*/
- public TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class requiredType, Throwable cause) {
+ public TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class<?> requiredType, Throwable cause) {
super(propertyChangeEvent,
"Failed to convert property value of type '" +
ClassUtils.getDescriptiveType(propertyChangeEvent.getNewValue()) + "'" +
@@ -73,7 +73,7 @@ public TypeMismatchException(PropertyChangeEvent propertyChangeEvent, Class requ
* @param value the offending value that couldn't be converted (may be {@code null})
* @param requiredType the required target type (or {@code null} if not known)
*/
- public TypeMismatchException(Object value, Class requiredType) {
+ public TypeMismatchException(Object value, Class<?> requiredType) {
this(value, requiredType, null);
}
@@ -83,7 +83,7 @@ public TypeMismatchException(Object value, Class requiredType) {
* @param requiredType the required target type (or {@code null} if not known)
* @param cause the root cause (may be {@code null})
*/
- public TypeMismatchException(Object value, Class requiredType, Throwable cause) {
+ public TypeMismatchException(Object value, Class<?> requiredType, Throwable cause) {
super("Failed to convert value of type '" + ClassUtils.getDescriptiveType(value) + "'" +
(requiredType != null ? " to required type '" + ClassUtils.getQualifiedName(requiredType) + "'" : ""),
cause);
@@ -103,7 +103,7 @@ public Object getValue() {
/**
* Return the required target type, if any.
*/
- public Class getRequiredType() {
+ public Class<?> getRequiredType() {
return this.requiredType;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/BeanCreationException.java | @@ -185,7 +185,7 @@ public void printStackTrace(PrintWriter pw) {
}
@Override
- public boolean contains(Class exClass) {
+ public boolean contains(Class<?> exClass) {
if (super.contains(exClass)) {
return true;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/BeanIsNotAFactoryException.java | @@ -34,7 +34,7 @@ public class BeanIsNotAFactoryException extends BeanNotOfRequiredTypeException {
* @param actualType the actual type returned, which did not match
* the expected type
*/
- public BeanIsNotAFactoryException(String name, Class actualType) {
+ public BeanIsNotAFactoryException(String name, Class<?> actualType) {
super(name, FactoryBean.class, actualType);
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/BeanNotOfRequiredTypeException.java | @@ -31,10 +31,10 @@ public class BeanNotOfRequiredTypeException extends BeansException {
private String beanName;
/** The required type */
- private Class requiredType;
+ private Class<?> requiredType;
/** The offending type */
- private Class actualType;
+ private Class<?> actualType;
/**
@@ -44,7 +44,7 @@ public class BeanNotOfRequiredTypeException extends BeansException {
* @param actualType the actual type returned, which did not match
* the expected type
*/
- public BeanNotOfRequiredTypeException(String beanName, Class requiredType, Class actualType) {
+ public BeanNotOfRequiredTypeException(String beanName, Class<?> requiredType, Class<?> actualType) {
super("Bean named '" + beanName + "' must be of type [" + requiredType.getName() +
"], but was actually of type [" + actualType.getName() + "]");
this.beanName = beanName;
@@ -63,14 +63,14 @@ public String getBeanName() {
/**
* Return the expected type for the bean.
*/
- public Class getRequiredType() {
+ public Class<?> getRequiredType() {
return this.requiredType;
}
/**
* Return the actual type of the instance found.
*/
- public Class getActualType() {
+ public Class<?> getActualType() {
return this.actualType;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/UnsatisfiedDependencyException.java | @@ -69,7 +69,7 @@ public UnsatisfiedDependencyException(
* @param msg the detail message
*/
public UnsatisfiedDependencyException(
- String resourceDescription, String beanName, int ctorArgIndex, Class ctorArgType, String msg) {
+ String resourceDescription, String beanName, int ctorArgIndex, Class<?> ctorArgType, String msg) {
super(resourceDescription, beanName,
"Unsatisfied dependency expressed through constructor argument with index " +
@@ -86,7 +86,7 @@ public UnsatisfiedDependencyException(
* @param ex the bean creation exception that indicated the unsatisfied dependency
*/
public UnsatisfiedDependencyException(
- String resourceDescription, String beanName, int ctorArgIndex, Class ctorArgType, BeansException ex) {
+ String resourceDescription, String beanName, int ctorArgIndex, Class<?> ctorArgType, BeansException ex) {
this(resourceDescription, beanName, ctorArgIndex, ctorArgType, (ex != null ? ": " + ex.getMessage() : ""));
initCause(ex); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessor.java | @@ -268,10 +268,10 @@ else if (candidate.getParameterTypes().length == 0) {
if (requiredConstructor == null && defaultConstructor != null) {
candidates.add(defaultConstructor);
}
- candidateConstructors = candidates.toArray(new Constructor[candidates.size()]);
+ candidateConstructors = candidates.toArray(new Constructor<?>[candidates.size()]);
}
else {
- candidateConstructors = new Constructor[0];
+ candidateConstructors = new Constructor<?>[0];
}
this.candidateConstructorsCache.put(beanClass, candidateConstructors);
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurer.java | @@ -50,7 +50,7 @@ public class CustomAutowireConfigurer implements BeanFactoryPostProcessor, BeanC
private int order = Ordered.LOWEST_PRECEDENCE; // default: same as non-Ordered
- private Set customQualifierTypes;
+ private Set<?> customQualifierTypes;
private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader();
@@ -79,7 +79,7 @@ public void setBeanClassLoader(ClassLoader beanClassLoader) {
* does not require explicit registration.
* @param customQualifierTypes the custom types to register
*/
- public void setCustomQualifierTypes(Set customQualifierTypes) {
+ public void setCustomQualifierTypes(Set<?> customQualifierTypes) {
this.customQualifierTypes = customQualifierTypes;
}
@@ -99,13 +99,13 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
QualifierAnnotationAutowireCandidateResolver resolver =
(QualifierAnnotationAutowireCandidateResolver) dlbf.getAutowireCandidateResolver();
for (Object value : this.customQualifierTypes) {
- Class customType = null;
+ Class<? extends Annotation> customType = null;
if (value instanceof Class) {
- customType = (Class) value;
+ customType = (Class<? extends Annotation>) value;
}
else if (value instanceof String) {
String className = (String) value;
- customType = ClassUtils.resolveClassName(className, this.beanClassLoader);
+ customType = (Class<? extends Annotation>) ClassUtils.resolveClassName(className, this.beanClassLoader);
}
else {
throw new IllegalArgumentException( | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java | @@ -243,7 +243,7 @@ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFound
*/
private class LifecycleMetadata {
- private final Class targetClass;
+ private final Class<?> targetClass;
private final Collection<LifecycleElement> initMethods;
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/AbstractFactoryBean.java | @@ -158,7 +158,7 @@ public final T getObject() throws Exception {
*/
@SuppressWarnings("unchecked")
private T getEarlySingletonInstance() throws Exception {
- Class[] ifcs = getEarlySingletonInterfaces();
+ Class<?>[] ifcs = getEarlySingletonInterfaces();
if (ifcs == null) {
throw new FactoryBeanNotInitializedException(
getClass().getName() + " does not support circular references");
@@ -225,9 +225,9 @@ public void destroy() throws Exception {
* or {@code null} to indicate a FactoryBeanNotInitializedException
* @see org.springframework.beans.factory.FactoryBeanNotInitializedException
*/
- protected Class[] getEarlySingletonInterfaces() {
- Class type = getObjectType();
- return (type != null && type.isInterface() ? new Class[] {type} : null);
+ protected Class<?>[] getEarlySingletonInterfaces() {
+ Class<?> type = getObjectType();
+ return (type != null && type.isInterface() ? new Class<?>[] {type} : null);
}
/** | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/BeanReferenceFactoryBean.java | @@ -46,7 +46,7 @@
* (which support placeholder parsing since Spring 2.5)
*/
@Deprecated
-public class BeanReferenceFactoryBean implements SmartFactoryBean, BeanFactoryAware {
+public class BeanReferenceFactoryBean implements SmartFactoryBean<Object>, BeanFactoryAware {
private String targetBeanName;
@@ -86,7 +86,7 @@ public Object getObject() throws BeansException {
}
@Override
- public Class getObjectType() {
+ public Class<?> getObjectType() {
if (this.beanFactory == null) {
return null;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/CustomEditorConfigurer.java | @@ -140,7 +140,6 @@ public void setCustomEditors(Map<Class<?>, Class<? extends PropertyEditor>> cust
@Override
- @SuppressWarnings("unchecked")
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (this.propertyEditorRegistrars != null) {
for (PropertyEditorRegistrar propertyEditorRegistrar : this.propertyEditorRegistrars) {
@@ -149,7 +148,7 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
}
if (this.customEditors != null) {
for (Map.Entry<Class<?>, Class<? extends PropertyEditor>> entry : this.customEditors.entrySet()) {
- Class requiredType = entry.getKey();
+ Class<?> requiredType = entry.getKey();
Class<? extends PropertyEditor> propertyEditorClass = entry.getValue();
beanFactory.registerCustomEditor(requiredType, propertyEditorClass);
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/CustomScopeConfigurer.java | @@ -77,7 +77,6 @@ public void setBeanClassLoader(ClassLoader beanClassLoader) {
@Override
- @SuppressWarnings("unchecked")
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
if (this.scopes != null) {
for (Map.Entry<String, Object> entry : this.scopes.entrySet()) {
@@ -87,12 +86,12 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
beanFactory.registerScope(scopeKey, (Scope) value);
}
else if (value instanceof Class) {
- Class scopeClass = (Class) value;
+ Class<?> scopeClass = (Class<?>) value;
Assert.isAssignable(Scope.class, scopeClass);
beanFactory.registerScope(scopeKey, (Scope) BeanUtils.instantiateClass(scopeClass));
}
else if (value instanceof String) {
- Class scopeClass = ClassUtils.resolveClassName((String) value, this.beanClassLoader);
+ Class<?> scopeClass = ClassUtils.resolveClassName((String) value, this.beanClassLoader);
Assert.isAssignable(Scope.class, scopeClass);
beanFactory.registerScope(scopeKey, (Scope) BeanUtils.instantiateClass(scopeClass));
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java | @@ -52,7 +52,7 @@ public class DependencyDescriptor implements Serializable {
private String methodName;
- private Class[] parameterTypes;
+ private Class<?>[] parameterTypes;
private int parameterIndex;
@@ -267,12 +267,12 @@ public Class<?> getDependencyType() {
Type[] args = ((ParameterizedType) type).getActualTypeArguments();
Type arg = args[args.length - 1];
if (arg instanceof Class) {
- return (Class) arg;
+ return (Class<?>) arg;
}
else if (arg instanceof ParameterizedType) {
arg = ((ParameterizedType) arg).getRawType();
if (arg instanceof Class) {
- return (Class) arg;
+ return (Class<?>) arg;
}
}
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/FieldRetrievingFactoryBean.java | @@ -55,7 +55,7 @@
public class FieldRetrievingFactoryBean
implements FactoryBean<Object>, BeanNameAware, BeanClassLoaderAware, InitializingBean {
- private Class targetClass;
+ private Class<?> targetClass;
private Object targetObject;
@@ -78,14 +78,14 @@
* @see #setTargetObject
* @see #setTargetField
*/
- public void setTargetClass(Class targetClass) {
+ public void setTargetClass(Class<?> targetClass) {
this.targetClass = targetClass;
}
/**
* Return the target class on which the field is defined.
*/
- public Class getTargetClass() {
+ public Class<?> getTargetClass() {
return targetClass;
}
@@ -189,7 +189,7 @@ else if (this.targetField == null) {
}
// Try to get the exact method first.
- Class targetClass = (this.targetObject != null) ? this.targetObject.getClass() : this.targetClass;
+ Class<?> targetClass = (this.targetObject != null) ? this.targetObject.getClass() : this.targetClass;
this.fieldObject = targetClass.getField(this.targetField);
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java | @@ -32,17 +32,18 @@
* @see SetFactoryBean
* @see MapFactoryBean
*/
-public class ListFactoryBean extends AbstractFactoryBean<List> {
+public class ListFactoryBean extends AbstractFactoryBean<List<Object>> {
- private List sourceList;
+ private List<?> sourceList;
- private Class targetListClass;
+ @SuppressWarnings("rawtypes")
+ private Class<? extends List> targetListClass;
/**
* Set the source List, typically populated via XML "list" elements.
*/
- public void setSourceList(List sourceList) {
+ public void setSourceList(List<?> sourceList) {
this.sourceList = sourceList;
}
@@ -52,7 +53,8 @@ public void setSourceList(List sourceList) {
* <p>Default is a {@code java.util.ArrayList}.
* @see java.util.ArrayList
*/
- public void setTargetListClass(Class targetListClass) {
+ @SuppressWarnings("rawtypes")
+ public void setTargetListClass(Class<? extends List> targetListClass) {
if (targetListClass == null) {
throw new IllegalArgumentException("'targetListClass' must not be null");
}
@@ -64,24 +66,25 @@ public void setTargetListClass(Class targetListClass) {
@Override
+ @SuppressWarnings("rawtypes")
public Class<List> getObjectType() {
return List.class;
}
@Override
@SuppressWarnings("unchecked")
- protected List createInstance() {
+ protected List<Object> createInstance() {
if (this.sourceList == null) {
throw new IllegalArgumentException("'sourceList' is required");
}
- List result = null;
+ List<Object> result = null;
if (this.targetListClass != null) {
- result = (List) BeanUtils.instantiateClass(this.targetListClass);
+ result = BeanUtils.instantiateClass(this.targetListClass);
}
else {
- result = new ArrayList(this.sourceList.size());
+ result = new ArrayList<Object>(this.sourceList.size());
}
- Class valueType = null;
+ Class<?> valueType = null;
if (this.targetListClass != null) {
valueType = GenericCollectionTypeResolver.getCollectionType(this.targetListClass);
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/MapFactoryBean.java | @@ -32,17 +32,18 @@
* @see SetFactoryBean
* @see ListFactoryBean
*/
-public class MapFactoryBean extends AbstractFactoryBean<Map> {
+public class MapFactoryBean extends AbstractFactoryBean<Map<Object, Object>> {
private Map<?, ?> sourceMap;
- private Class targetMapClass;
+ @SuppressWarnings("rawtypes")
+ private Class<? extends Map> targetMapClass;
/**
* Set the source Map, typically populated via XML "map" elements.
*/
- public void setSourceMap(Map sourceMap) {
+ public void setSourceMap(Map<?, ?> sourceMap) {
this.sourceMap = sourceMap;
}
@@ -52,7 +53,8 @@ public void setSourceMap(Map sourceMap) {
* <p>Default is a linked HashMap, keeping the registration order.
* @see java.util.LinkedHashMap
*/
- public void setTargetMapClass(Class targetMapClass) {
+ @SuppressWarnings("rawtypes")
+ public void setTargetMapClass(Class<? extends Map> targetMapClass) {
if (targetMapClass == null) {
throw new IllegalArgumentException("'targetMapClass' must not be null");
}
@@ -64,32 +66,33 @@ public void setTargetMapClass(Class targetMapClass) {
@Override
+ @SuppressWarnings("rawtypes")
public Class<Map> getObjectType() {
return Map.class;
}
@Override
@SuppressWarnings("unchecked")
- protected Map createInstance() {
+ protected Map<Object, Object> createInstance() {
if (this.sourceMap == null) {
throw new IllegalArgumentException("'sourceMap' is required");
}
- Map result = null;
+ Map<Object, Object> result = null;
if (this.targetMapClass != null) {
- result = (Map) BeanUtils.instantiateClass(this.targetMapClass);
+ result = BeanUtils.instantiateClass(this.targetMapClass);
}
else {
- result = new LinkedHashMap(this.sourceMap.size());
+ result = new LinkedHashMap<Object, Object>(this.sourceMap.size());
}
- Class keyType = null;
- Class valueType = null;
+ Class<?> keyType = null;
+ Class<?> valueType = null;
if (this.targetMapClass != null) {
keyType = GenericCollectionTypeResolver.getMapKeyType(this.targetMapClass);
valueType = GenericCollectionTypeResolver.getMapValueType(this.targetMapClass);
}
if (keyType != null || valueType != null) {
TypeConverter converter = getBeanTypeConverter();
- for (Map.Entry entry : this.sourceMap.entrySet()) {
+ for (Map.Entry<?, ?> entry : this.sourceMap.entrySet()) {
Object convertedKey = converter.convertIfNecessary(entry.getKey(), keyType);
Object convertedValue = converter.convertIfNecessary(entry.getValue(), valueType);
result.put(convertedKey, convertedValue); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java | @@ -121,7 +121,7 @@ public void setBeanClassLoader(ClassLoader classLoader) {
}
@Override
- protected Class resolveClassName(String className) throws ClassNotFoundException {
+ protected Class<?> resolveClassName(String className) throws ClassNotFoundException {
return ClassUtils.forName(className, this.beanClassLoader);
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java | @@ -94,7 +94,7 @@
* @see org.springframework.beans.factory.ObjectFactory
* @see ServiceLocatorFactoryBean
*/
-public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean<ObjectFactory> {
+public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean<ObjectFactory<Object>> {
private String targetBeanName;
@@ -118,12 +118,12 @@ public void afterPropertiesSet() throws Exception {
@Override
- public Class getObjectType() {
+ public Class<?> getObjectType() {
return ObjectFactory.class;
}
@Override
- protected ObjectFactory createInstance() {
+ protected ObjectFactory<Object> createInstance() {
return new TargetBeanObjectFactory(getBeanFactory(), this.targetBeanName);
}
@@ -132,7 +132,7 @@ protected ObjectFactory createInstance() {
* Independent inner class - for serialization purposes.
*/
@SuppressWarnings("serial")
- private static class TargetBeanObjectFactory implements ObjectFactory, Serializable {
+ private static class TargetBeanObjectFactory implements ObjectFactory<Object>, Serializable {
private final BeanFactory beanFactory;
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyOverrideConfigurer.java | @@ -100,7 +100,7 @@ public void setIgnoreInvalidKeys(boolean ignoreInvalidKeys) {
protected void processProperties(ConfigurableListableBeanFactory beanFactory, Properties props)
throws BeansException {
- for (Enumeration names = props.propertyNames(); names.hasMoreElements();) {
+ for (Enumeration<?> names = props.propertyNames(); names.hasMoreElements();) {
String key = (String) names.nextElement();
try {
processKey(beanFactory, key, props.getProperty(key)); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java | @@ -91,7 +91,7 @@ public class PropertyPathFactoryBean implements FactoryBean<Object>, BeanNameAwa
private String propertyPath;
- private Class resultType;
+ private Class<?> resultType;
private String beanName;
@@ -137,7 +137,7 @@ public void setPropertyPath(String propertyPath) {
* provided that you need matching by type (for example, for autowiring).
* @param resultType the result type, for example "java.lang.Integer"
*/
- public void setResultType(Class resultType) {
+ public void setResultType(Class<?> resultType) {
this.resultType = resultType;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/ProviderCreatingFactoryBean.java | @@ -39,7 +39,7 @@
* @see javax.inject.Provider
* @see ObjectFactoryCreatingFactoryBean
*/
-public class ProviderCreatingFactoryBean extends AbstractFactoryBean<Provider> {
+public class ProviderCreatingFactoryBean extends AbstractFactoryBean<Provider<Object>> {
private String targetBeanName;
@@ -63,12 +63,12 @@ public void afterPropertiesSet() throws Exception {
@Override
- public Class getObjectType() {
+ public Class<?> getObjectType() {
return Provider.class;
}
@Override
- protected Provider createInstance() {
+ protected Provider<Object> createInstance() {
return new TargetBeanProvider(getBeanFactory(), this.targetBeanName);
}
@@ -77,7 +77,7 @@ protected Provider createInstance() {
* Independent inner class - for serialization purposes.
*/
@SuppressWarnings("serial")
- private static class TargetBeanProvider implements Provider, Serializable {
+ private static class TargetBeanProvider implements Provider<Object>, Serializable {
private final BeanFactory beanFactory;
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java | @@ -188,9 +188,9 @@
*/
public class ServiceLocatorFactoryBean implements FactoryBean<Object>, BeanFactoryAware, InitializingBean {
- private Class serviceLocatorInterface;
+ private Class<?> serviceLocatorInterface;
- private Constructor serviceLocatorExceptionConstructor;
+ private Constructor<Exception> serviceLocatorExceptionConstructor;
private Properties serviceMappings;
@@ -206,7 +206,7 @@ public class ServiceLocatorFactoryBean implements FactoryBean<Object>, BeanFacto
* See the {@link ServiceLocatorFactoryBean class-level Javadoc} for
* information on the semantics of such methods.
*/
- public void setServiceLocatorInterface(Class interfaceType) {
+ public void setServiceLocatorInterface(Class<?> interfaceType) {
this.serviceLocatorInterface = interfaceType;
}
@@ -222,7 +222,7 @@ public void setServiceLocatorInterface(Class interfaceType) {
* @see #determineServiceLocatorExceptionConstructor
* @see #createServiceLocatorException
*/
- public void setServiceLocatorExceptionClass(Class serviceLocatorExceptionClass) {
+ public void setServiceLocatorExceptionClass(Class<? extends Exception> serviceLocatorExceptionClass) {
if (serviceLocatorExceptionClass != null && !Exception.class.isAssignableFrom(serviceLocatorExceptionClass)) {
throw new IllegalArgumentException(
"serviceLocatorException [" + serviceLocatorExceptionClass.getName() + "] is not a subclass of Exception");
@@ -263,7 +263,7 @@ public void afterPropertiesSet() {
// Create service locator proxy.
this.proxy = Proxy.newProxyInstance(
this.serviceLocatorInterface.getClassLoader(),
- new Class[] {this.serviceLocatorInterface},
+ new Class<?>[] {this.serviceLocatorInterface},
new ServiceLocatorInvocationHandler());
}
@@ -278,17 +278,18 @@ public void afterPropertiesSet() {
* @return the constructor to use
* @see #setServiceLocatorExceptionClass
*/
- protected Constructor determineServiceLocatorExceptionConstructor(Class exceptionClass) {
+ @SuppressWarnings("unchecked")
+ protected Constructor<Exception> determineServiceLocatorExceptionConstructor(Class<? extends Exception> exceptionClass) {
try {
- return exceptionClass.getConstructor(new Class[] {String.class, Throwable.class});
+ return (Constructor<Exception>) exceptionClass.getConstructor(new Class<?>[] {String.class, Throwable.class});
}
catch (NoSuchMethodException ex) {
try {
- return exceptionClass.getConstructor(new Class[] {Throwable.class});
+ return (Constructor<Exception>) exceptionClass.getConstructor(new Class<?>[] {Throwable.class});
}
catch (NoSuchMethodException ex2) {
try {
- return exceptionClass.getConstructor(new Class[] {String.class});
+ return (Constructor<Exception>) exceptionClass.getConstructor(new Class<?>[] {String.class});
}
catch (NoSuchMethodException ex3) {
throw new IllegalArgumentException(
@@ -309,8 +310,8 @@ protected Constructor determineServiceLocatorExceptionConstructor(Class exceptio
* @return the service locator exception to throw
* @see #setServiceLocatorExceptionClass
*/
- protected Exception createServiceLocatorException(Constructor exceptionConstructor, BeansException cause) {
- Class[] paramTypes = exceptionConstructor.getParameterTypes();
+ protected Exception createServiceLocatorException(Constructor<Exception> exceptionConstructor, BeansException cause) {
+ Class<?>[] paramTypes = exceptionConstructor.getParameterTypes();
Object[] args = new Object[paramTypes.length];
for (int i = 0; i < paramTypes.length; i++) {
if (paramTypes[i].equals(String.class)) {
@@ -320,7 +321,7 @@ else if (paramTypes[i].isInstance(cause)) {
args[i] = cause;
}
}
- return (Exception) BeanUtils.instantiateClass(exceptionConstructor, args);
+ return BeanUtils.instantiateClass(exceptionConstructor, args);
}
@@ -363,9 +364,8 @@ else if (ReflectionUtils.isToStringMethod(method)) {
}
}
- @SuppressWarnings("unchecked")
private Object invokeServiceLocatorMethod(Method method, Object[] args) throws Exception {
- Class serviceLocatorMethodReturnType = getServiceLocatorMethodReturnType(method);
+ Class<?> serviceLocatorMethodReturnType = getServiceLocatorMethodReturnType(method);
try {
String beanName = tryGetBeanName(args);
if (StringUtils.hasLength(beanName)) {
@@ -403,10 +403,10 @@ private String tryGetBeanName(Object[] args) {
return beanName;
}
- private Class getServiceLocatorMethodReturnType(Method method) throws NoSuchMethodException {
- Class[] paramTypes = method.getParameterTypes();
+ private Class<?> getServiceLocatorMethodReturnType(Method method) throws NoSuchMethodException {
+ Class<?>[] paramTypes = method.getParameterTypes();
Method interfaceMethod = serviceLocatorInterface.getMethod(method.getName(), paramTypes);
- Class serviceLocatorReturnType = interfaceMethod.getReturnType();
+ Class<?> serviceLocatorReturnType = interfaceMethod.getReturnType();
// Check whether the method is a valid service locator.
if (paramTypes.length > 1 || void.class.equals(serviceLocatorReturnType)) { | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/SetFactoryBean.java | @@ -32,17 +32,18 @@
* @see ListFactoryBean
* @see MapFactoryBean
*/
-public class SetFactoryBean extends AbstractFactoryBean<Set> {
+public class SetFactoryBean extends AbstractFactoryBean<Set<Object>> {
- private Set sourceSet;
+ private Set<?> sourceSet;
- private Class targetSetClass;
+ @SuppressWarnings("rawtypes")
+ private Class<? extends Set> targetSetClass;
/**
* Set the source Set, typically populated via XML "set" elements.
*/
- public void setSourceSet(Set sourceSet) {
+ public void setSourceSet(Set<?> sourceSet) {
this.sourceSet = sourceSet;
}
@@ -52,7 +53,8 @@ public void setSourceSet(Set sourceSet) {
* <p>Default is a linked HashSet, keeping the registration order.
* @see java.util.LinkedHashSet
*/
- public void setTargetSetClass(Class targetSetClass) {
+ @SuppressWarnings("rawtypes")
+ public void setTargetSetClass(Class<? extends Set> targetSetClass) {
if (targetSetClass == null) {
throw new IllegalArgumentException("'targetSetClass' must not be null");
}
@@ -64,24 +66,25 @@ public void setTargetSetClass(Class targetSetClass) {
@Override
+ @SuppressWarnings("rawtypes")
public Class<Set> getObjectType() {
return Set.class;
}
@Override
@SuppressWarnings("unchecked")
- protected Set createInstance() {
+ protected Set<Object> createInstance() {
if (this.sourceSet == null) {
throw new IllegalArgumentException("'sourceSet' is required");
}
- Set result = null;
+ Set<Object> result = null;
if (this.targetSetClass != null) {
- result = (Set) BeanUtils.instantiateClass(this.targetSetClass);
+ result = BeanUtils.instantiateClass(this.targetSetClass);
}
else {
- result = new LinkedHashSet(this.sourceSet.size());
+ result = new LinkedHashSet<Object>(this.sourceSet.size());
}
- Class valueType = null;
+ Class<?> valueType = null;
if (this.targetSetClass != null) {
valueType = GenericCollectionTypeResolver.getCollectionType(this.targetSetClass);
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java | @@ -114,7 +114,7 @@ public Class<?> getTargetType() {
if (!(targetTypeValue instanceof Class)) {
throw new IllegalStateException("Typed String value does not carry a resolved target type");
}
- return (Class) targetTypeValue;
+ return (Class<?>) targetTypeValue;
}
/**
@@ -131,7 +131,7 @@ public void setTargetTypeName(String targetTypeName) {
public String getTargetTypeName() {
Object targetTypeValue = this.targetType;
if (targetTypeValue instanceof Class) {
- return ((Class) targetTypeValue).getName();
+ return ((Class<?>) targetTypeValue).getName();
}
else {
return (String) targetTypeValue; | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java | @@ -40,22 +40,23 @@ public final class ParseState {
/**
* Internal {@link Stack} storage.
*/
- private final Stack state;
+ private final Stack<Entry> state;
/**
* Create a new {@code ParseState} with an empty {@link Stack}.
*/
public ParseState() {
- this.state = new Stack();
+ this.state = new Stack<Entry>();
}
/**
* Create a new {@code ParseState} whose {@link Stack} is a {@link Object#clone clone}
* of that of the passed in {@code ParseState}.
*/
+ @SuppressWarnings("unchecked")
private ParseState(ParseState other) {
- this.state = (Stack) other.state.clone();
+ this.state = (Stack<Entry>) other.state.clone();
}
@@ -78,7 +79,7 @@ public void pop() {
* {@code null} if the {@link Stack} is empty.
*/
public Entry peek() {
- return (Entry) (this.state.empty() ? null : this.state.peek());
+ return this.state.empty() ? null : this.state.peek();
}
/** | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/AbstractServiceLoaderBasedFactoryBean.java | @@ -31,25 +31,25 @@
* @since 2.5
* @see java.util.ServiceLoader
*/
-public abstract class AbstractServiceLoaderBasedFactoryBean extends AbstractFactoryBean
+public abstract class AbstractServiceLoaderBasedFactoryBean extends AbstractFactoryBean<Object>
implements BeanClassLoaderAware {
- private Class serviceType;
+ private Class<?> serviceType;
private ClassLoader beanClassLoader = ClassUtils.getDefaultClassLoader();
/**
* Specify the desired service type (typically the service's public API).
*/
- public void setServiceType(Class serviceType) {
+ public void setServiceType(Class<?> serviceType) {
this.serviceType = serviceType;
}
/**
* Return the desired service type.
*/
- public Class getServiceType() {
+ public Class<?> getServiceType() {
return this.serviceType;
}
@@ -75,6 +75,6 @@ protected Object createInstance() {
* @param serviceLoader the ServiceLoader for the configured service class
* @return the object to expose
*/
- protected abstract Object getObjectToExpose(ServiceLoader serviceLoader);
+ protected abstract Object getObjectToExpose(ServiceLoader<?> serviceLoader);
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceFactoryBean.java | @@ -33,8 +33,8 @@
public class ServiceFactoryBean extends AbstractServiceLoaderBasedFactoryBean implements BeanClassLoaderAware {
@Override
- protected Object getObjectToExpose(ServiceLoader serviceLoader) {
- Iterator it = serviceLoader.iterator();
+ protected Object getObjectToExpose(ServiceLoader<?> serviceLoader) {
+ Iterator<?> it = serviceLoader.iterator();
if (!it.hasNext()) {
throw new IllegalStateException(
"ServiceLoader could not find service for type [" + getServiceType() + "]");
@@ -43,7 +43,7 @@ protected Object getObjectToExpose(ServiceLoader serviceLoader) {
}
@Override
- public Class getObjectType() {
+ public Class<?> getObjectType() {
return getServiceType();
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceListFactoryBean.java | @@ -34,7 +34,7 @@
public class ServiceListFactoryBean extends AbstractServiceLoaderBasedFactoryBean implements BeanClassLoaderAware {
@Override
- protected Object getObjectToExpose(ServiceLoader serviceLoader) {
+ protected Object getObjectToExpose(ServiceLoader<?> serviceLoader) {
List<Object> result = new LinkedList<Object>();
for (Object loaderObject : serviceLoader) {
result.add(loaderObject);
@@ -43,7 +43,7 @@ protected Object getObjectToExpose(ServiceLoader serviceLoader) {
}
@Override
- public Class getObjectType() {
+ public Class<?> getObjectType() {
return List.class;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/serviceloader/ServiceLoaderFactoryBean.java | @@ -31,12 +31,12 @@
public class ServiceLoaderFactoryBean extends AbstractServiceLoaderBasedFactoryBean implements BeanClassLoaderAware {
@Override
- protected Object getObjectToExpose(ServiceLoader serviceLoader) {
+ protected Object getObjectToExpose(ServiceLoader<?> serviceLoader) {
return serviceLoader;
}
@Override
- public Class getObjectType() {
+ public Class<?> getObjectType() {
return ServiceLoader.class;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java | @@ -135,21 +135,21 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* Dependency types to ignore on dependency check and autowire, as Set of
* Class objects: for example, String. Default is none.
*/
- private final Set<Class> ignoredDependencyTypes = new HashSet<Class>();
+ private final Set<Class<?>> ignoredDependencyTypes = new HashSet<Class<?>>();
/**
* Dependency interfaces to ignore on dependency check and autowire, as Set of
* Class objects. By default, only the BeanFactory interface is ignored.
*/
- private final Set<Class> ignoredDependencyInterfaces = new HashSet<Class>();
+ private final Set<Class<?>> ignoredDependencyInterfaces = new HashSet<Class<?>>();
/** Cache of unfinished FactoryBean instances: FactoryBean name --> BeanWrapper */
private final Map<String, BeanWrapper> factoryBeanInstanceCache =
new ConcurrentHashMap<String, BeanWrapper>(16);
/** Cache of filtered PropertyDescriptors: bean Class -> PropertyDescriptor array */
- private final Map<Class, PropertyDescriptor[]> filteredPropertyDescriptorsCache =
- new ConcurrentHashMap<Class, PropertyDescriptor[]>(64);
+ private final Map<Class<?>, PropertyDescriptor[]> filteredPropertyDescriptorsCache =
+ new ConcurrentHashMap<Class<?>, PropertyDescriptor[]>(64);
/**
@@ -523,7 +523,7 @@ protected Object doCreateBean(final String beanName, final RootBeanDefinition mb
logger.debug("Eagerly caching bean '" + beanName +
"' to allow for resolving potential circular references");
}
- addSingletonFactory(beanName, new ObjectFactory() {
+ addSingletonFactory(beanName, new ObjectFactory<Object>() {
@Override
public Object getObject() throws BeansException {
return getEarlyBeanReference(beanName, mbd, bean);
@@ -821,11 +821,12 @@ protected Object getEarlyBeanReference(String beanName, RootBeanDefinition mbd,
* @return the FactoryBean instance, or {@code null} to indicate
* that we couldn't obtain a shortcut FactoryBean instance
*/
- private FactoryBean getSingletonFactoryBeanForTypeCheck(String beanName, RootBeanDefinition mbd) {
+ @SuppressWarnings("unchecked")
+ private FactoryBean<Object> getSingletonFactoryBeanForTypeCheck(String beanName, RootBeanDefinition mbd) {
synchronized (getSingletonMutex()) {
BeanWrapper bw = this.factoryBeanInstanceCache.get(beanName);
if (bw != null) {
- return (FactoryBean) bw.getWrappedInstance();
+ return (FactoryBean<Object>) bw.getWrappedInstance();
}
if (isSingletonCurrentlyInCreation(beanName)) {
return null;
@@ -845,7 +846,7 @@ private FactoryBean getSingletonFactoryBeanForTypeCheck(String beanName, RootBea
// Finished partial creation of this bean.
afterSingletonCreation(beanName);
}
- FactoryBean fb = getFactoryBean(beanName, instance);
+ FactoryBean<Object> fb = getFactoryBean(beanName, instance);
if (bw != null) {
this.factoryBeanInstanceCache.put(beanName, bw);
}
@@ -862,7 +863,7 @@ private FactoryBean getSingletonFactoryBeanForTypeCheck(String beanName, RootBea
* @return the FactoryBean instance, or {@code null} to indicate
* that we couldn't obtain a shortcut FactoryBean instance
*/
- private FactoryBean getNonSingletonFactoryBeanForTypeCheck(String beanName, RootBeanDefinition mbd) {
+ private FactoryBean<Object> getNonSingletonFactoryBeanForTypeCheck(String beanName, RootBeanDefinition mbd) {
if (isPrototypeCurrentlyInCreation(beanName)) {
return null;
}
@@ -1005,7 +1006,7 @@ protected BeanWrapper createBeanInstance(String beanName, RootBeanDefinition mbd
}
// Need to determine the constructor...
- Constructor[] ctors = determineConstructorsFromBeanPostProcessors(beanClass, beanName);
+ Constructor<?>[] ctors = determineConstructorsFromBeanPostProcessors(beanClass, beanName);
if (ctors != null ||
mbd.getResolvedAutowireMode() == RootBeanDefinition.AUTOWIRE_CONSTRUCTOR ||
mbd.hasConstructorArgumentValues() || !ObjectUtils.isEmpty(args)) {
@@ -1025,14 +1026,14 @@ protected BeanWrapper createBeanInstance(String beanName, RootBeanDefinition mbd
* @throws org.springframework.beans.BeansException in case of errors
* @see org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor#determineCandidateConstructors
*/
- protected Constructor[] determineConstructorsFromBeanPostProcessors(Class<?> beanClass, String beanName)
+ protected Constructor<?>[] determineConstructorsFromBeanPostProcessors(Class<?> beanClass, String beanName)
throws BeansException {
if (beanClass != null && hasInstantiationAwareBeanPostProcessors()) {
for (BeanPostProcessor bp : getBeanPostProcessors()) {
if (bp instanceof SmartInstantiationAwareBeanPostProcessor) {
SmartInstantiationAwareBeanPostProcessor ibp = (SmartInstantiationAwareBeanPostProcessor) bp;
- Constructor[] ctors = ibp.determineCandidateConstructors(beanClass, beanName);
+ Constructor<?>[] ctors = ibp.determineCandidateConstructors(beanClass, beanName);
if (ctors != null) {
return ctors;
}
@@ -1104,7 +1105,7 @@ protected BeanWrapper instantiateUsingFactoryMethod(
* @return BeanWrapper for the new instance
*/
protected BeanWrapper autowireConstructor(
- String beanName, RootBeanDefinition mbd, Constructor[] ctors, Object[] explicitArgs) {
+ String beanName, RootBeanDefinition mbd, Constructor<?>[] ctors, Object[] explicitArgs) {
return new ConstructorResolver(this).autowireConstructor(beanName, mbd, ctors, explicitArgs);
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java | @@ -357,7 +357,7 @@ public Class<?> getBeanClass() throws IllegalStateException {
throw new IllegalStateException(
"Bean class name [" + beanClassObject + "] has not been resolved into an actual Class");
}
- return (Class) beanClassObject;
+ return (Class<?>) beanClassObject;
}
@Override
@@ -369,7 +369,7 @@ public void setBeanClassName(String beanClassName) {
public String getBeanClassName() {
Object beanClassObject = this.beanClass;
if (beanClassObject instanceof Class) {
- return ((Class) beanClassObject).getName();
+ return ((Class<?>) beanClassObject).getName();
}
else {
return (String) beanClassObject;
@@ -384,12 +384,12 @@ public String getBeanClassName() {
* @return the resolved bean class
* @throws ClassNotFoundException if the class name could be resolved
*/
- public Class resolveBeanClass(ClassLoader classLoader) throws ClassNotFoundException {
+ public Class<?> resolveBeanClass(ClassLoader classLoader) throws ClassNotFoundException {
String className = getBeanClassName();
if (className == null) {
return null;
}
- Class resolvedClass = ClassUtils.forName(className, classLoader);
+ Class<?> resolvedClass = ClassUtils.forName(className, classLoader);
this.beanClass = resolvedClass;
return resolvedClass;
}
@@ -512,8 +512,8 @@ public int getResolvedAutowireMode() {
// Work out whether to apply setter autowiring or constructor autowiring.
// If it has a no-arg constructor it's deemed to be setter autowiring,
// otherwise we'll try constructor autowiring.
- Constructor[] constructors = getBeanClass().getConstructors();
- for (Constructor constructor : constructors) {
+ Constructor<?>[] constructors = getBeanClass().getConstructors();
+ for (Constructor<?> constructor : constructors) {
if (constructor.getParameterTypes().length == 0) {
return AUTOWIRE_BY_TYPE;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java | @@ -513,8 +513,8 @@ else if (containsSingleton(beanName) && !containsBeanDefinition(beanName)) {
// Retrieve corresponding bean definition.
RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName);
- Class[] typesToMatch = (FactoryBean.class.equals(typeToMatch) ?
- new Class[] {typeToMatch} : new Class[] {FactoryBean.class, typeToMatch});
+ Class<?>[] typesToMatch = (FactoryBean.class.equals(typeToMatch) ?
+ new Class<?>[] {typeToMatch} : new Class<?>[] {FactoryBean.class, typeToMatch});
// Check decorated bean definition, if any: We assume it'll be easier
// to determine the decorated bean's type than the proxy's type. | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.java | @@ -42,7 +42,7 @@ public class AutowireCandidateQualifier extends BeanMetadataAttributeAccessor {
* given type.
* @param type the annotation type
*/
- public AutowireCandidateQualifier(Class type) {
+ public AutowireCandidateQualifier(Class<?> type) {
this(type.getName());
}
@@ -65,7 +65,7 @@ public AutowireCandidateQualifier(String typeName) {
* @param type the annotation type
* @param value the annotation value to match
*/
- public AutowireCandidateQualifier(Class type, Object value) {
+ public AutowireCandidateQualifier(Class<?> type, Object value) {
this(type.getName(), value);
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java | @@ -56,10 +56,10 @@ abstract class AutowireUtils {
* decreasing number of arguments.
* @param constructors the constructor array to sort
*/
- public static void sortConstructors(Constructor[] constructors) {
- Arrays.sort(constructors, new Comparator<Constructor>() {
+ public static void sortConstructors(Constructor<?>[] constructors) {
+ Arrays.sort(constructors, new Comparator<Constructor<?>>() {
@Override
- public int compare(Constructor c1, Constructor c2) {
+ public int compare(Constructor<?> c1, Constructor<?> c2) {
boolean p1 = Modifier.isPublic(c1.getModifiers());
boolean p2 = Modifier.isPublic(c2.getModifiers());
if (p1 != p2) {
@@ -112,7 +112,7 @@ public static boolean isExcludedFromDependencyCheck(PropertyDescriptor pd) {
}
// It was declared by CGLIB, but we might still want to autowire it
// if it was actually declared by the superclass.
- Class superclass = wm.getDeclaringClass().getSuperclass();
+ Class<?> superclass = wm.getDeclaringClass().getSuperclass();
return !ClassUtils.hasMethod(superclass, wm.getName(), wm.getParameterTypes());
}
@@ -123,7 +123,7 @@ public static boolean isExcludedFromDependencyCheck(PropertyDescriptor pd) {
* @param interfaces the Set of interfaces (Class objects)
* @return whether the setter method is defined by an interface
*/
- public static boolean isSetterDefinedInInterface(PropertyDescriptor pd, Set<Class> interfaces) {
+ public static boolean isSetterDefinedInInterface(PropertyDescriptor pd, Set<Class<?>> interfaces) {
Method setter = pd.getWriteMethod();
if (setter != null) {
Class<?> targetClass = setter.getDeclaringClass();
@@ -146,10 +146,10 @@ public static boolean isSetterDefinedInInterface(PropertyDescriptor pd, Set<Clas
*/
public static Object resolveAutowiringValue(Object autowiringValue, Class<?> requiredType) {
if (autowiringValue instanceof ObjectFactory && !requiredType.isInstance(autowiringValue)) {
- ObjectFactory factory = (ObjectFactory) autowiringValue;
+ ObjectFactory<?> factory = (ObjectFactory<?>) autowiringValue;
if (autowiringValue instanceof Serializable && requiredType.isInterface()) {
autowiringValue = Proxy.newProxyInstance(requiredType.getClassLoader(),
- new Class[] {requiredType}, new ObjectFactoryDelegatingInvocationHandler(factory));
+ new Class<?>[] {requiredType}, new ObjectFactoryDelegatingInvocationHandler(factory));
}
else {
return factory.getObject();
@@ -283,9 +283,9 @@ else if (arg instanceof TypedStringValue) {
@SuppressWarnings("serial")
private static class ObjectFactoryDelegatingInvocationHandler implements InvocationHandler, Serializable {
- private final ObjectFactory objectFactory;
+ private final ObjectFactory<?> objectFactory;
- public ObjectFactoryDelegatingInvocationHandler(ObjectFactory objectFactory) {
+ public ObjectFactoryDelegatingInvocationHandler(ObjectFactory<?> objectFactory) {
this.objectFactory = objectFactory;
}
| true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java | @@ -45,7 +45,7 @@ public static BeanDefinitionBuilder genericBeanDefinition() {
* Create a new {@code BeanDefinitionBuilder} used to construct a {@link GenericBeanDefinition}.
* @param beanClass the {@code Class} of the bean that the definition is being created for
*/
- public static BeanDefinitionBuilder genericBeanDefinition(Class beanClass) {
+ public static BeanDefinitionBuilder genericBeanDefinition(Class<?> beanClass) {
BeanDefinitionBuilder builder = new BeanDefinitionBuilder();
builder.beanDefinition = new GenericBeanDefinition();
builder.beanDefinition.setBeanClass(beanClass);
@@ -67,7 +67,7 @@ public static BeanDefinitionBuilder genericBeanDefinition(String beanClassName)
* Create a new {@code BeanDefinitionBuilder} used to construct a {@link RootBeanDefinition}.
* @param beanClass the {@code Class} of the bean that the definition is being created for
*/
- public static BeanDefinitionBuilder rootBeanDefinition(Class beanClass) {
+ public static BeanDefinitionBuilder rootBeanDefinition(Class<?> beanClass) {
return rootBeanDefinition(beanClass, null);
}
@@ -76,7 +76,7 @@ public static BeanDefinitionBuilder rootBeanDefinition(Class beanClass) {
* @param beanClass the {@code Class} of the bean that the definition is being created for
* @param factoryMethodName the name of the method to use to construct the bean instance
*/
- public static BeanDefinitionBuilder rootBeanDefinition(Class beanClass, String factoryMethodName) {
+ public static BeanDefinitionBuilder rootBeanDefinition(Class<?> beanClass, String factoryMethodName) {
BeanDefinitionBuilder builder = new BeanDefinitionBuilder();
builder.beanDefinition = new RootBeanDefinition();
builder.beanDefinition.setBeanClass(beanClass); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java | @@ -164,7 +164,7 @@ else if (value instanceof ManagedMap) {
else if (value instanceof ManagedProperties) {
Properties original = (Properties) value;
Properties copy = new Properties();
- for (Map.Entry propEntry : original.entrySet()) {
+ for (Map.Entry<Object, Object> propEntry : original.entrySet()) {
Object propKey = propEntry.getKey();
Object propValue = propEntry.getValue();
if (propKey instanceof TypedStringValue) {
@@ -272,7 +272,7 @@ private Object resolveInnerBean(Object argName, String innerBeanName, BeanDefini
this.beanFactory.registerContainedBean(actualInnerBeanName, this.beanName);
if (innerBean instanceof FactoryBean) {
boolean synthetic = mbd.isSynthetic();
- return this.beanFactory.getObjectFromFactoryBean((FactoryBean) innerBean, actualInnerBeanName, !synthetic);
+ return this.beanFactory.getObjectFromFactoryBean((FactoryBean<?>) innerBean, actualInnerBeanName, !synthetic);
}
else {
return innerBean;
@@ -347,7 +347,7 @@ private Object resolveManagedArray(Object argName, List<?> ml, Class<?> elementT
/**
* For each element in the managed list, resolve reference if necessary.
*/
- private List resolveManagedList(Object argName, List<?> ml) {
+ private List<?> resolveManagedList(Object argName, List<?> ml) {
List<Object> resolved = new ArrayList<Object>(ml.size());
for (int i = 0; i < ml.size(); i++) {
resolved.add(
@@ -359,7 +359,7 @@ private List resolveManagedList(Object argName, List<?> ml) {
/**
* For each element in the managed set, resolve reference if necessary.
*/
- private Set resolveManagedSet(Object argName, Set<?> ms) {
+ private Set<?> resolveManagedSet(Object argName, Set<?> ms) {
Set<Object> resolved = new LinkedHashSet<Object>(ms.size());
int i = 0;
for (Object m : ms) {
@@ -372,9 +372,9 @@ private Set resolveManagedSet(Object argName, Set<?> ms) {
/**
* For each element in the managed map, resolve reference if necessary.
*/
- private Map resolveManagedMap(Object argName, Map<?, ?> mm) {
+ private Map<?, ?> resolveManagedMap(Object argName, Map<?, ?> mm) {
Map<Object, Object> resolved = new LinkedHashMap<Object, Object>(mm.size());
- for (Map.Entry entry : mm.entrySet()) {
+ for (Map.Entry<?, ?> entry : mm.entrySet()) {
Object resolvedKey = resolveValueIfNecessary(argName, entry.getKey());
Object resolvedValue = resolveValueIfNecessary(
new KeyedArgName(argName, entry.getKey()), entry.getValue()); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/CglibSubclassingInstantiationStrategy.java | @@ -72,7 +72,7 @@ protected Object instantiateWithMethodInjection(
@Override
protected Object instantiateWithMethodInjection(
RootBeanDefinition beanDefinition, String beanName, BeanFactory owner,
- Constructor ctor, Object[] args) {
+ Constructor<?> ctor, Object[] args) {
return new CglibSubclassCreator(beanDefinition, owner).instantiate(ctor, args);
}
@@ -104,7 +104,7 @@ public CglibSubclassCreator(RootBeanDefinition beanDefinition, BeanFactory owner
* Ignored if the ctor parameter is {@code null}.
* @return new instance of the dynamically generated class
*/
- public Object instantiate(Constructor ctor, Object[] args) {
+ public Object instantiate(Constructor<?> ctor, Object[] args) {
Enhancer enhancer = new Enhancer();
enhancer.setSuperclass(this.beanDefinition.getBeanClass());
enhancer.setCallbackFilter(new CallbackFilterImpl()); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java | @@ -103,12 +103,12 @@ public ConstructorResolver(AbstractAutowireCapableBeanFactory beanFactory) {
* @return a BeanWrapper for the new instance
*/
public BeanWrapper autowireConstructor(
- final String beanName, final RootBeanDefinition mbd, Constructor[] chosenCtors, final Object[] explicitArgs) {
+ final String beanName, final RootBeanDefinition mbd, Constructor<?>[] chosenCtors, final Object[] explicitArgs) {
BeanWrapperImpl bw = new BeanWrapperImpl();
this.beanFactory.initBeanWrapper(bw);
- Constructor constructorToUse = null;
+ Constructor<?> constructorToUse = null;
ArgumentsHolder argsHolderToUse = null;
Object[] argsToUse = null;
@@ -118,7 +118,7 @@ public BeanWrapper autowireConstructor(
else {
Object[] argsToResolve = null;
synchronized (mbd.constructorArgumentLock) {
- constructorToUse = (Constructor) mbd.resolvedConstructorOrFactoryMethod;
+ constructorToUse = (Constructor<?>) mbd.resolvedConstructorOrFactoryMethod;
if (constructorToUse != null && mbd.constructorArgumentsResolved) {
// Found a cached constructor...
argsToUse = mbd.resolvedConstructorArguments;
@@ -149,7 +149,7 @@ public BeanWrapper autowireConstructor(
}
// Take specified constructors, if any.
- Constructor[] candidates = chosenCtors;
+ Constructor<?>[] candidates = chosenCtors;
if (candidates == null) {
Class<?> beanClass = mbd.getBeanClass();
try {
@@ -164,7 +164,7 @@ public BeanWrapper autowireConstructor(
}
AutowireUtils.sortConstructors(candidates);
int minTypeDiffWeight = Integer.MAX_VALUE;
- Set<Constructor> ambiguousConstructors = null;
+ Set<Constructor<?>> ambiguousConstructors = null;
List<Exception> causes = null;
for (int i = 0; i < candidates.length; i++) {
@@ -239,7 +239,7 @@ public BeanWrapper autowireConstructor(
}
else if (constructorToUse != null && typeDiffWeight == minTypeDiffWeight) {
if (ambiguousConstructors == null) {
- ambiguousConstructors = new LinkedHashSet<Constructor>();
+ ambiguousConstructors = new LinkedHashSet<Constructor<?>>();
ambiguousConstructors.add(constructorToUse);
}
ambiguousConstructors.add(candidate);
@@ -267,7 +267,7 @@ else if (ambiguousConstructors != null && !mbd.isLenientConstructorResolution())
Object beanInstance;
if (System.getSecurityManager() != null) {
- final Constructor ctorToUse = constructorToUse;
+ final Constructor<?> ctorToUse = constructorToUse;
final Object[] argumentsToUse = argsToUse;
beanInstance = AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
@@ -296,7 +296,7 @@ public Object run() {
* @param mbd the bean definition to check
*/
public void resolveFactoryMethodIfPossible(RootBeanDefinition mbd) {
- Class factoryClass;
+ Class<?> factoryClass;
if (mbd.getFactoryBeanName() != null) {
factoryClass = this.beanFactory.getType(mbd.getFactoryBeanName());
}
@@ -762,7 +762,7 @@ private Object[] resolvePreparedArguments(
String beanName, RootBeanDefinition mbd, BeanWrapper bw, Member methodOrCtor, Object[] argsToResolve) {
Class<?>[] paramTypes = (methodOrCtor instanceof Method ?
- ((Method) methodOrCtor).getParameterTypes() : ((Constructor) methodOrCtor).getParameterTypes());
+ ((Method) methodOrCtor).getParameterTypes() : ((Constructor<?>) methodOrCtor).getParameterTypes());
TypeConverter converter = (this.beanFactory.getCustomTypeConverter() != null ?
this.beanFactory.getCustomTypeConverter() : bw);
BeanDefinitionValueResolver valueResolver = | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java | @@ -128,7 +128,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
private boolean allowEagerClassLoading = true;
/** Optional OrderComparator for dependency Lists and arrays */
- private Comparator dependencyComparator;
+ private Comparator<Object> dependencyComparator;
/** Resolver to use for checking if a bean definition is an autowire candidate */
private AutowireCandidateResolver autowireCandidateResolver = new SimpleAutowireCandidateResolver();
@@ -215,14 +215,14 @@ public void setAllowEagerClassLoading(boolean allowEagerClassLoading) {
* @see org.springframework.core.OrderComparator
* @see org.springframework.core.annotation.AnnotationAwareOrderComparator
*/
- public void setDependencyComparator(Comparator dependencyComparator) {
+ public void setDependencyComparator(Comparator<Object> dependencyComparator) {
this.dependencyComparator = dependencyComparator;
}
/**
* Return the dependency comparator for this BeanFactory (may be {@code null}.
*/
- public Comparator getDependencyComparator() {
+ public Comparator<Object> getDependencyComparator() {
return this.dependencyComparator;
}
@@ -898,7 +898,7 @@ else if (Collection.class.isAssignableFrom(type) && type.isInterface()) {
TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
Object result = converter.convertIfNecessary(matchingBeans.values(), type);
if (this.dependencyComparator != null && result instanceof List) {
- Collections.sort((List) result, this.dependencyComparator);
+ Collections.sort((List<?>) result, this.dependencyComparator);
}
return result;
} | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java | @@ -85,7 +85,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
private final Map<String, Object> singletonObjects = new ConcurrentHashMap<String, Object>(64);
/** Cache of singleton factories: bean name --> ObjectFactory */
- private final Map<String, ObjectFactory> singletonFactories = new HashMap<String, ObjectFactory>(16);
+ private final Map<String, ObjectFactory<?>> singletonFactories = new HashMap<String, ObjectFactory<?>>(16);
/** Cache of early singleton objects: bean name --> bean instance */
private final Map<String, Object> earlySingletonObjects = new HashMap<String, Object>(16);
@@ -156,7 +156,7 @@ protected void addSingleton(String beanName, Object singletonObject) {
* @param beanName the name of the bean
* @param singletonFactory the factory for the singleton object
*/
- protected void addSingletonFactory(String beanName, ObjectFactory singletonFactory) {
+ protected void addSingletonFactory(String beanName, ObjectFactory<?> singletonFactory) {
Assert.notNull(singletonFactory, "Singleton factory must not be null");
synchronized (this.singletonObjects) {
if (!this.singletonObjects.containsKey(beanName)) {
@@ -186,7 +186,7 @@ protected Object getSingleton(String beanName, boolean allowEarlyReference) {
synchronized (this.singletonObjects) {
singletonObject = this.earlySingletonObjects.get(beanName);
if (singletonObject == null && allowEarlyReference) {
- ObjectFactory singletonFactory = this.singletonFactories.get(beanName);
+ ObjectFactory<?> singletonFactory = this.singletonFactories.get(beanName);
if (singletonFactory != null) {
singletonObject = singletonFactory.getObject();
this.earlySingletonObjects.put(beanName, singletonObject);
@@ -206,7 +206,7 @@ protected Object getSingleton(String beanName, boolean allowEarlyReference) {
* with, if necessary
* @return the registered singleton object
*/
- public Object getSingleton(String beanName, ObjectFactory singletonFactory) {
+ public Object getSingleton(String beanName, ObjectFactory<?> singletonFactory) {
Assert.notNull(beanName, "'beanName' must not be null");
synchronized (this.singletonObjects) {
Object singletonObject = this.singletonObjects.get(beanName); | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java | @@ -65,7 +65,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
private static final Log logger = LogFactory.getLog(DisposableBeanAdapter.class);
- private static Class closeableInterface;
+ private static Class<?> closeableInterface;
static {
try { | true |
Other | spring-projects | spring-framework | 59002f245623d758765b72d598cd78c326c6f5fa.json | Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.
Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.
Issue: SPR-11064 | spring-beans/src/main/java/org/springframework/beans/factory/support/FactoryBeanRegistrySupport.java | @@ -52,12 +52,12 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
* @return the FactoryBean's object type,
* or {@code null} if the type cannot be determined yet
*/
- protected Class getTypeForFactoryBean(final FactoryBean factoryBean) {
+ protected Class<?> getTypeForFactoryBean(final FactoryBean<?> factoryBean) {
try {
if (System.getSecurityManager() != null) {
- return AccessController.doPrivileged(new PrivilegedAction<Class>() {
+ return AccessController.doPrivileged(new PrivilegedAction<Class<?>>() {
@Override
- public Class run() {
+ public Class<?> run() {
return factoryBean.getObjectType();
}
}, getAccessControlContext());
@@ -95,7 +95,7 @@ protected Object getCachedObjectForFactoryBean(String beanName) {
* @throws BeanCreationException if FactoryBean object creation failed
* @see org.springframework.beans.factory.FactoryBean#getObject()
*/
- protected Object getObjectFromFactoryBean(FactoryBean factory, String beanName, boolean shouldPostProcess) {
+ protected Object getObjectFromFactoryBean(FactoryBean<?> factory, String beanName, boolean shouldPostProcess) {
if (factory.isSingleton() && containsSingleton(beanName)) {
synchronized (getSingletonMutex()) {
Object object = this.factoryBeanObjectCache.get(beanName);
@@ -121,7 +121,7 @@ protected Object getObjectFromFactoryBean(FactoryBean factory, String beanName,
* @see org.springframework.beans.factory.FactoryBean#getObject()
*/
private Object doGetObjectFromFactoryBean(
- final FactoryBean factory, final String beanName, final boolean shouldPostProcess)
+ final FactoryBean<?> factory, final String beanName, final boolean shouldPostProcess)
throws BeanCreationException {
Object object;
@@ -192,12 +192,13 @@ protected Object postProcessObjectFromFactoryBean(Object object, String beanName
* @return the bean instance as FactoryBean
* @throws BeansException if the given bean cannot be exposed as a FactoryBean
*/
- protected FactoryBean getFactoryBean(String beanName, Object beanInstance) throws BeansException {
+ @SuppressWarnings("unchecked")
+ protected FactoryBean<Object> getFactoryBean(String beanName, Object beanInstance) throws BeansException {
if (!(beanInstance instanceof FactoryBean)) {
throw new BeanCreationException(beanName,
"Bean instance of type [" + beanInstance.getClass() + "] is not a FactoryBean");
}
- return (FactoryBean) beanInstance;
+ return (FactoryBean<Object>) beanInstance;
}
/** | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.