Skip to content
This repository
Browse code

Document use of MeesageFilter.or().

  • Loading branch information...
commit 0da14bb3e31baf68bd1bb2344b3dfff4edcfd767 1 parent 4225fb1
Steve Dougherty Thynix authored toad committed

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 src/freenet/io/comm/MessageFilter.java
7 src/freenet/io/comm/MessageFilter.java
@@ -170,10 +170,15 @@ public MessageFilter setField(String fieldName, Object fieldValue) {
170 170 return this;
171 171 }
172 172
  173 + /**
  174 + * Modifies the filter so that it returns true if either it or the filter in the argument returns true.
  175 + * Multiple combinations must be nested: such as filter1.or(filter2.or(filter3))).
  176 + * @return reference to this, the modified filter.
  177 + */
173 178 public MessageFilter or(MessageFilter or) {
174 179 if((or != null) && (_or != null) && or != _or) {
175 180 // FIXME maybe throw? this is almost certainly a bug, and a nasty one too!
176   - Logger.error(this, "or() replacement: "+_or+" -> "+or, new Exception("error"));
  181 + Logger.error(this, "or() cannot be called again on the same filter. To chain use filter1.or(filter2.or(filter3)).", new Exception("debug"));
177 182 }
178 183 _or = or;
179 184 return this;

0 comments on commit 0da14bb

Please sign in to comment.
Something went wrong with that request. Please try again.