[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JBMDR-51; Annotation equals is completely broken

alesj do-not-reply at jboss.com
Fri Oct 31 06:19:01 EDT 2008


"alesj" wrote : 
  | 
  |   |       try
  |   |       {
  |   |          Proxy.getInvocationHandler(obj);
  |   |       }
  |   |       catch (Exception ex)
  |   |       {
  |   |          return Boolean.FALSE;
  |   |       }
  |   |       return Boolean.TRUE;
  |   |    }
  |   | 
  | 
I've changed this with

  |          for (String key : map.keySet())
  |          {
  |             Object value = getValue(key);
  |             Object other = getBeanInfo().getProperty(obj, key);
  |             if (Objects.isArray(value))
  |             {
  |                if (Objects.isArray(other) == false)
  |                   return Boolean.FALSE;
  | 
  |                // TODO - how to generically compare arrays; primitives vs. objects 
  |                if (Arrays.equals(...) == false)   
  |                   return Boolean.FALSE;
  |             }
  |             else if (JBossObject.equals(value, other) == false)
  |                return Boolean.FALSE;
  |          }
  | 
but see my TODO.

Do we have some generic code for arrays compare?
So that I don't re-invent the wheel. ;-)

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

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



More information about the jboss-dev-forums mailing list