geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r952718 - /geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Date Tue, 08 Jun 2010 16:18:00 GMT
Author: djencks
Date: Tue Jun  8 16:18:00 2010
New Revision: 952718

URL: http://svn.apache.org/viewvc?rev=952718&view=rev
Log:
GERONIMO-5346 improve type compatibility checing to allow subclasses

Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?rev=952718&r1=952717&r2=952718&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
Tue Jun  8 16:18:00 2010
@@ -374,7 +374,13 @@ public abstract class AbstractNamingBuil
                 if (type == null) {
                     type = fieldType;
                 } else if (!fieldType.equals(type)) {
-                    throw new DeploymentException("Mismatched types in env-entry named: "
+ name + " type: " + type + " injections " + injectionTargets);
+                    if (fieldType.isAssignableFrom(type)) {
+                        //type is subclass
+                    } else if (type.isAssignableFrom(fieldType)) {
+                        type = fieldType;
+                    } else {
+                        throw new DeploymentException("Mismatched types in env-entry named:
" + name + " type: " + type + " injections " + injectionTargets);
+                    }
                 }
             } catch (ClassNotFoundException e) {
                 throw new DeploymentException("could not load injection target class for
env entry named: " + name + " in class: " + className, e);



Mime
View raw message