[EMAIL PROTECTED] wrote:
org.swix.swixml.SwingEngine

        /**
         * Removes the id from the cache.
         * @param id <code>String</code> assigned name
         */
    public void forget(final String id){
        try {
                idmap.remove(id);
        } catch (Exception e){
                // ignore it
        }
    }


we needed that... Figure it might be useful to add in to the main . Didn't
want to call it remove, or clear, or flush, because that implies that it
affects the object, when all we're really doing is making it forget about
it.

Hello Kate,

I have something to add about this. First, which exceptions might occur during the remove call? Should we really catch *all* exceptions without notice? This might lead to some bugs hard to find. (I had a discussion with Wolf about using "catch/throw[s] Exception" -- I'm no friend of that at all because this led me to sometimes bad solutions). If the id is not in the map, no exception is thrown. The UnsupportedOperationException is not very likely because we have the source code and decide which Map is the underlying implementation...

Second, why you do'nt want it to keep the name you are using inside? Like every other remove(), this does not affect the object given (java.util.List) or referenced by via key-value binding (Map).

Perhaps you can show some example?

Frank


Reply via email to