Unit tests need to be written for AndFilter.  I'll write the unit tests when I 
can find some time.

If you are interested in providing unit tests and a patch we'd be happy to 
accept them!

1 - sounds like a bug
2 - filters can be chained - this style allows an 'and' filter to be followed 
by other filters in the chain if the criteria expected by andFilter does not 
apply to the event.  You can always add a DenyAllFilter after the AndFilter to 
achieve this capability.
3 - or filter should not be needed since filters can already be chained (or'd) 
(at least it seems this way to me - maybe I'm missing something)
4 - I'm not sure when the next release will be

Hope this helps 

Scott


-----Original Message-----
From:   Sumit Kumar [mailto:[EMAIL PROTECTED]
Sent:   Mon 4/25/2005 11:47 PM
To:     [email protected]
Cc:     
Subject:        clarification about AndFilter ....
Hi All,

It's really good to see AndFilter in 1.3. It will help me really a
lot. Here I need some clarification about AndFilter (and some general
queries).

(Forgive me if I am wrong somewhere)

1. Why AndFilter checks for every added filter in the list when the
earlier one returns false.
(Code is:-
boolean accepted = true;        
while (f != null) {
      accepted = accepted && (Filter.ACCEPT == f.decide(event));
      f = f.getNext();
}

I felt it should be 
boolean accepted = true;        
while (accepted && f != null) {
      accepted = accepted && (Filter.ACCEPT == f.decide(event));
      f = f.getNext();
}
)

2. Why it returns neutral when the accepted is false.
(Code is
if(accepted) {
      if(acceptOnMatch) {
        return Filter.ACCEPT;
      }
       return Filter.DENY;
}
return Filter.NEUTRAL;

I felt it should be 
if(accepted) {
      if(acceptOnMatch) {
        return Filter.ACCEPT;
      }
       return Filter.DENY;
}
return Filter.DENY;

(I thought NEUTRAL should be in that case when I added an OR filter
(and not AndFiler)).

(3) Is there any ORFilter or any plan for that ?

(4) I am very curious to use 1.3 (it has some of the feature I needed
!!!). when is the stable release expected ?
(sorry to ask that if it is too early to ask.)

I feel there might be some rationale behind (2), but doesn't understand
that. For me, (1) is a coding error.

Waiting for reply ... :-w

cheers ....
Sumit

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




<<winmail.dat>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to