[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Installing instance of wrong class gives weird error

adrian@jboss.org do-not-reply at jboss.com
Thu Jun 12 11:26:15 EDT 2008


The point is that it shouldn't do anything at all unless there is an error.

You effectively have:


  | public void doSomething(X parameter)
  | {
  |    check(parameter);
  |    doIt(parameter);
  | }
  | 
  | private void doIt(parameter)
  | {
  |    check(parameter);
  |    ...
  | }
  | 

The correct code - since we don't implement doIt() and it gives bad error messages should be:


  | public void doSomething(X parameter)
  | {
  |    try
  |    {
  |       doIt(parameter);
  |    }
  |    catch (Exception e)
  |    {
  |       throw fixErrorMessage(e);
  |    }
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4157717#4157717

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4157717



More information about the jboss-dev-forums mailing list