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: r1345367 - in /tomcat/trunk/java/org/apache/catalina: core/ startup/ util/
Date Sun, 03 Jun 2012 21:49:14 GMT
2012/6/2  <markt@apache.org>:
> Author: markt
> Date: Fri Jun  1 22:03:10 2012
> New Revision: 1345367
>
> URL: http://svn.apache.org/viewvc?rev=1345367&view=rev
> Log:
> Refactor some duplicate code into an new utility class with an eye to the proposed patch
for BZ 53333
>
> Added:
>    tomcat/trunk/java/org/apache/catalina/util/Introspection.java   (with props)
> Modified:
>    tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java
>    tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties
>    tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
>    tomcat/trunk/java/org/apache/catalina/startup/LocalStrings.properties
>    tomcat/trunk/java/org/apache/catalina/startup/WebAnnotationSet.java
>    tomcat/trunk/java/org/apache/catalina/util/LocalStrings.properties
>

> -                        if (injections != null && methodName.startsWith("set")
> -                                && methodName.length() >
3
> -                                && method.getParameterTypes().length
== 1
> -                                && method.getReturnType().getName().equals("void"))
{
> -                            String fieldName = getName(method);
> +                        if (injections != null &&
> +                                Introspection.isValidSetter(method))
{
> +                            String fieldName = Introspection.getName(method);

If the "getName()" method was moved into utility class,
maybe rename it to something more specific?
 "getFieldName()" ? "getSetterFieldName()" ?

This method creates field name from the name of a setter method.

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