tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: svn commit: r1345580 - in /tomcat/trunk/java/org/apache/catalina/deploy: LocalStrings.properties NamingResources.java
Date Mon, 04 Jun 2012 22:44:09 GMT
2012/6/4 Mark Thomas <markt@apache.org>:
> On 03/06/2012 23:58, Mark Thomas wrote:
>
>> Konstantin Kolinko <knst.kolinko@gmail.com> wrote:
>
>>> Does something guarantee that there is always common type among
>>> injection targets?
>>>
>>> Can there be two disjoint interfaces A and B, which are both
>>> implemented by a resource, so assignment to A or B should succeed,
>>> but getInjectionTargetType() will result in a failure?
>>
>> Potentially, yes. That case needs to be handled too but in my view
>> only if a type is defined in web.xml. I don't think it is reasonable
>> to find a suitable type if injection targets define disparate
>> interfaces with no concrete type in web.xml.
>
> Fixed.
>

Thanks. Looks good.

Re:
http://svn.apache.org/viewvc?rev=1346109&view=rev

There are two things that are unusual to my taste, but they do not
affect the outcome. Just noting. It is not an objection.

1) Behaviour of getCompatibleType(..) when
resource.getInjectionTargets() is empty.

It always returns null.

This concern does not matter though - It is never called with empty
getInjectionTargets() as that is checked before the call.

2) Assignment

resource.setType(compatibleClass.getCanonicalName());

If typeClass != null it looks strange to change the value.
This concern does not matter though - In that case the new value is
the same as the old one.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message