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" );
@@ -172,6 +173,7 @@ public int hashCode() {
172173 private static class ClassFilterAwareUnionMethodMatcher extends UnionMethodMatcher {
173174
174175 private final ClassFilter cf1 ;
176+
175177 private final ClassFilter cf2 ;
176178
177179 public ClassFilterAwareUnionMethodMatcher (MethodMatcher mm1 , ClassFilter cf1 , MethodMatcher mm2 , ClassFilter cf2 ) {
@@ -195,11 +197,17 @@ public boolean equals(Object other) {
195197 if (this == other ) {
196198 return true ;
197199 }
198- if (!(other instanceof ClassFilterAwareUnionMethodMatcher )) {
200+ if (!super . equals (other )) {
199201 return false ;
200202 }
201- ClassFilterAwareUnionMethodMatcher that = (ClassFilterAwareUnionMethodMatcher ) other ;
202- return (this .cf1 .equals (that .cf1 ) && this .cf2 .equals (that .cf2 ) && super .equals (other ));
203+ ClassFilter otherCf1 = ClassFilter .TRUE ;
204+ ClassFilter otherCf2 = ClassFilter .TRUE ;
205+ if (other instanceof ClassFilterAwareUnionMethodMatcher ) {
206+ ClassFilterAwareUnionMethodMatcher cfa = (ClassFilterAwareUnionMethodMatcher ) other ;
207+ otherCf1 = cfa .cf1 ;
208+ otherCf2 = cfa .cf2 ;
209+ }
210+ return (this .cf1 .equals (otherCf1 ) && this .cf2 .equals (otherCf2 ));
203211 }
204212 }
205213
@@ -210,8 +218,9 @@ public boolean equals(Object other) {
210218 @ SuppressWarnings ("serial" )
211219 private static class IntersectionMethodMatcher implements IntroductionAwareMethodMatcher , Serializable {
212220
213- private MethodMatcher mm1 ;
214- private MethodMatcher mm2 ;
221+ private final MethodMatcher mm1 ;
222+
223+ private final MethodMatcher mm2 ;
215224
216225 public IntersectionMethodMatcher (MethodMatcher mm1 , MethodMatcher mm2 ) {
217226 Assert .notNull (mm1 , "First MethodMatcher must not be null" );
0 commit comments