Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #23983
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Unable to trace |
| Date | 2013-05-10 10:43 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <kmj0r9$aa1$1@dont-email.me> (permalink) |
| References | <a06740e3-a629-42de-944b-6dffd69a1424@googlegroups.com> <276fd7a3-461d-4df4-855a-63d49b900120@googlegroups.com> |
On 5/10/2013 10:26 AM, RVic wrote:
> I got it. Thanks for pointing me in the right direction Eric -- the Env enum needed the enumeration 'beta' in it.
>
> Thanks for your help guys, I am most grateful. RVic
That's probably not the end of your problems, just a clue
about their mechanism. Adding a `beta' value to the enum means
that Env.valueOf("beta") will now return Env.beta instead of
throwing an exception. That's all fine and dandy, but what will
the rest of the code do when it encounters this new Env.beta
object? For example, there may be something like
Env env = Env.valueOf(someString);
switch (env) {
case local:
// ...
break;
case mirror:
// ...
break;
case production:
// ...
break;
}
A "beta" value will no longer cause an exception in this code,
but whatever was supposed to have been done by the switch block
will remain un-done ... (This is one reason I think it's almost
always a good idea to have a `default:' label in every switch,
even if all it does is `assert false;'.)
You don't have a cure yet (not for sure, anyhow): You just
have the beginnings of a diagnosis.
--
Eric Sosman
esosman@comcast-dot-net.invalid
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Unable to trace RVic <rvince99@hotmail.com> - 2013-05-09 09:53 -0700
Re: Unable to trace Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-05-09 13:04 -0400
Re: Unable to trace markspace <markspace@nospam.nospam> - 2013-05-09 15:39 -0700
Re: Unable to trace Arne Vajhøj <arne@vajhoej.dk> - 2013-05-09 21:45 -0400
Re: Unable to trace RVic <rvince99@hotmail.com> - 2013-05-09 19:32 -0700
Re: Unable to trace RVic <rvince99@hotmail.com> - 2013-05-09 19:41 -0700
Re: Unable to trace Arne Vajhøj <arne@vajhoej.dk> - 2013-05-12 21:51 -0400
Re: Unable to trace RVic <rvince99@hotmail.com> - 2013-05-10 07:26 -0700
Re: Unable to trace Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-05-10 10:43 -0400
Re: Unable to trace Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-05-10 09:52 -0700
Re: Unable to trace Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-10 19:03 +0200
Re: Unable to trace Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-05-10 11:02 -0700
Re: Unable to trace Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2013-05-10 23:37 +0200
Re: Unable to trace RVic <rvince99@hotmail.com> - 2013-05-12 19:10 -0700
csiph-web