geronimo-jcdi_1.0_spec/src/main/java/javax/enterprise/util/AnnotationLiteral.java [110:240]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if(other == this)
        {
            return true;
        }
        
        if(other == null)
        {
            return false;
        }
        
        if (other instanceof Annotation)
        {
            Annotation annotOther = (Annotation) other;
            if (this.annotationType().equals(annotOther.annotationType()))
            {
                for (Method method : methods)
                {
                    Object value = callMethod(this, method);
                    Object annotValue = callMethod(annotOther, method);
                    
                    if((value == null && annotValue != null) || (value != null && annotValue == null))
                    {
                        return false;
                    }
                    
                    if(value == null && annotValue == null)
                    {
                        continue;
                    }
                    
                    Class<?> valueClass = value.getClass();
                    Class<?> annotValueClass = annotValue.getClass();
                    
                    if(valueClass.isPrimitive() && annotValueClass.isPrimitive())
                    {
                        if((valueClass != Float.TYPE && annotValue != Float.TYPE)
                                || (valueClass != Double.TYPE && annotValue != Double.TYPE))
                        {
                            if(value != annotValue)
                            {
                                return false;
                            }
                            
                        }
                    }
                    else if(valueClass.isArray() && annotValueClass.isArray())
                    {
                        Class<?> type = valueClass.getComponentType();
                        if(type.isPrimitive())
                        {
                            if(Long.TYPE == type)
                            {
                                if(!Arrays.equals(((Long[])value),(Long[])annotValue)) return false;
                            }
                            else if(Integer.TYPE == type)
                            {
                                if(!Arrays.equals(((Integer[])value),(Integer[])annotValue)) return false;
                            }
                            else if(Short.TYPE == type)
                            {
                                if(!Arrays.equals(((Short[])value),(Short[])annotValue)) return false;
                            }
                            else if(Double.TYPE == type)
                            {
                                if(!Arrays.equals(((Double[])value),(Double[])annotValue)) return false;
                            }
                            else if(Float.TYPE == type)
                            {
                                if(!Arrays.equals(((Float[])value),(Float[])annotValue)) return false;
                            }
                            else if(Boolean.TYPE == type)
                            {
                                if(!Arrays.equals(((Boolean[])value),(Boolean[])annotValue)) return false;
                            }
                            else if(Byte.TYPE == type)
                            {
                                if(!Arrays.equals(((Byte[])value),(Byte[])annotValue)) return false;
                            }
                            else if(Character.TYPE == type)
                            {
                                if(!Arrays.equals(((Character[])value),(Character[])annotValue)) return false;
                            }                    
                        }
                        else
                        {
                            if(!Arrays.equals(((Object[])value),(Object[])annotValue)) return false;
                        }
                    }
                    
                    else if (value != null && annotValue != null)
                    {
                        if (!value.equals(annotValue))
                        {
                            return false;
                        }
                    } 

                }
                
                return true;
            }
        }

        return false;
    }

    private Object callMethod(Object instance, Method method)
    {
        boolean access = method.isAccessible();

        try
        {
            if (!method.isAccessible())
            {
            	AccessController.doPrivileged(new PrivilegedActionForAccessibleObject(method, true));
            }

            return method.invoke(instance, EMPTY_OBJECT_ARRAY);
        }
        catch (Exception e)
        {
            throw new RuntimeException("Exception in method call : " + method.getName(), e);
        }
        finally
        {
            AccessController.doPrivileged(new PrivilegedActionForAccessibleObject(method, access));
        }
    }

    @Override
    public int hashCode()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-jcdi_1.1_spec/src/main/java/javax/enterprise/util/AnnotationLiteral.java [111:241]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if(other == this)
        {
            return true;
        }
        
        if(other == null)
        {
            return false;
        }
        
        if (other instanceof Annotation)
        {
            Annotation annotOther = (Annotation) other;
            if (this.annotationType().equals(annotOther.annotationType()))
            {
                for (Method method : methods)
                {
                    Object value = callMethod(this, method);
                    Object annotValue = callMethod(annotOther, method);
                    
                    if((value == null && annotValue != null) || (value != null && annotValue == null))
                    {
                        return false;
                    }
                    
                    if(value == null && annotValue == null)
                    {
                        continue;
                    }
                    
                    Class<?> valueClass = value.getClass();
                    Class<?> annotValueClass = annotValue.getClass();
                    
                    if(valueClass.isPrimitive() && annotValueClass.isPrimitive())
                    {
                        if((valueClass != Float.TYPE && annotValue != Float.TYPE)
                                || (valueClass != Double.TYPE && annotValue != Double.TYPE))
                        {
                            if(value != annotValue)
                            {
                                return false;
                            }
                            
                        }
                    }
                    else if(valueClass.isArray() && annotValueClass.isArray())
                    {
                        Class<?> type = valueClass.getComponentType();
                        if(type.isPrimitive())
                        {
                            if(Long.TYPE == type)
                            {
                                if(!Arrays.equals(((Long[])value),(Long[])annotValue)) return false;
                            }
                            else if(Integer.TYPE == type)
                            {
                                if(!Arrays.equals(((Integer[])value),(Integer[])annotValue)) return false;
                            }
                            else if(Short.TYPE == type)
                            {
                                if(!Arrays.equals(((Short[])value),(Short[])annotValue)) return false;
                            }
                            else if(Double.TYPE == type)
                            {
                                if(!Arrays.equals(((Double[])value),(Double[])annotValue)) return false;
                            }
                            else if(Float.TYPE == type)
                            {
                                if(!Arrays.equals(((Float[])value),(Float[])annotValue)) return false;
                            }
                            else if(Boolean.TYPE == type)
                            {
                                if(!Arrays.equals(((Boolean[])value),(Boolean[])annotValue)) return false;
                            }
                            else if(Byte.TYPE == type)
                            {
                                if(!Arrays.equals(((Byte[])value),(Byte[])annotValue)) return false;
                            }
                            else if(Character.TYPE == type)
                            {
                                if(!Arrays.equals(((Character[])value),(Character[])annotValue)) return false;
                            }                    
                        }
                        else
                        {
                            if(!Arrays.equals(((Object[])value),(Object[])annotValue)) return false;
                        }
                    }
                    
                    else if (value != null && annotValue != null)
                    {
                        if (!value.equals(annotValue))
                        {
                            return false;
                        }
                    } 

                }
                
                return true;
            }
        }

        return false;
    }

    private Object callMethod(Object instance, Method method)
    {
        boolean access = method.isAccessible();

        try
        {
            if (!method.isAccessible())
            {
                AccessController.doPrivileged(new PrivilegedActionForAccessibleObject(method, true));
            }

            return method.invoke(instance, EMPTY_OBJECT_ARRAY);
        }
        catch (Exception e)
        {
            throw new RuntimeException("Exception in method call : " + method.getName(), e);
        }
        finally
        {
            AccessController.doPrivileged(new PrivilegedActionForAccessibleObject(method, access));
        }
    }

    @Override
    public int hashCode()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



