fixed TypeDescriptor toString for MethodParameter annotations (SPR-6924)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2010 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.
|
||||
@@ -230,7 +230,12 @@ public class MethodParameter {
|
||||
if (this.parameterAnnotations == null) {
|
||||
Annotation[][] annotationArray = (this.method != null ?
|
||||
this.method.getParameterAnnotations() : this.constructor.getParameterAnnotations());
|
||||
this.parameterAnnotations = annotationArray[this.parameterIndex];
|
||||
if (this.parameterIndex >= 0 && this.parameterIndex < annotationArray.length) {
|
||||
this.parameterAnnotations = annotationArray[this.parameterIndex];
|
||||
}
|
||||
else {
|
||||
this.parameterAnnotations = new Annotation[0];
|
||||
}
|
||||
}
|
||||
return this.parameterAnnotations;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import java.util.Set;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.core.GenericTypeResolver;
|
||||
import org.springframework.core.convert.ConversionFailedException;
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
@@ -38,7 +39,6 @@ import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.core.convert.converter.ConverterFactory;
|
||||
import org.springframework.core.convert.converter.ConverterRegistry;
|
||||
import org.springframework.core.convert.converter.GenericConverter;
|
||||
import org.springframework.core.style.StylerUtils;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
|
||||
@@ -122,7 +122,7 @@ public class GenericConversionService implements ConversionService, ConverterReg
|
||||
public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
assertNotNull(sourceType, targetType);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Converting value " + StylerUtils.style(source) +" of " + sourceType + " to " + targetType);
|
||||
logger.debug("Converting value of " + sourceType + " to " + targetType);
|
||||
}
|
||||
if (sourceType == TypeDescriptor.NULL) {
|
||||
Assert.isTrue(source == null, "The source must be null if sourceType == TypeDescriptor.NULL");
|
||||
@@ -246,8 +246,8 @@ public class GenericConversionService implements ConversionService, ConverterReg
|
||||
}
|
||||
|
||||
private GenericConverter findConverterForClassPair(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Looking for Converter to convert from " + sourceType + " to " + targetType);
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Looking for Converter to convert from " + sourceType + " to " + targetType);
|
||||
}
|
||||
Class<?> sourceObjectType = sourceType.getObjectType();
|
||||
if (sourceObjectType.isInterface()) {
|
||||
|
||||
Reference in New Issue
Block a user