Browse Source

polishing

pull/7/head
Juergen Hoeller 14 years ago
parent
commit
339c57e41a
  1. 7
      org.springframework.core/src/main/java/org/springframework/core/GenericTypeResolver.java
  2. 6
      org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/annotation/AnnotationSessionFactoryBean.java

7
org.springframework.core/src/main/java/org/springframework/core/GenericTypeResolver.java

@ -116,21 +116,20 @@ public abstract class GenericTypeResolver { @@ -116,21 +116,20 @@ public abstract class GenericTypeResolver {
public static Class<?> resolveReturnTypeArgument(Method method, Class<?> genericIfc) {
Type returnType = method.getReturnType();
Type genericReturnType = method.getGenericReturnType();
ParameterizedType targetType;
if (returnType.equals(genericIfc)) {
if (genericReturnType instanceof ParameterizedType) {
targetType = (ParameterizedType)genericReturnType;
ParameterizedType targetType = (ParameterizedType) genericReturnType;
Type[] actualTypeArguments = targetType.getActualTypeArguments();
Type typeArg = actualTypeArguments[0];
if (!(typeArg instanceof WildcardType)) {
return (Class<?>)typeArg;
return (Class<?>) typeArg;
}
}
else {
return null;
}
}
return GenericTypeResolver.resolveTypeArgument((Class<?>)returnType, genericIfc);
return GenericTypeResolver.resolveTypeArgument((Class<?>) returnType, genericIfc);
}
/**

6
org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/annotation/AnnotationSessionFactoryBean.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2011 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.
@ -128,8 +128,8 @@ public class AnnotationSessionFactoryBean extends LocalSessionFactoryBean implem @@ -128,8 +128,8 @@ public class AnnotationSessionFactoryBean extends LocalSessionFactoryBean implem
}
/**
* Set whether to use Spring-based scanning for entity classes in the classpath
* instead of listing annotated classes explicitly.
* Specify packages to search using Spring-based scanning for entity classes in
* the classpath. This is an alternative to listing annotated classes explicitly.
* <p>Default is none. Specify packages to search for autodetection of your entity
* classes in the classpath. This is analogous to Spring's component-scan feature
* ({@link org.springframework.context.annotation.ClassPathBeanDefinitionScanner}).

Loading…
Cancel
Save