Author: hardy.ferentschik
Date: 2008-06-09 11:50:47 -0400 (Mon, 09 Jun 2008)
New Revision: 14753
Modified:
commons-annotations/trunk/
commons-annotations/trunk/src/java/org/hibernate/annotations/common/reflection/java/JavaXCollectionType.java
Log:
ANN-723
- Fixed wrong usage Class.isAssignableFrom(). Caller and callee had to be switched
- Modified svn ignore pattern
Property changes on: commons-annotations/trunk
___________________________________________________________________
Name: svn:ignore
- .classpath
.project
+ .*
build
test_output
target
Modified:
commons-annotations/trunk/src/java/org/hibernate/annotations/common/reflection/java/JavaXCollectionType.java
===================================================================
---
commons-annotations/trunk/src/java/org/hibernate/annotations/common/reflection/java/JavaXCollectionType.java 2008-06-09
12:42:12 UTC (rev 14752)
+++
commons-annotations/trunk/src/java/org/hibernate/annotations/common/reflection/java/JavaXCollectionType.java 2008-06-09
15:50:47 UTC (rev 14753)
@@ -1,3 +1,4 @@
+// $Id:$
package org.hibernate.annotations.common.reflection.java;
import java.lang.reflect.ParameterizedType;
@@ -15,6 +16,7 @@
* @author Emmanuel Bernard
* @author Paolo Perrotta
*/
+@SuppressWarnings("unchecked")
class JavaXCollectionType extends JavaXType {
public JavaXCollectionType(Type type, TypeEnvironment context, JavaReflectionManager
factory) {
@@ -36,8 +38,8 @@
Type[] args = parameterizedType.getActualTypeArguments();
Type componentType;
Class<? extends Collection> collectionClass = getCollectionClass();
- if ( collectionClass.isAssignableFrom( Map.class )
- || collectionClass.isAssignableFrom( SortedMap.class ) ) {
+ if ( Map.class.isAssignableFrom( collectionClass )
+ || SortedMap.class.isAssignableFrom( collectionClass ) ) {
componentType = args[1];
}
else {
@@ -52,7 +54,7 @@
return new TypeSwitch<XClass>() {
@Override
public XClass caseParameterizedType(ParameterizedType parameterizedType) {
- if ( getCollectionClass().isAssignableFrom( Map.class ) ) {
+ if ( Map.class.isAssignableFrom( getCollectionClass() ) ) {
return toXClass( parameterizedType.getActualTypeArguments()[0] );
}
return null;
Property changes on:
commons-annotations/trunk/src/java/org/hibernate/annotations/common/reflection/java/JavaXCollectionType.java
___________________________________________________________________
Name: svn:keywords
+ Id
Show replies by date