Browse Source

Merge pull request #34 from marschall/warnings

* warnings:
  Fix compiler warnings
pull/34/merge
Chris Beams 14 years ago
parent
commit
f667db56b1
  1. 4
      spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactory.java
  2. 5
      spring-beans/src/main/java/org/springframework/beans/factory/config/DestructionAwareAttributeHolder.java
  3. 3
      spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java
  4. 3
      spring-context/src/main/java/org/springframework/context/event/SourceFilteringListener.java
  5. 5
      spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassLoaderAdapter.java
  6. 4
      spring-context/src/test/java/org/springframework/context/support/TestProxyFactoryBean.java
  7. 3
      spring-core/src/main/java/org/springframework/core/LocalVariableTableParameterNameDiscoverer.java
  8. 1
      spring-core/src/main/java/org/springframework/core/MethodParameter.java
  9. 3
      spring-jdbc/src/main/java/org/springframework/jdbc/core/ColumnMapRowMapper.java
  10. 3
      spring-web/src/main/java/org/springframework/web/context/request/ServletRequestAttributes.java
  11. 8
      spring-web/src/main/java/org/springframework/web/context/request/ServletWebRequest.java

4
spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactory.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -93,7 +93,6 @@ public class ProxyFactory extends ProxyCreatorSupport { @@ -93,7 +93,6 @@ public class ProxyFactory extends ProxyCreatorSupport {
* (if necessary for proxy creation).
* @return the proxy object
*/
@SuppressWarnings("unchecked")
public Object getProxy() {
return createAopProxy().getProxy();
}
@ -107,7 +106,6 @@ public class ProxyFactory extends ProxyCreatorSupport { @@ -107,7 +106,6 @@ public class ProxyFactory extends ProxyCreatorSupport {
* (or <code>null</code> for the low-level proxy facility's default)
* @return the proxy object
*/
@SuppressWarnings("unchecked")
public Object getProxy(ClassLoader classLoader) {
return createAopProxy().getProxy(classLoader);
}

5
spring-beans/src/main/java/org/springframework/beans/factory/config/DestructionAwareAttributeHolder.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -59,7 +59,6 @@ public class DestructionAwareAttributeHolder implements Serializable { @@ -59,7 +59,6 @@ public class DestructionAwareAttributeHolder implements Serializable {
* the name of the attribute to be returned
* @return the attribute value or <code>null</code> if not available
*/
@SuppressWarnings("unchecked")
public Object getAttribute(String name) {
return attributes.get(name);
}
@ -75,7 +74,6 @@ public class DestructionAwareAttributeHolder implements Serializable { @@ -75,7 +74,6 @@ public class DestructionAwareAttributeHolder implements Serializable {
* @return any previously object stored under the same name, if any,
* <code>null</code> otherwise
*/
@SuppressWarnings("unchecked")
public Object setAttribute(String name, Object value) {
return attributes.put(name, value);
}
@ -101,7 +99,6 @@ public class DestructionAwareAttributeHolder implements Serializable { @@ -101,7 +99,6 @@ public class DestructionAwareAttributeHolder implements Serializable {
* @return the removed object, or <code>null</code> if no object was present
* @see #registerDestructionCallback
*/
@SuppressWarnings("unchecked")
public Object removeAttribute(String name) {
Object value = attributes.remove(name);

3
spring-context-support/src/main/java/org/springframework/scheduling/quartz/JobDetailFactoryBean.java

@ -168,7 +168,6 @@ public class JobDetailFactoryBean @@ -168,7 +168,6 @@ public class JobDetailFactoryBean
}
@SuppressWarnings("unchecked")
public void afterPropertiesSet() {
if (this.name == null) {
this.name = this.beanName;
@ -196,7 +195,7 @@ public class JobDetailFactoryBean @@ -196,7 +195,7 @@ public class JobDetailFactoryBean
this.jobDetail = jdi;
*/
Class jobDetailClass;
Class<?> jobDetailClass;
try {
jobDetailClass = getClass().getClassLoader().loadClass("org.quartz.impl.JobDetailImpl");
}

3
spring-context/src/main/java/org/springframework/context/event/SourceFilteringListener.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -88,7 +88,6 @@ public class SourceFilteringListener implements SmartApplicationListener { @@ -88,7 +88,6 @@ public class SourceFilteringListener implements SmartApplicationListener {
* <p>The default implementation invokes the specified delegate, if any.
* @param event the event to process (matching the specified source)
*/
@SuppressWarnings("unchecked")
protected void onApplicationEventInternal(ApplicationEvent event) {
if (this.delegate == null) {
throw new IllegalStateException(

5
spring-context/src/main/java/org/springframework/instrument/classloading/websphere/WebSphereClassLoaderAdapter.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -91,12 +91,11 @@ class WebSphereClassLoaderAdapter { @@ -91,12 +91,11 @@ class WebSphereClassLoaderAdapter {
}
}
@SuppressWarnings("unchecked")
public ClassLoader getThrowawayClassLoader() {
try {
ClassLoader loader = (ClassLoader) cloneConstructor.newInstance(getClassLoader());
// clear out the transformers (copied as well)
List list = (List) transformerList.get(loader);
List<?> list = (List<?>) transformerList.get(loader);
list.clear();
return loader;
}

4
spring-context/src/test/java/org/springframework/context/support/TestProxyFactoryBean.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -20,7 +20,7 @@ import org.springframework.aop.framework.AbstractSingletonProxyFactoryBean; @@ -20,7 +20,7 @@ import org.springframework.aop.framework.AbstractSingletonProxyFactoryBean;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
@SuppressWarnings({ "serial", "deprecation" })
@SuppressWarnings("serial")
public class TestProxyFactoryBean extends AbstractSingletonProxyFactoryBean implements BeanFactoryAware {
@Override

3
spring-core/src/main/java/org/springframework/core/LocalVariableTableParameterNameDiscoverer.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -77,7 +77,6 @@ public class LocalVariableTableParameterNameDiscoverer implements ParameterNameD @@ -77,7 +77,6 @@ public class LocalVariableTableParameterNameDiscoverer implements ParameterNameD
return null;
}
@SuppressWarnings("unchecked")
public String[] getParameterNames(Constructor ctor) {
Class<?> declaringClass = ctor.getDeclaringClass();
Map<Member, String[]> map = this.parameterNamesCache.get(declaringClass);

1
spring-core/src/main/java/org/springframework/core/MethodParameter.java

@ -281,7 +281,6 @@ public class MethodParameter { @@ -281,7 +281,6 @@ public class MethodParameter {
* @param annotationType the annotation type to look for
* @return the annotation object, or <code>null</code> if not found
*/
@SuppressWarnings("unchecked")
public <T extends Annotation> T getMethodAnnotation(Class<T> annotationType) {
return getAnnotatedElement().getAnnotation(annotationType);
}

3
spring-jdbc/src/main/java/org/springframework/jdbc/core/ColumnMapRowMapper.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -67,7 +67,6 @@ public class ColumnMapRowMapper implements RowMapper<Map<String, Object>> { @@ -67,7 +67,6 @@ public class ColumnMapRowMapper implements RowMapper<Map<String, Object>> {
* @return the new Map instance
* @see org.springframework.util.LinkedCaseInsensitiveMap
*/
@SuppressWarnings("unchecked")
protected Map<String, Object> createColumnMap(int columnCount) {
return new LinkedCaseInsensitiveMap<Object>(columnCount);
}

3
spring-web/src/main/java/org/springframework/web/context/request/ServletRequestAttributes.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -159,7 +159,6 @@ public class ServletRequestAttributes extends AbstractRequestAttributes { @@ -159,7 +159,6 @@ public class ServletRequestAttributes extends AbstractRequestAttributes {
}
}
@SuppressWarnings("unchecked")
public String[] getAttributeNames(int scope) {
if (scope == SCOPE_REQUEST) {
if (!isRequestActive()) {

8
spring-web/src/main/java/org/springframework/web/context/request/ServletWebRequest.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -87,12 +87,10 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ @@ -87,12 +87,10 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ
return getResponse();
}
@SuppressWarnings("unchecked")
public <T> T getNativeRequest(Class<T> requiredType) {
return WebUtils.getNativeRequest(getRequest(), requiredType);
}
@SuppressWarnings("unchecked")
public <T> T getNativeResponse(Class<T> requiredType) {
return WebUtils.getNativeResponse(getResponse(), requiredType);
}
@ -102,13 +100,11 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ @@ -102,13 +100,11 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ
return getRequest().getHeader(headerName);
}
@SuppressWarnings("unchecked")
public String[] getHeaderValues(String headerName) {
String[] headerValues = StringUtils.toStringArray(getRequest().getHeaders(headerName));
return (!ObjectUtils.isEmpty(headerValues) ? headerValues : null);
}
@SuppressWarnings("unchecked")
public Iterator<String> getHeaderNames() {
return CollectionUtils.toIterator(getRequest().getHeaderNames());
}
@ -121,12 +117,10 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ @@ -121,12 +117,10 @@ public class ServletWebRequest extends ServletRequestAttributes implements Nativ
return getRequest().getParameterValues(paramName);
}
@SuppressWarnings("unchecked")
public Iterator<String> getParameterNames() {
return CollectionUtils.toIterator(getRequest().getParameterNames());
}
@SuppressWarnings("unchecked")
public Map<String, String[]> getParameterMap() {
return getRequest().getParameterMap();
}

Loading…
Cancel
Save