From 339c57e41a5d4cc6a0e18bb4b5d2002c81a8957e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 11 Oct 2011 01:00:31 +0000 Subject: [PATCH] polishing --- .../java/org/springframework/core/GenericTypeResolver.java | 7 +++---- .../annotation/AnnotationSessionFactoryBean.java | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/GenericTypeResolver.java b/org.springframework.core/src/main/java/org/springframework/core/GenericTypeResolver.java index 25b1d37b295..59afdc4e7d3 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/GenericTypeResolver.java +++ b/org.springframework.core/src/main/java/org/springframework/core/GenericTypeResolver.java @@ -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); } /** diff --git a/org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/annotation/AnnotationSessionFactoryBean.java b/org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/annotation/AnnotationSessionFactoryBean.java index a4649337ace..3264e821cee 100644 --- a/org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/annotation/AnnotationSessionFactoryBean.java +++ b/org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/annotation/AnnotationSessionFactoryBean.java @@ -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 } /** - * 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. *

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}).