2011/2/27  <[email protected]>:
> Author: markt
> Date: Sun Feb 27 13:19:22 2011
> New Revision: 1075050
>

> --- tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java 
> (original)
> +++ tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java Sun 
> Feb 27 13:19:22 2011
> @@ -140,7 +140,9 @@ public class CatalinaProperties {
>             String name = (String) enumeration.nextElement();
>             String value = properties.getProperty(name);
>             if (value != null) {
> -                System.setProperty(name, value);
> +                // Remove leading/trailing whitespace as that can lead to 
> hard
> +                // to diagnose failures
> +                System.setProperty(name.trim(), value.trim());
>             }
>         }

1) The above fixes System.getProperty() only.
CatalinaProperties#properties keeps the original values.
2) There is no need for name.trim(). See java.util.Properties#load javadoc.
3) I think I am -1 on this change. If there ever would be some
property that I would need to set to the value of \u0020, I would not
be able to do so. I think that we should care about our own properties
only and not enforce our rules on something that we-do-not-know.

Regarding the original
https://issues.apache.org/bugzilla/show_bug.cgi?id=31027
they are saying about whitespace in port number.

I think that throwing a reasonable exception in that case is what has
to be done (and I think it is already done).

They say:
> it was difficult to track down whether tomcat was running

There are a log of log files, as well as tomcat.pid, as well as ps
command in the OS, etc.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to