You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Tom Dyas (JIRA)" <ji...@apache.org> on 2011/03/07 23:29:59 UTC

[jira] Created: (DAEMON-199) DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor

DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor
-----------------------------------------------------------------------------------------------------------------------

                 Key: DAEMON-199
                 URL: https://issues.apache.org/jira/browse/DAEMON-199
             Project: Commons Daemon
          Issue Type: Bug
    Affects Versions: 1.0.5
            Reporter: Tom Dyas


When using DaemonWrapper to wrap an existing Java class, DaemonWrapper assumes that it can instantiate the class using a no-argument constructor. I tried to use DaemonWrapper to wrap a bootstrap class that declared the no-argument constructor as private. The wrapped class had a static main method and so could be used by the ordinary Java bootstrap procedure. The attached patch fixes the issue.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (DAEMON-199) DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor

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

Tom Dyas updated DAEMON-199:
----------------------------

    Attachment: commons-daemon.patch

> DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DAEMON-199
>                 URL: https://issues.apache.org/jira/browse/DAEMON-199
>             Project: Commons Daemon
>          Issue Type: Bug
>    Affects Versions: 1.0.5
>            Reporter: Tom Dyas
>         Attachments: commons-daemon.patch
>
>
> When using DaemonWrapper to wrap an existing Java class, DaemonWrapper assumes that it can instantiate the class using a no-argument constructor. I tried to use DaemonWrapper to wrap a bootstrap class that declared the no-argument constructor as private. The wrapped class had a static main method and so could be used by the ordinary Java bootstrap procedure. The attached patch fixes the issue.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Closed] (DAEMON-199) DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor

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

Tom Dyas closed DAEMON-199.
---------------------------

    Resolution: Won't Fix

> DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DAEMON-199
>                 URL: https://issues.apache.org/jira/browse/DAEMON-199
>             Project: Commons Daemon
>          Issue Type: Bug
>    Affects Versions: 1.0.5
>            Reporter: Tom Dyas
>         Attachments: commons-daemon.patch
>
>
> When using DaemonWrapper to wrap an existing Java class, DaemonWrapper assumes that it can instantiate the class using a no-argument constructor. I tried to use DaemonWrapper to wrap a bootstrap class that declared the no-argument constructor as private. The wrapped class had a static main method and so could be used by the ordinary Java bootstrap procedure. The attached patch fixes the issue.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DAEMON-199) DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor

Posted by "Nick Griffiths (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13020804#comment-13020804 ] 

Nick Griffiths commented on DAEMON-199:
---------------------------------------

You could always create your own shim to do this, seeing as no-one wants to accept your patch.

> DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DAEMON-199
>                 URL: https://issues.apache.org/jira/browse/DAEMON-199
>             Project: Commons Daemon
>          Issue Type: Bug
>    Affects Versions: 1.0.5
>            Reporter: Tom Dyas
>         Attachments: commons-daemon.patch
>
>
> When using DaemonWrapper to wrap an existing Java class, DaemonWrapper assumes that it can instantiate the class using a no-argument constructor. I tried to use DaemonWrapper to wrap a bootstrap class that declared the no-argument constructor as private. The wrapped class had a static main method and so could be used by the ordinary Java bootstrap procedure. The attached patch fixes the issue.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DAEMON-199) DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor

Posted by "Tom Dyas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DAEMON-199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13022390#comment-13022390 ] 

Tom Dyas commented on DAEMON-199:
---------------------------------

I can (and will have to now) create a shim given your resolution of this issue.  However, I still believe that DamonWrapper.Invoker#invoke() should not be passing an instantiated object to java.lang.reflect.Method when trying to invoke a static method. While the javadocs for java.lang.reflect.Method#invoke do state that the object is ignored in the case of a static method, it seems to unnecessarily limit the usefulness of DaemonWrapper to have it require that the wrapped object be instantiated when there is no need to do so as in the case of a static method.

Also, just so I know how this project's governance works: Where are technical discussions generally held for the project? I am used to the Mozilla method of conducting the technical discussions in the issue tracking system and not in an offline location where the a patch submitter can't even attempt to argue the merits of a patch to the project's developers. The "seeing as no-one wants to accept your patch" phrase seems very gruff in tone to me.

No matter, I'll close the issue myself.

> DaemonWrapper fails when the wrapped class does not have a (or restricts the visibility of its) no-argument constructor
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: DAEMON-199
>                 URL: https://issues.apache.org/jira/browse/DAEMON-199
>             Project: Commons Daemon
>          Issue Type: Bug
>    Affects Versions: 1.0.5
>            Reporter: Tom Dyas
>         Attachments: commons-daemon.patch
>
>
> When using DaemonWrapper to wrap an existing Java class, DaemonWrapper assumes that it can instantiate the class using a no-argument constructor. I tried to use DaemonWrapper to wrap a bootstrap class that declared the no-argument constructor as private. The wrapped class had a static main method and so could be used by the ordinary Java bootstrap procedure. The attached patch fixes the issue.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira