You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2008/09/17 17:05:46 UTC
[jira] Commented: (JCR-1738) BeanConfig may incorrectly throw
ConfigurationException
[ 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.