You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Michael Osipov (JIRA)" <ji...@apache.org> on 2010/09/22 15:54:33 UTC

[jira] Created: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
------------------------------------------------------------------------

                 Key: DBUTILS-72
                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
             Project: Commons DbUtils
          Issue Type: Bug
    Affects Versions: 1.3
            Reporter: Michael Osipov
            Priority: Critical


The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.

The class has to be made public or decoupled from the row processor.

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


[jira] Updated: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DBUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated DBUTILS-72:
------------------------

    Priority: Minor  (was: Critical)

> BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
> ------------------------------------------------------------------------
>
>                 Key: DBUTILS-72
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michael Osipov
>            Priority: Minor
>
> The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.
> The class has to be made public or decoupled from the row processor.

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


[jira] Commented: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

Posted by "Michael Osipov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913683#action_12913683 ] 

Michael Osipov commented on DBUTILS-72:
---------------------------------------

Sebb, there is no remedy to this but wrapping the map in another one without patching the input taglib?

> BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
> ------------------------------------------------------------------------
>
>                 Key: DBUTILS-72
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michael Osipov
>            Priority: Minor
>
> The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.
> The class has to be made public or decoupled from the row processor.

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


[jira] Commented: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

Posted by "Michael Osipov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913937#action_12913937 ] 

Michael Osipov commented on DBUTILS-72:
---------------------------------------

Niall,

thanks for the insight. I guess the guys from the input taglib did not want to rely on any external libraries. I will patch the appropriate line. At least such information should be prominent somewhere if people try to access the map through reflection.

> BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
> ------------------------------------------------------------------------
>
>                 Key: DBUTILS-72
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michael Osipov
>            Priority: Minor
>
> The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.
> The class has to be made public or decoupled from the row processor.

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


[jira] Commented: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

Posted by "Michael Osipov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913657#action_12913657 ] 

Michael Osipov commented on DBUTILS-72:
---------------------------------------

Why do you think so? I have wrapped this map into a CaseInsensitiveMap of Commons Collections and it worked perfectly. In my opinion, it is the private modifier. The taglib should set privateClass.setAccessable(true) but this is a dirty workaround.

> BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
> ------------------------------------------------------------------------
>
>                 Key: DBUTILS-72
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michael Osipov
>            Priority: Minor
>
> The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.
> The class has to be made public or decoupled from the row processor.

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


[jira] Commented: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913665#action_12913665 ] 

Sebb commented on DBUTILS-72:
-----------------------------

AFAICT, the nested class is an internal implementation detail, so is not required to be accessible.

> BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
> ------------------------------------------------------------------------
>
>                 Key: DBUTILS-72
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michael Osipov
>            Priority: Minor
>
> The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.
> The class has to be made public or decoupled from the row processor.

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


[jira] Commented: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913653#action_12913653 ] 

Sebb commented on DBUTILS-72:
-----------------------------

That seems more like a restriction of the taglib than a bug in DBUTILS.

> BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
> ------------------------------------------------------------------------
>
>                 Key: DBUTILS-72
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michael Osipov
>            Priority: Critical
>
> The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.
> The class has to be made public or decoupled from the row processor.

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


[jira] Commented: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913830#action_12913830 ] 

Niall Pemberton commented on DBUTILS-72:
----------------------------------------

IMO this is a bug in the taglib and how its using reflection. If a private class implements a public interface then the method should be accessed through the public interface and this issue won't occur. Commons BeanUtils does this, searching the interface hierarchy if the class is not public.

I believe that taglib is in the attic - but you should be able to get the source code and you could replace the whole of that method with one line:

{code}
    return PropertyUtils.getProperty(bean name);
{code}

Anyway, I don't think DBUtils should change to accomodate a bug in taglibs

> BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
> ------------------------------------------------------------------------
>
>                 Key: DBUTILS-72
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michael Osipov
>            Priority: Minor
>
> The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.
> The class has to be made public or decoupled from the row processor.

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


[jira] Commented: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913583#action_12913583 ] 

Sebb commented on DBUTILS-72:
-----------------------------

What is the use-case for needing to access the nested class?

> BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
> ------------------------------------------------------------------------
>
>                 Key: DBUTILS-72
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michael Osipov
>            Priority: Critical
>
> The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.
> The class has to be made public or decoupled from the row processor.

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


[jira] Commented: (DBUTILS-72) BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection

Posted by "Michael Osipov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DBUTILS-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12913643#action_12913643 ] 

Michael Osipov commented on DBUTILS-72:
---------------------------------------

Sebb,

have a lot at this file:http://svn.apache.org/repos/asf/jakarta/taglibs/deprecated/input/trunk/src/org/apache/taglibs/input/Util.java from line 160. The generic retrieval fails since the class itself ist not public. Reader cannot be invoked on that instance.
This taglib is deprecated but works flawlessly for my projects.

> BasicRowProcessor's CaseInsentitiveHashMap does not work with reflection
> ------------------------------------------------------------------------
>
>                 Key: DBUTILS-72
>                 URL: https://issues.apache.org/jira/browse/DBUTILS-72
>             Project: Commons DbUtils
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: Michael Osipov
>            Priority: Critical
>
> The map has been declared class private, this causes problems when someone tries to invoke the get method via reflection. I do use the results in the Jakarta Input Taglib which invokes the get via reflection and it fails with illegalaccessexception.
> The class has to be made public or decoupled from the row processor.

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