11/*
2- * Copyright 2002-2012 the original author or authors.
2+ * Copyright 2002-2013 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -102,8 +102,9 @@ public static boolean matches(MethodMatcher mm, Method method, Class targetClass
102102 @ SuppressWarnings ("serial" )
103103 private static class UnionMethodMatcher implements IntroductionAwareMethodMatcher , Serializable {
104104
105- private MethodMatcher mm1 ;
106- private MethodMatcher mm2 ;
105+ private final MethodMatcher mm1 ;
106+
107+ private final MethodMatcher mm2 ;
107108
108109 public UnionMethodMatcher (MethodMatcher mm1 , MethodMatcher mm2 ) {
109110 Assert .notNull (mm1 , "First MethodMatcher must not be null" );
@@ -168,6 +169,7 @@ public int hashCode() {
168169 private static class ClassFilterAwareUnionMethodMatcher extends UnionMethodMatcher {
169170
170171 private final ClassFilter cf1 ;
172+
171173 private final ClassFilter cf2 ;
172174
173175 public ClassFilterAwareUnionMethodMatcher (MethodMatcher mm1 , ClassFilter cf1 , MethodMatcher mm2 , ClassFilter cf2 ) {
@@ -191,11 +193,17 @@ public boolean equals(Object other) {
191193 if (this == other ) {
192194 return true ;
193195 }
194- if (!(other instanceof ClassFilterAwareUnionMethodMatcher )) {
196+ if (!super . equals (other )) {
195197 return false ;
196198 }
197- ClassFilterAwareUnionMethodMatcher that = (ClassFilterAwareUnionMethodMatcher ) other ;
198- return (this .cf1 .equals (that .cf1 ) && this .cf2 .equals (that .cf2 ) && super .equals (other ));
199+ ClassFilter otherCf1 = ClassFilter .TRUE ;
200+ ClassFilter otherCf2 = ClassFilter .TRUE ;
201+ if (other instanceof ClassFilterAwareUnionMethodMatcher ) {
202+ ClassFilterAwareUnionMethodMatcher cfa = (ClassFilterAwareUnionMethodMatcher ) other ;
203+ otherCf1 = cfa .cf1 ;
204+ otherCf2 = cfa .cf2 ;
205+ }
206+ return (this .cf1 .equals (otherCf1 ) && this .cf2 .equals (otherCf2 ));
199207 }
200208 }
201209
@@ -206,8 +214,9 @@ public boolean equals(Object other) {
206214 @ SuppressWarnings ("serial" )
207215 private static class IntersectionMethodMatcher implements IntroductionAwareMethodMatcher , Serializable {
208216
209- private MethodMatcher mm1 ;
210- private MethodMatcher mm2 ;
217+ private final MethodMatcher mm1 ;
218+
219+ private final MethodMatcher mm2 ;
211220
212221 public IntersectionMethodMatcher (MethodMatcher mm1 , MethodMatcher mm2 ) {
213222 Assert .notNull (mm1 , "First MethodMatcher must not be null" );
0 commit comments