Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: Fixing "typos" in enums... Date: Mon, 18 Nov 2013 09:33:43 -0800 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 18 Nov 2013 17:33:46 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="9358cda03e1e0dfd3c4b757daa608707"; logging-data="24151"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19zYd8jmoi3ml5TsNQ+w054H6FWxpefYxo=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 In-Reply-To: Cancel-Lock: sha1:EWDY393nWlmTDU5MEVonL1X6zuk= Xref: csiph.com comp.lang.java.programmer:26538 On 11/18/2013 9:20 AM, Andreas Leitgeb wrote: > markspace wrote: >> On 11/15/2013 8:25 AM, Andreas Leitgeb wrote: >>> @Deprecated public enum Foo { FURST, SECOND } >>> public enum Fooing { FIRST, SECOND } > > This solution would require duplicating lots of other > code, like methods taking that enum as parameter... So you change the old method to a new method that takes the new type. It's called refactoring. You don't duplicate methods, that's dumb. > > Also, in my case at hand the enum itself already has the > one and only correct name for that task (and it's of course I dislike adding a "2" onto new interface names, so I showed that coming up with a new name is better. I'm sure if you really think about it, you can come up with a new name. So far in the Java API, we've had Date, Calendar and now LocalDateTime to all mean essentially the same thing. A little creativity and thought is required.