@@ -23,13 +23,13 @@ class Class extends Container
2323 implements EnclosedElement {
2424 // TODO(srawlins): To make final, remove public getter, setter, rename to be
2525 // public, and add `final` modifier.
26- List <DefinedElementType > _mixins ;
26+ List <DefinedElementType > _mixedInTypes ;
2727
28- List <DefinedElementType > get mixins => _mixins ;
28+ List <DefinedElementType > get mixedInTypes => _mixedInTypes ;
2929
3030 @Deprecated ('Field intended to be final; setter will be removed as early as '
3131 'Dartdoc 1.0.0' )
32- set mixins (List <DefinedElementType > value) => _mixins = value;
32+ set mixedInTypes (List <DefinedElementType > value) => _mixedInTypes = value;
3333
3434 // TODO(srawlins): To make final, remove public getter, setter, rename to be
3535 // public, and add `final` modifier.
@@ -44,7 +44,7 @@ class Class extends Container
4444 final List <DefinedElementType > _interfaces;
4545
4646 Class (ClassElement element, Library library, PackageGraph packageGraph)
47- : _mixins = element.mixins
47+ : _mixedInTypes = element.mixins
4848 .map <DefinedElementType >(
4949 (f) => ElementType .from (f, library, packageGraph))
5050 .where ((mixin ) => mixin != null )
@@ -109,10 +109,16 @@ class Class extends Container
109109 Iterable <Constructor > get constructors => element.constructors
110110 .map ((e) => ModelElement .from (e, library, packageGraph) as Constructor );
111111
112+ bool get hasPublicConstructors => publicConstructors.isNotEmpty;
113+
112114 @visibleForTesting
113115 Iterable <Constructor > get publicConstructors =>
114116 model_utils.filterNonPublic (constructors);
115117
118+ List <Constructor > _publicConstructorsSorted;
119+ Iterable <Constructor > get publicConstructorsSorted =>
120+ _publicConstructorsSorted ?? = publicConstructors.toList ()..sort (byName);
121+
116122 /// Returns the library that encloses this element.
117123 @override
118124 ModelElement get enclosingElement => library;
@@ -131,24 +137,15 @@ class Class extends Container
131137 return kind;
132138 }
133139
134- @override
135- bool get hasPublicConstructors => publicConstructorsSorted.isNotEmpty;
136-
137- List <Constructor > _publicConstructorsSorted;
138-
139- @override
140- List <Constructor > get publicConstructorsSorted =>
141- _publicConstructorsSorted ?? = publicConstructors.toList ()..sort (byName);
142-
143140 bool get hasPublicImplementors => publicImplementors.isNotEmpty;
144141
145142 bool get hasPublicInterfaces => publicInterfaces.isNotEmpty;
146143
147- bool get hasPublicMixins => publicMixins .isNotEmpty;
144+ bool get hasPublicMixedInTypes => publicMixedInTypes .isNotEmpty;
148145
149146 @override
150147 bool get hasModifiers =>
151- hasPublicMixins ||
148+ hasPublicMixedInTypes ||
152149 hasAnnotations ||
153150 hasPublicInterfaces ||
154151 hasPublicSuperChainReversed ||
@@ -199,6 +196,10 @@ class Class extends Container
199196 return result;
200197 }
201198
199+ List <Class > _publicImplementorsSorted;
200+ Iterable <Class > get publicImplementorsSorted =>
201+ _publicImplementorsSorted ?? = publicImplementors.toList ()..sort (byName);
202+
202203 /*lazy final*/ List <Method > _inheritedMethods;
203204
204205 Iterable <Method > get inheritedMethods {
@@ -291,8 +292,8 @@ class Class extends Container
291292 @override
292293 String get kind => 'class' ;
293294
294- Iterable <DefinedElementType > get publicMixins =>
295- model_utils.filterNonPublic (mixins );
295+ Iterable <DefinedElementType > get publicMixedInTypes =>
296+ model_utils.filterNonPublic (mixedInTypes );
296297
297298 @override
298299 DefinedElementType get modelType => super .modelType;
@@ -310,7 +311,7 @@ class Class extends Container
310311 _inheritanceChain.add (this );
311312
312313 /// Caching should make this recursion a little less painful.
313- for (var c in mixins .reversed.map ((e) => (e.element as Class ))) {
314+ for (var c in mixedInTypes .reversed.map ((e) => (e.element as Class ))) {
314315 _inheritanceChain.addAll (c.inheritanceChain);
315316 }
316317
0 commit comments