Hi,
I was looking through the source code to try and get up to speed on Turbine
and Jetspeed and I noticed a potential bug in
src/java/org/apache/jetspeed/services/template/JetspeedTemplateService.java
The method is getScreenTemplateName which if I am following the flow of the
code correctly is not really being used for Jetspeed as it is configured now.
So it is probably not a big issue. The method looks like it was copied from
getLayoutTemplateName which gets passed in a String parameter named "name" while
getScreenTemplateName gets passed in a String parameter named "key". There is
null check at the begining that checks for a null "name" not "key". Also all
the logging in getScreenTemplateName refers to getLayoutTemplateName so that
might cause some confusion if the method was ever called. Here is the method
with my comments added.
/**
* Locate and return the name of a screen template.
*
*
* @param name A String which is the key to the template.
* @return A String with the screen template path.
* @exception Exception, a generic exception.
*/
public String getScreenTemplateName(String key)
throws Exception
{
// This should probably be "key" not "name"
if (name==null)
// ^^^^^^^^^^^^^^
throw new Exception ("TurbineTemplateService: " +
"getLayoutTemplateName() was passed in a null value.");
// ^^^^^^^^^^^^^^^^^^^^^^
// All references to "name" below here are ok.
String name = null;
if ( useCache && templateCache.containsKey(key) )
{
name = (String)templateCache.get(key);
}
else
{
Log.debug("JetspeedTemplatePage.getLayoutTemplateName(" + key + ")");
// ^^^^^^^^^^^^^^^^^^^^^
String[] names = parseScreenTemplate(key);
name = names[2];
addToCache( key, names[0], screenCache );
addToCache( key, names[1], layoutCache );
addToCache( key, names[2], templateCache );
}
return name;
}
What is the procedure for me to submit changes if I find anything else? It
would probably be faster for me to just make the change and submit it for
review rather than tell the active developers about it and have them have to
make the changes. It looks like you guys have put a lot of good work into
this and I would like to help out where I can. Thanks.
Steven F. Davis
Digital Evergreen Interactive - Application Architect
[EMAIL PROTECTED]
