[jira] [Commented] (LOG4J2-1593) Concrete Filter implementations should override equals and hashCode

2016-09-19 Thread JIRA

[ 
https://issues.apache.org/jira/browse/LOG4J2-1593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15502737#comment-15502737
 ] 

Mikael Ståldal commented on LOG4J2-1593:


OK, given the current implementation of the filter framework, it seems to be 
necessary. Just make sure to document that third-party Filters need to do it.

> Concrete Filter implementations should override equals and hashCode
> ---
>
> Key: LOG4J2-1593
> URL: https://issues.apache.org/jira/browse/LOG4J2-1593
> Project: Log4j 2
>  Issue Type: Improvement
>  Components: Filters
>Reporter: Remko Popma
> Fix For: 2.8
>
>
> For {{CompositeFilter.remove(Filter)}} to work correctly, concrete Filter 
> implementations should override {{equals}} and {{hashCode}}. 
> This is because CompositeFilter uses List.remove(Object), comparing by 
> equality. Applications that keep a reference to the Filter object that was 
> registered will work, but for example registering and unregistering 
> serialized and deserialized instances via JMX will not work without this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1593) Concrete Filter implementations should override equals and hashCode

2016-09-19 Thread Remko Popma (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4J2-1593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15502717#comment-15502717
 ] 

Remko Popma commented on LOG4J2-1593:
-

The alternative is to override equals on AbstractFilter, but I think abstract 
classes in principle should not implement equals().
What we did instead is provide {{AbstractFilter.equalsImpl()}} and 
{{AbstractFilter.hashCodeImpl()}} that subclasses can use to base their 
implementation of equals() on.

> Concrete Filter implementations should override equals and hashCode
> ---
>
> Key: LOG4J2-1593
> URL: https://issues.apache.org/jira/browse/LOG4J2-1593
> Project: Log4j 2
>  Issue Type: Improvement
>  Components: Filters
>Reporter: Remko Popma
> Fix For: 2.8
>
>
> For {{CompositeFilter.remove(Filter)}} to work correctly, concrete Filter 
> implementations should override {{equals}} and {{hashCode}}. 
> This is because CompositeFilter uses List.remove(Object), comparing by 
> equality. Applications that keep a reference to the Filter object that was 
> registered will work, but for example registering and unregistering 
> serialized and deserialized instances via JMX will not work without this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org



[jira] [Commented] (LOG4J2-1593) Concrete Filter implementations should override equals and hashCode

2016-09-19 Thread JIRA

[ 
https://issues.apache.org/jira/browse/LOG4J2-1593?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15502701#comment-15502701
 ] 

Mikael Ståldal commented on LOG4J2-1593:


Then we need to document that third-party Filters need to do this. Do we want 
to put that burden upon third-party Filter implementers?

> Concrete Filter implementations should override equals and hashCode
> ---
>
> Key: LOG4J2-1593
> URL: https://issues.apache.org/jira/browse/LOG4J2-1593
> Project: Log4j 2
>  Issue Type: Improvement
>  Components: Filters
>Reporter: Remko Popma
> Fix For: 2.8
>
>
> For {{CompositeFilter.remove(Filter)}} to work correctly, concrete Filter 
> implementations should override {{equals}} and {{hashCode}}. 
> This is because CompositeFilter uses List.remove(Object), comparing by 
> equality. Applications that keep a reference to the Filter object that was 
> registered will work, but for example registering and unregistering 
> serialized and deserialized instances via JMX will not work without this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org