jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcel Reutegger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1738) BeanConfig may incorrectly throw ConfigurationException
Date Wed, 17 Sep 2008 15:05:46 GMT

    [ https://issues.apache.org/jira/browse/JCR-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12631801#action_12631801
] 

Marcel Reutegger commented on JCR-1738:
---------------------------------------

Proposed patch:

Index: BeanConfig.java
===================================================================
--- BeanConfig.java	(revision 695779)
+++ BeanConfig.java	(working copy)
@@ -116,7 +116,7 @@
             Iterator it = properties.keySet().iterator();
             while (it.hasNext()) {
                 String key = (String) it.next();
-                if (map.get(key) == null && properties.getProperty(key) != null)
{
+                if (!map.containsKey(key) && properties.getProperty(key) != null)
{
                     String msg = object.getClass().getName() + " does not support '" + key;
                     log.error(msg);
                     throw new ConfigurationException(msg);



> BeanConfig may incorrectly throw ConfigurationException
> -------------------------------------------------------
>
>                 Key: JCR-1738
>                 URL: https://issues.apache.org/jira/browse/JCR-1738
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core
>            Reporter: Marcel Reutegger
>            Priority: Minor
>             Fix For: 1.5
>
>
> With the changes from JCR-1462 the BeanConfig.newInstance() may throw a ConfigurationException
if the bean does not support a configuration parameter that is configured.
> There may be cases where the check in newInstance() yields an unsupported property even
though there is a bean property present with the given key. Because the implementation uses
'map.get(key) == null'  as a check for a property name the method will throw if the key exists
but the value is null.
> The implementation should rather use 'map.containsKey(key)'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message