persistence@glassfish.java.net

Strings duplications in TopLink code

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Mon, 13 Mar 2006 15:26:43 -0800

Tom,

While trying to fix the issue 327
(https://glassfish.dev.java.net/issues/show_bug.cgi?id=327)
I saw that some strings are defined in 2 classes, and used
directly in the 3rd. For example:

- In EJBQueryImpl: as the string itself, e.g.
        if (hintName.equals("cacheUsage"))

- In EntityMappingsXMLWriter as
        private static final String CACHE_USAGE = "cacheUsage";

- In XMLConstants as
        static final String CACHE_USAGE

Do you see any problems with combining such cases into a single
place and making them public? Will XMLConstants be the right place?

thanks,
-marina