User: starksm 
  Date: 01/12/05 16:44:30

  Modified:    src/main/org/jboss/ejb/plugins/jrmp/interfaces Tag:
                        Branch_2_4 BeanProxy.java
  Log:
  Validate for null arguments in isIdentical to fix bug #489461
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.4.1   +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.1
  retrieving revision 1.1.4.1
  diff -u -r1.1 -r1.1.4.1
  --- BeanProxy.java    2001/05/02 03:04:14     1.1
  +++ BeanProxy.java    2001/12/06 00:44:30     1.1.4.1
  @@ -19,7 +19,7 @@
    * An abstract base proxy class from which all bean proxys extend from.
    *
    * @author  Jason Dillon <a 
href="mailto:[EMAIL PROTECTED]";>&lt;[EMAIL PROTECTED]&gt;</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.1.4.1 $
    */
   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 a == b;
  +
           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