tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <p...@steitz.com>
Subject Error in composeName() implementations
Date Sat, 29 Nov 2003 00:51:15 GMT
I have been working on commons-naming (extracted from catalina's 
org.apache.naming, soon to be moved to incubator-directory) and I have 
discovered a (apparently harmless to tomcat) bug in the composeName() 
implementation that is repeated in o.a.n.NamingContext, 
o.a.n.SelectorContext, o.a.n.resources.BaseDirContext, and 
o.a.n.r.ProxyDirContext.

All of these classes include:

  public Name composeName(Name name, Name prefix)
         throws NamingException {
	prefix = (Name) name.clone();
	return prefix.addAll(name);
     }

This ignores the prefix and composes the name with itself.  A grep on 
tomcat-4.0 and tomcat-catalina for 'composeName(' turns up nothing but the 
method declarations, so I assume that these methods are not used (at least 
directly) by tomcat.

Should I submit a patch to fix this?  If yes, should I submit it against 
jakarta-tomcat-catalina?  The fix that I have in mind is to replace the 
body with:

Name result = (Name) prefix.clone();
return result.addAll(name);

As we add more tests, we may find other things like this. Should we try to 
replicate the patches, or hold off until the incubator-directory-naming 
component is ready for a release and possible re-integration into tomcat?

Phil




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message