
|
If you were logged in you would be able to see more operations.
|
|
|
| Resolution Date: |
28/Oct/05 09:26 AM
|
|
This is a minor issue I am marking as an improvement since the JNDI API doesn't appear to say explicitly what the behavior is, so I'm entering this issue to document it. The issue is that if you supply a null Name as the name to search in DirContext.search() you get a NPE. If you supply a null String, however, it is treated as the empty String, which indicates a search at the current context's name. IMO, a null Name should be treated like the empty String.
So, a null Name fails with NPE:
Name name = null;
NamingEnumeration answer = ctx.search( name, matchAttrs, attrIDs );
java.lang.NullPointerException
at org.apache.ldap.common.name.LdapName.addAll(LdapName.java:527)
at org.apache.ldap.server.jndi.ServerContext.buildTarget(ServerContext.java:843)
at org.apache.ldap.server.jndi.ServerDirContext.search(ServerDirContext.java:488)
...
But, a null String will work fine:
String name = null;
NamingEnumeration answer = ctx.search( name, matchAttrs, attrIDs );
Which is the same as the empty String, which works fine, too;
String name = "";
NamingEnumeration answer = ctx.search( name, matchAttrs, attrIDs );
|
|
Description
|
This is a minor issue I am marking as an improvement since the JNDI API doesn't appear to say explicitly what the behavior is, so I'm entering this issue to document it. The issue is that if you supply a null Name as the name to search in DirContext.search() you get a NPE. If you supply a null String, however, it is treated as the empty String, which indicates a search at the current context's name. IMO, a null Name should be treated like the empty String.
So, a null Name fails with NPE:
Name name = null;
NamingEnumeration answer = ctx.search( name, matchAttrs, attrIDs );
java.lang.NullPointerException
at org.apache.ldap.common.name.LdapName.addAll(LdapName.java:527)
at org.apache.ldap.server.jndi.ServerContext.buildTarget(ServerContext.java:843)
at org.apache.ldap.server.jndi.ServerDirContext.search(ServerDirContext.java:488)
...
But, a null String will work fine:
String name = null;
NamingEnumeration answer = ctx.search( name, matchAttrs, attrIDs );
Which is the same as the empty String, which works fine, too;
String name = "";
NamingEnumeration answer = ctx.search( name, matchAttrs, attrIDs );
|
Show » |
made changes - 28/Oct/05 09:26 AM
| Field |
Original Value |
New Value |
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
|
Resolution
|
|
Won't Fix
[ 2
]
|
|
Fix Version/s
|
|
0.9.3
[ 12310193
]
|
made changes - 10/Feb/06 12:43 PM
|
Key
|
DIREVE-295
|
DIRSERVER-468
|
|
Project
|
Directory Server
[ 10516
]
|
Directory ApacheDS
[ 12310260
]
|
|
Component/s
|
jndi-provider
[ 11088
]
|
|
|
Fix Version/s
|
0.9.3
[ 12310193
]
|
|
made changes - 06/May/09 05:08 PM
|
Status
|
Resolved
[ 5
]
|
Closed
[ 6
]
|
|