cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12006] New: - Boolean.getBoolean() should be Boolean.valueOf()
Date Sat, 24 Aug 2002 06:22:19 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12006>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12006

Boolean.getBoolean() should be Boolean.valueOf()

           Summary: Boolean.getBoolean() should be Boolean.valueOf()
           Product: Cocoon 2
           Version: 2.0.3
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: sitemap components
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: per@onclave.com
                CC: per@onclave.com


SUMMARY:

Cocoon2 uses Boolean.getBoolean(String) in lots of places where it should be 
using Boolean.valueOf(String).


DETAILS:

All the classes listed below try to use the function Boolean.getBoolean(String 
name) to 'convert' the value of the <reloadable> setting from a string to a 
boolean.

Except that's not what the function does. What is does is look up a system 
property with the given name and return boolean true iff the value of that 
named system property is the string "true". E.g., it looks up the 
strings "true" or "false" as system properties and returns boolean true iff the 
property exists and its value was "true". 

Boolean.valueOf(String) is the right way to do what was intended.


SYMPTOMS:

Actions that keep their configuration in an external file, often use a 
parameter like <reloadable> to state whether or not Cocoon should detect 
changes and reload the configuration.

There are two places to set <reloadable>: in the <map:action> component 
definition, or in the <map:act> element that uses it. If you set it on the 
<map:action> component definition, that setting is supposed to be the default 
value for any <map:act> that uses that component.

But with this bug, <reloadable> is _always_ false if <reloadable> is declared

as a default in the component <map:action> definition of the Actions.


MITIGATING FACTORS:

It only affected sitemaps where <reloadable> was set on the <map:action> 
component definition (if you set <reloadable> on <map:act>, it works as 
expected).

The default sitemap doesn't use <reloadable> at all. Which means the default 
value of <reloadable> is set from the value as defined in Constants.java.



AFFECTED (list is from 2.0.3, probably more errors in 2.1):

AbstractComplementaryConfigurableAction.java
DatabaseAddAction.java
DatabaseAuthenticatorAction.java
DatabaseDeleteAction.java
DatabaseSelectAction.java
DatabaseUpdateAction.java
FormValidatorAction.java
SessionValidatorAction.java

[scratchpad]
CookieValidatorAction.java
DatabaseCookieAuthenticatorAction.java
DbXMLAuthenticatorAction.java
DatabaseAction.java


Searching for Boolean.getBoolean works to find all cases.

Per

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


Mime
View raw message