[jira] Created: (XBEAN-119) ContextUtil$ReadOnlyBinding#isRelative() always returns false

View: New views
3 Messages — Rating Filter:   Alert me  

[jira] Created: (XBEAN-119) ContextUtil$ReadOnlyBinding#isRelative() always returns false

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ContextUtil$ReadOnlyBinding#isRelative() always returns false
-------------------------------------------------------------

                 Key: XBEAN-119
                 URL: https://issues.apache.org/jira/browse/XBEAN-119
             Project: XBean
          Issue Type: Bug
    Affects Versions: 3.4.2, 3.4.1, 3.4, 3.3
            Reporter: Christian Haul
            Priority: Minor


When iterating through the JNDI tree in Geronimo with the following code

{code}
                NamingEnumeration<Binding> namingEnum = context.listBindings("");
                while (namingEnum.hasMore()) {
                        Binding nameClassPair = namingEnum.nextElement();
                        if (nameClassPair.isRelative()) {
{code}

the isRelative() test always fails. The object returned from the nextElement() call is a ContextUtil$ReadOnlyBinding which has a trivial implementation of the isRelative() method:

{code}
        public boolean isRelative() {
            return false;
        }
{code}

Since the ReadOnlyBinding inherits from the NameClassPair it has a instance var named isRelative and inherits a  method isRelative() which -- at least in my case -- has the correct default value of "true". So, the method could be simply deleted so that the original method is used.

However, I haven't dug deep enough into the code to assess if the property is initialized correctly at any time, i.e. for the top level JNDI entries one might assume that those return "false" (OTOH would that really be necessary? In what situation should the NameClassPair return "false" for isRelative ?)

Relates to [http://issues.apache.org/jira/browse/GERONIMO-4477]

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


[jira] Updated: (XBEAN-119) ContextUtil$ReadOnlyBinding#isRelative() always returns false

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/XBEAN-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jack Cai updated XBEAN-119:
---------------------------

    Attachment: XBean_119.patch

Created a patch based on the above suggestion.

> ContextUtil$ReadOnlyBinding#isRelative() always returns false
> -------------------------------------------------------------
>
>                 Key: XBEAN-119
>                 URL: https://issues.apache.org/jira/browse/XBEAN-119
>             Project: XBean
>          Issue Type: Bug
>    Affects Versions: 3.3, 3.4, 3.4.1, 3.4.2
>            Reporter: Christian Haul
>            Priority: Minor
>         Attachments: XBean_119.patch
>
>
> When iterating through the JNDI tree in Geronimo with the following code
> {code}
> NamingEnumeration<Binding> namingEnum = context.listBindings("");
> while (namingEnum.hasMore()) {
> Binding nameClassPair = namingEnum.nextElement();
>                         if (nameClassPair.isRelative()) {
> {code}
> the isRelative() test always fails. The object returned from the nextElement() call is a ContextUtil$ReadOnlyBinding which has a trivial implementation of the isRelative() method:
> {code}
>         public boolean isRelative() {
>             return false;
>         }
> {code}
> Since the ReadOnlyBinding inherits from the NameClassPair it has a instance var named isRelative and inherits a  method isRelative() which -- at least in my case -- has the correct default value of "true". So, the method could be simply deleted so that the original method is used.
> However, I haven't dug deep enough into the code to assess if the property is initialized correctly at any time, i.e. for the top level JNDI entries one might assume that those return "false" (OTOH would that really be necessary? In what situation should the NameClassPair return "false" for isRelative ?)
> Relates to [http://issues.apache.org/jira/browse/GERONIMO-4477]

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


[jira] Updated: (XBEAN-119) ContextUtil$ReadOnlyBinding#isRelative() always returns false

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/XBEAN-119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Jencks updated XBEAN-119:
-------------------------------

    Component/s: naming

> ContextUtil$ReadOnlyBinding#isRelative() always returns false
> -------------------------------------------------------------
>
>                 Key: XBEAN-119
>                 URL: https://issues.apache.org/jira/browse/XBEAN-119
>             Project: XBean
>          Issue Type: Bug
>          Components: naming
>    Affects Versions: 3.3, 3.4, 3.4.1, 3.4.2
>            Reporter: Christian Haul
>            Priority: Minor
>         Attachments: XBean_119.patch
>
>
> When iterating through the JNDI tree in Geronimo with the following code
> {code}
> NamingEnumeration<Binding> namingEnum = context.listBindings("");
> while (namingEnum.hasMore()) {
> Binding nameClassPair = namingEnum.nextElement();
>                         if (nameClassPair.isRelative()) {
> {code}
> the isRelative() test always fails. The object returned from the nextElement() call is a ContextUtil$ReadOnlyBinding which has a trivial implementation of the isRelative() method:
> {code}
>         public boolean isRelative() {
>             return false;
>         }
> {code}
> Since the ReadOnlyBinding inherits from the NameClassPair it has a instance var named isRelative and inherits a  method isRelative() which -- at least in my case -- has the correct default value of "true". So, the method could be simply deleted so that the original method is used.
> However, I haven't dug deep enough into the code to assess if the property is initialized correctly at any time, i.e. for the top level JNDI entries one might assume that those return "false" (OTOH would that really be necessary? In what situation should the NameClassPair return "false" for isRelative ?)
> Relates to [http://issues.apache.org/jira/browse/GERONIMO-4477]

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