@@ -116,7 +116,7 @@ public final class AnnotatedClass
116
116
* Member methods of interest; for now ones with 0 or 1 arguments
117
117
* (just optimization, since others won't be used now)
118
118
*/
119
- protected AnnotatedMethodMap _memberMethods ;
119
+ protected AnnotatedMethodMap _memberMethods ;
120
120
121
121
/**
122
122
* Member fields of interest: ones that are either public,
@@ -538,23 +538,28 @@ private void resolveCreators()
538
538
*/
539
539
private void resolveMemberMethods ()
540
540
{
541
- _memberMethods = new AnnotatedMethodMap ();
541
+ _memberMethods = _resolveMemberMethods ();
542
+ }
543
+
544
+ private AnnotatedMethodMap _resolveMemberMethods ()
545
+ {
546
+ AnnotatedMethodMap memberMethods = new AnnotatedMethodMap ();
542
547
AnnotatedMethodMap mixins = new AnnotatedMethodMap ();
543
548
// first: methods from the class itself
544
- _addMemberMethods (_class , this , _memberMethods , _primaryMixIn , mixins );
549
+ _addMemberMethods (_class , this , memberMethods , _primaryMixIn , mixins );
545
550
546
551
// and then augment these with annotations from super-types:
547
552
for (JavaType type : _superTypes ) {
548
553
Class <?> mixin = (_mixInResolver == null ) ? null : _mixInResolver .findMixInClassFor (type .getRawClass ());
549
554
_addMemberMethods (type .getRawClass (),
550
555
new TypeResolutionContext .Basic (_typeFactory , type .getBindings ()),
551
- _memberMethods , mixin , mixins );
556
+ memberMethods , mixin , mixins );
552
557
}
553
558
// Special case: mix-ins for Object.class? (to apply to ALL classes)
554
559
if (_mixInResolver != null ) {
555
560
Class <?> mixin = _mixInResolver .findMixInClassFor (Object .class );
556
561
if (mixin != null ) {
557
- _addMethodMixIns (_class , _memberMethods , mixin , mixins );
562
+ _addMethodMixIns (_class , memberMethods , mixin , mixins );
558
563
}
559
564
}
560
565
@@ -575,14 +580,15 @@ private void resolveMemberMethods()
575
580
// Since it's from java.lang.Object, no generics, no need for real type context:
576
581
AnnotatedMethod am = _constructMethod (m , this );
577
582
_addMixOvers (mixIn .getAnnotated (), am , false );
578
- _memberMethods .add (am );
583
+ memberMethods .add (am );
579
584
}
580
585
} catch (Exception e ) { }
581
586
}
582
587
}
583
588
}
589
+ return memberMethods ;
584
590
}
585
-
591
+
586
592
/**
587
593
* Method that will collect all member (non-static) fields
588
594
* that are either public, or have at least a single annotation
@@ -591,14 +597,16 @@ private void resolveMemberMethods()
591
597
private void resolveFields ()
592
598
{
593
599
Map <String ,AnnotatedField > foundFields = _findFields (_type , this , null );
600
+ List <AnnotatedField > f ;
594
601
if (foundFields == null || foundFields .size () == 0 ) {
595
- _fields = Collections .emptyList ();
602
+ f = Collections .emptyList ();
596
603
} else {
597
- _fields = new ArrayList <AnnotatedField >(foundFields .size ());
598
- _fields .addAll (foundFields .values ());
604
+ f = new ArrayList <AnnotatedField >(foundFields .size ());
605
+ f .addAll (foundFields .values ());
599
606
}
607
+ _fields = f ;
600
608
}
601
-
609
+
602
610
/*
603
611
/**********************************************************
604
612
/* Helper methods for resolving class annotations
0 commit comments