Issue Details (XML | Word | Printable)

Key: XBEAN-119
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Christian Haul
Votes: 0
Watchers: 0
Available Workflow Actions

Begin RTC Review
Operations

If you were logged in you would be able to see more operations.
XBean

ContextUtil$ReadOnlyBinding#isRelative() always returns false

Created: 22/Dec/08 04:38 PM   Updated: 02/Apr/09 05:32 PM
Return to search
Component/s: naming
Affects Version/s: 3.3, 3.4, 3.4.1, 3.4.2
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works XBean_119.patch 2009-03-09 02:32 AM Jack Cai 1 kB
Issue Links:
dependent
 


 Description  « Hide
When iterating through the JNDI tree in Geronimo with the following code
NamingEnumeration<Binding> namingEnum = context.listBindings("");
		while (namingEnum.hasMore()) {
			Binding nameClassPair = namingEnum.nextElement();
                        if (nameClassPair.isRelative()) {

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:

public boolean isRelative() {
            return false;
        }

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



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jack Cai added a comment - 09/Mar/09 02:32 AM
Created a patch based on the above suggestion.