public String makeUrl(String host,int port,String dbm) { String key = host+port+dbm; String value = (String)cache.get(key); if(value!=null) return value;
otherwise calculate and cache.put(value); return value; }
Well, strictly speaking 'host+port+dbm' may not give a unique key.
Ina ddiiton, iw oudl liek to point out taht I acn find no classes that call makeUrl(String host,int port,String dbm).
All classes call "makeUrl()".
I would instead propose to make makeUrl(String host,int port,String dbm) private, and remove the overloaded methods 'makeUrl(String dbm)' and 'makeUrl(String host,String dbm)' (note:also remove from JDBC interface)
The only public method makeUrl() can then become:
static jdbcUrl = null;
public String makeUrl() {
if (jdbcUrl == null)
jdbcUrl = makeUrl(jdbcHost, jdbcPort, jdbcDatabase);
return jdbcUrl
}BTW afaik this is not really a hack, more a bugfix.
-- Pierre van Rooden Mediapark, C 107 tel. +31 (0)35 6772815 "Never summon anything bigger than your head."
