User: dbudworth
  Date: 01/11/02 18:07:41

  Modified:    src/main/org/jboss/ejb/plugins CMPPersistenceManager.java
  Log:
  added more descriptive NoSuchMethodException throw.  Default version didn't
  specify what class or what method, requiring users to look in the jboss source
  to find out what method was missing.  The method name createMethodCache()
  sounds more like "create a method cache", and not "create a create method cache"
  So the stack trace was pretty much useless.
  
  Revision  Changes    Path
  1.33      +8 -3      jboss/src/main/org/jboss/ejb/plugins/CMPPersistenceManager.java
  
  Index: CMPPersistenceManager.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/CMPPersistenceManager.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- CMPPersistenceManager.java        2001/10/09 00:59:39     1.32
  +++ CMPPersistenceManager.java        2001/11/03 02:07:41     1.33
  @@ -53,7 +53,7 @@
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Dan Christopherson</a>
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Bill Burke</a>
   *   @author <a href="mailto:[EMAIL PROTECTED]";>Andreas Schaefer</a>
  -*   @version $Revision: 1.32 $
  +*   @version $Revision: 1.33 $
   *
   *   Revisions:
   *   20010621 Bill Burke: removed loadEntities call because CMP read-ahead is now
  @@ -156,8 +156,13 @@
         {
            if (methods[i].getName().equals("create"))
            {
  -            createMethods.put(methods[i], con.getBeanClass().getMethod("ejbCreate", 
methods[i].getParameterTypes()));
  -            postCreateMethods.put(methods[i], 
con.getBeanClass().getMethod("ejbPostCreate", methods[i].getParameterTypes()));
  +                      try{
  +                             createMethods.put(methods[i], 
con.getBeanClass().getMethod("ejbCreate", methods[i].getParameterTypes()));
  +                             postCreateMethods.put(methods[i], 
con.getBeanClass().getMethod("ejbPostCreate", methods[i].getParameterTypes()));
  +                      }
  +                      catch (NoSuchMethodException nsme){
  +                              throw new NoSuchMethodException("Can't find 
ejb[Post]Create in "+con.getBeanClass().getName());
  +                      }
            }
         }
          
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to