User: starksm 
  Date: 01/12/06 08:37:54

  Modified:    src/main/org/jboss/ejb/plugins/jrmp/interfaces
                        BeanProxy.java
  Log:
  Handle null a argument to isIdentical().
  
  Revision  Changes    Path
  1.5       +16 -7     
jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/BeanProxy.java
  
  Index: BeanProxy.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/jrmp/interfaces/BeanProxy.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BeanProxy.java    2001/08/03 17:15:49     1.4
  +++ BeanProxy.java    2001/12/06 16:37:54     1.5
  @@ -19,7 +19,7 @@
    * An abstract base proxy class from which all bean proxys extend from.
    *
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public abstract class BeanProxy
      extends GenericProxy
  @@ -48,8 +48,10 @@
      /**
       * Initialize {@link EJBObject} method references.
       */
  -   static {
  -      try {
  +   static
  +   {
  +      try
  +      {
            final Class[] empty = {};
            final Class type = EJBObject.class;
            
  @@ -58,7 +60,8 @@
            GET_EJB_HOME = type.getMethod("getEJBHome", empty);
            IS_IDENTICAL = type.getMethod("isIdentical", new Class[] { type });
         }
  -      catch (Exception e) {
  +      catch (Exception e)
  +      {
            e.printStackTrace();
            throw new ExceptionInInitializerError(e);
         }
  @@ -101,14 +104,17 @@
       * @throws NamingException    Failed to create InitalContext or lookup
       *                            EJBHome reference.
       */
  -   protected EJBHome getEJBHome() throws NamingException {
  +   protected EJBHome getEJBHome() throws NamingException
  +   {
         // get a reference to the correct context
         final InitialContext ctx = createInitialContext();
   
  -      try {
  +      try
  +      {
            return (EJBHome)ctx.lookup(name);
         }
  -      finally {
  +      finally
  +      {
            ctx.close();
         }
      }
  @@ -126,6 +132,9 @@
      protected Boolean isIdentical(final Object a, final Object b)
         throws RemoteException
      {
  +      if( a == null )
  +         return false;
  +
         final EJBObject ejb = (EJBObject)a;
         final Object pk = ejb.getPrimaryKey();
         return new Boolean(pk.equals(b));
  
  
  

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

Reply via email to