[OpenJDK 2D-Dev] [PATCH] FontManager refactoring
Roman Kennke
roman.kennke at aicas.com
Mon Oct 20 10:33:46 UTC 2008
Hi Igor,
> I see that in number of places static variables are upper case. E.g.
> number of variables in the FontUtilities.
> I am not sure if detailed naming and code conventions for OpenJDK were
> published but
> usually we use upper case names for constants only. See
> http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367
> While i have my own concerns to our codestyle i strongly believe that we
> should try to keep code style the same
> in the whole workspaces. Obviously there are exceptions.
Eh, yeah. These variables are supposed to be final and used as
constants, the only reason why they are not is the code in the static
initializer. I cleaned this up a bit and now they are real constants.
> Comments like:
>
> /**
> * For backward compatibilty only, this will to be removed soon, don't use
> * in new code.
> */
>
> are way more helpful if they mention what to use instead.
> (btw, you may want to fix spelling of "compatibilty")
Indeed, I agree. The original intent was to make these constants
deprecated, and instead put stuff in subclasses of FontManager instead.
However, this doesn't seem feasible in all cases (e.g. IS_SOLARIS_8/9),
and also, these constants are used outside the FontManager class
hierarchy, and we probably don't want to introduce subclasses of these
as well. I think the OS specific handling of stuff all over the place is
not very nice, and maybe I will find a cleaner solution of this at some
point, but for now I think it's ok to use these constants. I removed
those comments and the deprecation. Find the updated webrev:
http://kennke.org/~roman/fontmanager/webrev/
/Roman
--
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com * Tel: +49-721-663 968-48
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
More information about the 2d-dev
mailing list