Women in Technology

Hear us Roar



Article:
  Seven Low-Cost Ways to Improve Legacy Code
Subject:   Enums and "Constant Object"
Date:   2004-10-28 08:42:15
From:   dubwai
Response to: Enums and "Constant Object"

"I address this fact in the book in the section on constant objects. Avoiding such a problem is a rather minor task with the readResolve() method."


OK but I think you should mention it in the article. A developer may read this article but not the book. This can cause a nasty, hard to find bug. If the developer follows the advice in this article to change working code with static final ints to non-working code with 'constant-objects' it's not an improvement.