technically, it would be an empty map not empty list, but even so, i'm
not sure about this.  if we can say for sure that no one (especially
us) will ever want to tell the difference between an empty toolbox and
no toolbox being set, then it would be marginally simpler to ensure
that toolbox is never null.

at this point, it's not a great burden to always test for the
toolbox's presence and potentially provides more a more useful
interface.

in other words, i'll think about this...

On 11/30/06, Henning P. Schmiedehausen <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] writes:

>+    public Map getToolbox()
>+    {
>+        if (this.toolbox != null)
>+        {
>+            return Collections.unmodifiableMap(this.toolbox);
>+        }

Wouldn't it be better (and probably remove a lot of these tests) to make sure
that the toolbox can never be null (but contains an empty List?).

>+        return null;
>     }

I'd prefer Collections.EMPTY_LIST. Removes the necessity of always
checking for null.

        Best regards
                Henning

--
Henning P. Schmiedehausen  -- [EMAIL PROTECTED] | J2EE, Linux,
91054 Buckenhof, Germany   -- +49 9131 506540 | Apache person
Open Source Consulting, Development, Design | Velocity - Turbine guy

          "Save the cheerleader. Save the world."

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to