Re: statement is not reachable

2009-03-05 Thread Jarrett Billingsley
On Thu, Mar 5, 2009 at 10:45 AM, Qian Xu wrote: > Hi Jarrett, > > but I need an exception here. This is an unexpected case. I want no instance > to be create in this case. By the time the constructor runs, an instance has already been created. But if you throw an exception in the ctor, it's impo

Re: statement is not reachable

2009-03-05 Thread Ary Borenszweig
Qian Xu wrote: Jarrett Billingsley wrote: On Thu, Mar 5, 2009 at 3:17 AM, Qian Xu wrote: this(char[] s, int flag) { if (flag == 1) { this(1); return; } else if (flag == 2) { this("hello"); return; } throw new Exception("unhandled case"); this(0); // fake This line is unreachable. The 'thro

Re: statement is not reachable

2009-03-05 Thread Qian Xu
Jarrett Billingsley wrote: > On Thu, Mar 5, 2009 at 3:17 AM, Qian Xu > wrote: > >> this(char[] s, int flag) { >> if (flag == 1) >> { >> this(1); >> return; >> } >> else if (flag == 2) >> { >> this("hello"); >> return; >> } >> throw new Exception("unhandled case"); >> this(0); // fake > > This l

Re: statement is not reachable

2009-03-05 Thread Jarrett Billingsley
On Thu, Mar 5, 2009 at 3:17 AM, Qian Xu wrote: >  this(char[] s, int flag) { >    if (flag == 1) >    { >      this(1); >      return; >    } >    else if (flag == 2) >    { >      this("hello"); >      return; >    } >    throw new Exception("unhandled case"); >    this(0); // fake This line is