public static PermissionCondition create(Class<? extends Annotation> permission,PersistentResource resource,String field,ChangeSpec changes){
  if (resource != null) {
    if (changes != null) {
      if (field != null && changes.getFieldName() == null) {
        return new PermissionCondition(permission,resource,field);
      }
      return new PermissionCondition(permission,resource,changes);
    }
 else     if (field == null) {
      return new PermissionCondition(permission,resource);
    }
 else {
      return new PermissionCondition(permission,resource,field);
    }
  }
  throw new IllegalArgumentException("Resource cannot be null");
}

public static PermissionCondition create ( Class < ? extends Annotation > permission , PersistentResource resource , String field , ChangeSpec changes ) { if ( resource != null ) { if ( changes != null ) { if ( field != null && changes . getFieldName ( ) == null ) { return new PermissionCondition ( permission , resource , field ) ; } return new PermissionCondition ( permission , resource , changes ) ; } else if ( field == null ) { return new PermissionCondition ( permission , resource ) ; } else { return new PermissionCondition ( permission , resource , field ) ; } } throw new IllegalArgumentException ( "Resource cannot be null" ) ; }
this function attempts to create the appropriate permissioncondition based on parameters that may or may not be null . this is a temporary workaround given that the caller functions duplicate data in their signatures and pass nulls . the calling code needs to be cleaned up - and then this function can be disposed of .
